Skip to content

build: run turbo boundaries in CI and move the shared Vitest config into a package - #2423

Merged
fforootd merged 1 commit into
mainfrom
claude/turbo-boundaries
Oct 28, 2026
Merged

fforootd merged 1 commit into
mainfrom
claude/turbo-boundaries

Conversation

@fforootd

Copy link
Copy Markdown
Member

Summary

turbo boundaries fails when a package imports a file outside its own directory, or a package its package.json does not declare. It reported 40 issues on main. This PR gets it to none and runs it in CI, so turbo's own check keeps imports inside the package graph.

  • Shared Vitest config as a package. The root vitest.shared.mjs and its vitest.shared.d.mts move into a private workspace package, @zitadel/vitest-config (packages/vitest-config, file names unchanged).
    • The 26 Vitest and Vite configs that spread it, and the root vitest.config.ts, now import it by name and list it in their devDependencies. That fixes 26 of the 40 issues.
    • Both runners keep its files a global dependency: globalDependencies in turbo.json, implicitInputs in .moon/tasks/typescript.yml. No task edge reaches the package, and turbo hashes another package's files into a task only through task edges, so dropping that would leave every test cache-hit after an edit to the config.
  • The 14 imports that cannot go through a package now carry // @boundaries-ignore <reason>:
    • 12 of root scripts/ modules: the release manifest and artifacts, dev-process, task-runner, render-builtin-schemas, check-pr-title. No package can depend on the workspace root.
    • The storybook's import of the components' unpublished Vite plugin. The comment above it already explains why it is imported by path.
    • k6/x/nextgen, which the xk6 binary provides at run time.
  • CI. turbo boundaries runs right after install in ci.yml (the required full-pr check) and in ci-turbo.yml.
  • References. The places that named the old root files now name the package: moon's inputs, the PR-title check's non-shipping lists, the sdk-core contract spec's guard on edge configs, the package docs.
  • Docs. The rule is in docs/design/build/turborepo.md, and the CI step is listed in CONTRIBUTING.md.

Validation

  • turbo boundaries: no issues in 1505 files and 38 packages (40 issues before). It exits 1 on a probe import that leaves its package.
  • turbo run typecheck test for every JS package and the root, uncached: 82 tasks passed (27 typechecks, 25 test suites, and their builds) in 62 s.
  • node scripts/check-moon-graph.mjs, node scripts/check-typecheck-programs.mjs, biome check, pnpm install --frozen-lockfile: clean.
  • Hashing: an edit to packages/vitest-config/vitest.shared.mjs changes the hash of every task, as an edit to the root file did.
  • node scripts/check-pr-title.mjs --base origin/main: ok.

Release notes / changeset

No changeset required — no shipped behavior changed. The published packages gain a devDependency only.

Notes

  • The ignore comments state why an import crosses the boundary. They do not make turbo hash the file. Of the files they mark, only the deployment lanes list theirs as task inputs today (cli-deployment, schemas-deployment). The journey lanes, e2e#test and cli#test read root scripts their turbo inputs do not list; build: stop docs and test edits from re-running the task graph, and let turbo select what ci-turbo runs #2420 adds those inputs.
  • Turbo's --ignore=all option, which writes these comments itself, deleted import nextgen from from the k6 script in a trial run, so the comments here are written by hand.
  • The edge-project comment the contract spec pins ("see edgeProject in vitest.shared.mjs") still names the file, which kept its name inside the package.

🤖 Generated with Claude Code

…nto a package

`turbo boundaries` checks that each package imports only its own files and
the packages its package.json declares. It reported 40 issues; it now
reports none and runs in ci.yml and ci-turbo.yml.

- vitest.shared.mjs and vitest.shared.d.mts move into the private package
  `@zitadel/vitest-config` (packages/vitest-config). The 26 configs that
  spread it and the root vitest.config.ts import it by name and declare it.
  Both runners keep its files a global dependency: no task edge reaches
  the package.
- The 14 imports that cannot go through a package carry
  `// @boundaries-ignore <reason>`: root scripts/ modules, the components'
  unpublished Vite plugin and k6's runtime module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cloud Ready Ready Preview Oct 28, 2026 1:47am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ No Changeset found

Latest commit: 202c487

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@fforootd
fforootd marked this pull request as ready for review October 28, 2026 02:08
Copilot AI balanced review requested due to automatic review settings October 28, 2026 02:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-28T02:10:35.701886Z 202c487 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

This change introduces a new repo-wide required turbo boundaries CI gate propped up by 14 manual // @boundaries-ignore comments, whose passing run must be verified before merge.

No open issues 🎉

1 file not reviewed
  • pnpm-lock.yaml: Generated file
What changed in this PR

This PR makes turbo boundaries pass and runs it in CI, so each package only imports its own files and the workspace packages it declares. The main mechanism is extracting the root shared Vitest config (vitest.shared.mjs / vitest.shared.d.mts) into a private workspace package @zitadel/vitest-config, so the 26+ configs that spread it import it by name and declare it as a devDependency. The 14 imports that genuinely cannot route through a package (root scripts/ modules, the unpublished components Vite plugin, k6's runtime module) are annotated with // @boundaries-ignore <reason>.

Changes:

  • Move the shared Vitest config into packages/vitest-config (@zitadel/vitest-config) and update all configs + devDependencies + lockfile.
  • Add // @boundaries-ignore comments to the 14 unavoidable cross-boundary imports; add turbo boundaries to ci.yml and ci-turbo.yml.
  • Update references (moon inputs, turbo globalDependencies, PR-title non-shipping lists, contract-spec guard, docs) to the new package path.
File Description
packages/​vitest-config/​{package.json,vitest.shared.mjs,vitest.shared.d.mts} New private package holding the shared config and its hand-written types
27 vitest/​vite config files Import @zitadel/vitest-config by name instead of the root relative path
~25 package.json files + pnpm-lock.yaml Add @zitadel/vitest-config devDependency and lockfile links
turbo.json List the package's files in globalDependencies; refresh the comment
moon.yml, .moon/​tasks/​typescript.yml Point test inputs/implicitInputs at the new package path
scripts/​check-pr-title.mjs Add packages/vitest-config/ to non-shipping workspaces; drop old root files
packages/​sdk-core/​src/​contract.spec.ts Update the edge-config import guard regex/fixture to the package name
e2e/​* , tools/​bench/​scripts/​bench.js, apps/​storybook/​.storybook/​main.ts, apps/​cli/​tests/​.../​check-pr-title.test.ts Add // @boundaries-ignore to unavoidable cross-boundary imports
.github/​workflows/​{ci.yml,ci-turbo.yml} Add the turbo boundaries step after install
CONTRIBUTING.md, docs/​design/​build/​turborepo*.md, packages/​AGENTS.md, packages/​components/​AGENTS.md Document the boundaries rule and the package rename

Note: this change introduces turbo boundaries as a new repo-wide required CI gate backed by hand-written ignore comments; it would be worth confirming this PR's own full-pr run of that step is green before merge.

Review effort: Balanced

@fforootd
fforootd added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 282ab1d Oct 28, 2026
20 checks passed
@fforootd
fforootd deleted the claude/turbo-boundaries branch October 28, 2026 02:51
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Oct 28, 2026
mridang added a commit that referenced this pull request Oct 28, 2026
Moves vite.shared.mjs into a private @zitadel/vite package so the SDK
builds pass turbo boundaries, as #2423 did for the Vitest config.

This branch was successfully deployed

1 active deployment
Preview — 202c4875 Deployed Oct 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants