-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Renovate PRs may include yarn.lock
with mismatched lockfile
#30051
Comments
It may be possible to resolve this issue by extending .husky/pre-commit actions to run yarn run yarn-deduplicate --strategy highest
if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
echo yarn.lock deduplication changes detected
echo yarn.lock added to this commit
git add yarn.lock
fi If this sounds like a reasonable solution then it would be better for a PR to come from the core Cypress.io team as I have no write access to the repo and no access to Renovate logs etc., so I would be unable to trigger any test runs using Renovate. |
@MikeMcC399 It looks like Renovate has an option to turn this on: https://docs.renovatebot.com/configuration-options/#postupdateoptions - |
Thanks for uncovering that Renovate option! In that case the option could be added to the config in renovate.json, which would put it in the place where it really belongs. I haven't noticed any other process being responsible for leaving out deduplication, so the Husky hook suggestion would not need to be implemented. The same comment about submitting a PR and testing still applies though, so I think that it would be better for the Cypress.io to do it as I don't have the right access to be effective in testing. |
Current behavior
When
yarn
(install
) is run against the repo after a Renovate-generated PR has been merged, a git diff may occur.It appears that Renovate runs
yarn
without using the postinstall stepyarn-deduplicate --strategy highest
.cypress/scripts/run-postInstall.js
Lines 5 to 8 in 482358b
Desired behavior
If Renovate PRs include updated
yarn.lock
files, then they should agree with the result of independently runningyarn
.Test code to reproduce
On Ubuntu
22.04.4
LTS, Node.js18.17.1
, Yarn1.22.22
No differences reported.
Now go to one commit later in the
develop
branch history:Now
yarn.lock
is showing differences - see Debug Logs below.For reference, here is the history snippet:
Cypress Version
13.13.3
Node version
v18.17.1
Operating System
Ubuntu
22.04.4
LTSDebug Logs
Other
Running
yarn
outside of Renovate includes the postinstall commandyarn-deduplicate --strategy highest
.In the above example, this removes the unneeded
@antfu/[email protected]
since semver needs are all satisfied by@antfu/[email protected]
.This can be simulated by separately executing the following:
Adding this command to the original steps to reproduce:
shows the same
git diff
as in the original steps to reproduce.The text was updated successfully, but these errors were encountered: