Skip to content

fix: regenerate API client for SessionResponse additionalProperties - #78

Merged
giordano-lucas merged 1 commit into
mainfrom
t3code/fix-ci-workflow-failure
Aug 28, 2026
Merged

fix: regenerate API client for SessionResponse additionalProperties#78
giordano-lucas merged 1 commit into
mainfrom
t3code/fix-ci-workflow-failure

Conversation

@giordano-lucas

Copy link
Copy Markdown
Member

What

Regenerates internal/api/client.gen.go via make generate. No hand edits.

Why

CI's "Check generated code is up to date" step has been red on every run since ~09:00 UTC today, including main and unrelated PR branches.

Nothing in the repo broke it. That step regenerates against the live staging spec (scripts/generate.sh curls https://us-staging.notte.cc/openapi.json at job time), so its input can change without a commit. Between 2026-08-27 16:02 UTC (last green main) and 2026-08-28 09:07 UTC (first red), a staging deploy set additionalProperties: true on the SessionResponse schema.

oapi-codegen reacts by emitting an AdditionalProperties map plus Get/Set/MarshalJSON/UnmarshalJSON methods — 433 lines the committed file lacked, so git status --porcelain came back dirty and the step exited 1.

The clearest evidence it isn't commit-related: the red main run is 693b501, the goreleaser brew bump, whose entire diff over the previous green run is nine lines of Formula/notte.rb checksums and zero Go files.

SearchRequest already carried the identical treatment from #76 — this is the same drift recurring on a second schema.

Diff

internal/api/client.gen.go | 434 ++++++++++++++++++++++++++++++++++++++++++++-
  • SessionResponse gains AdditionalProperties map[string]interface{} json:"-"
  • Generated Get / Set / UnmarshalJSON / MarshalJSON for SessionResponse

Byte-identical to what CI produced in its failure output.

Verification

Ran locally against the regenerated tree:

  • go build -v ./... — clean
  • go test -race -short ./... — all 11 packages pass
  • golangci-lint run ./... — 0 issues (local v2.8.0; CI pins v2.12.0)
  • ./scripts/generate.sh is now a no-op, which is what the failing step asserts

Follow-up worth considering

This will recur on the next staging schema change. Because generation hits a live server, the check can go red on any push with no code change, and a push during a partial rollout could bake a half-deployed schema into the client. Vendoring a spec snapshot refreshed by an explicit PR would make CI deterministic. Out of scope here — flagging it, not doing it.

🤖 Generated with Claude Code

The staging OpenAPI spec at us-staging.notte.cc set
`additionalProperties: true` on the SessionResponse schema between
2026-08-27 16:02 UTC and 2026-08-28 09:07 UTC. oapi-codegen responds by
emitting an AdditionalProperties map plus Get/Set/MarshalJSON/
UnmarshalJSON methods, which the committed client.gen.go lacked.

Since the "Check generated code is up to date" CI step regenerates
against the live spec, every run after that deploy went red regardless of
its contents -- including the goreleaser brew-formula bump on main
(693b501), whose only diff was nine lines of Formula/notte.rb checksums,
and unrelated PR branches.

Regenerated with `make generate`; no hand edits. SearchRequest already
carried the same treatment from #76.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Greptile Summary

The PR regenerates the API client so SessionResponse preserves additional OpenAPI properties.

  • Adds an AdditionalProperties map and generated Get/Set helpers.
  • Adds custom JSON decoding and encoding to retain unknown response fields.
  • Does not add the integration test required by the repository’s bug-fix guidelines.

Confidence Score: 4/5

The PR appears safe to merge, with the non-blocking omission of the repository-required integration regression test.

The generated response handling has no established runtime defect, but its newly added unknown-property round-trip behavior is not protected by a focused integration test.

Files Needing Attention: internal/api/client.gen.go

Important Files Changed

Filename Overview
internal/api/client.gen.go Adds generated SessionResponse additional-property round-tripping correctly, but without a focused integration regression test.

Fix all with Greploop Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
internal/api/client.gen.go:3684-3699
**Missing additional-properties regression test**

The new `SessionResponse` decoding and encoding behavior has no integration test covering preservation of unknown properties, so later schema or generator changes can silently break this round trip. Repository bug-fix guidelines require at least one integration test.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix: regenerate API client for SessionRe..." | Re-trigger Greptile

@giordano-lucas
giordano-lucas merged commit b988c06 into main Aug 28, 2026
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