Commit Graph

3688 Commits

Author SHA1 Message Date
Jamie Tanna 7b00f3a2a8 refactor(types): use BranchStatusConfig for setting status checks (#42463)
As we have a strong type for this, we should use it.

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>
2026-04-08 13:23:16 +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 5f02aa860d chore(onboarding): add "reading list" link from onboarding PR (#42418)
As a potentially actionable suggestion for newly onboarding users.
2026-04-07 10:57:01 +00:00
Jamie Tanna 434606bfb4 feat(onboarding): make Add your custom config to ... more prominent (#42332)
* feat(onboarding): make `Add your custom config to ...` more prominent

As part of work to improve the Onboarding flow as part of larger repos,
we noticed that the `Add your custom config to ...` comment may be
missed.

We can make this more prominent by moving it up to the top of the PR.

* fixup! feat(onboarding): make `Add your custom config to ...` more prominent
2026-04-07 10:29:52 +00:00
RahulGautamSingh 8a30bf5c13 fix: migrate cli params before calling parseEarlyFlags (#42337)
migrate cli params before calling parseEarlyFlags
2026-04-02 20:40:35 +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 ac30b35f0c feat(pr): break Schedule definition over multiple lines + show cron syntax in code blocks (#42329)
* test(pr): add test coverage for `automergeSchedule`

* test(pr): validate full `Schedule` text

As part of a future change, we'll be modifying this, so we should
clarify the exact behaviour.

* feat(pr): break `Schedule` definition over multiple lines

To provide a more readable set of `schedule` and `automergeSchedule`
configuration options, we can break these over multiple lines, which
makes it clearer where there are multiple schedules that may apply at
a given time, as well as making it clearer between branch creation vs
automerge, which isn't necessarily clear.

* feat(pr): show cron syntax in code blocks

As it can make it clearer, as well as avoiding potential interpretation
as Markdown.

* fix(pr): ensure enough whitespace between elements

Although it's unlikely to hit our currently used Platforms, it's worth
making sure we do it right.
2026-04-02 11:56:10 +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
Michael Kriese 440e353145 chore: use ts extension (#42300) 2026-04-01 07:46:34 +00:00
Felipe Santos e7f55d7e42 refactor: extract applyHostRules and applyNpmrc to functions (#41528)
* refactor: extract `applyHostRules` and `applyNpmrc` to functions

* Reuse applyHostRules in inherited.ts

* Restore original log message for npmrc

* Simplify applyNpmrc log context handling

* Remove redundant config word

* Apply Jamie's suggestion

* Restore log messages again

* Revert "Restore log messages again"

This reverts commit 7a67c5d3a4.

* chore: re-add log line

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2026-03-31 18:03:44 +00:00
Michael Kriese 3953a78123 refactor: pass packageFile to updateDependency (#42253) 2026-03-30 17:32:36 +00:00
Jamie Tanna 3951723d13 feat(dry-run): log commit contents (#41718)
As a means to make the dry-run functionality a little more useful, we
can log out what commit(s) a given Renovate run would have created
outside of Dry Run.

Because the meta key `contents` is automagically replaced with
`[contents]`, we need to move this into a new field, `rawContents`.

This can also lead to longer lines being output, but provides additional
utility that we've had requests for before.
2026-03-30 16:15:36 +00:00
Jamie Tanna 9c57ae1399 test(config): ensure no duplicate environment variable names (#42204)
As we continue to be more careful with our environment variable usage,
we should make sure it's not possible to ever have a clash.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-03-27 15:06:21 +00:00
Felipe Santos 93985c3daa fix(cli): avoid printing logs on --version/--help (#42183) 2026-03-27 09:25:06 +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 41eba99ed9 test(workers/repository): cover generation of prettyDepType (#42152)
As part of changes in #42142, I noticed that we didn't have any coverage
of how this was determined.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-03-26 11:17:31 +00:00
Jamie Tanna 2f8c8ee569 chore(autodiscover): log options being filtered (#42090)
* chore(autodiscover): log options being filtered

As a way to provide more debuggability, we can log the options we're
going to be filtering with.

* Update lib/workers/global/autodiscover.ts

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

* fixup! Update lib/workers/global/autodiscover.ts

* fixup! Update lib/workers/global/autodiscover.ts

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-03-25 13:17:12 +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 ae786755ab fix(repository/finalize): skip branch pruning when defaultBranch is unavailable (#42000) 2026-03-19 16:08:04 +00:00
Jamie Tanna b1d03bc8f3 chore(onboarding): add link to prHourlyLimit docs (#39445)
To make this more actionable.
2026-03-19 10:11:34 +00:00
Johannes Feichtner 292ef85dca fix(participants): filter out empty entries from code owners (#41576)
* fix(participants): filter out empty entries from code owners

* add defense in depth
2026-03-15 12:08:19 +00:00
Johannes Feichtner 18bcf81283 fix(repository/finalize): avoid pruning crash when base branches are not resolved yet (#41928) 2026-03-15 12:02:49 +00:00
Felipe Santos e8a5c70862 feat(config-migration): preserve comments when migrating renovate.json (#38646)
* feat(config-migration): preserve comments when migrating `renovate.json`

* Replace jsonc-parser with jsonc-weaver

* Switch to npm package

Refs https://github.com/felipecrs/jsonc-weaver/commit/7a168e2fdd6959fab9d1ebd6bb5dafc02dbf62ff

* Fix tests

* Add test coverage for fallback

* Fix coverage again

* Fix coverage for real

* Restore line break
2026-03-13 21:53:52 +00:00
Jamie Tanna 6061757b88 refactor(manager/npm): remove duplicate ArtifactError type (#41779) 2026-03-10 13:06:03 +00:00
Jamie Tanna 8b3dc2cb3c test(workers/repository): cover ignored coverage (#41781)
Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-03-10 12:57:53 +00:00
Jamie Tanna 2d1e57532f refactor(types): rename lockFile to fileName in ArtifactError (#41631)
As `fileName` makes more sense (as it's not always a lock file we're
updating).

Also, if you set `fileName`, it would never actually output the
filename.

This renames the usages of `lockFile` to `fileName`.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-03-10 09:57:31 +00:00
RahulGautamSingh 2dc7d9c43f refactor: move onboardingCommitMessage to InheritConfig (#41380)
* refactor: move onbaordingCommitMessage to InheritConfig

* fix test

* fix sorting
2026-03-09 13:12:06 +00:00
Sergei Zharinov 41bfb8678e refactor(lint): use oxlint for type-aware rules (#41739)
* feat: enable oxlint type-aware linting

Move type-aware typescript-eslint rules from ESLint to oxlint,
leveraging oxlint-tsgolint for type information. This removes
the need for ESLint's projectService and parserOptions.

- Add `options.typeAware: true` to .oxlintrc.json with all
  type-aware rules (recommendedTypeChecked + stylisticTypeChecked)
- Switch ESLint to non-type-aware configs (recommended, stylistic)
- Remove projectService/parserOptions from ESLint config
- Drop @typescript-eslint/naming-convention (no oxlint equivalent)
- Update oxlint/eslint-plugin-oxlint to 1.51.0
- Add oxlint-tsgolint dependency
- Convert eslint-disable comments to oxlint-disable for type-aware rules
- Fix prefer-optional-chain violations newly caught by oxlint

* fix: revert unnecessary code changes, suppress with oxlint-disable instead

* fix: suppress remaining prefer-optional-chain violations

* fix: suppress last prefer-optional-chain violation

* fix: remove redundant --type-aware CLI flag, use config instead
2026-03-09 12:51:12 +00:00
Jamie Tanna 4f0d819316 fix(workers/repository): handle no depName but packageName (#41720)
As noted in #41716, there are cases where a `depName` may be absent, but
a `packageName` is present.

We should handle this accordingly, and check for the `packageName`, and
only error if neither of these are set.
2026-03-06 17:09:57 +00:00
Jamie Tanna 32b550cfa0 feat(workers/repository): raise artifact error if pending version used in an update (#41629)
* feat(workers/repository): raise artifact error if `pending` version used in an update

When using Minimum Release Age, and a package manager that doesn't
support being told an explicit version to update to (#41624) it is
possible that an artifact update leads to a different version of a
dependency being used compared to what Renovate is expecting.

This can lead to, at best, a surprising PR update, and at worst, a
supply chain attack.

We should report these cases more explicitly with an Artifact Error, to
allow the reviewers to decide what to do with the changes.

To do this, we need to re-extract package files after an update, and
determine if any of the version(s) of that dependency are using any of
the `pendingVersions`.

This may be slightly breaking to users, which is why this is a `feat`
not a `fix`, but isn't so breaking that it's worth leaving until the
next breaking change .

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

* fixup! feat(workers/repository): raise artifact error if `pending` version used in an update

* fixup! fixup! feat(workers/repository): raise artifact error if `pending` version used in an update

* Update lib/workers/repository/update/branch/get-updated.ts

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

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+github-copilot@mend.io>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-03-04 17:03:56 +00:00
Jamie Tanna db13e7a430 chore: point Minimum Release Age status check to the full docs page (#41630)
Instead of the `minimumReleaseAge` configuration option.
2026-03-03 16:08:08 +00:00
Jamie Tanna e83acfb2ef feat(postUpgradeTasks): allow specifying installTools (#41594)
* feat(postUpgradeTasks): allow specifying `installTools`

As noted in #8111 and #41569, it is possible that when using
`binarySource=install`, you can execute a `postUpgradeTasks`' given
command without Renovate having the right tools installed, dependent on
the Manager used for the update.

To make it possible for users to indicate that they explicitly need
given tools (at a given `constraint`), we can introduce a new
`installTools` option which will allow specifying which tools +
constraints to use when invoking the `postUpgradeTasks`'s command.

Right now, we're not defining what the `installTools'` interior type is,
but leaving it open to extension.

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>

* docs: add examples for `toolVersions`

---------

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>
2026-03-02 15:47:28 +00:00
RahulGautamSingh b4cb678bb9 refactor: move onboardingConfig to InheritConfig (#41382)
refactor: move onboardingConfig to InheritConfig
2026-03-02 12:23:13 +00:00
Johannes Feichtner 0bcfef096f refactor(vulnerabilities): revert cleanup ae-cvss-calculator import (#41568) 2026-03-02 06:06:12 +00:00
Johannes Feichtner 3a80eda1e1 test: refactor GitHub vulnerability alert detection tests (#41567) 2026-03-02 06:04:16 +00:00
renovate[bot] c2aa761c1e chore(deps): update linters (main) (#41417)
* chore(deps): update linters

| datasource | package              | from   | to     |
| ---------- | -------------------- | ------ | ------ |
| npm        | @eslint/js           | 9.39.2 | 9.39.3 |
| npm        | eslint               | 9.39.2 | 9.39.3 |
| npm        | eslint-plugin-oxlint | 1.46.0 | 1.49.0 |
| npm        | oxlint               | 1.47.0 | 1.49.0 |
| npm        | typescript-eslint    | 8.55.0 | 8.56.0 |

* chore(deps): update linters

| datasource | package              | from   | to     |
| ---------- | -------------------- | ------ | ------ |
| npm        | @eslint/js           | 9.39.2 | 9.39.3 |
| npm        | eslint               | 9.39.2 | 9.39.3 |
| npm        | eslint-plugin-oxlint | 1.46.0 | 1.49.0 |
| npm        | oxlint               | 1.47.0 | 1.49.0 |
| npm        | typescript-eslint    | 8.55.0 | 8.56.0 |

* Radix rule has been deprecated

* fixup! Radix rule has been deprecated

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2026-02-28 11:23:25 +00:00
Jamie Tanna 6e105562cb chore: log when repositories is being overridden by the CLI (#41553)
As noted in #41551, when i.e. a `config.js` specifies the
`repositories` to run against, with specific configuration for each
repo, this is silently overridden by the CLI passing command-line
arguments.

Until #41551 is complete, we can introduce a warning log to surface this
to self-hosted users who may be unaware of this behaviour.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-27 17:03:47 +00:00
Florian Greinacher 21c011ad44 fix(gitlab): skip branch status when no pipeline found, retry after PR creation (#41130)
* fix(gitlab): skip branch status when no pipeline found, retry after PR creation

On GitLab with MR pipelines, posting a commit status without a
pipeline_id causes GitLab to create an unwanted branch pipeline.

Skip posting the status in setBranchStatus() when no pipeline is found
after retries. Retry setting branch statuses after ensurePr() in the
with-pr block so that the MR pipeline created by GitLab can be found.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(gitlab): gate skip-status-without-pipeline behind experimental flag

Move the behavior that skips setting a branch status check when no
pipeline is found behind the RENOVATE_X_GITLAB_SKIP_STATUS_WITHOUT_PIPELINE
experimental environment variable. Without the flag, the original
behavior of always posting the status is preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(gitlab): restore original 'sets branch status' test case

Keep the original test that verifies branch status is set without
the experimental flag alongside the new skip-behavior test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(docs): sort experimental env var headers alphabetically

Move RENOVATE_X_GITLAB_SKIP_STATUS_WITHOUT_PIPELINE after
RENOVATE_X_GITLAB_MERGE_REQUEST_DELAY to satisfy alphabetical
ordering requirement in self-hosted-experimental.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(gitlab): address PR review comments for skip-status-without-pipeline

Use strict `=== 'true'` check for env var, update docs wording, and
add test coverage for the new experimental flag behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-27 16:45:46 +00:00
Jalil David Salamé Messina 99a3ac22af fix(jsonata): updates when version and digest changed (#38308)
* fix(jsonata): updates when version and digest changed (#36461)

Cherry-picked from #38066 and fixed regression #38252.

Uses the test from #38298 to confirm the regression is not reintroduced.

* fix: review comments

Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
Change-Id: I6a6a69641345ca16b82a9e082aa1b19b13e267bf

* fix: issues introduced by branch update

I didn't resolve the merge conflict properly.

Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>

---------

Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
2026-02-27 16:09:45 +00:00
RahulGautamSingh d1fa243a08 refactor: move onboardingConfigFileName to InheritConfig (#41383)
* refactor: move onboardingConfigFilenName to InheritConfig

* fix test

* fix type

* update fn
2026-02-26 20:29:53 +00:00
Michael Kriese d98ad0b462 refactor: cleanup ae-cvss-calculator import (#41525) 2026-02-26 18:18:10 +00:00
Jamie Tanna da5b7c3a67 chore: use a stable sort for manager extract durations (ms) (#41509)
As per request in #40091, we have cases where folks are using tools to
read or diff the `manager extract durations (ms)`

To improve this, we can make sure to perform a stable sort, by
alphabetically sorting our package manager names.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-26 13:36:13 +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 3eb6f5a31b feat(vulnerabilities): add support for github-actions vulnerability alerts (#40175)
* feat(vulnerabilities): add support for github-actions vulnerability alerts

* fix failed merge from main

* now for real

* review comments

* remove no longer needed assertion
2026-02-26 08:11:14 +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
rngcntr bd7214d04b feat: Log PR labels on PR creation (#41450)
With the current logs, there was no way other than inspecting the actual
PR to determine the PR labels. As a consequence, debugging PR labels
with a dry run was simply not possible. This makes more complex labeling
rules extremely hard to debug.

This commit adds the computed PR labels to the log output when actually
creating a PR as well as when performing a dry run.
2026-02-25 13:08:11 +00:00