Commit Graph

2035 Commits

Author SHA1 Message Date
Jamie Tanna 698d7df92d test(lib/util/exec): use clearer example for global config (#40952)
Otherwise it's unclear what's being tested.
2026-02-05 15:42:49 +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 c246f814d5 feat: Add github-digest datasource (#40226)
* feat(datasource/github-digest): Add datasource for non-semver refs

* fix: Use `Promise.allSettled` to avoid dangling promises
2026-02-02 10:58:43 +00:00
Jamie Tanna dc9f86873d fix(onboardingAutoCloseAge): don't allow higher inherited value than global (#40810) (#40817)
Our intent for `onboardingAutoCloseAge` would be that the global
config would take precedence over the inherited config value.

Our implementation missed this, which means that inherited config could
then override the value, including disabling it.

To correct this, we can make sure that when using `getInheritedOrGlobal`
we only allow the inherit config option if it is lower than the global
option.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-02 08:55:23 +00:00
RahulGautamSingh 9327821472 refactor: typo (#40825)
NOT_PRESET -> NOT_PRESENT
2026-01-31 10:39:48 +00:00
Sergei Zharinov 2b0e80b884 feat!: Switch to ESM modules (#40756) 2026-01-29 14:21:41 +00:00
Michael Kriese cd0426babd feat(sidecar): use renovatebot/base-image instead of containerbase/sidecar (#40772)
* feat(sidecar): use `renovatebot/base-image` instead of `containerbase/sidecar`

* refactor: simplify sidecar handling

* test: fixup

* docs: fixup
2026-01-29 10:05:24 +00:00
Michael Kriese 17a1bbad96 refactor: use named simpleGit imports (#40759) 2026-01-28 16:55:14 +00:00
Sergei Zharinov c07814ca4d refactor: Remove decorators for ESM compatibility (#40736)
* refactor: Migrate to decorator alternatives

* refactor: Remove decorators

* Fixes

* build: Remove decorator support from build pipeline

* fix: Remove extra brace in cdnjs getDigest cache key
2026-01-28 13:22:53 +00:00
Sergei Zharinov ad47fd2981 refactor: Extract decorator logic into standalone functions (#40710)
* refactor: Extract decorator logic into standalone `cached()` and `instrumented()` functions

* Update lib/util/cache/package/cached.ts

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-27 11:18:09 +00:00
Sergei Zharinov c5b0a74f82 refactor: Remove constructor parameter properties (#40712) 2026-01-27 11:16:26 +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 0785d0b8bc test: add coverage (part2) (#40643) 2026-01-23 20:57:46 +00:00
Michael Kriese 9fe353adb4 test: add coverage (part1) (#40636) 2026-01-23 15:09:01 +00:00
Jamie Tanna 9d5e9de4a9 fix(onboardingAutoCloseAge): correctly handle partial days elapsed (#40606)
As noted in #40604, we're seeing cases where we need to wait
`onboardingAutoCloseAge+1` days until the onboarding PR will be
auto-closed.

To fix this, we can refactor `getElapsedDays` to optionally return a
floating point number, which we can then perform more careful
calculations against.

As we're now being a little more careful with timings being used for our
date comparisons, we need to make sure that Vitest fakes our timer
during these tests.

Instead of long floating-point numbers, we should use a 2 decimal
place value for log messages, as they're more readable to humans.
2026-01-23 07:49:14 +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 19bd22ccff fix(util/exec): correctly pass commands around when using binarySource=docker (#40517)
As noted in #40513, when running Composer's `lockFileMaintenance`
against a repository with `symfony/flex`[0], we hit a case[1] where
Composer needs to be installed first, which then results in a failure
when running in `binarySource=docker`, which strips any options from
`CommandWithOptions`.

This is because we were stripping the options and was inadvertently left
in as it fixed Typescript type checking, but subtly broke
implementation.

This also corrects a test that was a sign that this wasn't quite working
for Yarn, but we'd expected that it was mocked, not actually broken.

[0]: https://github.com/renovatebot/renovate/blob/795a121b5486138fd65e344ac7feaf370278d791/lib/modules/manager/composer/utils.ts#L15
[1]: https://github.com/renovatebot/renovate/blob/795a121b5486138fd65e344ac7feaf370278d791/lib/modules/manager/composer/artifacts.ts#L170
2026-01-19 13:14:41 +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
renovate[bot] c8e38bfb9a chore(deps): update dependency @vitest/eslint-plugin to v1.6.5 (main) (#40165)
* chore(deps): update dependency @vitest/eslint-plugin to v1.6.5

| datasource | package               | from  | to    |
| ---------- | --------------------- | ----- | ----- |
| npm        | @vitest/eslint-plugin | 1.5.2 | 1.6.5 |

* 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-13 15:00:10 +00:00
Jamie Tanna f903dcd4f0 chore(util/exec): allow specifying shell on CommandWithOptions (#40323)
As part of future changes, we need to be able to specify on a
per-command level whether a `shell` should be used.

Before we do this, we should make it possible to provide the `shell`
specifier.
2026-01-08 14:17:46 +00:00
Jamie Tanna 9f3db00d1a fix(util/exec): allow ignoring failures per-command (#40290)
As part of future changes which will fix issues with Composer + Yarn 1
introduced by f430552de4, we need to find
a way to ignore command failure, on a per-command basis.

To do this, we can provide a refactor to introduce a new type,
`CommandWithOptions` which has the ability to specify whether to
`ignoreFailure`.

To make this less of a refactor than would otherwise require, we can
pass around a `(string | CommandWithOptions)[]`
(or a `string[]` or a `CommandWithOptions[]`) to be used, and use
helpers `asRawCommand` and `asRawCommands` to extract the underlying
command where necessary.

In the case a command's failure is being ignored, return the error code
in the `ExecResult`.

We also need to make sure that when executing in Docker, we still
provide the `|| true`s, otherwise we'll start to see commands failing
unexpectedly.

As part of future-proofing the `CommandWithOptions`, we can make sure
that it uses `string[]`s for the command it's representing, to avoid
re-parsing it.
2026-01-08 09:36:06 +00:00
Marks Polakovs 8efdad4a66 fix(jsonata): ensure all evaluations use a new environment (#40312)
* fix(jsonata): ensure all evaluations use a new environment

When evaluating a JSONata expression concurrently, specifically when reusing
an expression instance (as we do since we cache them), it's possible that
a second concurrent evaluate() call clobbers the `$` binding before the
first one has finished, which will make it use incorrect values.

Passing in a non-undefined bindings value causes JSONata to instead
create a new environment for each evaluate() call, preventing these conflicts.

Fixes #40311.

* fix(jsonata): concurrency issues by wrapping jsonata.Expression

* fix(jsonata): tweak return type and revert no-longer-necessary change

---------

Co-authored-by: secustor <sebastian@poxhofer.at>
2026-01-07 20:50:08 +00:00
Adam Setch bc86d7394b refactor(git): add debug logging for baseBranch (#40307)
* refactor: log baseBranch name in isBranchModified

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* refactor: log baseBranch name

Signed-off-by: Adam Setch <adam.setch@outlook.com>

---------

Signed-off-by: Adam Setch <adam.setch@outlook.com>
2026-01-07 16:29:15 +00:00
Sergei Zharinov 2e9edba619 feat(http): Prevent writes of already cached responses (#38986)
* feat(http): Prevent writes of already cached responses

* Update repository-http-cache-provider.ts

* Update repository-http-cache-provider.ts

* Fix queue timing measurement in HTTP request

* Fix import type for HttpCache schema

* Add mutex to HTTP request to prevent race conditions

* Refactor is import to use isPlainObject directly

* Only use locks for GET and HEAD

* Return method name to the mutex key

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2026-01-07 15:25:46 +00:00
Jamie Tanna 2ac386df0f test(util/exec): clarify how errors are thrown (#40287)
As part of future changes, we should have this explicitly tested.
2026-01-06 13:44:17 +00:00
Jamie Tanna 021532c402 fix(util/exec): always pass shell when preparing rawExec arguments (#40235)
As noted in #40242, without `shell` being passed around, this won't
correctly apply for Post Upgrade Tasks, and might break other usages.

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-06 11:46:46 +00:00
Jamie Tanna eda8991a7d fix(util/exec): remove hash for Containerbase installs (#40234)
After recent changes to remove `shell: true`, it's clear from #40231
that this breaks Containerbase's installing of tools, as we use the
`hash` shell built-in.

As we no longer need the `hash` call, we can remove it.
2025-12-31 12:51:09 +00:00
Jamie Tanna f430552de4 fix(util/exec): don't use shell by default
As it can lead to unexpected side effects, and opportunities for command
execution / variable interpolation when untrusted input is provided.
2025-12-31 10:37:18 +00:00
Jamie Tanna c5c98ead08 test(util/exec): document ability to use arguments with spaces 2025-12-31 10:37:18 +00:00
Jamie Tanna b19c3ee660 refactor(util/exec): use spawnargs to return error messages
As part of a future change, we will optionally be passing around
command arguments.

To make this a simpler change, we can prefactor this to make sure we're
using the space-separated `spawnargs` for error messages.
2025-12-31 10:37:17 +00:00
Jamie Tanna a0a84a4541 refactor(util/exec): specify the args array for execa
As part of a future change, we will optionally be passing around
command arguments.

To make this a simpler change, we can prefactor this to pass around the
(empty) args array first.
2025-12-31 10:37:17 +00:00
Jamie Tanna 140a777105 fix(postUpgradeTasks): always run commands with shell mode
As part of future changes to ensure that `shell` is disabled by default,
we should first enforce this for our `postUpgradeTasks`, which are
user-controlled and are more likely to contain shell-interpolated
variables.

We need to add a new `shell` type to pass around, as it was previously
not optional.
2025-12-31 10:37:17 +00:00
Jamie Tanna d0bee7f113 test(util/exec): clarify existing behaviour of shell parameter
As part of being able to make future changes to how the `shell` handling
works, we should clarify existing behaviour.
2025-12-31 10:37:17 +00:00
Jamie Tanna 8fab5f04a5 test: remove encoding from stubs (#40221)
As part of 39bfc0975e we removed this for
our production code, but we can also remove it for our test code, too.
2025-12-31 10:31:19 +00:00
Jamie Tanna e773b32431 fix(util/exec): migrate to execa for command execution (#40212)
* fix(util/exec): migrate to `execa` for command execution

As part of a future change, we need to make sure that we have
cross-platform support for specific command executions.

By using `execa`'s functionality on top of `node:child_process`, we can
provide this functionality, as well as retain a consistent API with
internal users.

We need to make a couple of small tweaks to setting the `RawExecOptions`
as we're now bound by `readonly` properties.

As the `stdio` property's type is not exported, we can replace this with
an explicit setting of `stdin`, `stdout` and `stderr`.

This requires a number of test changes to make sure that the `stdin`,
`stdout` and `stderr` are set.

This doesn't migrate any calls under `tools`, as they can remain using
`node:child_process`.

* chore(util/exec): ignore floating promises `.on` calls

Since moving to use `execa`, we now have "floating promises" for the
`.on` method calls.

As we aren't handling them here, we can now mark them as `void` (as an
alternative to ignoring the ESLint rule).
2025-12-30 14:28:18 +00:00
Sergei Zharinov 151d78f37f feat(typst): Update datasource to use official registry API (#38982)
* feat(typst): Update datasource to use official registry API

* Fix

* Update self-hosted-configuration.md

* Update rate-limits.ts
2025-12-30 10:25:03 +00:00
Jamie Tanna 39bfc0975e refactor(util/exec): remove deprecated encoding property (#40199)
This has been deprecated since 2022-07, and is unused as we only ever
use UTF-8.

In `tools/utils/exec.ts` we make sure to specify it explicitly, so we
don't get a Buffer returned.
2025-12-30 09:55:31 +00:00
Sergei Zharinov 65a961cceb refactor(github): add GraphQL branch query adapter (#40177)
* refactor(github): add GraphQL branch query adapter

Add infrastructure for querying GitHub branches via GraphQL:
- Add branches-query-adapter following the tags-query-adapter pattern
- Add GithubBranchItem type
- Export queryBranches function
- Register cache namespace

* style: fix prettier formatting

* test: add queryBranches coverage

* Refactor undefined checks to use `is.undefined`

Replace direct comparison of `undefined` with the `is.undefined` helper for consistency.

* refactor: use maxItems instead of maxPages
2025-12-28 17:16:19 +00:00
Sergei Zharinov fb15aa4bfe fix(cache): use bitbucket-server as platform cache key (#40168)
* fix(cache): use `bitbucket-server` as platform cache key

Change the Bitbucket Server platform cache key from `bitbucketServer`
(camelCase) to `bitbucket-server` (kebab-case) to match the platform ID.

Adds migration logic to automatically convert existing caches using
the old key to the new format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Simplify

* Simplify more

* Update lib/modules/platform/bitbucket-server/pr-cache.ts

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

* Revert "Update lib/modules/platform/bitbucket-server/pr-cache.ts"

This reverts commit e564d91742.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
2025-12-28 16:58:54 +00:00
Jamie Tanna 5c1cec370e fix(instrumentation): instrument command execution (#39654)
As part of ongoing work to improve OpenTelemetry instrumentation of
Renovate in #38609, we can introduce an instrumented call for each
external command execution.

This makes sure we cover the key functions used for command
execution -  `rawExec` - across the codebase, which is used
under-the-hood by `exec`.

Because commands could include sensitive arguments (such as repo or
global secrets) we need to make sure we sanitize the span name.

Note that we don't add instrumentation to `tools/utils/exec.ts` as it's
only used for i.e. building the docs site, and isn't used as part of the
core Renovate CLI.
2025-12-23 17:20:17 +00:00
Jamie Tanna 650b2be065 test(exec): clarify rawExec vs exec tests (#40123)
As it was previously unclear that the tests we had covered `exec` not
`rawExec`.
2025-12-23 15:03:12 +00:00
Cyrille a8ee6648c0 fix(forgejo): support fallback for all forgejo-* host types (#39968)
* fix: support fallback for forgejo-* host types

* Sort imports

* Reorganize code to lexicographical order
2025-12-16 20:28:24 +00:00
Sergei Zharinov cc60dfda05 refactor: Cache decorator (#40014) 2025-12-16 11:14:33 +00:00
Sergei Zharinov 4c9171657d refactor: Refactor TTL tests (#40015) 2025-12-16 11:13:55 +00:00
RahulGautamSingh 2298b2f284 fix(onboarding): prevent secrets resolution (#39624)
* skip on unknown reviewers instead of failing

* fix(onboarding): prevent secrets resolution

* revert

* use expect-error

* fix: type of onboardingConfig

* Update lib/config/types.ts

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

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-12-15 18:12:29 +00:00
renovate[bot] 225e2b73eb chore(deps): update dependency @vitest/eslint-plugin to v1.5.2 (main) (#39675)
* chore(deps): update dependency @vitest/eslint-plugin to v1.5.2

| datasource | package               | from  | to    |
| ---------- | --------------------- | ----- | ----- |
| npm        | @vitest/eslint-plugin | 1.4.4 | 1.5.2 |

* chore: fixup

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-12-15 10:26:19 +00:00
RahulGautamSingh 214e1da38d feat(config): allow template fields in allowedVersions (#38922)
* handlebars: regsiter add helper

* allow template fields in allowedVersions

* fix test

* fix doc example

* remove comments

* Apply Suggestions

* use empty object instead of undefined

* template(helpers/add): handle undefined/null

* Apply Suggestions

* Apply suggestion from @RahulGautamSingh

* Apply suggestion from @RahulGautamSingh

* fix conflict

* remove unused function

* fix lint issue

* fix test

* Update docs/usage/configuration-options.md

Co-authored-by: Anne Stellingwerf <1637358+astellingwerf@users.noreply.github.com>

* prettier

* throw error if invalid inputs used

---------

Co-authored-by: Anne Stellingwerf <1637358+astellingwerf@users.noreply.github.com>
2025-12-11 14:52:15 +00:00
Matthew Gamble 7b1eddb8cd test: don't sign commits made in submodules created by test suite (#39748)
fix: don't sign commits made in submodules created by test suite

The 'commit.gpgsign=false' configuration was already in place for some
tests in this file, but not all of them. I'm pretty sure that with this
change in place, there's no more commit signing happening in this test
suite.
2025-12-05 16:49:28 +00:00
Adam Setch a10b97daf4 feat: map emojis to repository problems (#39769)
* feat: add emojis for repo problem levels

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* feat: add emojis for repo problem levels

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* feat: add emojis for repo problem levels

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* feat: add emojis for repo problem levels

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* feat: add emojis for repo problem levels

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* feat: add emojis for repo problem levels

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* incorporate feedback

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* incorporate feedback

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* Update common.ts

* Update common.ts

* Update common.ts

---------

Signed-off-by: Adam Setch <adam.setch@outlook.com>
2025-12-05 13:03:08 +00:00
Jamie Tanna b5cd0317cf fix(git): report Git operation statistics at end of run (#39596)
Now we have instrumented our Git operations with tracing, we can make
sure that users who are not using OpenTelemetry still get insights into
their Git operation usage using a debug log output.

Following how other insights are produced, we can introduce a new type
in `lib/util/stats` for `GitOperationStats`, which will track the
overall execution for each operation type, and output them in the same
style as we use for other timing reports.

At the end of a Renovate run, we'll then make sure that this is logged
into a debug log for further investigation.

To create the report, we can make sure that we introduce a new
OpenTelemetry `SpanProcessor`, which will run when we end our Run, and
store any Git operations in `GitOperationStats`.

This adapts code from GPT-4.1 and code from [0].

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

[0]: https://github.com/yurisouza/monitoria-sdk/blob/ca9d751fa7c3a785a04f87b8966bb782b4617021/src/adapters/nestjs/span-duration-tracker.ts#L18-L27
2025-12-01 15:53:26 +00:00