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

pnpm lockedVersion should come from importers, not packages #22382

Closed
rarkins opened this issue May 23, 2023 · 10 comments · Fixed by #22415
Closed

pnpm lockedVersion should come from importers, not packages #22382

rarkins opened this issue May 23, 2023 · 10 comments · Fixed by #22415
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:bug Bug fix of existing functionality

Comments

@rarkins
Copy link
Collaborator

rarkins commented May 23, 2023

How are you running Renovate?

Mend Renovate hosted app on github.com

If you're self-hosting Renovate, tell us what version of Renovate you run.

No response

If you're self-hosting Renovate, select which platform you are using.

None

Was this something which used to work for you, and then stopped?

I am trying to get this working for the first time

Describe the bug

Renovate gets lockedVersion wrong for some pnpm packages, which results in confused PRs as described in #22375

Instead of iterating through the packages section of the pnpm lock file, Renovate needs to iterate through the importers section instead

Relevant debug logs

Logs
            "currentValue": "^5.1.1",
            "currentVersion": "7.1.1",
            "datasource": "npm",
            "depName": "execa",
            "depType": "devDependencies",
            "fixedVersion": "7.1.1",
            "isSingleVersion": false,
            "lockedVersion": "7.1.1",

Have you created a minimal reproduction repository?

I have linked to a minimal reproduction in the description above

@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) status:ready labels May 23, 2023
@viceice
Copy link
Member

viceice commented May 23, 2023

you forgot the link to the reproduction 🙃

@rarkins
Copy link
Collaborator Author

rarkins commented May 23, 2023

yarn start --dry-run=lookup renovate-reproductions/22375

@rarkins
Copy link
Collaborator Author

rarkins commented May 23, 2023

@RahulGautamSingh
Copy link
Collaborator

Yes on it.

@rarkins
Copy link
Collaborator Author

rarkins commented May 23, 2023

I think it's working but please test it and then tests need updating

@RahulGautamSingh
Copy link
Collaborator

Is it necessary that there always be importers? I tried on replit and got no importers for simple repos.

@rarkins
Copy link
Collaborator Author

rarkins commented May 23, 2023

Please check the pnpm definitions. The current approach seems wrong

@viceice
Copy link
Member

viceice commented May 24, 2023

We need to check the different lockfile versions. maybe that importers are only available since a specific version.

@RahulGautamSingh
Copy link
Collaborator

RahulGautamSingh commented May 24, 2023

Fields in pnpm-lock.yaml for:
i. Normal Repo
ii. Monorepo

We need to care for lockfile-version>=5 since we only update pnpm-lock.yaml. And according to this comment by the maintainer the formatting of the v5 and v6 should be almost same.

Which means for monorepos we need to look in importers section and for normal repos we need to look either in packages or dependencies section. I would prefer dependencies since it willl be smaller in size than packages.

@RahulGautamSingh
Copy link
Collaborator

RahulGautamSingh commented May 25, 2023

Lockfile Version <=5 / 5.3 and 6 have different formatting which is still not updated in the official docs. Here is a comment confirming this

6.0
lockfileVersion: '6.0'

importers:

  .:
    dependencies:
      chalk:
        specifier: 1.1.0
        version: 1.1.0
      pnpm:
        specifier: ^8.5.1
        version: 8.5.1

  package-a:
    dependencies:
      dotenv:
        specifier: ^9.0.2
        version: 9.0.2
5.3

lockfileVersion: 5.3

importers:

  .:
    specifiers:
      chalk: 1.1.0
      pnpm: ^6.2.0
    dependencies:
      chalk: 1.1.0
      pnpm: 6.35.1

  package-a:
    specifiers:
      dotenv: ^9.0.2
    dependencies:
      dotenv: 9.0.2

@rarkins rarkins added status:in-progress Someone is working on implementation and removed status:ready labels May 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2023
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:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants