🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

feat(npm): allow opting into deprecated versions - #11554

Merged
olblak merged 1 commit into
mainfrom
t3/allow-deprecated-npm-versions
Dec 1, 2026
Merged

olblak merged 1 commit into
mainfrom
t3/allow-deprecated-npm-versions

Conversation

@loispostula

@loispostula loispostula commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

An npm project using eslint: ^8.57.1 gets no version found after #11511. The npm registry marks 8.57.1 deprecated, and it is the only published release matching the range. Filtering it out causes the npm source to fail and blocks the lockfile target.

Set allowdeprecatedversion: true on an npm resource or in npm autodiscovery to include deprecated releases. The option defaults to false and preserves the existing fallback for packages whose releases are all deprecated.

autodiscovery:
  crawlers:
    npm:
      allowdeprecatedversion: true

Test

  • Ran go test -count=1 ./pkg/plugins/autodiscovery/npm ./pkg/plugins/resources/npm.
  • Ran autodiscovery and its generated source against the public npm registry with eslint: ^8.57.1. The default returned no version found. Enabling the option returned 8.57.1 with the same semver constraint and three-day minimum release age.

Summary by CodeRabbit

  • New Features
    • Added an option to include deprecated npm releases when selecting routine dependency updates. It is off by default; when enabled, deprecated releases can be considered alongside package constraints and minimum release-age settings.
    • If every matching release is deprecated, those releases remain candidates whether the option is enabled or not.

A package.json range can select only deprecated releases while newer majors are still maintained. Let manifests opt into those releases while retaining the configured version and age filters.

Signed-off-by: Loïs Postula <lois@postu.la>
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The npm resource adds an AllowDeprecatedVersion option for deprecated release selection. Npm autodiscovery passes the option into generated source configuration.

Changes: Deprecated npm version selection

Layer / File(s) Summary
Resource option and candidate selection
pkg/plugins/resources/npm/main.go, pkg/plugins/resources/npm/source_test.go
AllowDeprecatedVersion controls whether deprecated releases are excluded. The option is included in reported configuration. Tests cover default selection, opting in, and minimum-age constraints.
Autodiscovery configuration propagation
pkg/plugins/autodiscovery/npm/main.go, pkg/plugins/autodiscovery/npm/dependency.go, pkg/plugins/autodiscovery/npm/manifestTemplate.go, pkg/plugins/autodiscovery/npm/main_test.go
Autodiscovery passes the option through manifest parameters and emits allowdeprecatedversion: true in generated source YAML when enabled. The test checks the generated configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related PRs

  • updatecli/updatecli#11511: This PR adds an option to include deprecated versions, complementing #11511’s default exclusion of deprecated versions.

Suggested reviewers: olblak, kevinleturc

Merge Risk: Minimal · up to 19462

This adds an opt-in setting for npm sources to select deprecated releases. Default behavior is unchanged, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a new opt-in option (allowdeprecatedversion) for npm resources and npm autodiscovery that lets deprecated versions be selected. It follows the conventional feat(npm) f…
Description check Passed The description states the problem (eslint ^8.57.1 returns no version found after deprecated releases are filtered out), describes the new allowdeprecatedversion option and its false default, and incl…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a new opt-in option (allowdeprecatedversion) for npm resources and npm autodiscovery that lets deprecated versions be selected. It follows the conventional feat(npm) form and is specific, so it passes.

Full details: Description check

Explanation

The description states the problem (eslint ^8.57.1 returns no version found after deprecated releases are filtered out), describes the new allowdeprecatedversion option and its false default, and includes a YAML example. The Test section lists the go test command and the manual registry check. It does not reference an issue with 'Fix #XXX' and does not address the template's checklist items (documentation update in the website repository, manual testing checkbox) or the Tradeoff and Potential improvement sections. These are non-critical omissions, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7568ec1b-2acd-447e-b35a-d47fe69c0899
Commits

Reviewing files that changed from the base of the PR and between a8cf191 and 1946240.

Files selected for processing: 6

  • pkg/plugins/autodiscovery/npm/dependency.go
  • pkg/plugins/autodiscovery/npm/main.go
  • pkg/plugins/autodiscovery/npm/main_test.go
  • pkg/plugins/autodiscovery/npm/manifestTemplate.go
  • pkg/plugins/resources/npm/main.go
  • pkg/plugins/resources/npm/source_test.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@loispostula
loispostula requested a review from olblak December 1, 2026 06:24
@olblak olblak added the bug Something isn't working label Dec 1, 2026
@olblak
olblak merged commit 8fb7ac7 into main Dec 1, 2026
8 checks passed
@olblak
olblak deleted the t3/allow-deprecated-npm-versions branch December 1, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working resource-npm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants