Repository navigation
ci(repo): scope integration test inputs to packages the e2e apps use - #10623
Closed
austincalvelage wants to merge 17 commits into
Closed
austincalvelage wants to merge 17 commits into
austincalvelage wants to merge 17 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 2dbd626 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 |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
austincalvelage
force-pushed
the
austin/caching-ci
branch
from
November 3, 2026 23:00
d6f0737 to
b0c1041
Compare
austincalvelage
force-pushed
the
austin/caching-ci
branch
from
November 4, 2026 00:24
b0c1041 to
2af2db1
Compare
1 of 9 tasks
Give each integration suite task a dependsOn list of the package builds its e2e apps install, and drop the packages/* input globs. Turbo folds the dependency build hashes into the suite hash, so a change to a package no suite installs no longer invalidates every suite, while a change to a transitive dependency still does. Force full runs in the merge queue and nightly.
… boot Derive each suite's dependsOn and inputs from the presets and the tests tagged for it, and fail the CI script tests when turbo.json drifts. Each task now lists only the test directories and templates it owns, and the turbo passthrough variables move to globalPassThroughEnv so the 26 task blocks differ only where the suites differ.
Read the environment the CI setup needs up front and exit with a named variable instead of crashing mid-run.
…cript Explain how a suite's cache key is built, the --only rule, the merge queue safety net, the in-task setup script, and how to add a suite. The matrix script shows which suites rerun for a set of representative edits.
Each suite's tests now live under integration/tests/<suite>/, so a suite's turbo inputs are its own directory rather than every top-level test file. Tests tagged for both generic and nextjs live in generic/, and the seven tests no suite tag selects live in unscheduled/. Only the import depth changed inside the moved files.
The chrome-extension suite imports a clerk-js test fixture that the clerk-js build excludes, so a fixture change could reuse a cached pass. The dependency checker now records package source files that tests import directly and adds them to the suite's inputs, and a check asks turbo's dry run to confirm it hashes each one.
…ess deps out of the root Integration suites now depend on <pkg>#build:inputs, a task no package defines. It hashes the same inputs as build and chains through ^build:inputs, so a suite's hash still covers every package it uses, but a cache hit restores no build outputs and TURBO_FORCE in the merge queue no longer rebuilds dependencies. @clerk/backend, @clerk/shared and @clerk/testing move from the root package.json to a new private @clerk/integration workspace package. Turbo folded every file of a root workspace dependency into the global hash, so editing any file in those packages, tests included, reran every task in the repo. Suites now list the harness packages explicitly, derived from integration/package.json, and a test keeps workspace packages out of the root manifest.
…uild CLERK_* is in globalEnv, and the integration test step sets CLERK_PLATFORM_API_KEY and CLERK_E2E_OAUTH_PROVIDER_CLIENT_SECRET. Once the build moved into that step, every package hash differed from the Build Packages job, so each integration cache miss rebuilt all 26 packages. The runner now drops CLERK_* from the build's environment. Also removes the no-op .npmrc edit from the integration job and corrects the staging workflow's description of the cache key.
…ng (will be reverted)" This reverts commit 1dea6d4.
austincalvelage
force-pushed
the
austin/caching-ci
branch
from
November 4, 2026 07:04
5233c3f to
a61edee
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Every
//#test:integration:*task listedpackages/*/src/**as an input, so a change to any package invalidated all 26 integration suites. A Mosaic or Swingset change reran Express, Nuxt, Astro, and the rest. Separately, the rootpackage.jsondepended on@clerk/backend,@clerk/sharedand@clerk/testing, and Turborepo includes every file of a root workspace dependency in the global hash. Editing any file in those packages, a test or README included, reran every task in the repo.Each suite now hashes only what it uses:
dependsOnlists<pkg>#build:inputsfor each package the suite needs:@clerk/clerk-js,@clerk/ui, the harness packages, and the framework packages its e2e apps install.build:inputsis a transit node. No package defines it, so it runs and restores nothing, but it hashes the same inputs asbuildand chains through^build:inputs, so transitive packages are covered. A cache hit downloads no build outputs.inputscovers the harness, the test directories the suite's tagged tests live in, the templates its apps copy, and any package source file a test imports directly.scripts/integration-deps.test.mjsderives both lists fromintegration/presetsand the tagged tests, and fails with the block to paste whenturbo.jsondrifts.packages/mosaic/srcmosaicpackages/expo/srcexpo-webpackages/upgrade/srcpackages/shared/srcpackages/sharedtest fileshared's own test and lint tasks rerun)integration/tests/vue/components.test.tsvueintegration/tests/generic/sign-in-flow.test.tsgeneric,nextjs,nextjs:canary,customintegration/expo-nativenode scripts/integration-hash-matrix.mjsreproduces this table on a clean tree.The three harness packages move from the root
package.jsoninto a new private@clerk/integrationworkspace package (integration/package.json). A test keeps workspace packages out of the root manifest.Every integration test now lives under
integration/tests/<suite>/, because Turborepo scopes inputs by path and about 60 tests used to sit at the top level with only a@suitetag. Tests tagged for both@genericand@nextjslive ingeneric/, and the seven tests no suite selects live inunscheduled/. Only import depth changed inside the moved files. Review commit by commit:ace299fb69is pure renames.Per-job setup (package build, pkglab publish, clerk-js and ui install, Chromium, Xvfb) moved from workflow steps into
integration/scripts/run-integration.mjs, which runs inside the turbo task. A cache hit skips all of it, including user cleanup, which is gated on thetests-startedoutput the script writes. The script stripsCLERK_*from its package build, becauseCLERK_*is inglobalEnvand the test step's secrets would otherwise make every build miss the Build Packages job's cache.Caching e2e suites is a deliberate exception to Turborepo's assumption that tasks are deterministic. The suites also depend on the live Clerk backend and on template dependencies resolved from npm at test time, which no hash can see. So:
TURBO_FORCEon the integration test step, so every suite runs before anything reachesmain. Forcing reaches only the suite, because its dependencies are transit nodes.--force, so external drift surfaces within a day.--only, which drops dependency hashes from the task hash.The
clerk-monoreposkill gains an "Integration CI caching" section covering the cache key, these rules, and how to add a suite.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change