fix(config): restore the go:generate directive so make generate works - #152
fix(config): restore the go:generate directive so make generate works#152c1-squire-dev[bot] wants to merge 1 commit into
Conversation
pkg/config had no //go:generate directive, so the Makefile's
"go generate ./pkg/config" was a silent no-op and make generate never
regenerated conf.gen.go. Running the generator by hand instead
("go run ./pkg/config/gen") writes conf.gen.go relative to the working
directory, so it landed in the repo root and had to be moved.
A go:generate directive runs with the working directory set to the package,
which fixes both halves at once. baton-datadog, baton-okta, baton-github and
baton-slack all carry the same line; this repo is the outlier.
make generate now reproduces the committed conf.gen.go byte for byte.
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Connector PR Review: fix(config): restore the go:generate directive so make generate worksBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryScanned the full PR diff for security and correctness: it is a single added Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. |
One line.
pkg/confighas no//go:generatedirective, so the Makefile'sis a silent no-op — it prints
Generating pkg/config/conf.gen.go...and regenerates nothing. Running the generator directly instead (go run ./pkg/config/gen) does work, but the SDK's generator isos.Create("conf.gen.go"), relative to the working directory, so the file lands in the repo root and has to be moved by hand.A
//go:generatedirective runs with the working directory set to the package, which fixes both halves at once.This repo is the outlier: baton-datadog, baton-okta, baton-github and baton-slack all carry the same
//go:generate go run ./genline inpkg/config/config.go, against an otherwise byte-identical Makefile rule.Verification
conf.gen.gois regenerated in place, byte for byte identical to what was committed, and nothing is left in the repo root. The only change in the tree is this file's one added line.Scope
config_schema.jsonandbaton_capabilities.jsonare deliberately left alone. They are generated from the built binary rather than fromconfig.go, so they move when the SDK moves — commit85111b92here rewrote 92 lines ofbaton_capabilities.jsonoff a dependency bump with no config change at all. That is whygenerate-baton-metadata.yamlregenerates and commits them on merge tomain, and why no connector's Makefile emits them. Adding them to a local target would produce files that go stale on the next SDK bump with nobody touching the repo.