Skip to content

Extract API codegen into a shared composite action#1111

Closed
SachaProbo wants to merge 1 commit into
mainfrom
SachaProbo/gqlgen-panic-fix
Closed

Extract API codegen into a shared composite action#1111
SachaProbo wants to merge 1 commit into
mainfrom
SachaProbo/gqlgen-panic-fix

Conversation

@SachaProbo
Copy link
Copy Markdown
Contributor

@SachaProbo SachaProbo commented Apr 27, 2026

gqlgen's rewriter captures token offsets at packages.Load() parse time and re-reads files from disk later to extract source ranges. When the on-disk content drifts between the two reads, the slice goes out of bounds and gqlgen panics. The race is intermittent.

Inline a retry_generate bash helper in each CI "Generate Go code" step that retries gqlgen up to three times on the slice-bounds panic and propagates other errors unchanged. Drop the order-only Makefile prerequisites and CI sequencing introduced in f7070c4 so console and trust gqlgen runs go back to running in parallel.


Summary by cubic

Moved Go API code generation to a shared composite action and restored parallel gqlgen runs for ./pkg/server/api/{connect,console,trust,mcp}/v1 to speed up CI.

  • Refactors
    • Workflows now use ./.github/actions/generate-go in build, lint-go, and test-go jobs to run go generate in parallel.
    • Removed Makefile sequencing so make can fan out codegen again.

Written for commit 7dcb19e. Summary will update on new commits. Review in cubic

@SachaProbo SachaProbo requested a review from a team April 27, 2026 10:09
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/actions/generate-go/action.yaml">

<violation number="1" location=".github/actions/generate-go/action.yaml:17">
P1: `retry_generate` won’t reliably retry failures under GitHub Actions because `go generate` is executed in a context where `errexit` exits before your retry branch runs.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread .github/actions/generate-go/action.yaml Outdated
@SachaProbo SachaProbo force-pushed the SachaProbo/gqlgen-panic-fix branch from 3a69282 to 4e614b9 Compare April 27, 2026 10:42
@SachaProbo SachaProbo changed the title Retry gqlgen in CI on Rewriter.getSource slice-bounds panic Extract API codegen into a shared composite action Apr 27, 2026
Move the four parallel `go generate` calls used by the build, lint-go,
and test-go jobs into a shared composite action, and drop the
order-only Makefile prerequisites between the gqlgen targets that
f7070c4 added. The serialization workaround for the intermittent
gqlgen Rewriter.getSource panic was insufficient; reverting to parallel
execution restores CI throughput, and a retry will be added separately.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
@SachaProbo SachaProbo force-pushed the SachaProbo/gqlgen-panic-fix branch from 4e614b9 to 7dcb19e Compare April 27, 2026 14:59
@SachaProbo SachaProbo closed this May 12, 2026
@SachaProbo SachaProbo deleted the SachaProbo/gqlgen-panic-fix branch May 12, 2026 11:39
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