Skip to content

fix(ci): run the generator with go generate . so removed APIs don't crash it - #14

Merged
rmilyushkevich merged 1 commit into
mainfrom
fix/regen-generator-crash
Oct 20, 2026
Merged

rmilyushkevich merged 1 commit into
mainfrom
fix/regen-generator-crash

Conversation

@rmilyushkevich

Copy link
Copy Markdown
Contributor

Problem

The daily regen workflow has failed every day since 2026-10-10:

gen: wrote 67 commands (hash f9e447f42c33)
generate: open .../cmd/gen_amazon_reviews.go: no such file or directory

go generate ./... reads every package's file list up front. The //go:generate directive in main.go runs first, and it deletes the cmd/gen_*.go files for APIs that left the catalog. When go generate then reaches the cmd package, it tries to open a file that no longer exists. This is the first time an API was removed (amazon-reviews, which was retired on purpose), so the bug never showed up before. CI's verify-generated job runs the same command and fails the same way.

Fix

main.go holds the only directive, so go generate . runs the same generator without scanning cmd/. I changed it in regen.yml, ci.yml and the README.

Tested

Run locally against the live catalog:

  • go generate . exits 0 and writes 67 commands. It removes amazon-reviews and adds chat-gpt-chat, facebook-profile, google-finance, google-flights-deals, google-scholar, google-scholar-cite, instagram-comments, tripadvisor-place/reviews/search and walmart-product/reviews/search.
  • go vet ./... and go build pass, and --help succeeds for every generated command.

Heads-up

On this PR, verify-generated will report "Generated files are out of date". That's real drift: main hasn't had a spec refresh since July, and #13 is stale. It goes green once a fresh refresh lands. After this merges, the next regen run (or a manual workflow_dispatch) opens one.

🤖 Generated with Claude Code

… crash it

`go generate ./...` lists every package's files before running anything.
The directive in main.go then deletes cmd/gen_*.go for APIs that left the
catalog, and go generate fails opening a file that's gone when it reaches
the cmd package. amazon-reviews leaving the catalog has failed the daily
regen run since 2026-10-10, and verify-generated fails the same way.

The only directive lives in main.go, so `go generate .` runs the same
generator without scanning cmd/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rmilyushkevich
rmilyushkevich merged commit 97d05dd into main Oct 20, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant