Commit Graph

481 Commits

Author SHA1 Message Date
Matthew Nitschke ac22678812 feat(datasource/npm): integrity and tarball extraction (#44315)
* added support for extracting integrity and tarball from npm datasource

* test(datasource/npm): keep integrity and tarball in packument shape assertions

The packument-trimming tests on main pinned a cached shape that dropped
`dist.tarball`, so they broke once the schema started retaining
`integrity` and `tarball`. Update both expectations to the new shape and
cover `integrity` alongside `tarball`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test(workers/lookup): expect integrity and tarball on npm updates

`generateUpdate` copies `downloadUrl` and `newDigest` from the release
onto the update, so every npm lookup in these tests now carries the
tarball URL and, where the packument fixture has one, the integrity
hash. Pin and rollback updates are built without those release fields,
so their expectations are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Michael Kriese <michael.kriese@mend.io>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 10:09:59 +00:00
Birger Johan Nordølum 19e4cdc47f fix(lookup): preserve current compatibility (#45171)
* fix: preserve current compatibility after lookup

* fix: expose current compatibility in lookup result

* test: preserve current compatibility after lookup

* test: preserve compatibility through fetch

* test: isolate current compatibility regression

* test: isolate current compatibility regression

* test: isolate current compatibility regression

* test: isolate current compatibility regression
2026-09-03 14:29:15 +00:00
Sebastian Poxhofer a473e73b3e fix(linters): forbid inert counts in v8 coverage-ignore comments (#45287)
Adds a custom oxlint rule renovate/v8-ignore-no-count that flags the
count form '/* v8 ignore next <N> */'. The count is not honored by
vitest's ast-v8-to-istanbul hint parser, which captures only the
keyword (if/else/next/file); 'next' always exempts exactly the next
AST node. Trailing counts therefore suggest a line range that is never
applied and mislead readers.

The rule is autofixable (drops the count, preserving actual behavior)
and has been applied to all existing occurrences.
2026-08-22 11:25:31 +00:00
Jamie Tanna 7f40d43179 refactor(workers/repository): allow managers to opt out of digest pinning (#45198)
As part of future changes in #45190, we have found that when using
GitHub Actions' dependency lockfile, the digest pinning is manged by the
lockfile, rather than being specified in the package file itself.

To avoid a "flip flop" where using the manager removes the digest from
the package file (relying on the lockfile itself) and then a `pinDigest`
update re-adds it to the package file, we can instead follow how
`digestOneAndOnly` works and add a means to note
`digestManagedExternally`.

This isn't currently used, but allows an opt out for github-actions in
the future.

Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
2026-08-10 13:56:23 +00:00
Jamie Tanna 33f51391f0 fix(workers/repository): apply minimumReleaseAge to pinDigest updates (#44968)
As per #44820, `pinDigest` updates currently don't get
`minimumReleaseAge` checks applied to them.

We can extend the recent support for `digest`s being handled by also
introducing support for `pinDigest`s to receive `minimumReleaseAge`
enforcement.

This will:

- enforce `minimumReleaseAge` on all updates that `pinDigest`s has
  pending
- consider the newest resolved version's timestamp, ignoring
  `rangeStrategy`-related logic
- allow unversioned releases like `latest` to /not/ be bound by
  `minimumReleaseAge`, as they'll potentially not have a release
  timestamp and will be unpinned forever, which is less safe (and
  reduces reproducibility)

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-07-30 16:00:12 +00:00
Jamie Tanna 1247df7fc4 fix(workers/repository): apply minimumReleaseAge to digest updates (#44965)
In some cases, we hadn't correctly wired in the `minimumReleaseAge`
checks for `digest`, due to the `currentValue` not changing.

To handle this, we need to:

- use our helper methods for calculating whether the `minimumReleaseAge`
  has passed
- handle a new digest's new `releaseTimestamp`
  the current timestamp
- intentionally not gate `minimumConfidence`, as this is only computed
  per-release, not at the digest level
- note the fixed behaviour, and clarify when it will/will not work
- add coverage for all generated updates for `digest`s, including when
  remapping a Go Modules update as a `digest`
- clarify that `filterInternalChecks` and
  `applyMinimumReleaseAgeToDigestUpdate` should stay in sync

Co-authored-by: Claude Fable 5 <jamie.tanna+claude-code@mend.io>
2026-07-30 12:06:25 +00:00
Jamie Tanna 12f5fde66e refactor(types): make currentVersionTimestamp a Timestamp (#44917)
To more strongly type it for other usages.
2026-07-28 13:03:28 +00:00
Arnaud Dezandee 5173de026b refactor: move checkMinimumReleaseAge to lib/util/minimum-release-age.ts (#44904) 2026-07-28 08:11:05 +00:00
Jamie Tanna 927b094344 refactor(workers/repository): extract minimumReleaseAge/minimumConfidence checks (#44825)
As part of follow-up changes, we'll need to call the checks in multiple
places, so should prefactor these into helper methods.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-07-25 16:00:26 +00:00
Jamie Tanna f1cd516513 refactor(workers/repository): add isMinimumReleaseAgeApplicable/isMinimumConfidenceApplicable (#44824)
As part of follow-up changes, we'll use these functions to centrally
determine as to whether to execute `minimumReleaseAge` or
`minimumConfidence` checks against a given updateType.

For now, we can wire this into our documentation tests, to make sure
that this stays in sync with `isMinimumReleaseAgeApplicable`.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-07-24 16:22:00 +00:00
Sebastian Poxhofer d57843c60d refactor(oxlint): enable typescript/no-unnecessary-type-arguments (#44555)
Enable the type-aware typescript/no-unnecessary-type-arguments rule as
error and remove all 44 pre-existing redundant type arguments (type
arguments identical to the type parameter default), e.g.
HttpResponse<string>, ZodError<unknown>,
PackageDependency<Record<string, any>>.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:33:42 +00:00
Sebastian Poxhofer 9717259ffc refactor(oxlint): enable no-else-return and unicorn/no-lonely-if (#44553)
Enable no-else-return (with allowElseIf: false) and unicorn/no-lonely-if
as errors in .oxlintrc.json and fix all 131 pre-existing violations
(91 no-else-return, 40 unicorn/no-lonely-if) across 98 files.

The no-else-return violations were fixed with the oxlint autofix
(iterated to a fixpoint, plus two else-if chains that required
--fix-dangerously) followed by Prettier formatting. One comment dropped
by the autofix in lib/modules/manager/pub/artifacts.ts was restored
manually. The unicorn/no-lonely-if violations were merged by hand,
preserving comments and coverage-ignore hints.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:11:21 +00:00
Sebastian Poxhofer 7436b80cda test(linter): add renovate/no-redundant-mock-reset rule (#44557)
ci(linter): add renovate/no-redundant-mock-reset rule

Vitest sets mockReset: true globally in vitest.config.mts, which resets
all mocks before each test. This makes vi.resetAllMocks() /
vi.clearAllMocks() and per-mock .mockReset() / .mockClear() calls inside
beforeEach/afterEach hooks redundant. Add a custom oxlint rule (enabled
for **/*.spec.ts and test/**) flagging such calls, and remove the 40
redundant calls it found. restoreAllMocks/mockRestore are not flagged
because restoreMocks is not enabled globally.

Two sites keep an inline disable with a reason: nested beforeEach hooks
in filter-checks.spec.ts and onboarding/pr/index.spec.ts intentionally
call mockReset() to discard once-values queued by an outer beforeEach.

Requested by maintainer review feedback (review comment 3052324877).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 11:26:20 +00:00
Sebastian Poxhofer ad0b59f8b7 refactor(oxlint): enable vitest/require-to-throw-message (#44421) 2026-07-07 17:47:04 +00:00
Jérémy Fauvel 5646cbae8c fix: use lockedVersion for currentVersionTimestamp lookup (#42476)
break line
2026-06-09 09:28:35 +00:00
Michael Kriese 058faaa872 fix(worker/lookup): don't use a range as current version (#43737) 2026-06-02 12:46:05 +00:00
Björn Kautler 950f9a40a7 fix(lookup): try to find a release for changelog by newVersion if not found by newValue (#38894)
* fix(lookup): try to find a release for changelog by newVersion if not found by newValue

* Review Feedback Vol. 1

* Review Feedback Vol. 2
2026-05-27 11:31:56 +00:00
Sebastian Poxhofer 73b90e958b refactor: remove string concetation for production code (#43442)
refactor: prefer templates rather than `+`
2026-05-19 13:31:27 +00:00
Jamie Tanna fd537a28be chore(workers/repository): improve error for invalid allowedVersions (#43312)
As noted in #43304, when using `osvVulnerabilityAlerts`, we can
sometimes produce an `allowedVersions` that is valid for the ecosystem,
but without setting the `versioning`, we produce an invalid rule, which
then results in a `config-validation` result, breaking any updates on
the repo.

When this happens, it's unclear which `versioning` is used to validate
this, so we should add this to the error message.
2026-05-13 13:41:54 +00:00
Felipe Santos 3afa38511b refactor(datasource/npm): extract defaultRegistryUrl constant (#42794)
* feat(datasource/npm): extract defaultRegistryUrl constant

* Fix some other places

* Remove useless defaultRegistryUrls export

* Fix another place

* Undo rules.spec.ts changes, which are not related

* Fix npm presets

* Restore line removed by mistake

* Fix another test file

* Restore changes to a file which is not relevant

* Fix another small place
2026-04-27 15:24:01 +00:00
Jamie Tanna 300035a700 chore(workers/repository): provide more detail when rolling back (#42818)
* chore(workers/repository): provide more detail when rolling back

To help debug the case where rollbacks are being initiated, we can:

- add slightly more information to the `Filtered out ...` log line
- add `prBodyNotes` to the resulting PR

This requires we expose the `prBodyNotes` field to `LookupUpdate`, and
the `packageName` and `datasource` to `RollbackConfig`, so we can log
them.

* chore(modules/datasource): log `datasource` and `packageName` when filtering

For more context when reviewing the logs.
2026-04-24 16:23:45 +00:00
Jamie Tanna 0c21df1e22 perf(workers/repository): use a Set for allReleaseVersions (#42779)
So all lookups downstream can be performed in `O(1)` time.

Suggested by Claude Sonnet.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-21 08:55:41 +00:00
Jamie Tanna a11f338de6 fix(workers/repository): correctly pass all version numbers to versioning (#42767)
This results in some incorrect behaviour, where we'll have an incorrect
measure of all releases, as this was previously only for a given bucket
of updates.

Additionally, we can make sure this is only mapped once by moving it
above other loops.
2026-04-20 15:45:13 +00:00
Jamie Tanna 171d17734a chore(versioning): allow providing known versions to module (#42719)
As part of future changes, we'll introduce a new Versioning module for
GitHub Actions, which requires knowing if the version it's proposing
actually exists.

This is a more useful concept for Versioning modules to be able to take
advantage of, so we can expose this as an optional capability that
Versioning modules can use.
2026-04-17 15:00:06 +00:00
Michael Kriese e8d13714aa fix(replacements): don't use current releases for new digest when new name differs (#42333)
* fix(replacements): don't use current releases for new digest when new name differs

* chore: fix types
2026-04-02 11:58:01 +00:00
Jamie Tanna 0b74302d3a fix: correctly warn when an attestation is missing (#42311)
* test: add additional case for attestation changes

* fix: correctly warn when an attestation is missing

As noted in #37258, when a package registry had previously seen an
attestation for authenticity of a given package release, Renovate should
warn if future updates then lose authenticity.

Our previous attempt at this didn't quite pass around the current
package's attestation, which results in no warnings.

Given recent supply chain attacks where an attestation was removed (such
as Axios in MSC-2026-3522), we should make sure that this logic does
work correctly, and flags to our users.

In the future, we'll add more checks and a failing status check.

By introducing `hasAttestation` in the `LookupUpdate`, this can now be
matched on with `matchJsonata`, as well as providing visibility in the
`packageFiles with updates` log line.

* fixup! fix: correctly warn when an attestation is missing

> Run `pnpm run jest
> lib/workers/repository/process/lookup/index.spec.ts` and handle any test
> failures - the implementation is correct, so update the tests

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>

* test: clarify that we don't check for intermediate releases

Which we'll look to improve as part of future changes.

* chore: fix typo

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-04-01 15:00:08 +00:00
Sam Chung f33f3f6d7c fix: use correct digest when replacing packages with replacementNameTemplate (#40058)
* fix: use correct digest when replacing packages with replacementNameTemplate

* chore: avoid CodeQL flagging false positives

* Apply suggestions from code review

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>

---------

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2026-03-27 09:16:02 +00:00
Jamie Tanna f785fd2459 chore(workers/repository): add more information to lookup error warnings (#42120)
When a `lookupError` occurs, it's currently unclear as to why the lookup
error occurred.

It seems to be more common in the Go ecosystem where a lookup error
occurs, and Renovate autocloses PRs, only to recreate them in a
future run.

To provide more useful debugging information to users, we can add the
actual `lookupError` string itself.
2026-03-25 05:49:30 +00:00
renovate[bot] 645a28c77c build(deps): update dependency prettier to v3.8.1 (main) (#39779)
* build(deps): update dependency prettier to v3.8.1

| datasource | package  | from  | to    |
| ---------- | -------- | ----- | ----- |
| npm        | prettier | 3.6.2 | 3.8.1 |

* fixup prettier

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2026-02-18 08:41:34 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +00:00
Sergei Zharinov c531748f09 refactor(presets): Rename to *.preset.ts and enforce sort-keys via oxlint (#40976) 2026-02-06 13:39:02 +00:00
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00
Jamie Tanna 847c980f82 chore(minimumReleaseAge): only log once per case of "did not have a releaseTimestamp" (#39936)
This will make sure that we're calling it for each release being
skipped/continued with, so we're reducing the log lines for duplicate
dependencies across the codebase.
2025-12-15 08:52:23 +00:00
RahulGautamSingh 214e1da38d feat(config): allow template fields in allowedVersions (#38922)
* handlebars: regsiter add helper

* allow template fields in allowedVersions

* fix test

* fix doc example

* remove comments

* Apply Suggestions

* use empty object instead of undefined

* template(helpers/add): handle undefined/null

* Apply Suggestions

* Apply suggestion from @RahulGautamSingh

* Apply suggestion from @RahulGautamSingh

* fix conflict

* remove unused function

* fix lint issue

* fix test

* Update docs/usage/configuration-options.md

Co-authored-by: Anne Stellingwerf <1637358+astellingwerf@users.noreply.github.com>

* prettier

* throw error if invalid inputs used

---------

Co-authored-by: Anne Stellingwerf <1637358+astellingwerf@users.noreply.github.com>
2025-12-11 14:52:15 +00:00
Felipe Santos d32eedbb10 feat(lookup): add maxMajorIncrement (#38854)
* feat(lookup): add `maxMajorIncrement`

Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>

* Update lib/workers/repository/process/lookup/filter.ts

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>

---------

Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>
Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>
2025-12-10 22:32:05 +00:00
Michael Kriese c641239c19 fix: use stricter types for renovate config (#39594)
* fix: use stricter types for renovate config

* fix: revert changes

* Apply suggestions from code review
2025-11-28 13:16:27 +00:00
Michael Kriese bbc27b2afb fix(minimumReleaseAge): treat minimumReleaseAge=0 days as disabled (#39494)
* fix: treat `minimumReleaseAge=0 days` as disabled

* fix: treat `minimumReleaseAge=0 days` as disabled
2025-11-24 11:24:26 +00:00
Jamie Tanna ccb0462820 fix(minimumReleaseAgeBehaviour): correct log message to use valid option (#39374) 2025-11-18 10:22:47 +00:00
RahulGautamSingh 76f911041a refactor: use named exports (#39196)
* use named exports

* fix test

* add missing imnport

* fix prettier
2025-11-10 12:00:35 +00:00
Rhys Arkins 0d5d7a8669 refactor!: remove rangeStrategy=pin from versioning modules (#36261)
Refactors `getNewValue` logic to replace it with an optional
`getPinnedValue()` where rangeStrategy=pin. This way each versioning
module doesn't need to add and test extensive "pin" logic.

This should not be breaking, but out of an abundance of caution, we'll
mark it as such.
2025-11-06 08:07:40 +00:00
Jamie Tanna 3c98e9dca5 chore(minimumReleaseAge): add missing word in log message (#39068) 2025-11-05 10:19:35 +00:00
Felix Breuer 19c396a44a chore(minimumReleaseAgeBehaviour): reduce number of WARN log lines (#39001)
* chore: debug log message when timestamp is optional

When setting minimumReleaseAgeBehaviour to optional
it is intended that packages that does not have a release timestamp
will get updated. Writing a warning to the console is spam for an
intentional setting.

* chore: re-add WARN log, once

To make sure that users are still aware, we can make sure a single
warning log message is emitted.

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2025-11-04 10:20:13 +00:00
Volker 086af99876 refactor(lookup): optimize version filtering logic in filterVersions and lookupUpdates (#38539)
* Optimize version filtering logic in filterVersions and lookupUpdates functions

* Simplifies version filtering optimization to cover conditions by existing tests.

* Further reduction of versioning API usage.

* Keeping compatibility of exported function filterVersions()
2025-10-20 10:53:13 +00:00
Maxime Brunet 765a5eb5ae chore(minimumReleaseAgeBehaviour): correct warning message (#38663)
fix: correct minimumReleaseAgeBehaviour=timestamp-optional warning message
2025-10-17 10:46:45 +00:00
Jamie Tanna 4393503d55 feat(minimumReleaseAge): optionally enforce presence of releaseTimestamp (#38363)
As noted in #38290, #38348, a "rough edge" of the current implementation
of `minimumReleaseAge` is that:

- if we have set `minimumReleaseAge` to apply to a given dependency
- and we have 3 dependencies that need an update
  - 2 of which have a `releaseTimestamp` that is not yet "stable"
  - 1 of which does not have a `releaseTimestamp`

The dependency update that does not have a `releaseTimestamp` will be
treated as "stable", and will receive an update immediately.

To make this a little more predictable, and explicit, we should add a
new configuration item, `minimumReleaseAgeBehaviour`, to control this
behaviour.

This adds the new configuration field, as well as making it available as
a strongly typed field in the codebase.

In the case that `minimumReleaseAgeBehaviour=timestamp-optional` is
being used, we will WARN on any packages that are being updated, but
maybe shouldn't be, as a way to proactively inform the user of possible
misconfiguration.

Closes #38290, #38348.
2025-10-16 10:27:03 +00:00
Jamie Tanna a942f63bd5 fix(merge-confidence): use packageName for all lookups (#38468)
When performing lookups in Mend's Merge Confidence APIs, our contract
requires that we use the `packageName` not the `depName`.

In 9b7ae6aa98 and
b67eae2180 we made changes to make sure
that this wasn't the case, but we ended up missing a couple of cases.
2025-10-09 13:54:08 +00:00
Jamie Tanna ddfa560100 test: correct test name (#38364)
* chore(tests): correct test names

As they're not quite in line with reality.

* sq
2025-10-06 13:39:18 +00:00
Jamie Tanna d621588e1c test(minimumReleaseAge): document releaseTimestamp leads to immediate PRs (#38362)
As part of discussion in #38290, #38348 and #38324, the current
behaviour of `minimumReleaseAge` has been flagged as not particularly
great, as when we run with `minimumReleaseAge` enforced, a package that
does not return a `releaseTimestamp` will no longer be treated as
release that is bound by `minimumReleaseAge`'s checks to make it
pending.

As noted in the discussions, this can lead to cases where users are in a
"false sense of security", as they feel comfortable with
`minimumReleaseAge` in place, but it is not being enforced, only when
the `releaseTimestamp` is present.

Before we change this, we should add a test to document the existing
behaviour.

[0]: https://github.com/renovatebot/renovate/discussions/38290
[1]: https://github.com/renovatebot/renovate/discussions/38348
2025-10-06 12:00:55 +00:00
Jamie Tanna 0f47c71bd6 test: remove snapshots from filter-checks (#38365)
chore(tests): remove snapshots from `filter-checks`

As CI complains about it when modifying tests in this file, so we should
prefactor these snapshots out.
2025-10-06 10:56:04 +00:00
Rhys Arkins c0bdd1cb4c feat(datasource/maven): set latest tag ignored by default (#37541) 2025-08-18 17:13:25 +00:00