Commit Graph

66 Commits

Author SHA1 Message Date
Jamie Tanna 238e15a498 feat(config): add inheritConfigTrusted to trust inherited-config hostRules
Renovate deployments that are deployed across multiple organisations may
take advantage of Inherited Config as a means to decentralise some
decisions and/or preferences that their organisations would like to use
for some self-hosted configuration.

Similarly, the decision of which hosts to allowlist may be something
that a self-hosted administrator /may/ want to allow their organisation
admins to decide.

We can make this an opt-in capability to indicate that the self-hosted
administrator trusts the Inherited Config moreso, and allows someone who
can write to it the ability to allowlist access to internal hosts that
may not be intended.

If a self-hosted administrator sets `allowInternal: false`, this takes
precedence, allowing a "veto", and a self-hosted admin's `headers` are
still preferred, too.

It's not possible for Inherited Config to set grants for `extends`, as
config resolution has already occurred, so this still needs to be
performed at the self-hosted config level.

This trust is transitive: `hostRules` defined in presets the
inherited config `extends` are registered at the same inherited
tier once resolved, so this option must only be enabled when those
preset sources are trusted too.

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
Jamie Tanna 29a7b9c5f5 fix(util/http): allow blocking requests to internal hosts
To harden Renovate from being able to access internal hosts, we can add
a level of enforcement on all outgoing requests.

We can split this into two types of traffic:

- where the response becomes configuration (i.e. `extends`)
- where the response does not become configuration (i.e.
  `customDatasources`)

To harden this, we enforce on every outbound HTTP request:

- check the resolved URL before anything, including cache lookups, can
  proceed
  - catching IP-literal hosts in every spelling the WHATWG URL parser normalizes
  - blocking known Cloud metadata IPs, too
- a `dnsLookup` wrapper validates every address a hostname resolves to,
  on every new connection, which also defeats DNS rebinding
- a `beforeRedirect` hook re-runs the URL check on each redirect
  target, with the new host getting its own grant lookup rather than
  inheriting the original host's verdict

We default this enforcement to `warn`, to not break existing deployments
and instead give them visibility into required configuration before a
future major version (major+1) enables `block` by default.

We'll also remove allow in a future major version (major+2), to give
time for admins to migrate over.

When a request is blocked, this degrades like an unreachable registry,
so a Renovate run isn't aborted by a blocked request.

As part of this, we can also provide a worked example of the different
cases that do/do not need allowing via `hostRules`.

Requests through an admin-configured proxy resolve DNS at the proxy, so
`dnsLookup` never runs for them, so we can resolve the hostname locally
and validate every address before the request instead.

This doesn't catch everything, especially as the proxy may resolve the
name to a different result, and if we can't resolve the name - possible
in locked-down corporate environments - we fail open.

Child processes aren't currently able to route traffic through
Renovate's HTTP layer, so are unrestricted.

