Commit Graph

114 Commits

Author SHA1 Message Date
Jamie Tanna acb46bc706 fix(config): surface blocked hosts more clearly when resolving config
With the new hardening on blocking internal hosts with outbound HTTP
calls, we should build on top of this to ensure that the UX is better
when a preset is blocked.

We can do this by making sure that when `HOST_BLOCKED`, we report a more
targeted config validation error.

We can also make sure to pass around our `internalGrants`, similar to
how we currently allow an admin's `headers` are handled.

Co-authored-by: Claude Fable 5 <jamie.tanna+claude-code@mend.io>
Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
2026-09-10 14:52:01 +01: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
Sebastian Poxhofer df8c4051ff test(core): replace file snapshots with explicit assertions (#45660)
* test(core): replace file snapshots with explicit assertions

* test(core): replace inline snapshots with explicit assertions

* test(core): assert on relevant sections instead of full bodies

* test(core): drop assertions implied by full equality

* test(core): address review feedback

* test(core): use resolves instead of awaiting inside expect
2026-09-04 10:28:55 +00:00
Sebastian Poxhofer 1012b34025 feat(presets): add @oxlint/* packages to packages:linters and monorepo:oxlint (#45466)
* feat(presets): add @oxlint/* packages to packages:linters

Groups oxlint plugin packages together with oxlint itself.

* feat(presets): add @oxlint/plugins to monorepo:oxlint

* test(presets): update linters snapshots for @oxlint/**
2026-08-26 07:14:28 +00:00
Sebastian Poxhofer 69e05233e8 feat(manager/github-actions): add workflow depType for reusable workflow calls (#45443)
* feat(manager/github-actions): add `workflow` depType for reusable workflow calls

A job-level `uses:` pointing at `owner/repo/.github/workflows/<file>.yml@<ref>`
calls a reusable workflow rather than running an action, but both got the
`action` depType, so `matchDepTypes` could not tell them apart.

Give a reference whose sub-path is exactly `.github/workflows/<file>.yml|.yaml`
the new `workflow` depType. Every other sub-path, such as
`github/codeql-action/init`, stays an action.

The existing depType-keyed sites now accept both values, so nothing else
changes behaviour: the `actions.lock` file records reusable workflow calls too,
and `helpers:pinGitHubActionDigests` pinned them before this split.

* Apply suggestions from code review

Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2026-08-25 11:52:05 +00:00
Sebastian Poxhofer 9d0e535934 feat(config): add overrideDescription option (#45400)
* feat(config): add `overrideDescription` option

Presets which extend many other presets used an `ignoreDeps: []` sentinel
to keep their own one-line summary in the onboarding PR instead of one line
per extended preset. Replace that hack with an explicit `overrideDescription`
option, which is consumed and removed while presets are resolved.

The resolved descriptions are unchanged. Repositories which set
`ignoreDeps: []` in their own config no longer lose all preset descriptions
in their onboarding PR.

* fixup! feat(config): add `overrideDescription` option

* fixup! feat(config): add `overrideDescription` option

* fixup! feat(config): add `overrideDescription` option
2026-08-24 11:22:31 +00:00
Sebastian Poxhofer 874f3e3953 feat(presets): support relative paths inside a preset repo (#45211)
* feat(presets): support relative `extends` references inside presets

Presets which are fetched from a repository can now reference sibling
presets relatively, instead of repeating their own source, repository and
tag:

- `./x` resolves against the directory of the preset file with the
  reference
- `../x` resolves against the parent directory of that file
- `/x` resolves against the root of the preset repository

The source, repository and tag of the preset which holds the reference are
inherited, so `./system/registries` inside `github>org/repo#v2.0.0`
resolves to `github>org/repo//system/registries#v2.0.0`. A reference which
resolves to the `default` preset at the repository root is emitted in the
plain repository form, so `github>org/repo#v2.0.0`, which keeps it
deduplicated against the way consumers spell the very same preset.

A reference must stay inside its repository, its final path segment must
name a preset file rather than a directory, and it can carry parameters
but neither its own `#tag` nor a `:subPreset`. Parameters may contain a
Handlebars template, including a sub-expression such as
`./group({{ lower (env.TEAM) }})`, while a templated path cannot be
resolved and is left alone. A reference must also not carry a source
prefix, so strings such as `local>./x` or `github>../x` are rejected as
invalid.

References are canonicalized lazily, while the preset which holds them is
fetched in `getPreset()`, after migration and massaging. Only presets from
a repository hosted source, so `github`, `gitlab`, `gitea`, `forgejo` and
`local`, are walked. A relative reference which has no parent preset, for
example in a repository config, an inherited config or in `globalExtends`,
is reported as a validation error for that entry.

Relative entries of a preset's `ignorePresets` are resolved in the same
way, so a preset can neutralize a preset which it references relatively,
as long as the consuming repository does not set `ignorePresets` itself.
A reference which cannot be resolved is kept raw and logged, which lets
consumers neutralize it with `ignorePresets`, and it only fails per entry.

Because relative references cannot be resolved while a config is
validated, they are stripped from a `packageRules` entry before its
presets are resolved. A rule which is then left without any selector is
reported as a warning rather than as an error, since the stripped preset
may still provide the missing selectors. Rules without relative references
keep failing hard as before.

The `renovate-config` manager reports relative and unparsable `extends`
entries with a skipReason, instead of dropping them, and ignores templated
entries which can only be resolved at runtime.

Behavior change: an `extends` string which starts with `./`, `../` or `/`,
such as `./x`, `../x` or `/x`, is now read as a relative reference. Before
it was parsed as a local repository name, which in rare cases could
accidentally resolve through the dot segment normalization of the request
URL. For the same reason a source prefixed relative looking string, such
as `local>/org/repo`, `github>./x` or `npm>./x`, is now rejected as an
invalid preset.

* fix(presets): parse scoped npm presets with explicit `npm>` prefix

`npm>@scope/name` was parsed as a local preset, because the heuristic for
local presets matched before the `npm>` prefix was stripped.

Every other use of `npm>` keeps its current behavior, so `npm>foo` still
falls back to the npm package `renovate-config-foo`, `npm>owner/repo` is
still resolved as a local preset and nested prefixes such as
`local>npm>foo` keep working.

* refactor: remove duplicated preset source

* docs: streamline new docs

* add more docs for skipReason and add requested changes

* Apply suggestions from code review

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>

* test(presets): drop object literal type casts in relative preset spec

---------

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>
2026-08-13 13:54:50 +00:00
Micah Nagel c33364d126 fix(presets/helpers): ensure that pinGitHubActionDigestsToSemver preset only applies to actions (#44830)
fix: ensure that pinGitHubActionDigestsToSemver preset only applies to actions

Signed-off-by: Micah Nagel <micah.nagel@defenseunicorns.com>
2026-07-24 13:58:35 +00:00
Sebastian Poxhofer aac8365dd6 refactor(oxlint): enable vitest/prefer-snapshot-hint (#44420)
Add distinct hints to the multi-snapshot tests flagged by the rule
and regenerate the affected snapshot files, then re-enable the rule.

Part of #43845

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 16:35:22 +00:00
Jamie Tanna 87b4a04a00 feat(presets): link to Octochangelog for updates to Renovate itself (#43712)
* feat(presets): link to Octochangelog for updates to Renovate itself

Related to #41809, and a recommendation I personally have for folks
updating their version of Renovate via Renovate, we can use
Octochangelog to provide a nicer breakdown of Renovate CLI release
notes, grouping them by headers i.e. "Features" and "Bug Fixes" across
all version(s) being updated.

This overrides the default link i.e.

```
https://app.renovatebot.com/package-diff?name=renovate&from=43.198.0&to=43.206.1
```

to:

```
https://octochangelog.com/compare?repo=renovatebot%2Frenovate&from=43.198.0&to=43.206.1
```

As this is a strong recommendation, we add it into `config:recommended`.

* fixup! feat(presets): link to Octochangelog for updates to Renovate itself
2026-06-01 11:13:11 +00:00
Jamie Tanna 032a5cb289 feat(presets): log the resolved configuration (without internal presets) (#39314)
As noted in #15827, it would be useful to log the "shallow"
configuration for a given repository - that is, the resolved
configuration, but without any Renovate internal presets being included.

This will be very useful for debugging, as it shows the final resulting
configuration, but without the - often very - verbose internal presets.

In the case that only this log line is shared, we can make sure to
reference the version of the Renovate CLI in the log line.

This requires building on top of changes in
6a4fa3f245 to be able to return a `merged`
and `unmerged` list of presets, and uses helpers from
c8f42e86b4, and
66b84dd12b to process the internal presets
accordingly.

Since we first worked on this, we've worked on improvements to caching
which should provide a require no additional performance overhead
performing this resolution twice.

This can also lead to being able to understand more clearly how Renovate
configuration is being used[0], as we have the final resolved configuration.

We want to make sure we don't try and merge or visit any internal
presets if we're not going to merge them, so we can avoid verbose
`config` or `visitedPresets` results.

[0]: https://www.jvt.me/posts/2024/04/14/renovate-config-sql/
2026-05-11 10:46:55 +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
RahulGautamSingh 246a5ab9c6 feat(presets): add changelogUrl link for GitLab-based digest updates (#41700)
* feat(presets): add changelogUrl link for GitLab-based digest updates

* Update lib/config/presets/internal/helpers.preset.ts

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

* Update lib/config/presets/internal/helpers.preset.ts

* prettier

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-04-30 08:28:07 +00:00
Michael Kriese 0f9a516986 feat(presets): add changelogUrl link for Forgejo and Gitea digest updates (#41786)
* feat(presets): add changelogUrl link for Forgejo and Gitea digest updates

* fix: fix typo
2026-04-15 15:25:33 +00:00
Michael Kriese 570c989065 fix(presets/eslint): add missing packages (#41653) 2026-03-04 13:34:50 +00:00
Michael Kriese e06b74e9c6 fix(presets/cache): do not cache internal presets (#41524) 2026-02-26 15:46:20 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +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 3e4807e9f1 feat(presets): add oxlint to linters packages (#40520)
* feat(presets): add `oxlint` to linter packages

* test: fix tests
2026-01-19 12:21:47 +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 133bbf64d6 test: rename describe block (#40417) 2026-01-14 12:11:03 +00:00
Jamie Tanna 0d1b1a429e feat(presets): add helpers for golang.org/x packages (#39738)
When working with Go modules, the `golang.org/x` need to be treated
slightly differently, as they're hosted on Google's
`cs.opensource.google` infrastructure.

This adapts changes from [0] to:

- provide a linked `depName`, through to `pkg.go.dev` for the package
- provide a link through to `cs.opensource.google` for the given
  changelog

We also wire this in by default for `config:recommended` users.

[0]: https://code.forgejo.org/forgejo/renovate-config/src/commit/42f4672021ac9907141d34966f38f735be401734/go.json#L59-L73

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-12-03 20:34:30 +00:00
Jamie Tanna 8c43bc2bd4 feat(presets): add helper to add changelog for digest updates for GitHub-based packages (#39650)
* feat(presets): add helper to add changelog for digest updates for GitHub-based packages

As noted in #39646, this would be useful to provide changelogs for
digest updates.

THis also wires it in by default for `config:recommended` users.

Via [0].

[0]: https://www.jvt.me/posts/2025/05/08/renovate-digest-changelog/

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

* fix: simplify `matchSourceUrls`

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

---------

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-12-03 11:10:20 +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
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
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
Sergei Zharinov 05d42780ad fix(cache): Make TTL overrides work for all namespaces (#36903)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-07-16 11:40:48 +00:00
Aleksandr Mezin e49d205448 feat(presets): substitute entire parameter string for {{args}} (#36771) 2025-07-02 19:30:17 +00:00
Rhys Arkins 8cc5e3ed26 feat(config)!: add mergeConfidence:age-confidence-badges to config:recommended (#36450)
To reverse this change, you can add ``"ignorePresets": ["mergeConfidence:age-confidence-badges"]`` to your global or shared config.

BREAKING CHANGE: Merge Confidence badges will now be included by default with the `config:recommended` preset.
2025-06-19 10:59:47 +02:00
RahulGautamSingh e0e53b9d76 refactor: move customEnvVariables to util folder (#35097) 2025-03-31 09:10:48 +00:00
Michael Kriese 19c115c813 test: cleanup (#34785) 2025-03-13 17:52:09 +00:00
Michael Kriese 1644d9cb18 test: migrate more to vitest (#34500) 2025-02-26 15:45:17 +00:00
Michael Kriese bb5377b3d8 test: fix code coverage (#34495) 2025-02-26 12:40:30 +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
Risu b0946602ad refactor(config/presets): move parsePreset to avoid a circular dependency (#33036) 2024-12-11 16:38:21 +00:00
Michael Kriese 91c69adbcc feat(preset): add @eslint-community and @stylistic eslint plugin to eslint packages (#30825) 2024-08-16 12:30:41 +00:00
Gilmore Davidson 9fc7d19406 fix(presets): Add typescript-eslint top-level package to eslint preset (#30585) 2024-08-05 09:34:43 +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
lstoeferle 91e8a86e2e feat: allow templating of the extends field (#27955)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-05-14 12:18:20 +00:00
Adam Setch 2bec323237 refactor(preset): update regexManagers: to customManagers: (#28979) 2024-05-13 05:23:29 +00:00
Michael Kriese 290aea3889 feat(presets): add eslint-stylistic monorepo and add to eslint group (#28812) 2024-05-03 07:14:55 +00:00
Michael Kriese 02eaf8c977 feat(presets): add stylelint plugin to group (#28749) 2024-04-30 07:33:40 +00:00
Matt Alexander 0c30ef4ed1 feat(config): Add @eslint/* to ESLint packages preset (#28328) 2024-04-11 04:52:37 +00:00
Yuki Sato 0e16efa0c1 feat(config): Add @babel/eslint-parser to ESLint packages Presets (#28014) 2024-03-19 19:45:46 +00:00
Aleksandr Mezin a9a33dd94d feat(presets): fetch presets from HTTP URLs (#27359) 2024-02-24 07:16:34 +00:00
Yun Lai f5b4da3c68 feat(presets): presetCachePersistence (#25825)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-12-01 11:22:26 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Alessandro Lai 3c0f71d1e3 feat(presets): map PHP linters in default linters group (#25072)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2023-10-08 03:05:00 +00:00
Michael Kriese f9e3e80e0c feat(presets)!: rename config:base to config:recommended (#21136)
Closes #12024

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Bastian Gutschke <bastian.gutschke@gmx.de>

BREAKING CHANGE: Preset config:base is now called config:recommended
2023-07-04 19:21:52 +02:00