Skip to content

Commit af36b59

Browse files
authored
Merge pull request #21 from redpanda-data/jb/go-tidy
go mod tidy
2 parents 04898b7 + 22cde08 commit af36b59

File tree

98 files changed

+120
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+120
-112
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ jobs:
100100

101101
- name: Check golden files are up to date
102102
run: |
103-
# Generate fresh files
104-
go test ./pkg/generator -update-golden
103+
# Generate fresh files using task (includes gofumpt formatting)
104+
./taskw generate-golden
105105
106106
# Check if any files changed
107107
if ! git diff --quiet; then

Taskfile.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ tasks:
2525
- echo "Updating golden test files..."
2626
- go test ./pkg/generator -update-golden -v
2727
- task: fmt
28+
- go run mvdan.cc/gofumpt@latest -l -w ./pkg/testdata/gen/go-golden/
2829
- echo "Golden files updated successfully!"
2930

3031

@@ -34,7 +35,7 @@ tasks:
3435
cmds:
3536
- buf generate buf.build/googleapis/googleapis
3637
- buf generate --include-imports
37-
- gofumpt -l -w .
38+
- go run mvdan.cc/gofumpt@latest -l -w .
3839

3940
integrationtest:
4041
desc: Run integration tests (requires OPENAI_API_KEY)

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ require (
77
github.com/mark3labs/mcp-go v0.20.0
88
github.com/onsi/gomega v1.37.0
99
github.com/openai/openai-go v1.5.0
10+
github.com/redpanda-data/common-go/api v0.0.0-20250801174835-9eea07f1ea06
1011
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
1112
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a
13+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b
1214
google.golang.org/grpc v1.67.1
1315
google.golang.org/protobuf v1.36.6
1416
)
@@ -17,7 +19,6 @@ require (
1719
buf.build/gen/go/redpandadata/common/protocolbuffers/go v1.34.2-20240917150400-3f349e63f44a.2 // indirect
1820
github.com/google/go-cmp v0.7.0 // indirect
1921
github.com/google/uuid v1.6.0 // indirect
20-
github.com/redpanda-data/common-go/api v0.0.0-20250801174835-9eea07f1ea06 // indirect
2122
github.com/tidwall/gjson v1.14.4 // indirect
2223
github.com/tidwall/match v1.1.1 // indirect
2324
github.com/tidwall/pretty v1.2.1 // indirect
@@ -26,6 +27,5 @@ require (
2627
golang.org/x/net v0.37.0 // indirect
2728
golang.org/x/sys v0.31.0 // indirect
2829
golang.org/x/text v0.23.0 // indirect
29-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b // indirect
3030
gopkg.in/yaml.v3 v3.0.1 // indirect
3131
)

pkg/generator/generator_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,14 @@ func TestFullGeneration(t *testing.T) {
327327
cmd = exec.Command("../../taskw", "fmt")
328328
output, err = cmd.CombinedOutput()
329329
if err != nil {
330-
t.Fatalf("Failed to generate current files: %v\nOutput: %s", err, output)
330+
t.Fatalf("Failed to format non-generated files: %v\nOutput: %s", err, output)
331+
}
332+
333+
// Format generated files like the generate task does
334+
cmd = exec.Command("go", "run", "mvdan.cc/gofumpt@latest", "-l", "-w", ".")
335+
output, err = cmd.CombinedOutput()
336+
if err != nil {
337+
t.Fatalf("Failed to format generated files: %v\nOutput: %s", err, output)
331338
}
332339

333340
// Find all .pb.mcp.go files in gen/go and compare with golden/

pkg/testdata/gen/go-golden/google/api/annotations.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/testdata/gen/go-golden/google/api/client.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/testdata/gen/go-golden/google/api/expr/v1alpha1/checked.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/testdata/gen/go-golden/google/api/expr/v1alpha1/eval.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/testdata/gen/go-golden/google/api/expr/v1alpha1/explain.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/testdata/gen/go-golden/google/api/expr/v1alpha1/syntax.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)