Skip to content

Commit 0f5b64d

Browse files
authored
chore: add gno version output in gno bug body (#3696)
1 parent 262e8ff commit 0f5b64d

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

gnovm/cmd/gno/bug.go

+9-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"text/template"
1212
"time"
1313

14+
"github.com/gnolang/gno/gnovm/pkg/version"
1415
"github.com/gnolang/gno/tm2/pkg/commands"
1516
)
1617

@@ -23,9 +24,10 @@ Describe your issue in as much detail as possible here
2324
2425
### Your environment
2526
26-
* Go version: {{.GoVersion}}
27-
* OS and CPU architecture: {{.Os}}/{{.Arch}}
28-
* Gno commit hash causing the issue: {{.Commit}}
27+
* Gno version: {{ .GnoVersion }}
28+
* Go version: {{ .GoVersion }}
29+
* OS and CPU architecture: {{ .Os }}/{{ .Arch }}
30+
* Gno commit hash causing the issue: {{ .Commit }}
2931
3032
### Steps to reproduce
3133
@@ -62,10 +64,11 @@ func newBugCmd(io commands.IO) *commands.Command {
6264
Name: "bug",
6365
ShortUsage: "bug",
6466
ShortHelp: "start a bug report",
65-
LongHelp: `opens https://github.com/gnolang/gno/issues in a browser.
67+
LongHelp: `opens https://github.com/gnolang/gno/issues in a browser.
6668
6769
The new issue body is prefilled for you with the following information:
6870
71+
- Gno version (the output of "gno version")
6972
- Go version (example: go1.22.4)
7073
- OS and CPU architecture (example: linux/amd64)
7174
- Gno commit hash causing the issue (example: f24690e7ebf325bffcfaf9e328c3df8e6b21e50c)
@@ -96,10 +99,11 @@ func execBug(cfg *bugCfg, args []string, io commands.IO) error {
9699
}
97100

98101
bugReportEnv := struct {
99-
Os, Arch, GoVersion, Commit string
102+
Os, Arch, GnoVersion, GoVersion, Commit string
100103
}{
101104
runtime.GOOS,
102105
runtime.GOARCH,
106+
version.Version,
103107
runtime.Version(),
104108
getCommitHash(),
105109
}

gnovm/cmd/gno/bug_test.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@ import "testing"
55
func TestBugApp(t *testing.T) {
66
tc := []testMainCase{
77
{
8-
args: []string{"bug -h"},
9-
errShouldBe: "flag: help requested",
8+
args: []string{"bug", "-h"},
9+
errShouldContain: "flag: help requested",
1010
},
1111
{
12-
args: []string{"bug unknown"},
12+
args: []string{"bug", "unknown"},
1313
errShouldBe: "flag: help requested",
1414
},
1515
{
1616
args: []string{"bug", "-skip-browser"},
1717
stdoutShouldContain: "Go version: go1.",
1818
},
19+
{
20+
args: []string{"bug", "-skip-browser"},
21+
stdoutShouldContain: "Gno version: develop",
22+
},
1923
}
2024
testMainCaseRun(t, tc)
2125
}

0 commit comments

Comments
 (0)