Repository navigation
build: stop CI compiling the server while the console build is restored - #3576
Conversation
`full-pr` failed three times on 2026-12-02 in `nextgen#build`:
internal/staticui/console/embed.go:14:5: embed dist/assets/.turbo-restore-4000-2828:
open internal/staticui/console/dist/assets/.turbo-restore-4000-2828: no such file or directory
`nextgen#build` is turbo's built-in `go build ./...` of the server's Go
module, which apps/api/turbo.json drops. The root `docs:api` shape
(`dependsOn: ["^build", "build"]`) applied to every package, the Go modules
too, and a `dependsOn` that reaches a dropped built-in runs turbo's own
command again, with no edges. So it started beside `@zitadel/console#build`,
listed a temporary file of that build's cache restore for
`//go:embed all:dist`, and could not open it after the rename.
`docs:api` is now a task of the thirteen SDKs that have the script, each
after its own `build`. No task reaches a Go module's dropped built-in, and
the graph test holds every task that compiles the server module to the
console's build.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmTkxuPGCPPRHB4oEhB
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 8b9bbdd The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change limiting API documentation tasks to SDK packages.
No open issues 🎉
What changed in this PR
Prevents unintended Go builds from racing with console cache restoration in CI by limiting API documentation tasks to SDK packages.
Changes:
- Moves
docs:apifrom the root configuration into 13 SDKs, depending only on each SDK’s build. - Adds regression tests for server build ordering and documentation task scope.
- Documents the dependency behavior and includes an empty changeset for this build-only change.
| File | Description |
|---|---|
turbo.json |
Removes the global docs:api task. |
scripts/task-graph.test.mjs |
Tests build ordering and documentation task scope. |
packages/sdk-vue/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-tanstack-start/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-sveltekit/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-svelte/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-solid/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-solid-start/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-react/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-qwik/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-qwik-router/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-nuxt/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-next/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-core/turbo.json |
Defines SDK-local documentation task. |
packages/sdk-angular/turbo.json |
Defines SDK-local documentation task. |
docs/design/build/turborepo.md |
Explains task scope and cache-restore ordering. |
apps/api/turbo.json |
Adds comments explaining dropped built-in task behavior. |
.changeset/sdk-docs-api-task.md |
Records a change requiring no package release. |
Review effort: Balanced
Context
full-prfailed innextgen#buildthree times on 2026-12-02, each time on an unrelated change and each time green when run again:Summary
The race
nextgen#buildis a task nobody wrote. It is turbo's built-ingo build ./...for the Go module inapps/api.apps/api/turbo.jsondrops it ("build": { "extends": false }), because the module's tasks are@zitadel/server's.turbo run buildhas nonextgen#build. AdependsOnthat reaches it runs turbo's own command again, with no dependencies.docs:apishape (dependsOn: ["^build", "build"]) applied to every package, the Go modules too.nextgen#docs:api,bench#docs:apiandgo-workspace#docs:apihave no script and run nothing, but their edges broughtnextgen#buildinto CI's graph. Under--affected, any change inapps/apiselects it.@zitadel/console#buildfrom the cache intoapps/api/internal/staticui/console/dist/: each file as.turbo-restore-<pid>-<n>, then a rename.go buildlists that folder for//go:embed all:distand the compiler opens the files later. A temporary file listed in between is gone by then.@zitadel/console:buildiscache hit, replaying logsat 15:55:50, andnextgen:buildiscache bypass, force executingand fails at 15:56:16..turbo-restore-*files indist/assetsbesidego build ./internal/staticui/console/failed 10 of 15 builds with the same message.The fix
docs:apiis no longer a root shape. It is a task in theturbo.jsonof the 13 SDKs that have the script, each withdependsOn: ["build"].^buildis gone from it, asdocs/design/build/turborepo.mdalready asks. TypeDoc compilestsconfig.lib.json, the programbuildcompiles, andbuild's own edges cover what that imports.nextgen#buildare three more uncached built-ingo build ./...runs (zitadel/v5,defaults,design-tokens) and 49 nodes that ran nothing (48docs:api,go-workspace#build).turborepo.mdandapps/api/turbo.jsonnow say that a dropped Go built-in comes back throughdependsOn, and that a cache restore writes like a build does.The
noconsoletag is not the answer here: this build should not run at all. The one build that must not wait for the console, the hosted cloud's launcher, already uses it.How the graph rules it out
One green run proves nothing about a race, so the claim is about edges (
turbo run <the ci list> --dry=json):@zitadel/console#build.nextgenruns a command.@zitadel/console#build:@zitadel/console#build@zitadel/server#build@zitadel/server#vet,#lint@zitadel/server#test:unit,#test:sqlite,#test:postgres@zitadel/server-*#build-binary//#smoke-upgrade@zitadel/server#build@zitadel/server#test:powinternal/crypto/powonly@zitadel/cloud#build-tags noconsole@zitadel/server#check-generate.gitkeepbench#build,#vet,#testgo list -depsshowstools/benchdoes not import the embed package//#check-go-workgo list -deps -testlists names and opens no file; 15 runs beside the same loop, 0 failuresTwo new tests in
scripts/task-graph.test.mjs(part of//#test) hold this. Onmainthey fail withexpected [ 'nextgen#build' ] to deeply equal []and on the 48docs:apitasks of packages that have no such script.Validation
turbo run lint typecheck build test docs:api --concurrency=2: 203 of 204 tasks pass.@zitadel/cli#test, one test of 11,756:auth-method sso enable when the schema cannot be written. It makes a file read-only withchmodand my container runs as root. This PR does not touch the CLI.--concurrency=2because turbo's default ran my 4-core container out of memory.vitest run scripts/task-graph.test.mjs: 30 pass. Before the fix the two new tests fail as quoted above.turbo run clean, thenturbo run docs:api --filter="@zitadel/sdk-*": 32 tasks pass withapi-mock,vitest-configandclient-sdk-contractunbuilt, so thebuildedge is enough.turbo boundaries: no issues.bench#buildandbench#test(see Notes).node scripts/check-changesets-status.mjs --summaryandnode scripts/check-pr-title.mjs --base origin/main: ok.Release notes / changeset
Empty changeset (
.changeset/sdk-docs-api-task.md):packages/sdk-*/turbo.jsonlie under publishable roots, but no tarball holds aturbo.jsonand nothing ships.Notes
dependsOn: ["build"]that reaches a Go module would bring the built-in back. The new test fails on that.bench#buildandbench#testmiss the cache on the run after the console's output changes. Turbo adds every file of the modulesbenchrequires to their inputs, the ignoredapps/api/internal/staticui/console/dist/**included. CI's checkout starts with that folder empty, so its keys are stable.Generated by Claude Code