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

Version in pnpm lockfile doesn't match PR title after updating a lockfile-only PR #33492

Closed
rarkins opened this issue Jan 9, 2025 Discussed in #32552 · 4 comments · Fixed by #33497
Closed

Version in pnpm lockfile doesn't match PR title after updating a lockfile-only PR #33492

rarkins opened this issue Jan 9, 2025 Discussed in #32552 · 4 comments · Fixed by #33497
Assignees
Labels
manager:npm package.json files (npm/yarn/pnpm) priority-2-high Bugs impacting wide number of users or very important features type:bug Bug fix of existing functionality

Comments

@rarkins
Copy link
Collaborator

rarkins commented Jan 9, 2025

Discussed in #32552

Originally posted by thasmo November 14, 2024

How are you running Renovate?

A Mend.io-hosted app

Please tell us more about your question or problem

When using pnpm as package manager, any successive renovate run (except the initial run, which creates a PR) will not update the version of the dependency (renovate) in the pnpm-lockfile.yaml file, and therefore will be out of sync with the PR title.

PR Title: Update dependency renovate to v39.15.3
Commit: Update dependency renovate to v39.13.1

  • This issue happens only when Renovate comes back and tries to update an existing PR to a newer version. (The initial PR/commit is fine.)
  • When using the checkbox If you want to rebase/retry this PR, check this box to force Renovate to do a rebase, it actually updates the files correctly in line with the PR title.

https://github.com/thasmo/renovate-pnpm-lockfile

Thank you! :)

image

Reproduction details here: #32552 (comment)

@rarkins rarkins added type:bug Bug fix of existing functionality priority-2-high Bugs impacting wide number of users or very important features manager:npm package.json files (npm/yarn/pnpm) labels Jan 9, 2025
@rarkins
Copy link
Collaborator Author

rarkins commented Jan 9, 2025

This logic seems wrong:

if (
config.reuseExistingBranch &&
!config.updatedPackageFiles?.length &&
config.upgrades?.every((upgrade) => upgrade.isLockfileUpdate)
) {
logger.debug('Existing branch contains all necessary lock file updates');
return { artifactErrors, updatedArtifacts };
}

But looking at the PR which I wrote apparently 4 years ago, it seems like there's additional code which was meant to replace it:

75b1d8f#diff-968c98c2d5f5636ba78651d20ba73017c4fc6339229dd66740c7d926e06c88ee

Maybe we "broke" this later somehow. But I've confirmed it's not due to caching as the same problem occurs even if repositoryCache=disabled.

@rarkins
Copy link
Collaborator Author

rarkins commented Jan 9, 2025

My reproduction PR: renovate-reproductions/32552#2

@zharinov
Copy link
Collaborator

zharinov commented Jan 9, 2025

This logic seems wrong

Could we just remove this if-branch? In my reproduction, it worked well.

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 39.100.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:npm package.json files (npm/yarn/pnpm) priority-2-high Bugs impacting wide number of users or very important features type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants