Commit Graph

2035 Commits

Author SHA1 Message Date
Michael Kriese f09609fb8f refactor: replace better-sqlite3 with node:sqlite (#40697)
* refactor: replace `better-sqlite3` with `node:sqlite`

* test: fix test

Co-authored-by: Copilot <copilot@github.com>

* fix: drop unused expose

* fix(cache): defer node sqlite import (#43107)

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Sergei Zharinov <zharinov@users.noreply.github.com>
2026-05-09 11:57:10 +00:00
Michael Kriese b4362ffe1a build: allow es2025 lib (#42612) 2026-05-09 07:13:04 +00:00
Jamie Tanna 2239c7536c fix(git): Revert "fix(git): not detecting commits modified through rebase or amend" (#43171)
Revert "fix(git): not detecting commits modified through rebase or amend (#42…"

This reverts commit ff2a83d979.
2026-05-08 10:41:43 +00:00
Felipe Santos ff2a83d979 fix(git): not detecting commits modified through rebase or amend (#42975)
* fix(git): not detecting commits modified with rebase or amend

* Fix being detected as modified when new commits in base branch
2026-05-07 19:11:39 +00:00
Jamie Tanna b10905bc1e fix(util/exec): allow setting PNPM_WORKERS/PNPM_MAX_WORKERS in environment (#43131)
As found in #40942, we've been seeing increased memory usage by pnpm and
Yarn in recent months on Mend-hosted apps.

As a way to provide more control to test + validate fixes, as well as
provide self-serve for other environments, we can allowlist
`PNPM_WORKERS`/`PNPM_MAX_WORKERS` in both the "basic env vars" and the
allowed `global:safeEnv`.
2026-05-06 20:55:22 +00:00
Jamie Tanna 0a1b54a852 feat(manager/renovate-config): extract constraints (#42873)
* feat(manager/renovate-config): extract `constraints`

As noted in #41571, it would be useful to detect and suggest updates
when specifying `constraints` in Renovate config, where it's a known
tool we provide versioning information for.

We can extend our existing `renovate-config` manager to add support for
`constraints` that are known Containerbase tools.

We can support top-level `constraints` as well as `constraints` inside
`packageRules`.

* refactor(renovate-config): remove nesting
2026-05-06 18:16:09 +00:00
Michael Kriese 9c4fa0e824 refactor(http): use got default export (#43127) 2026-05-06 14:11:58 +00:00
Michael Kriese 59c3dfdbae fix(git): pass only allowed child env (#43113)
* fix(git): pass only allowed child env

* test(git): cover filtered git env (#43125)

* Update lib/util/git/index.ts

Co-authored-by: Dave <reduckted@outlook.com>

---------

Co-authored-by: Sergei Zharinov <zharinov@users.noreply.github.com>
Co-authored-by: Dave <reduckted@outlook.com>
2026-05-06 14:04:55 +00:00
renovate[bot] 766db6fc6f build(deps): update dependency upath to v3 (main) (#43121)
* build(deps): update dependency upath to v3

| datasource | package | from  | to    |
| ---------- | ------- | ----- | ----- |
| npm        | upath   | 2.0.1 | 3.0.7 |

* chore: fix types

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-05-06 12:09:33 +00:00
Jamie Tanna ee61f1e1ce test(util/git): increase coverage ahead of simple-git upgrade (#42944)
* test

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

* sq

* chore: linting

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-05-06 08:53:45 +00:00
Jamie Tanna 8add2699f2 chore(instrumentation): instrument Merge Confidence API calls (#43045) 2026-05-04 08:50:09 +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
Elliot Courant 8776389291 feat(vulnerability): Add vulnerability alerts to deps-edn + lein (#42945)
* feat(vulnerability): Add vulnerability alerts to deps-end + lein

deps-edn and lein both essentially use maven upstream for several
packages. Some packages come from clojars directly but others are
typical java packages. If there is an OSV alert for a maven package
however, it will not propagate to the deps-edn or lein dependency update
from renovate. This tries to adjust that so that clojure can derive
dependency alerts from maven as well so that those dependencies are
treated the same way.

* chore: Code review feedback

* chore: Make ecosystem to datasource one to many

Technically datasource to ecosystem was already many to one in a way, as
maven appeared in the values twice. Once for clojure and once for maven
itself. This changes it so that the ecosystem to datasource is the same
way and looking up by ecosystem you will get multiple datasources
(should match the map above the modified code).

Then to make this work, instead of keying off of datasource for
vulnerabilities we key off of ecosystem so that all of the datasources
that are part of that ecosystem inherit the vulnerabilities for the same
dependency.

* chore: Tweaking to try to force CI/CD retry
2026-05-04 08:08:17 +00:00
Felipe Santos 45ba03e616 fix(git): implement caching for branch update dates (#42948)
* feat(update-date-cache): implement caching for branch update dates

* Try fix coverage

* Fix some test style inconsistencies

* Fix coverage

* Fix test

* Fix test testing the same path
2026-05-01 08:39:20 +00:00
Tobias Bieniek cd8446e70f feat(datasource): Implement rust-version data source (#39529)
* feat(rust-version): Implement `rust-version` data source

* refactor(rust-version): pass `URL` directly to `getText()`
2026-04-29 15:23:44 +00:00
Hajime-san 0004fcf69b feat(managers): add Deno manager support (#37828)
* works

* fix ci

Base branch is: main
Base branch ref for this PR is: c3a9360ecd
❌ Error: Snapshots have been added in this PR. Use toMatch instead.

* fix ci

Base branch is: main
Base branch ref for this PR is: c3a9360ecd
✅ Snapshot code check passed.
Added files in '__fixtures__':
lib/modules/manager/deno/__fixtures__/.gitignore
lib/modules/manager/deno/__fixtures__/npm-compat-workspace/deno.lock
lib/modules/manager/deno/__fixtures__/npm-compat-workspace/package.json
lib/modules/manager/deno/__fixtures__/npm-compat-workspace/sub/package.json
lib/modules/manager/deno/__fixtures__/workspace-01/deno.json
lib/modules/manager/deno/__fixtures__/workspace-01/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-01/docs/deno.json
lib/modules/manager/deno/__fixtures__/workspace-01/docs/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-01/packages/pkg1/deno.jsonc
lib/modules/manager/deno/__fixtures__/workspace-01/packages/pkg1/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-02/deno.json
lib/modules/manager/deno/__fixtures__/workspace-02/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-02/docs/deno.json
lib/modules/manager/deno/__fixtures__/workspace-02/import_map.json
lib/modules/manager/deno/__fixtures__/workspace-03/deno.json
lib/modules/manager/deno/__fixtures__/workspace-03/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-03/node/package.json
Total number of added files in '__fixtures__': 17
Deleted files in '__fixtures__':

Total number of deleted files in '__fixtures__': 0

Updated total number of added files in '__fixtures__': 17
Updated total number of deleted files in '__fixtures__': 0
❌ Error: More files have been added to '__fixtures__' directories than deleted.
Error: Process completed with exit code 1.

* nit fix

* fix import map

* remove unnecessary mock

* nested workspace is invalid

* cleanup to postExtract

* revert JSR datasource files

* move to schema

* move

* cleanup lock

* importMapReferrer

* cleanup artifact test

* comment

* remove support deno-cli detailed behaviour due to complexity

* cleanup

* fix schema

* cleanup

* schema for updateDependency

* nit

* lint

* update doc

* tmp-promise

* no need filter deno

* returns an error

* remove delete lockfile

* store the importMapReferrer result

* constraints

* use parseJson

* remove processDenoCompatiblePackageJson

* move to types.ts

* Update lib/modules/manager/deno/post.ts

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

* Revert "Update lib/modules/manager/deno/post.ts"

This reverts commit 64bd57649c.

* Revert "remove delete lockfile"

This reverts commit e701333519.

* Reapply "remove delete lockfile"

This reverts commit 89c3d79a43.

* remove comment

* bump ci

* fix eslint

* Apply suggestion from @RahulGautamSingh

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

* Update lib/modules/manager/deno/compat.spec.ts

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

* Update lib/modules/manager/deno/post.ts

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

* Update lib/modules/manager/deno/compat.spec.ts

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

* prettier

* Revert "Reapply "remove delete lockfile""

This reverts commit 85af6a506e.

* falling back for lockFileMaintenance

* mock statically

* use mockExecAll

* avoid cloning

* avoid cloning

* add `.ts` extension

* fix versioning

* fix `.ts` extension

* c8

* c8 update

* c8 post

* c8 extract

* c8 versiong

* c8 schema

* c8 compat

* revert deno versioning

* pnpm lint-fix

* lockFileNames

* zod/v3

* comment

* Apply suggestions from code review

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

* Apply suggestions from code review

review batch lib/modules/manager/deno/compat.ts

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

* fix import

* fix

* Apply suggestions from code review

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

* isObject

* Apply suggestions from code review

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

* named import @sindresorhus/is

* Apply suggestions from code review

* review

* rm test

* Apply suggestions from code review

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

* Redundant radix parameter.

* review

* review

* c8 lib/modules/manager/deno/update.ts

* fix

* named import

* clean up

* rm unnecessary

* named import

* Missing radix parameter.

* better

* move to beforeAll

* `lockFile` to `fileName`

https://github.com/renovatebot/renovate/pull/41631

* `lockFile` to `fileName`

https://github.com/renovatebot/renovate/pull/41631

* Update lib/modules/manager/deno/schema.ts

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

* update containerbase

* oxlint

* refactor for

https://github.com/renovatebot/renovate/pull/42253

* Apply suggestions from code review

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

* use `Record`

* use type `Upgrade`

* update README.md

---------

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-04-29 14:36:41 +00:00
Jamie Tanna 0e5e384237 feat(manager/gomod): extract the go and toolchain directives as constraints (#42582)
As part of future changes in #42567 to surface the `constraints` of a
given Go module, we should first extract the constraints from the
package file.

To make this simpler for users, we can make sure we extract these at
parse time:

- the `toolchain` directive becomes the `golang` constraint, which
  matches the `golang` tool name already in use for Containerbase
- the `go` directive becomes a new `%goMod` constraint, which keeps it
  separate from the version of the Go toolchain actually used to run, as
  well as clearly not for the Go tooling, or something that
  Containerbase knows about
- we make sure to extract it with a SemVer range that can then be used
  to ensure that, in future changes, using `constraintsFiltering=strict`
  will allow filtering releases from the Go datasource based on this
  constraint.
- because we're now returning the `constraintsVersioning`, we need to
  make sure this is part of our types
2026-04-29 13:20:13 +00:00
Jamie Tanna 53dcdba84d fix(validation): validate constraints (#42825)
* fix(validation): validate `constraints`

To provide better coverage for our users of what is a valid option for a
`constraints` value, we can validate the overall format of the
`constraints` block, as well as the given names of constraints.

Where we have a Tool defined, we can use the default versioning for that
Tool to validate the constraint's value.

For now, both the validation of the `constraints`' value, and the
validation of `constraints`' names will be a warning, but in the future
may be made an error.

* chore(validation): remove check for `compatibility`

As this was renamed in #7308. It's been long enough since then that we
can remove this check.

* chore(validation): add logger in `else` case

For coverage fix, and also to provide insight when this does happen

* fixup! chore(validation): add logger in `else` case

* fixup! chore(validation): add logger in `else` case

* key

* coverage

* Remove duplicate function

As it's been pulled in via another PR.

* fixup! docs(constraints): document the possible `constraints` and `installTools` (#42837)

As it can't be `undefined`.

* test: coverage

And more whitespace to make it clearer they're two separate `if` blocks.

* typo

* typo

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-04-28 10:21:41 +00:00
Felipe Santos 1bbe82400e fix(gerrit): defer change creation to createPr() (#39250)
* fix(gerrit): defer change creation to `createPr()`

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

* Refactor hashtags handling

* Add prTitle to all missing commitAndPush()

* Fix gerrit tests

* Add warning when prTitle is set in updatePr

* Remove now useless labels from commitAndPush

* Fix gerrit client coverage

* Fix gerrit scm coverage

* Fix rebase coverage

* Improve TODO about assignees

* Fix formatting

* Fix review comment

* Extract to a pushForReview function

* Fix after #41382

* Fix onboarding

* Cleanup code

* Fix ESLint

* Fix tests

* Restore gitRetry for git.merge

* Fix tests

* Simplify hashtags code

* Delete pendingChangeBranch in pushForReview()

* Fix test name

* Remove unnecessary test comments

* Improve test name again

* Fix another test name

* Delete local branch in Gerrit SCM

* Add test for deleting pending branch

* Add tests for pushForReview()

* Fix test case name

* Improve another test name

* Fix another small test inconsistency

* Fix some code style issues

* Use isUndefined instead

* Fix one small test style issue

---------

Signed-off-by: Felipe Santos <felipe.santos@ericsson.com>
2026-04-28 08:29:26 +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 5042d74fac test(util): add coverage of new GitHub Installation Access Token format (#42928)
Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-27 12:33:07 +00:00
Jamie Tanna 8278ce5370 docs(constraints): document the possible constraints and installTools (#42837)
* docs(constraints): list the possible `constraints` and `installTools`

Now we have a stronger type for what a valid tool constraint is, and
what additional constraints are, we should be very explicit with what
each option is, and specify them in the `constraints` as well as our
`installTools` docs.

* test: add coverage

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-04-26 16:13:09 +00:00
Jamie Tanna 41125296a0 docs(util/exec): add description field for ConstraintName/ToolName (#42907)
Instead of inline documentation with JSDoc, we can use an optional
`description` field that can be accessed programatically.

This means the `description` can also be added to our JSON Schema for a
Tool, or be the only output when a non-Tool constraint, as the
description for non-Tools are more clear than the autogenerated text.

We can make sure we continue to export the known names, as well as the
full definitions.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-26 14:44:05 +00:00
Jamie Tanna ec921a69e0 fix(git): support repo cache with getBranchUpdateDate (#42852)
As noted in #41953, the introduction of `getBranchUpdateDate` did not
take into account the use of a repository cache.

When using a repository cache, the repo is not cloned until it is needed
(and various metadata is used from the cache instead).

However, when using a cache (with a repo not yet cloned) this results in
`getBranchUpdateDate` failing (and a debug log appearing).

We can instead handle this by performing a repo sync at this point.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-24 07:15:06 +00:00
Jamie Tanna f391c50cd7 docs(json-schema): add constraints and installTools (#42834)
* docs(json-schema): add `constraints` and `installTools`

This requires `toolNames` and `additionalConstraintNames` are exported
for use.

* fixup! docs(json-schema): add `constraints` and `installTools`
2026-04-23 14:28:53 +00:00
Jamie Tanna c5a87efec8 chore(types): add missing ConstraintName enforcement (#42745)
* chore(types): correct JSDoc

* chore(types): add missing `ConstraintName` enforcement

* fixup! chore(types): add missing `ConstraintName` enforcement

By simplifying this case, which should never happen, as the types
wouldn't allow it.

* chore: reorder for typechecking simplicity

* fixup! chore(types): add missing `ConstraintName` enforcement
2026-04-21 11:50:34 +00:00
renovate[bot] a561b74314 chore(deps): update dependency @biomejs/biome to v2.4.11 (main) (#42034)
* chore(deps): update dependency @biomejs/biome to v2.4.11

| datasource | package        | from  | to     |
| ---------- | -------------- | ----- | ------ |
| npm        | @biomejs/biome | 2.4.6 | 2.4.11 |

* fixup linter changes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2026-04-20 21:45:46 +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
Felipe Santos f9bddb97a7 test(git): test failing when no git author is configured (#42676)
Fix test failing when no git author is configured locally
2026-04-16 09:02:24 +00:00
Johannes Feichtner 70fa9622bc fix(git): don't pass extraCloneOpts to ls-remote when local clone exists (#42491)
* fix(workers/repository): cleanup localDir before recursive retry after automerge

* add test for failed directory cleanup

* fix(git): don't pass extraCloneOpts to ls-remote when local clone exists
2026-04-15 09:56:04 +00:00
Sergei Zharinov f49de7ad60 refactor(cache): Remove obsolete compress flag (#42563)
* refactor(cache): Remove obsolete compress flag

* Update terminology in package cache tests

Replace references to "current format" in test descriptions with
explicit mentions of payload values and expiries. Rename the
`compressedValue` variable to `payloadValue` to match the updated
descriptions.
2026-04-15 09:34:22 +00:00
Mike Ryan f635ae29c4 chore(instrumentation): add timing statistics for getReleases (#42523)
* feat: timing statistics for getReleases

Adds collection and reporting of timing statistics for
`datasource.getReleases()` calls. Each call records the datasource, registryUrl,
packageName, and duration. The intent is to visibility into where
renovate is retrieving release information and how long that might take.

The report consists of a nested data-structure that provides increasing
detail as we descend datasource, registryUrl, and packageName.

The full report  is logged at trace level
`getReleases statistics with packages`.

A summary report including only datasources and registryUrls is logged
at debug level `getReleases statistics summary`.

* add GetReleasesSpanProcessor

- Re-instrument getReleases calls using open telemetry.
- Adds GetReleasesSpanProcessor, which can adapt
  `getReleases` spans to GetReleasesStats.

* fixup instrumentation tests

* pr feedback

* pr feedback: naming

* pr feedback: comments
2026-04-14 17:36:37 +00:00
Jamie Tanna 33c1bf5d18 fix(util/git): allow setting config.hooksPath (#42630)
* test(util/git): add test coverage for `X_CLEAR_HOOKS`

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

* fix(util/git): allow setting `config.hooksPath`

Since simple-git 3.35.2's update in #42588, the setting of
`config.hooksPath` is marked as "unsafe", and does not allow setting
this configuration.

This only affects users who specify the experimental self-hosted config
option, `RENOVATE_X_CLEAR_HOOKS`.

However, the primary user of this is Mend-hosted Renovate which, as
noted in #42628, resulted in all jobs failing to run.

We can instead conditionally set the `allowUnsafeHooksPath`
configuration if we're running with `RENOVATE_X_CLEAR_HOOKS`.

We need to refactor our test to make sure that we're re-initialising
`git` at the point the `RENOVATE_X_CLEAR_HOOKS` is set.

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

---------

Co-authored-by: Claude Opus 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-14 16:26:34 +00:00
Thomas Papillon 5184761a39 feat(cache): add a in-memory expiry map to package file cache (#42531)
* feat(PackageCacheFile): add a in-memory expiry map

This allows for faster expiry lookup, which makes for the bulk of
the loop on destroy(). Note that this doesn't remove the overhead
of looping through all entries, but at least doesn't load the
data from disk with a deserialization.

* deps: add lru-cache

* limit the size of the in-memory object

* remove benchmark
2026-04-14 14:23:10 +00:00
Jamie Tanna 1044a80642 chore(types): add a strong type for ToolName and ConstraintName (#42589)
* chore(types): add a strong type for `ToolName`s

Until #41849, we can use our local definitions of the tool names that
Containerbase supports by extracting out a `ToolName` type.

* fixup! chore(types): add a strong type for `ToolName`s

Co-authored-by: Claude Opus 4.6 <jamie.tanna+claude-code@mend.io>
Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>

* fixup! fixup! chore(types): add a strong type for `ToolName`s

* no-never

* simplify

* coverage

* sq

* warn

* sq

* fixup! sq

* sq

* fixup! sq

---------

Co-authored-by: Claude Opus 4.6 <jamie.tanna+claude-code@mend.io>
Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>
2026-04-14 08:55:42 +00:00
Sergei Zharinov 50a2bacb2b fix(cache): Improve SQLite cache error handling (#42557)
* fix(cache): Improve SQLite cache error handling

* Update minimum coverage threshold for functions

* Apply suggestions from code review

Co-authored-by: Sergei Zharinov <zharinov@users.noreply.github.com>
2026-04-13 15:22:58 +00:00
Sergei Zharinov a0d6ac4ceb refactor(cache): Add writeSchema transform to package cache (#42558)
feat(cache): Add `writeSchema` transform to package cache
2026-04-12 07:04:42 +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 bc514206b5 refactor(vulnerability): check in case-insensitive manner (#42457) 2026-04-08 07:58:25 +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
Jamie Tanna 3e84e6b209 test(util): wrap in a describe block (#42432)
test(util): wrap in a `describe` block`
2026-04-07 14:54:41 +00:00
Michael Kriese fa1068721f test: fix flaky test (#42428) 2026-04-07 15:38:02 +01:00
Michael Kriese f8ef935840 fix(git): skip merge commits for semantic commit detection (#42419)
* fix(git): skip merge commits for semantic commit detection

* docs: update docs
2026-04-07 13:35:24 +00:00
Michael Kriese 52a0e53537 feat: use custom conventional commits detector (#42328)
* feat: use custom conventional commits detector

* fix: update names and add test
2026-04-02 15:26:05 +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
Michael Kriese 440e353145 chore: use ts extension (#42300) 2026-04-01 07:46:34 +00:00
Sergei Zharinov b8809cedb5 fix(http): fallback to github hostType for GHE platform endpoint (#42287)
* fix(http): fallback to github hostType for GHE platform endpoint

When running against GitHub Enterprise Server, datasources not listed
in GITHUB_API_USING_HOST_TYPES (e.g. github-digest) fail to authenticate
because the existing fallback only covers api.github.com URLs.

This adds a host-matching fallback: when the active platform is github
and the request URL targets the same host as the configured endpoint,
credentials from the github hostType rule are applied.

* Refactor

* Fix
2026-03-31 17:07:43 +00:00
Sergei Zharinov e0c9bc1961 refactor(lint): move option-dependent rules from ESLint to oxlint (#42215)
Migrate rules that previously stayed in ESLint due to option parity
concerns. oxlint now supports all needed options:

- `no-restricted-imports` (paths: nock, parse-link-header, path)
- `consistent-type-assertions` (objectLiteralTypeAssertions: allow)
- `explicit-function-return-type` (allowExpressions, allowTypedFunctionExpressions)
- `no-unused-vars` (args: none, ignoreRestSiblings)
- `no-empty-object-type` (allowInterfaces: with-single-extends)

Convert eslint-disable comments to oxlint-disable for the allowed
import sites (url.ts wrapper, http-mock.ts test helper).

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-03-30 16:45:02 +00:00
Florian Arens f340b1a9e9 feat(datasource): add elm-package datasource (#41000)
* feat(datasource): add elm-package datasource

* refactor(elm): inline test fixtures

* fix(elm): correct import ordering in test file

* fix(elm): use zod/v3 import to match codebase conventions

* refactor(elm): rename types.ts to schema.ts

Follow project convention of using schema.ts for zod schema files.

* test(elm): add test for invalid JSON response

Use v8 ignore if directive and add test covering the null result
path when the API returns invalid JSON.

* refactor(elm): remove unreachable null check

* test(elm): add test for default registry URL fallback

* refactor(elm): guard against missing registryUrl instead of fallback

* fix(elm): handle ZodError gracefully instead of throwing

* feat(elm): add package cache for elm-package datasource
2026-03-28 13:23:00 +00:00