Commit Graph

94 Commits

Author SHA1 Message Date
Jamie Tanna 8dc06640a7 feat(workers/repository): allow users to bypass registryUrl when unknown-registry (#46323)
As part of follow-up changes in #45706, we want the `apk` / `apt`
parsing in the `dockerfile` manager to attempt to determine which
distribution - and therefore registry - to look up dependencies for.

When there is an image that we don't know how to resolve, we want to
treat them as a `skipReason: unknown-registry`.

However, this doesn't provide any way for the user to say "I know which
registry you should look up updates for".

To handle this, we can treat `unknown-registry` differently, allowing it
to un-skip itself when there are any `registryUrls`s defined.

This allows for general usage, where if Renovate doesn't know how to
interact with a given registry, but a user does, then the user can
override the registry with a `packageRules` entry.

We continue skipping a dependency when `unknown-registry` is set
alongside a dependency's `registryUrl`.

We add this un-skipping logic into `applyPackageRules()`, but need to
make sure that we also gate it inside `lookup()`, so a dependency that's
passed through `applyPackageRules()` is re-checked to ensure that the
check is enforced.

Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
2026-09-18 15:59:57 +00:00
Jamie Tanna f2896deaaf fix(merge-confidence): don't require auth in platform=local (#45769)
* fix(merge-confidence): don't require auth in `platform=local`

When dry-running Renovate against a repository to validate it[0], if a
repository is using `matchConfidence`, the whole Renovate run is aborted
due to missing API credentials.

This can be frustrating, and the workaround available is to temporarily
remove all package rules use `matchConfidence`, which isn't the best
experience.

Instead, we should follow the existing pattern to return `null` when
loading a Package Rule with `matchConfidence`, as well as DEBUG logging
to inform the user why this is happening.

[0]: https://www.jvt.me/posts/2026/03/08/renovate-test-config/

* fixup! fix(merge-confidence): don't validate auth in a

With debugging from Claude to work out how to get the test to pass.

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

---------

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-09-09 13:54:13 +00:00
Sebastian Poxhofer 05e1271376 test: use expect().resolves instead of awaiting inside expect (#45672)
Enables the vitest/prefer-expect-resolves oxlint rule and applies its
autofix across the spec suite.
2026-09-04 10:40:46 +00:00
Eyal Zekaria 0e90c69f91 perf(package-rules): avoid re-cloning invariant packageRules array on every rule match (#44781)
perf(package-rules): avoid re-cloning packageRules array on every rule merge

applyPackageRules() merges each matching rule via mergeChildConfig(),
which deep-clones the entire accumulated config — including the
invariant packageRules array itself. On repos with many dependency
instances and large rule arrays (e.g. vulnerabilityAlerts force-rules
embedding advisory texts), this cloning dominates the whole run
(observed at ~66% of total CPU in a production profile).

Exclude packageRules from the working config while rules are applied
and restore it afterwards, preserving the previous merge semantics for
rules that themselves carry nested packageRules, and for null/empty/
absent inputs.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-03 07:41:06 +00:00
Sebastian Poxhofer 97327c3d28 refactor(linters): add prefer-coerce-array rule (#45492)
* refactor(linters): add prefer-coerce-array rule

Refs #45217

`x ?? []` and `coerceArray(x)` say the same thing, but only the second
one is searchable and consistent. The rule flags a `??` whose default is
a bare `[]` literal; a non-empty default or an asserted `([] as Foo[])`
still passes.

Applying it across `lib/` surfaced three spots the helper cannot cover,
which keep `?? []` with a disable comment or a narrower fix:

- `package-files.ts` destructures a tuple, which `coerceArray()` widens
- `generate.spec.ts` defaults `matchAll()`, an iterator rather than an array
- `mise/upgradeable-tooling.ts` declares a `Record` return, so its
  `?? []` fallback was wrong to begin with and becomes `coerceObject()`

* refactor(platform/github): hoist the GHE version header lookup

`Object.entries(...).find()` returns a tuple, and defaulting it with
`?? []` only to destructure the second element reads as an array
default when it is not one. Name the found entry instead, which drops
the `?? []` rather than routing a tuple through `coerceArray()`.
2026-08-28 09:27:58 +00:00
renovate[bot] 196101a6bb chore(deps): update dependency oxlint-tsgolint to v0.25.0 (main) (#44424)
* chore(deps): update dependency oxlint-tsgolint to v0.25.0

| datasource | package         | from   | to     |
| ---------- | --------------- | ------ | ------ |
| npm        | oxlint-tsgolint | 0.23.0 | 0.25.0 |

* chore: fix new no-unnecessary-type-assertion findings

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Poxhofer <sebastian.poxhofer@stedi.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 07:04:21 +00:00
Alberto Cortina Eduarte 61e4c9c2d1 fix(presets/monorepo): update react and react-native source URLs to react/react org (#44780)
fix(data): update react and react-native source URLs to react/react org

The react and react-native repositories moved from the facebook org to
the react org on GitHub

See https://github.com/renovatebot/renovate/discussions/44772
2026-07-22 10:14:08 +00:00
Jamie Tanna 89be048657 refactor: use GlobalConfig for productLinks (#44098)
As a follow-up to e1e5c398e0, we can make
sure that we remove references to hardcoded docs site URLs, by wiring in
the `GlobalConfig.get(...)` call.

To do this, we need to make sure that `productLinks` exists to be called
by `GlobalConfig.get`.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-06-19 10:34:03 +00:00
Jamie Tanna e1e5c398e0 chore: ensure we use productLinks for docs site links where possible (#44066)
* chore: ensure we use `productLinks` for docs site links where possible

Where possible, we should be making sure that we're using the
`productLinks`' configuration for  the documentation site, especially
where self-hosted users may create a mirror of their docs[0].

To make sure we catch this in the future, we can introduce a custom
linting rule with Oxlint to enforce this.

Where we (currently) can't wire in the config, we can disable it against
that line.

[0]: https://www.jvt.me/posts/2024/11/19/renovate-private-docs/

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

* fixup! chore: ensure we use `productLinks` for docs site links where possible

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

* fixup! chore: ensure we use `productLinks` for docs site links where possible

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

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-06-18 08:55:27 +00:00
Felipe Santos 392105b7c6 chore(oxlint): enable unicorn plugin and prefer-node-protocol (#43283)
chore(oxlint): enable unicorn plugin and prefer-node-protocol
2026-05-29 06:55:58 +00:00
Felipe Santos e9e8083223 feat(config-validator): optimize imports to improve speed by 5x (#43048)
Optimize config-validator
2026-05-04 08:48:32 +00:00
Mike Ryan 525f80d6df fix(package-rules): respect each dep update's fetchChangeLogs value (#42671)
* fix(package-rules): respect each dep update's fetchChangeLogs value

Ensures that changelog fetching respects each dep update's specific `fetchChangeLogs` value.

Given the following renovate configuration: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/blob/fb9e070d0f9a4d6fc742c4a22edee2c9b055fece/.github/renovate.json5#L42-L61

My expectation is that Renovate would never fetch changelogs for `lodash`. However, when grouped
together with `chalk` and `tar` under `group of unrelated packages`, we find that
renovate fetches changelogs all packages, including `lodash`.

Before this change (`lodash` logs fetched):
- Run: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/actions/runs/24480887343/job/71544876893
- (wrong) lodash, tar, and chalk all have changelogs: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/pull/9

After this change, the PR created by renovate only contains changelogs for `chalk` and `tar`, but not `lodash`:

- Run: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/actions/runs/24481738609/job/71547632550
- (expected) lodash does not have changelogs, but tar and chalk have changelogs: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/pull/10

----

We can further explore the effectiveness of the change with a more elaborate configuration, where the top-level has `fetchChangeLogs: off`: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/blob/0ea69c18b9171e38c56440c762faa68109d3d0d5/.github/renovate.json5#L41-L95

Before the change:

- Run: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/actions/runs/24482213234/job/71549162174
- (wrong) lodash, tar, and chalk all have changelogs: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/pull/15
- (expected) typescript (inherited `off`) does not have changelogs: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/pull/17
- (expected) grunt (overridden `pr`) has changelogs: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/pull/13

After the change::

- Run: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/actions/runs/24482561172/job/71550255278
- (expected) lodash does not have changelogs, but tar and chalk have changelogs: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/pull/22
- (expected) typescript (inherited `off`) does not have changelogs: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/pull/24
- (expected) grunt (overridden `pr`) has changelogs: https://github.com/justfalter/renovate-test-packagerules-fetchchangelogs/pull/20

Portions of this PR previously appeared in #42368

* pre feedback: just use fetchChangeLogs from upgrade

* revert documentation.spec.ts changes

They've already been integrated with #42846
2026-04-27 15:28:15 +00:00
Jamie Tanna ae222506ed fix(package-rules): correctly merge force.enabled (#42679)
* fix(package-rules): correctly merge `force.enabled`

As noted in #42666, after changes in
f8b4477335, we're skipping vulnerability
alert PRs when using the `security:only-security-updates` preset.

This happens because the `enabled=false` that exists on the all
dependencies are not correctly merged into the `force` config in the
`vulnerabilityAlert` update.

To fix this, we need to take `force.enabled` into account when merging
config options.

To slightly improve the type checking, we can also make sure that
`removeMatchers` knows that `force` is field we want typed, too.

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

* chore(package-rules): simplify condition

As we don't actually need to take into account whether the option is
currently enabled, as we can make sure the `skipReason` and `skipStage`
are always deleted if we're enabling the update.

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-16 09:13:31 +00:00
Sebastian Poxhofer 7be38227f0 feat(package-rules): add matchRegistryUrls option (#41966)
* feat(package-rules): add matchRegistryUrls option

* chore: add patternMatch option

* Update docs/usage/configuration-options.md

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

---------

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
2026-03-19 11:42:27 +00:00
Timo Hankamer f593ffca20 feat(package-rules): support template compilation for sourceUrl (#41932)
Add template compilation support for sourceUrl in package rules,
allowing users to dynamically construct source URLs using template
syntax. This enables use cases like OpenTofu providers where the
source URL needs to be constructed from the package name.
2026-03-19 10:16:52 +00:00
Jamie Tanna e0ce9dabd6 docs: prefix child options with their parent (#41828)
This also makes sure that our URL fragments should be more consistent
over the years, as duplicate names (across parent and child options)
cannot clash.

This also corrects links from the code to include the new fragment.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-03-12 10:56:52 +00:00
Sebastian Poxhofer ee2b77542c feat(package-rules): add detectPlatform helper function (#41798)
feat(package-rules): add detectPlatform function
2026-03-11 10:38:51 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +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
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
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
Michael Kriese 19c115c813 test: cleanup (#34785) 2025-03-13 17:52:09 +00:00
Trim21 6e5731b554 test: migrate from jest to vitest (#34499) 2025-02-26 14:18:38 +00:00
Michael Kriese 997c23502e test: migrate to vitest (#34475)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2025-02-26 09:35:54 +00:00
Rhys Arkins a70a6a376d feat(packageRules): overrideDatasource, overrideDepName, overridePackageName (#31925)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2024-10-12 14:22:29 +00:00
Rhys Arkins c4d4658569 chore: ensure versioning/versioningApi used consistently (#31856) 2024-10-08 15:24:46 +00:00
Rhys Arkins 32ecb4ccc8 feat(packageRules): matchJsonata (#31826)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2024-10-08 11:32:30 +00:00
Rhys Arkins b6cff319d5 refactor(packageRules): allow async matchers (#31828) 2024-10-07 14:04:06 +00:00
renovate[bot] eb8c08079e chore(deps): update typescript-eslint monorepo to v8 (major) (#30750)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-08-14 10:33:02 +00:00
Michael Kriese 4da584a9a2 fix(package-rules): wrong prefix match glob (#30394) 2024-07-26 08:31:23 +00:00
Michael Kriese ac9933e75b chore: drop invalid file (#30393) 2024-07-26 07:49:02 +00:00
Rhys Arkins 879f7cc212 feat(packageRules): migrate matchers and excludes (#28602)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-07-25 15:28:16 +02:00
RahulGautamSingh 31c6602459 test: update wrong assertion (#28741) 2024-07-25 15:28:16 +02:00
Rhys Arkins 69dab293f5 feat(packageRules)!: support regex or glob matching for all (#28591)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-07-25 15:28:16 +02:00
Rhys Arkins 1e5cf6d07c feat(packageRules)!: support glob/regex patterns for matchPackageNames (#28551)
BREAKING CHANGE: matchPackageNames exact matches are now case-insensitive
2024-07-25 15:28:16 +02:00
Rhys Arkins 3d78ae761f feat(package-rules)!: remove depName fallback (#28548)
Removes fallback to checking depName for all matchPackageX and excludePackageX rules.

BREAKING CHANGE: matchPackageNames and related functions no longer fall back to checking depName. Rewrite packageRules to use matchDepNames instead.
2024-07-25 15:28:16 +02:00
Rhys Arkins b6b85eb69e feat(package-rules): set skipStage (#30264) 2024-07-21 10:29:13 +00:00
renovate[bot] be0bd3d63e build(deps): update dependency prettier to v3.3.3 (#30272)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-07-20 16:51:43 +00:00
RahulGautamSingh e6a29bbff4 feat(versioning): same major (#28418)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-06-26 07:23:39 +00:00
Rhys Arkins 954f408b25 refactor(package-rules): correct matcher order (#29496) 2024-06-07 06:32:52 +00:00
Róbert Papp e521f7f3c0 fix(package-rules): replacement recommendation for matchPackagePrefixes and excludePackagePrefixes (#29262) 2024-05-26 13:24:59 +00:00
Róbert Papp 3110afc2de chore: Add packageRule logging to matchPackagePrefixes and excludePackagePrefixes warnings (#29261) 2024-05-26 12:11:22 +00:00
Aleksandr Mezin 56856d4a46 feat(util/package-rules): allow glob pattens in match{Current,New}Value (#29168) 2024-05-22 06:06:25 +00:00
Rhys Arkins bf22e13e90 feat(packageRules): set skipReason=package-rules (#28952) 2024-05-09 10:04:58 +00:00
RahulGautamSingh bc2e4b38ea test(pep440): add tests (#28915) 2024-05-08 06:57:05 +00:00
Rhys Arkins 1556cbbb41 chore: fix matcher name typos in tests (#28652) 2024-04-25 15:55:43 +00:00
Rhys Arkins fa732c4c94 feat(package-rules): warn for depName fallback (#28547) 2024-04-22 06:02:01 +00:00
Rhys Arkins 58b29f9e80 test(packageRules): increase matchPackageNames tests (#28545) 2024-04-20 15:05:50 +00:00
Yusuke Iinuma 7b66b9f3c2 feat(package-rules): add DepNamePrefix matcher (#28542)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-04-20 15:05:27 +00:00