Commit Graph

799 Commits

Author SHA1 Message Date
Jamie Tanna a945d8bc5a chore(workers/repository): split malicious dependency checks (#42508)
* chore(workers/repository): report malicious packages before `packageFiles with updates`

As part of future changes, we may modify the `skipReason`s before the
update phase, which means that we should ensure these are correct before
logging out `packageFiles with updates`.

* chore(workers/repository): split malicious dependency checks

We will likely run into two specific cases of malicious dependencies -
you're currently using one, or you're receiving an update to one.

We should make these separate, explicit, cases so users are aware what
`malicious` actually means, and what the path forward is.
2026-04-09 19:06:50 +00:00
Jamie Tanna 1caa918bb9 chore(workers/repository): log warning on skipReason: malicious (#42504)
As part of future changes, we'll be introducing `skipReason: malicious`
against dependencies that have been found to be actively malicious.

Once we've looked up all our dependencies, we should then - centrally -
log any malicious package usages as a WARN, to highlight this to users.
2026-04-09 11:29:28 +00:00
Jamie Tanna 5e5af62224 refactor(vulnerability): extract ecosystem<->datasource translation (#42435)
As part of the addition of the new Enrichment modules, we should perform
a prefactor that'll introduce a shared helper for the how we translate
an "Ecosystem" according to OSV with a datasource that Renovate
understands.

Co-authored-by: Claude Opus 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-08 14:41:28 +00:00
Jamie Tanna 76ae34045a refactor(vulnerability): extract shared functionality into util functions (#42433)
As part of the addition of the new Enrichment modules, we should perform
a prefactor that'll introduce helper methods that can be used across
both GitHub and OSV Vulnerability Alerts.

Because each module uses a slightly different input (Datasource ID or an
"Ecosystem" according to OSV) we need to handle both types of inputs.

Co-authored-by: Claude Opus 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-08 07:25:37 +00:00
Sergei Zharinov 7df11ed734 chore(lint): add enforce-ts-extension oxlint rule (#42389)
* refactor(lint): extract custom oxlint rules into separate files

Split `tools/lint/rules.js` into one file per rule under
`tools/lint/rules/`. Also simplify `test-root-describe` with
early-exit guard clauses.

* feat(lint): add `enforce-ts-extension` oxlint rule

Add a custom JS-based oxlint rule that enforces `.ts` extensions on
local imports. The rule catches two problems:

- `.js` extension used instead of `.ts` (auto-fixable)
- missing file extension entirely (report only)

Checked locations:
- static import/export declarations
- dynamic `import()` expressions
- vitest module APIs: `vi.mock`, `vi.doMock`, `vi.unmock`,
  `vi.doUnmock`, `vi.importActual`, `vi.importMock`

Both relative paths (`./`, `../`) and path aliases (`~test/`)
are treated as local. Package imports are ignored.

Also fixes 26 pre-existing violations across 18 spec files.

* Update tools/lint/rules/enforce-ts-extension.js

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

---------

Co-authored-by: Anne Stellingwerf <1637358+astellingwerf@users.noreply.github.com>
2026-04-07 15:36:16 +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
Johannes Feichtner 0bcfef096f refactor(vulnerabilities): revert cleanup ae-cvss-calculator import (#41568) 2026-03-02 06:06:12 +00:00
Michael Kriese d98ad0b462 refactor: cleanup ae-cvss-calculator import (#41525) 2026-02-26 18:18:10 +00:00
Michael Kriese 6460e6e0fc fix(osv): ensure singleton database instance (#41512)
* fix(osv): ensure singleton database instance

* Update lib/workers/repository/process/vulnerabilities.spec.ts

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2026-02-26 10:41:56 +00:00
Johannes Feichtner 4fce8ec749 fix(vulnerabilities): fix CJS interop for ae-cvss-calculator import (#41337)
* fix(vulnerabilities): fix CJS interop for ae-cvss-calculator import

* avoid as any
2026-02-25 22:58:31 +00:00
Jamie Tanna c9fec45276 refactor(libyears): clarify log messages are LibYear related (#41489)
refactor(libyears): clarify log messages are LibYear related.

As it can be a little confusing exactly where this log message is coming
from, otherwise.
2026-02-25 22:15:04 +00:00
Yash Saini ed825d52a1 fix(libyear): skip disabled dependencies (#41244)
* fix(libyear): skip disabled dependencies when checking timestamps

* test(libyear): update expectations for disabled dependencies

* test(libyear): rename test to reflect skipping disabled dependencies

* Apply suggestion from @jamietanna

---------

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>
2026-02-25 16:27:40 +00:00
Jamie Tanna 1b7e5b2106 test(libyears): clarify existing behaviour with enabled: false (#41488)
If we're going to make changes in #41244, we should first document the
existing behaviour (even though it shouldn't be possible).
2026-02-25 13:39:49 +00:00
Michael Kriese 07c6e733bd chore(instrumentation): instrument osv getVulnerabilities (#41480) 2026-02-25 09:38:07 +00:00
Felipe Santos 7ebba26236 feat: add commitHourlyLimit (#36226)
* feat: add `commitHourlyLimit`

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

* Update docs/usage/configuration-options.md

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>

* Remove date optionality

* Fix lint comment

* Fix coverage

* Restore contents of commit.spec.ts

* Use ! somewhere else too

* Change optional parameter to nullish

* Refactor `!` to use proper check

* Fix set-branch-commit.spec.ts lint

* Fix test coverage

* Apply suggestions from code review

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>

* Split commit-limit-reached into two

* Fix review comments

* Use toUTC() where applicable

* Simplify another test to utc()

---------

Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-02-19 18:00:32 +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
renovate[bot] 4a2578d18d build(deps): update dependency zod to v4 (main) (#41225)
* build(deps): update dependency zod to v4

| datasource | package | from    | to    |
| ---------- | ------- | ------- | ----- |
| npm        | zod     | 3.25.76 | 4.3.6 |

* fix: zod migration

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-02-18 07:37:50 +00:00
RahulGautamSingh 7a8dcdbd01 refactor(config/inherit): move onboardingBranch to InheritConfig (#40865)
* move onboardingBranch to InheritConfig

* fix lint issue

* fix import order

* more fixrs

* fix import

* fix imports
2026-02-15 08:17:11 +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 2b0e80b884 feat!: Switch to ESM modules (#40756) 2026-01-29 14:21:41 +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 6a4fa3f245 refactor(presets): return merged presets from resolveConfigPresets (#40422)
As part of future changes, we want to log the shallow configuration (the
full resolved configuration, but without any internal Renovate
configuration presets), where we'll want to note which presets have not
been merged in.

Before that, we can start with an initial refactor to indicate which
have been merged, and return them.
2026-01-14 16:52:16 +00:00
renovate[bot] acacad57c6 chore(deps): update linters (main) (#40277)
* chore(deps): update linters

| datasource | package              | from   | to     |
| ---------- | -------------------- | ------ | ------ |
| npm        | eslint-plugin-oxlint | 1.36.0 | 1.38.0 |
| npm        | typescript-eslint    | 8.50.1 | 8.52.0 |

* chore: enable oxlint gha format

* chore: fix lint

* chore: fix lint

* chore: fix lint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-14 15:32:48 +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 f212641b42 chore: lint fix (#39630) 2025-11-29 13:31:19 +00:00
Jamie Tanna 55a447e805 chore(instrumentation): further instrument extract phase (#39614)
As it's interesting to see how much each of these take.
2025-11-28 14:19:09 +00:00
Jamie Tanna 498b9df2f0 fix(instrumentation): instrument manager lookups (#39612)
As a means to provide more insight into how long package manager lookups
take when using instrumentation, we can wrap the fetching of updates in
a trace per manager.
2025-11-28 14:07:42 +00:00
Jamie Tanna 5282a9ae27 fix(instrumentation): wrap branches in spans (#39608)
As part of ongoing work to improve OpenTelemetry instrumentation of
Renovate in #38609, we can instrument our branch creation with the
branch name (and relevant Semantic Convention attributes) for
visibility.
2025-11-28 13:49:04 +00:00
Jamie Tanna c1a8da0275 fix(instrumentation): correctly instrument extract and lookup (#39611)
When calling `extractDependencies`, we actually perform both `extract`
and `lookup` splits. However, we are instrumenting the whole method call
as the `extract` split, which results in incorrect tracing data.

To correct this, we can wrap the specific code responsible for the
extraction into `extract`, and then the separate code for `lookup`
accordingly.

This also makes sure that `emptyExtract` sets repository splits.
2025-11-28 13:47:29 +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
renovate[bot] b4ed9e65d9 chore(deps): update dependency @vitest/eslint-plugin to v1.3.23 (main) (#38702)
* chore(deps): update dependency @vitest/eslint-plugin to v1.3.23

| datasource | package               | from   | to     |
| ---------- | --------------------- | ------ | ------ |
| npm        | @vitest/eslint-plugin | 1.3.16 | 1.3.23 |

* remove now unnecessary exceptions

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2025-10-31 07:50:48 +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
RahulGautamSingh 95ea2c9078 fix(branchPrefix): include base branch name iff multiple bases expected (#35423)
* use branchPrefix if multiple base branches expected

* fix test

* fix coverage

* apply suggestions

* apply suggestions

* use utility fn

* refactor tests

* fix test

* major overhaul: use baseBranches field internally

suggested by @secustor

* refactor: cleanup

* test: use better descriptions

* add tests

* fix logic

* fix test

* exclude unlisted versions when finding latestStable

---------

Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-10-20 06:27:56 +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
renovate[bot] 1280fe4dc7 chore(deps): update dependency @vitest/eslint-plugin to v1.3.16 (main) (#38502)
* chore(deps): update dependency @vitest/eslint-plugin to v1.3.16

| datasource | package               | from   | to     |
| ---------- | --------------------- | ------ | ------ |
| npm        | @vitest/eslint-plugin | 1.3.13 | 1.3.16 |

* fix linting errors

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2025-10-13 09:24:15 +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