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

fix(npm): Don't skip lockfile-only updates #33497

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

zharinov
Copy link
Collaborator

@zharinov zharinov commented Jan 9, 2025

Changes

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@zharinov zharinov requested a review from rarkins January 9, 2025 21:09
@rarkins
Copy link
Collaborator

rarkins commented Jan 10, 2025

New logs:

DEBUG: manager.getUpdatedPackageFiles() reuseExistingBranch=true (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Cannot patch pnpm lock file directly - falling back to using pnpm (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: updateArtifacts for nonUpdatedPackageFiles (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: npm.updateArtifacts(package.json) (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: No packageManager updates - returning null (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: No package files need updating (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Getting updated lock files (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Writing package.json files (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "packageFiles": ["package.json"]
DEBUG: Writing any updated package files (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Found 0 npm host rule(s) (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: npmrc file .npmrc found in repository (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Generating pnpm-lock.yaml for . (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Spawning pnpm install to create pnpm-lock.yaml (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Found pnpm constraint in package.json packageManager: 9.15.3 (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Using node constraint "22" from .nvmrc (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Performing lockfileUpdate (pnpm) (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Setting CONTAINERBASE_CACHE_DIR to /tmp/renovate/cache/containerbase (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Using docker to execute (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "image": "sidecar"
DEBUG: Resolved stable matching version (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "toolName": "node",
       "constraint": "22",
       "resolvedVersion": "v22.13.0"
DEBUG: containerbaseDir is inside cacheDir (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Resolved tag constraint (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "image": "ghcr.io/containerbase/sidecar:13.5.8"
DEBUG: Fetching Docker image: ghcr.io/containerbase/sidecar:13.5.8 (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Finished fetching Docker image ghcr.io/containerbase/sidecar:13.5.8@sha256:496ed5a140059e864d2660919e46d1f62601748d4bf72531a4abcf982bb5750e (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Executing command (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "command": "docker run --rm --name=renovate_sidecar --label=renovate_child --user=1000:0 -v \"/tmp/renovate/repos/github/renovate-reproductions/32552\":\"/tmp/renovate/repos/github/renovate-reproductions/32552\" -v \"/tmp/renovate/cache\":\"/tmp/renovate/cache\" -e NPM_CONFIG_CACHE -e npm_config_store -e CONTAINERBASE_CACHE_DIR -w \"/tmp/renovate/repos/github/renovate-reproductions/32552\" ghcr.io/containerbase/sidecar:13.5.8 bash -l -c \"install-tool node v22.13.0 && install-tool pnpm 9.15.3 && pnpm update --no-save [email protected] --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile && pnpm dedupe --config.ignore-scripts=true\""
DEBUG: exec completed (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "durationMs": 21835,
       "stdout": "[09:48:31.137] INFO (9): Installing tool [email protected]...\nv22.13.0\n10.9.2\n0.30.0\n[09:48:33.471] INFO (9): Install tool node succeeded in 2.3s.\n[09:48:34.282] INFO (45): Installing npm [email protected]...\n9.15.3\n[09:48:35.445] INFO (45): Install tool pnpm succeeded in 1.1s.\nProgress: resolved 1, reused 0, downloaded 0, added 0\nProgress: resolved 8, reused 0, downloaded 0, added 0\nProgress: resolved 194, reused 0, downloaded 0, added 0\nProgress: resolved 524, reused 0, downloaded 0, added 0\nProgress: resolved 859, reused 0, downloaded 0, added 0\nProgress: resolved 949, reused 0, downloaded 0, added 0\nProgress: resolved 962, reused 0, downloaded 0, added 0\nProgress: resolved 978, reused 0, downloaded 0, added 0\n WARN  4 deprecated subdependencies found: [email protected], [email protected], [email protected], [email protected]\nProgress: resolved 981, reused 0, downloaded 0, added 0, done\nDone in 8.1s\nProgress: resolved 1, reused 0, downloaded 0, added 0\nProgress: resolved 9, reused 0, downloaded 9, added 0\nProgress: resolved 91, reused 0, downloaded 57, added 0\nProgress: resolved 267, reused 0, downloaded 240, added 0\nProgress: resolved 469, reused 0, downloaded 435, added 0\nProgress: resolved 675, reused 0, downloaded 645, added 0\nProgress: resolved 940, reused 0, downloaded 892, added 0\n WARN  4 deprecated subdependencies found: [email protected], [email protected], [email protected], [email protected]\nAlready up to date\nProgress: resolved 980, reused 0, downloaded 980, added 980, done\n\ndevDependencies:\n+ @commitlint/cli 19.6.1\n+ @somehow-digital/commitlint-config 1.1.0\n+ @somehow-digital/cspell-dictionary 2.2.0\n+ @somehow-digital/prettier-config 2.0.0\n+ concurrently 9.1.2\n+ cspell 8.17.1\n+ husky 9.1.7\n+ lint-staged 15.3.0\n+ prettier 3.4.2\n+ renovate 39.100.1\n\n",
       "stderr": ""
DEBUG: pnpm-lock.yaml needs updating (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Updated 1 lock files (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "updatedArtifacts": ["pnpm-lock.yaml"]

With cache disabled, it unfortunately result in the pnpm command being run every run:

DEBUG: manager.getUpdatedPackageFiles() reuseExistingBranch=true (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Cannot patch pnpm lock file directly - falling back to using pnpm (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: updateArtifacts for nonUpdatedPackageFiles (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: npm.updateArtifacts(package.json) (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: No packageManager updates - returning null (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: No package files need updating (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Getting updated lock files (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Writing package.json files (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "packageFiles": ["package.json"]
DEBUG: Writing any updated package files (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Found 0 npm host rule(s) (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: npmrc file .npmrc found in repository (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Generating pnpm-lock.yaml for . (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Spawning pnpm install to create pnpm-lock.yaml (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Found pnpm constraint in package.json packageManager: 9.15.3 (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Using node constraint "22" from .nvmrc (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Performing lockfileUpdate (pnpm) (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Setting CONTAINERBASE_CACHE_DIR to /tmp/renovate/cache/containerbase (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Using docker to execute (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "image": "sidecar"
DEBUG: Resolved stable matching version (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "toolName": "node",
       "constraint": "22",
       "resolvedVersion": "v22.13.0"
DEBUG: containerbaseDir is inside cacheDir (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Resolved tag constraint (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "image": "ghcr.io/containerbase/sidecar:13.5.8"
DEBUG: Fetching Docker image: ghcr.io/containerbase/sidecar:13.5.8 (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Finished fetching Docker image ghcr.io/containerbase/sidecar:13.5.8@sha256:496ed5a140059e864d2660919e46d1f62601748d4bf72531a4abcf982bb5750e (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: Executing command (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "command": "docker run --rm --name=renovate_sidecar --label=renovate_child --user=1000:0 -v \"/tmp/renovate/repos/github/renovate-reproductions/32552\":\"/tmp/renovate/repos/github/renovate-reproductions/32552\" -v \"/tmp/renovate/cache\":\"/tmp/renovate/cache\" -e NPM_CONFIG_CACHE -e npm_config_store -e CONTAINERBASE_CACHE_DIR -w \"/tmp/renovate/repos/github/renovate-reproductions/32552\" ghcr.io/containerbase/sidecar:13.5.8 bash -l -c \"install-tool node v22.13.0 && install-tool pnpm 9.15.3 && pnpm update --no-save [email protected] --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile && pnpm dedupe --config.ignore-scripts=true\""
DEBUG: exec completed (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
       "durationMs": 17197,
       "stdout": "[09:50:13.809] INFO (9): Installing tool [email protected]...\nv22.13.0\n10.9.2\n0.30.0\n[09:50:16.051] INFO (9): Install tool node succeeded in 2.2s.\n[09:50:16.960] INFO (45): Installing npm [email protected]...\n9.15.3\n[09:50:18.117] INFO (45): Install tool pnpm succeeded in 1.1s.\nProgress: resolved 1, reused 0, downloaded 0, added 0\nProgress: resolved 13, reused 0, downloaded 0, added 0\nProgress: resolved 381, reused 0, downloaded 0, added 0\nProgress: resolved 827, reused 0, downloaded 0, added 0\n WARN  4 deprecated subdependencies found: [email protected], [email protected], [email protected], [email protected]\nProgress: resolved 980, reused 0, downloaded 0, added 0, done\nDone in 4.1s\nProgress: resolved 1, reused 0, downloaded 0, added 0\nProgress: resolved 10, reused 0, downloaded 9, added 0\nProgress: resolved 199, reused 0, downloaded 171, added 0\nProgress: resolved 415, reused 0, downloaded 386, added 0\nProgress: resolved 621, reused 0, downloaded 587, added 0\nProgress: resolved 869, reused 0, downloaded 823, added 0\n WARN  4 deprecated subdependencies found: [email protected], [email protected], [email protected], [email protected]\nAlready up to date\nProgress: resolved 980, reused 0, downloaded 980, added 980, done\n\ndevDependencies:\n+ @commitlint/cli 19.6.1\n+ @somehow-digital/commitlint-config 1.1.0\n+ @somehow-digital/cspell-dictionary 2.2.0\n+ @somehow-digital/prettier-config 2.0.0\n+ concurrently 9.1.2\n+ cspell 8.17.1\n+ husky 9.1.7\n+ lint-staged 15.3.0\n+ prettier 3.4.2\n+ renovate 39.100.1\n\n",
       "stderr": ""
DEBUG: pnpm-lock.yaml hasn't changed (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: No updated lock files in branch (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)

So at least now we understand what I was trying to fix 4 years ago (and maybe did fix at the time).

With cache it's efficient:

DEBUG: syncBranchState() (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)
DEBUG: branch.isUpToDate(): using cached result "true" (repository=renovate-reproductions/32552, branch=renovate/renovate-39.x-lockfile)

So I still think this is a worthy trade-off.

@rarkins rarkins added this pull request to the merge queue Jan 10, 2025
Merged via the queue into renovatebot:main with commit 4aab664 Jan 10, 2025
39 checks passed
@rarkins rarkins deleted the fix/pnpm-lockfile-only-updates branch January 10, 2025 10:02
@renovate-release
Copy link
Collaborator

🎉 This PR is included 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version in pnpm lockfile doesn't match PR title after updating a lockfile-only PR
3 participants