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

Support pnpm v9 lockfiles #28467

Closed
viceice opened this issue Apr 17, 2024 · 7 comments · Fixed by #28470
Closed

Support pnpm v9 lockfiles #28467

viceice opened this issue Apr 17, 2024 · 7 comments · Fixed by #28470
Assignees
Labels
manager:npm package.json files (npm/yarn/pnpm) priority-2-high Bugs impacting wide number of users or very important features status:in-progress Someone is working on implementation type:feature Feature (new functionality)

Comments

@viceice
Copy link
Member

viceice commented Apr 17, 2024

Describe the proposed change(s).

pnpm v9 brings a new lockfile format 9.0 which is different from 6.0

https://github.com/pnpm/pnpm/releases/tag/v9.0.0

@viceice viceice added type:feature Feature (new functionality) priority-2-high Bugs impacting wide number of users or very important features manager:npm package.json files (npm/yarn/pnpm) labels Apr 17, 2024
@viceice viceice self-assigned this Apr 17, 2024
@viceice viceice added the status:in-progress Someone is working on implementation label Apr 17, 2024
@viceice
Copy link
Member Author

viceice commented Apr 17, 2024

wrong behavior: renovate-reproductions/28467-pnpm-v9@d51e853

@viceice
Copy link
Member Author

viceice commented Apr 17, 2024

@rarkins I think i found a bug

config.reuseLockFiles = config.upgrades.every(
(upgrade) => upgrade.updateType !== 'lockFileMaintenance',
);

// istanbul ignore next
if (
packageFile.managerData.pnpmShrinkwrap &&
config.reuseLockFiles === false
) {
await deleteLocalFile(packageFile.managerData.pnpmShrinkwrap);
}

this will delete the lockfile before we get to the update function, so we can't extract contraints from lockfile here

const lockfileContent = await readLocalFile(lockFileName, 'utf8');
if (!lockfileContent) {
return null;
}
// TODO: use schema (#9610)

@viceice
Copy link
Member Author

viceice commented Apr 17, 2024

We delete the lockfile here if it's lockfile maintenance

if (upgrades.find((upgrade) => upgrade.isLockFileMaintenance)) {
logger.debug(
`Removing ${lockFileName} first due to lock file maintenance upgrade`,
);
try {
await deleteLocalFile(lockFileName);
} catch (err) /* istanbul ignore next */ {
logger.debug(
{ err, lockFileName },
'Error removing yarn.lock for lock file maintenance',
);
}
}

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 37.303.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@moltar
Copy link
Contributor

moltar commented Apr 20, 2024

I think something here has introduced a bug. We use a self-hosted version via GH Actions, and for the past 3 days pretty much all PRs fail to update pnpm locks. Our action does not pin a Renovate version, so it always uses the latest tag.

 WARN: artifactErrors (repository=foo/bar, baseBranch=master, branch=renovate/undici-6.x)
       "artifactErrors": [
         {
           "lockFile": "pnpm-lock.yaml",
           "stderr": "Scope: all 3 workspace projects\nProgress: resolved 1, reused 0, downloaded 0, added 0\nProgress: resolved 77, reused 0, downloaded 0, added 0\nProgress: resolved 417, reused 0, downloaded 0, added 0\nProgress: resolved 631, reused 0, downloaded 0, added 0\nProgress: resolved 957, reused 0, downloaded 0, added 0\nProgress: resolved 1028, reused 0, downloaded 0, added 0\nProgress: resolved 1411, reused 0, downloaded 0, added 0\nProgress: resolved 1591, reused 0, downloaded 0, added 0\nProgress: resolved 1685, reused 0, downloaded 0, added 0\nProgress: resolved 1685, reused 0, downloaded 0, added 0, done\n"
         }

I've spent hours trying to pin it down to something, and unfortunately, I cannot find precisely what is causing this.

But this change is the closest to all the clues I can find.

@moltar
Copy link
Contributor

moltar commented Apr 20, 2024

What is also odd, is that some PRs are fine, and some are not.

Debugging is further exacerbated by the lack of ppm error messages (see #28536).

Another clue is that it might be related to this: pnpm/pnpm#7978

Which would explain why some PRs are ok, maybe they do not have peer issues.

@rarkins
Copy link
Collaborator

rarkins commented Apr 20, 2024

@moltar please start a new discussion instead

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:npm package.json files (npm/yarn/pnpm) priority-2-high Bugs impacting wide number of users or very important features status:in-progress Someone is working on implementation type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants