Skip to content
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

Only use cache layer if yarn.lock AND package.json match #813

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

c0d1ngm0nk3y
Copy link
Contributor

Fixes #143

Summary

When checking the sha in the metadata if the cache layer can be reused, not only check yarn.lock but also package.json for changes. This also aligns the behaviour with npm-install where package.json and package.lock are used to calculate the sha.

Use Cases

If the user somehow changes the package.json without changing yarn.lock, this will now not use the cached layer, but install the packages again with the changed package.json.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@mhdawson mhdawson merged commit c28b4cf into main Nov 14, 2024
10 checks passed
@mhdawson mhdawson deleted the align-caching-decision branch November 14, 2024 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cached node_modules layer reused on rebuild even when package.json has changed
2 participants