Commit Graph

21 Commits

Author SHA1 Message Date
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
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
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
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
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
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 b6cff319d5 refactor(packageRules): allow async matchers (#31828) 2024-10-07 14:04:06 +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
Rhys Arkins b6b85eb69e feat(package-rules): set skipStage (#30264) 2024-07-21 10:29:13 +00:00
Rhys Arkins bf22e13e90 feat(packageRules): set skipReason=package-rules (#28952) 2024-05-09 10:04:58 +00:00
RahulGautamSingh ba38763b91 refactor(package-rules): delete all matchers from config (#26880)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-02-18 15:53:51 +00:00
RahulGautamSingh 897066123f feat(config/package-rules): matchCurrentAge (#23264)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-01-25 05:12:39 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Rhys Arkins e8874dca1d fix(package-rules): return early (#19768) 2023-01-10 14:28:13 +01:00
Rhys Arkins 17c2a006d2 feat: matchCurrentValue (#17953) 2022-09-25 06:56:02 +00:00
Sebastian Poxhofer dda2ebce92 refactor(package-rules): move to class based implementation (#16865)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-08-29 19:40:03 +00:00