Skip to content

feat(pnpm): add minimumReleaseAgeExclude for security updates #39168

Description

@jamietanna

Describe the proposed change(s).

As discussed in #38766, it would be a very positive user experience improvement if we were to integrate pnpm's minimumReleaseAgeExclude with Renovate raising security updates.

This would require we follow the rough flow of:

  • if this is not a vulnerability alert, do nothing
  • parse the pnpm-workspace.yaml (as a raw YAML document)
  • determine if minimumReleaseAgeExclude is found
  • if minimumReleaseAgeExclude isn't found, create it
  • append to the minimumReleaseAgeExclude YAML type:
    • a comment, indicating that this is a Renovate-issued security upgrade?
    • the version upgrade

Depending on how we do it, we need to consider:

  • what happens to the existing YAML document, and relevant formatting, etc? Do we risk breaking / reformatting too much?
    • likely already covered in existing functionality in lib/modules/manager/npm/update/dependency/pnpm.ts
  • where do we want to create minimumReleaseAgeExclude if one's not already found? Immediately after packages or minimumReleaseAge? At the bottom of the file?

This will avoid ERR_PNPM_NO_MATCHING_VERSION errors requiring manual human intervention.

Activity

  1. added
    priority-3-mediumDefault priority, "should be done" but isn't prioritised ahead of others
    needs-discussionIssue requires a GitHub Discussion first
    on Nov 7, 2025
  2. github-actions commented on Nov 7, 2025

    @github-actions
    Contributor

    Please create a GitHub Discussion instead of this issue.

    Issues in this repository are for creation by Maintainers only - please create a GitHub Discussion instead. If needed, a Renovate maintainer will create an Issue after your Discussion been triaged and confirmed.

    This Issue will now be closed and locked. We may later batch-delete this issue. This way we keep Issues actionable, and free of duplicates or wrong bug reports.

    Thanks, the Renovate team

  3. jamietanna commented on Nov 17, 2025

    @jamietanna
    MemberAuthor

    @zharinov @RahulGautamSingh did either of you fancy taking this? I made a start in #39171, but very happy for either of you to take it over / start again with it, as I'm not going to be able to get back to this for a couple of weeks

  4. karlhorky commented on Dec 12, 2025

    @karlhorky
    Contributor

    Just to update this, since the critical- and high-severity Next.js vulnerabilities below have caused new versions next@16.0.7, next@16.0.9 and next@16.0.10 to be published (not to mention the other previous versions and versions of transitive dependencies):

    These have led to PRs being opened by Renovate in our repositories, which then subsequently fail immediately because of Renovate incompatibility with pnpm minimumReleaseAge:

    Show Renovate failure comment

    ⚠️ Artifact update problem

    Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

    ♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

    • any of the package files in this branch needs updating, or
    • the branch becomes conflicted, or
    • you click the rebase/retry checkbox if found above, or
    • you rename this PR's title to start with "rebase!" to trigger it manually

    The artifact failure details are included below:

    File name: pnpm-lock.yaml
    Progress: resolved 1, reused 0, downloaded 0, added 0
     WARN  deprecated @types/sharp@0.32.0: This is a stub types definition. sharp provides its own type definitions, so you do not need this installed.
    Progress: resolved 20, reused 0, downloaded 0, added 0
    Progress: resolved 25, reused 0, downloaded 0, added 0
    Progress: resolved 28, reused 0, downloaded 0, added 0
     ERR_PNPM_NO_MATCHING_VERSION  No matching version found for next@15.5.8 published by Fri Dec 05 2025 04:49:01 GMT+0000 (Coordinated Universal Time) while fetching it from https://registry.npmjs.org/. Version 15.5.8 satisfies the specs but was released at Thu Dec 11 2025 20:08:56 GMT+0000 (Coordinated Universal Time)
    
    This error happened while installing a direct dependency of /tmp/renovate/repos/github/upleveled/next-portfolio-dev
    
    The latest release of next is "16.0.10". Published at 12/11/2025 10:56:10 PM
    
    Other releases are:
      * next-11: 11.1.4 published at 1/27/2022
      * next-12-2-6: 12.2.6 published at 9/29/2022
      * next-14-1: 14.1.1 published at 2/29/2024
      * rc: 15.0.0-rc.1 published at 10/15/2024
      * next-13: 13.5.11 published at 3/27/2025
      * next-12-3-2: 12.3.7 published at 3/28/2025
      * beta: 16.0.0-beta.0 published at 10/10/2025
      * backport: 15.4.10 published at 12/11/2025 11:02:47 PM
      * next-15-3: 15.3.8 published at 12/11/2025 11:08:02 PM
      * next-15-2: 15.2.8 published at 12/11/2025 11:13:56 PM
      * next-15-0: 15.1.11 published at 12/11/2025 11:17:00 PM
      * next-15-0-0: 15.0.7 published at 12/11/2025 11:20:40 PM
      * next-14: 14.2.35 published at 12/11/2025 11:36:04 PM
      * canary: 16.1.0-canary.19 published at 12/11/2025 11:43:23 PM
    
    If you need the full list of all 3516 published versions run "$ pnpm view next versions".
    
    If you want to install the matched version ignoring the time it was published, you can add the package name to the minimumReleaseAgeExclude setting. Read more about it: https://pnpm.io/settings#minimumreleaseageexclude
    Progress: resolved 29, reused 0, downloaded 0, added 0
    
    

    Our pnpm config which we hand-authored to get around this, in case this is interesting:

    pnpm-workspace.yaml

    # Prevents installation of packages newer than 7 days
    # to mitigate supply chain risks
    # - https://pnpm.io/settings#minimumreleaseage
    minimumReleaseAge: 10080
    minimumReleaseAgeExclude:
      # - https://github.com/vercel/next.js/security/advisories/GHSA-9qr9-h5gf-34mp
      # - https://github.com/vercel/next.js/security/advisories/GHSA-mwv6-3258-q52c
      # - https://github.com/vercel/next.js/security/advisories/GHSA-w37m-7fhw-fmv9
      # - https://github.com/vercel/next.js/security/advisories/GHSA-5j59-xgg2-r9c4
      - next@16.0.7 || 16.0.9 || 16.0.10
      - '@next/env@16.0.7 || 16.0.9 || 16.0.10'
      - '@next/swc-darwin-arm64@16.0.7 || 16.0.9 || 16.0.10'
      - '@next/swc-linux-x64-gnu@16.0.7 || 16.0.9 || 16.0.10'
      - '@next/swc-linux-x64-musl@16.0.7 || 16.0.9 || 16.0.10'
  5. RahulGautamSingh commented on Dec 12, 2025

    @RahulGautamSingh
    Collaborator

    Is it possible to pass this via cli so that we can prevent writing the workspace file?

    ie. pnpm install --minimum-release-age-exclude=<pkgname>@<version>

  6. karlhorky commented on Dec 12, 2025

    @karlhorky
    Contributor

    Writing to the workspace file is desirable, I think, because one-time exclusions won't be respected in the following installs

    Cc @zkochan @btea @KSXGitHub in case you have opinions on how Renovate (bot for creating dependency upgrade PRs) should integrate with pnpm's minimumReleaseAgeExclude

  7. jamietanna commented on Dec 12, 2025

    @jamietanna
    MemberAuthor

    I would prefer us writing to the workspace file, too

  8. 1 remaining item

  9. removed
    auto:idea-rewriteThe idea description or title needs updating before conversion to an issue
    on Dec 13, 2025
  10. zkochan commented on Dec 14, 2025

    @zkochan

    Updating minimumReleaseAgeExclude in pnpm-workspace.yaml sounds like a good idea.

    Just a note that pnpm commands that update pnpm-workspace.yaml unfortunately currently remove the comments.

  11. RahulGautamSingh commented on Dec 15, 2025

    @RahulGautamSingh
    Collaborator

    We only need this incase pnpm-lock.yaml is present, right? Or is the presence of pnpm-workspace.yaml without lockfile is also a good enough reason to update the workspace file?

  12. github-actions commented on Jan 22, 2026

    @github-actions
    Contributor

    🎉 This issue has been resolved in version 42.89.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  13. anomiex commented on Jan 22, 2026

    @anomiex
    Contributor

    Thank you for implementing this! 🙂

    Unfortunately, it didn't work quite right for us in a recent update. Renovate 42.89.2 (self-hosted on GitHub using renovatebot/github-action) created this commit, which includes the following addition

      # Renovate security update: lodash@^4.17.15
      - lodash@4.17.23 || 4.17.23 || 4.17.23 || 4.17.23 || 4.17.23 || ^4.17.15

    pnpm does not like this, complaining

     ERR_PNPM_INVALID_MINIMUM_RELEASE_AGE_EXCLUDE  Invalid value in minimumReleaseAgeExclude: Invalid versions union. Found: "lodash@4.17.23 || 4.17.23 || 4.17.23 || 4.17.23 || 4.17.23 || ^4.17.15". Use exact versions only.
    

    Specifically it seems to dislike the caret version in there. Changing it to lodash@4.17.23 || 4.17.23 || 4.17.23 || 4.17.23 || 4.17.23 makes pnpm happy (although deduplicating it to lodash@4.17.23 would be even better).

    What appears to have happened is that it took the dependencies from all the package.json files and concatenated them, which happened to include one that is not pinned (and not updated in the PR), rather than specifically excluding the version being updated to.

  14. jamietanna commented on Jan 22, 2026

    @jamietanna
    MemberAuthor

    Thanks for the speedy report! I've raised #40610 - let's discuss there

  15. jamietanna commented on Jan 22, 2026

    @jamietanna
    MemberAuthor

    Do we know if there are any other constraints that we need to consider?

  16. anomiex commented on Jan 22, 2026

    @anomiex
    Contributor

    Replied at #40610 (comment) 🙂

  17. locked as resolved and limited conversation to collaborators on Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Fields

Priority

None yet

Datasource

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions