Repository navigation
ci(repo): hash environment variables only into the tasks they affect - #10667
austincalvelage wants to merge 2 commits into
Conversation
NODE_VERSION was in globalEnv, so the Unit Tests jobs (which set it per Node version) computed different build hashes from the Build Packages job (which does not set it) and rebuilt every package the PR changed. Scoping it to the test task keeps test results separate per Node version and lets every job share build cache entries.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
🦋 Changeset detectedLatest commit: cd2fb8a 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 |
@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: |
…ks they affect Remove NPM_VERSION and NEXT_PHASE, which nothing reads. Hash RSDOCTOR only into the clerk-js and ui builds that read it, and TZ only into tests. Pass TZ and the VERCEL variables through to tasks without hashing them, since they don't change any task's output.
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
Description
Scopes the variables in
globalEnvto the tasks they affect, following Turbo's rules for environment variables: a variable that changes a task's output goes in that task'senv, and a variable a task only needs at runtime goes in a pass-through list, which isn't hashed.NODE_VERSIONmoves to thetesttaskCI sets
NODE_VERSIONonly in the Unit Tests steps (24.15.0or20.19.0), and the Build Packages job doesn't set it. Because it was inglobalEnv, each package build had three cache keys, one per job:NODE_VERSION@clerk/clerk-js#buildbefore1e99830997e4d0ca22193a379805db2424.15.0(Unit Tests)bfb74d663908a32622193a379805db2420.19.0(Unit Tests)6d504020eae9134a22193a379805db24As a result, both Unit Tests jobs rebuilt every package a PR changed, even though Build Packages had just built it. On recent PRs that cost 40 to 70 seconds per job. With this change, both Unit Tests jobs download all 26 builds from the cache. Test results keep a separate cache entry per Node version, so the Node 20 job still runs its own tests.
The other entries
NPM_VERSION,NEXT_PHASEglobalEnvNEXT_PHASEinside its own build.RSDOCTORglobalEnvenvof the clerk-jsbuildandbuild:sandboxtasks and the uibuildtaskTZglobalEnvenvof thetesttask, plusglobalPassThroughEnvVERCEL,VERCEL_PROJECT_PRODUCTION_URL,VERCEL_TARGET_ENVglobalEnvglobalPassThroughEnvVERCEL_TARGET_ENVon its own anyway.NODE_ENVand theCLERK_*familiesglobalEnvNODE_ENV. The integration test apps read theCLERK_*families, so the integration tasks need them hashed. Moving those into each integration task'senvcan follow the integration suite changes in #10648, #10653 and #10661.Every task's hash changes once, so the first run after merge rebuilds everything.
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change