-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Prevent reusing Yarn cache across Yarn versions #21046
Conversation
The Yarn cache will no longer be reused across Yarn versions in our CircleCI pipeline. This should prevent bugs in the event that the lockfile format changes again, or the checksum method used by Yarn. We saw this problem when we upgraded from Yarn v3 to v4 on our main branch. We prepared a backport release that was still using v3, and it resulted in lockfile errors that we didn't catch until 2 releases later.
91518bb
to
a80c3b1
Compare
- run: | ||
name: Save Yarn version | ||
command: | | ||
yarn --version > /tmp/YARN_VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A file was used here rather than an environment variable because CircleCI doesn't support referencing dynamically-set environment variables from restore_cache keys. It only works for environment variables set statically for the entire workflow.
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #21046 +/- ##
========================================
Coverage 68.39% 68.39%
========================================
Files 1007 1007
Lines 40252 40252
Branches 10764 10764
========================================
Hits 27529 27529
Misses 12723 12723 ☔ View full report in Codecov by Sentry. |
Builds ready [a80c3b1]
Page Load Metrics (1516 ± 396 ms)
Bundle size diffs
|
@Gudahtt @brad-decker @FrederikBolding I think there's a problem with this PR actually, because now we're restoring cache from |
Thanks @HowardBraham , good catch! |
Description
The Yarn cache will no longer be reused across Yarn versions in our CircleCI pipeline. This should prevent bugs in the event that the lockfile format changes again, or the checksum method used by Yarn.
We saw this problem when we upgraded from Yarn v3 to v4 on our main branch. We prepared a backport release that was still using v3, and it resulted in lockfile errors that we didn't catch until 2 releases later.
Manual testing steps
See that CI completes successfully using the correct cache key
Related issues
None
Pre-merge author checklist
Pre-merge reviewer checklist