-
Notifications
You must be signed in to change notification settings - Fork 1
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
Simplify the way yarn-install action ensures yarn.lock stays unchanged after yarn install
#369
Conversation
🦋 Changeset detectedLatest commit: e11f730 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
77d66a9
to
333beb4
Compare
yarn install
3cace5f
to
27a3821
Compare
27a3821
to
65c5157
Compare
9f7c650
to
31eab9a
Compare
4ce24b4
to
d71bcaf
Compare
so it's more performant and less error prone
d71bcaf
to
e11f730
Compare
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.
Thank you for testing it in two apps, looks good!
I have addressed the concerns raised by @sashuk and @pudek357 and re-rested on toptal/staff-portal and on toptal/platform https://github.com/toptal/platform/actions/runs/12673183166/job/35318966291#step:11:624 |
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.
Great job!
Background
I have faced a problem integrating yarn-install action into tracker-front where we have yarn.lock that gets all packages through registry.yarnpkg.com, so not a single mention of registry.npmjs.com is there, and this leads to
Change registry in yarn.lock file to npm Artifact Registry
step failing with an error (e.g. https://github.com/toptal/tracker-front/actions/runs/12527127099/job/34940394300?pr=3264)Initially tried to hunt down and fix this specific problem, but debugging this quite complex bash script came to conclusion it's kind of overengineered and we can achieve the same behavior with much more simple and even more performant implementation. Thus this is my suggestion
Description
The idea if existing implementation is that after running yarn install we process entire yarn.lock and undo any registry overrides that we've done previously so we can compare yarn.lock after yarn install to one in git index.
The idea of updated implementation is that we capture checksum of the yarn.lock right before running
yarn install
(with overridden URLs) and compare it to checksum after yarn installHow to test
yarn-install
works as expected on different toptal reposDevelopment checks
PR commands
List of available commands:
@toptal-anvil ping reviewers
- Ping teams for review