Co-authored-by: Claude Fable 5 <jamie.tanna+claude-code@mend.io>
Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-09-10 14:52:01 +01:00
renovate[bot] 9d74625d93 build(deps): update dependency prettier to v3.9.6 (main) (#45815)
* build(deps): update dependency prettier to v3.9.6

| datasource | package  | from  | to    |
| ---------- | -------- | ----- | ----- |
| npm        | prettier | 3.8.1 | 3.9.6 |

* chore: prettier fixes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@mend.io>
2026-09-09 13:50:03 +00:00
Jamie Tanna d16dc9a739 refactor(config/global): improve type restrictions for GlobalConfig.OPTIONS (#44636)
* refactor(config/global): improve type restrictions for `GlobalConfig.OPTIONS`

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

* fixup! refactor(config/global): improve type restrictions for `GlobalConfig.OPTIONS`

---------

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-07-21 13:19:41 +00:00
Jamie Tanna 0e6429b13e refactor(types): document localDir isn't a globalOnly option (#44635)
* refactor(types): document `localDir` isn't a `globalOnly` option

To make sure that it's clear when reviewing `GlobalConfig`, as well as
working with our types, we can move the `localDir` definition into a
separate type.

* fixup! refactor(types): document `localDir` isn't a `globalOnly` option

* fixup! refactor(types): document `localDir` isn't a `globalOnly` option

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

* fixup! refactor(types): document `localDir` isn't a `globalOnly` option

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

* fixup! refactor(types): document `localDir` isn't a `globalOnly` option

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-07-20 08:07:17 +00:00
Felipe Santos 42864ebb4d fix(config): move checkedBranches and rebaseAllOpenBranches into GlobalConfig (#44611)
* refactor(config): move checkedBranches and rebaseAllOpenBranches into GlobalConfig

Both options are globalOnly but were being read directly off the
repository config object instead of GlobalConfig, so they weren't
part of the RepoGlobalConfig contract enforced elsewhere.

* test: reset GlobalConfig in beforeEach instead of per-test

Matches the pattern used elsewhere (common.spec.ts, error-config.spec.ts,
prune.spec.ts) and resets before each test instead of after, so a failed
assertion can't leak state into the next test.

* refactor: use isNonEmptyArray instead of .length check
2026-07-15 15:41:03 +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 ff6761ed23 fix(config/global): return default values for GlobalConfig.get (#42113)
* fix(config/global): return default values for `GlobalConfig.get`

As noted in #39949, it can be awkward working with in `GlobalConfig.get`, where
we would previously need to specify the default value when calling `.get`,
which could lead to drift with the defaults for a given config option.

To reduce this risk, we can rely on a given `default` for a configuration
option, providing that as a default.

Because this now definitely returns a value that matches the config option, it
now allows us to remove `!` assertions.

* fixup! fix(config/global): return default values for `GlobalConfig.get`

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* fixup! fix(config/global): return default values for `GlobalConfig.get`

* test(presets): remove impossible test

As it's now not possible to set a value as `undefined` (as
`GlobalConfig` will then use the default), this test no longer validates
anything.

* test(workers/repository): add mock

Now `platform` defaults to `github`, we need to mock out the call to
fetch config.

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

* test: coverage

* test: coverage

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-05-15 17:10:38 +00:00
RahulGautamSingh 36f9d4a185 refactor: move requireConfig to InheritConfig (#41385)
* refactor: move requireConfig to InheritConfig

* fix test

* update test

* refactor
2026-04-14 11:53:53 +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
RahulGautamSingh b4cb678bb9 refactor: move onboardingConfig to InheritConfig (#41382)
refactor: move onboardingConfig to InheritConfig
2026-03-02 12:23:13 +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
Sergei Zharinov 000c2f936b feat(github): Make PR cache sync max pages configurable (#41493) 2026-02-26 15:29:14 +00:00
RahulGautamSingh 54547c97fc refactor: move onboarding to InheritConfig (#41377)
* refactor: move  to

* fix test
2026-02-24 21:52:41 +00:00
RahulGautamSingh af14f83a05 refactor: move onboardingNoDeps to InheritConfig (#41384)
refactor: move onboardingNoDeps to InheritConfig
2026-02-24 21:45:05 +00:00
RahulGautamSingh da50c75c49 refactor: move onboardingPrTitle to InheritConfig (#41376)
* refactor: move onboardingPrTitle to InheritConfig

* remove unwanted flat clone
2026-02-22 18:32:16 +00:00
Jamie Tanna 067a19490b feat: promote repositoryCacheForceLocal out of experimental (#41207)
We've been happily using this with Mend Renovate Self-Hosted customers
since introduction in 2024, and so we're happy making this
non-experimental now.

This follows other changes where we've promoted an experimental option
to non-experimental, and heavily driven by Claude Sonnet 4.5.

We can also rename config item to use the same `repositoryCache` prefix.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-16 11:20:30 +00:00
RahulGautamSingh 7a8dcdbd01 refactor(config/inherit): move onboardingBranch to InheritConfig (#40865)
* move onboardingBranch to InheritConfig

* fix lint issue

* fix import order

* more fixrs

* fix import

* fix imports
2026-02-15 08:17:11 +00:00
RahulGautamSingh 26f4fee6cc refactor: move bbUseDevelopmentBranch to InheritConfig.OPTIONS (#40890)
* move bbUseDevelopmentBranch to InheritConfig.OPTIONS

* fix import extension

* fix import order
2026-02-15 08:15:12 +00:00
Robert Stupp c08656f4b7 feat(gradle): allow specifying Gradle daemon heap size (#40090)
This change introduces a heap size limitation for the Gradle daemon used
when updating the Gradle wrapper, defaults to 512m.

The heap size is limited to the globally configured limit, which
defaults to 512m. It can be configured on the repository level, but not
exceed the globally configured limit. A hard coded mimiumum heap size of
512m is enforced.

The configuration option is named `toolSettings`, which has two
properties for the maximum and initial heap size. See
`docs/usage/configuration-options#toolSettings` for more details.
2026-02-04 13:25:58 +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
RahulGautamSingh 50b5f5a900 refactor(config): add an InheritConfig class (#40449)
* init InheritConfig class

* fix imports

* fix order

* add test

* fix import order

* RepoInheritConfig -> GlobalInheritableConfig

* fix import order

* Apply suggestions from code review

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

* handle null/undefined inherited values

* add tests

---------

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>
2026-01-19 13:45:54 +00:00
Jamie Tanna cbe1d049c6 feat(self-hosted): allow choice of shell: true for postUpgradeTasks (#40229)
As part of hardening the configuration around executing
`postUpgradeTasks` with `shell: true`, we can give self-hosted
administrators the opportunity to configure this.

This continues to be on-by-default to be non-breaking, but in the next
major version can be flipped to the safer option.
2025-12-31 11:55:04 +00:00
RahulGautamSingh ef0ff99f37 feat(self-hosted): onboardingAutoCloseAge (#39876)
* init

* prevent multiple closed comments

* add tests

* test + types

* doxcs

* revert createdAt type change

* revert inhertited config support
2025-12-15 16:53:13 +00:00
Mike Glazer ccb80f210d fix(allowedUnsafeExecutions): add to GlobalConfig options (#39700)
fix: Add `allowedUnsafeExecutions` to GlobalConfig OPTIONS

Missed when doing: #39573
2025-12-02 13:42:43 +00:00
Jamie Tanna 78e5977977 refactor(config/options): ensure global options are sorted (#39681) 2025-12-02 09:12:41 +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
Michael Kriese 32f73bb511 fix(platform): includeMirrors is a global only option (#39580) 2025-11-27 10:46:30 +00:00
Michael Kriese ad710ec6ea fix(platform): endpoint is a global only option (#39579) 2025-11-27 10:12:16 +00:00
RahulGautamSingh 51faa92cf5 fix(config/options): convert ignorePrAuthor to global only (#37956) 2025-09-11 10:02:03 +00:00
Rhys Arkins e7a4162169 refactor(config): set and delete keys early (#35679)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-02 08:15:56 +00:00
Rhys Arkins 319de90d4f feat(config)!: validate allowedCommands against post-compiled commands (#35564)
Drops `allowCommandTemplating` so that templating is always allowed. Changes validation logic so that `allowedCommands` are now compared to the post-compiled command instead of pre-compiled.

BREAKING CHANGE: `allowedCommands` filters need to be updated to match against the post-compiled `postUpgradeCommands` in cases where templating was in use.
2025-04-30 10:54:47 +02:00
Rhys Arkins 12a62cc0c7 feat: rename allowedPostUpgradeCommands/allowPostUpgradeCommandTemplating (#32657) 2025-01-24 12:30:09 +00:00
RahulGautamSingh 8ec8391310 feat(self-hosted): convert experimental vars to config options (#29137)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-08-19 15:45:49 +00:00
RahulGautamSingh 3857332a9e feat(self-hosted): convert experimental env vars to config options (#29154)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-08-07 07:28:34 +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
Sergei Zharinov 8fc2a7bdb2 feat: Add cachePrivatePackages global config option (#30045) 2024-07-04 19:57:26 +00:00
Gabriel-Ladzaretti 3bcd779e46 fix(merge-confidence): fix initialization (#29300) 2024-05-28 12:50:29 +00:00
Philip 19655269e1 feat(warnings): add encryptedWarning text parameter (#29120)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-05-27 12:43:15 +00:00
RahulGautamSingh 044dc0fa28 feat(self-hosted): mergeConfidenceEndpoint and mergeConfidenceDatasources (#28880)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-05-21 13:57:56 +00:00
RahulGautamSingh 10a4a8bb26 feat(self-hosted): autodiscoverRepoSort and autodiscoverRepoOrder (#28738)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-05-06 18:16:01 +00:00
RahulGautamSingh 5558b0d3da feat(config/self-hosted): userAgent (#28737)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-04-29 16:16:35 +00:00
Sergei Zharinov e89be688a5 feat(http): Cleanup for HTTP cache (#28381)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-04-14 14:16:47 +00:00
RahulGautamSingh 2194142f78 feat(config): support user configured env (#27028)
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-02-22 05:05:05 +00:00
François db9d485227 feat(config): implement custom header field inside HostRules (#26225) 2024-01-17 09:22:19 +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
Gabriel-Ladzaretti e45bacf026 feat(package-cache): add configurable cache TTL override (#24073)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-08-25 15:40:37 +00:00
RahulGautamSingh aa14b777c0 feat!: replace dockerImagePrefix with dockerSidecarImage (#22708)
Closes #21217

BREAKING CHANGE: dockerImagePrefix is now replaced by dockerSidecarImage
2023-07-04 19:21:52 +02:00
Sergei Zharinov 11c05fc837 refactor: Default values for GlobalConfig.get (#22967) 2023-06-25 19:34:42 +00:00