Commit Graph

282 Commits

Author SHA1 Message Date
Tim Tran 2f71422620 feat(bazel-module,bazelisk): add lock files updating (#41507)
* feat(exec): register bazelisk as containerbase tool

* test(bazel-module): add failing tests for updateArtifacts

* feat(bazel-module): implement updateArtifacts for lockfile support

* feat(bazel-module): export updateArtifacts from manager index

* fix(bazel-module): address code review feedback

- Use logger.warn instead of debug for artifact errors
- Add utf8 encoding to readLocalFile calls
- Use getSiblingFileName for lockfile path derivation
- Add empty updatedDeps guard
- Strengthen test assertions

* docs(bazel-module): document lockfile support

* Update lib/modules/manager/bazel-module/index.ts

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

* Apply suggestions from code review

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

* fix(bazel-module): address review feedback

- Remove unnecessary afterEach in tests
- Use partial<StatusResult> for all StatusResult mocks
- Add lockfile maintenance support
- Export supportsLockFileMaintenance flag

* fix(bazel-module): handle untracked lock files and clarify docs

Check status.not_added alongside status.modified for lock file changes,
matching the pattern used by other managers (composer, gomod, etc.).
Clarify that Bazelisk (not Renovate) reads .bazelversion. Add test for
lockfile maintenance with no changes.

* feat(bazelisk): implement updateArtifacts for MODULE.bazel.lock

When the Bazel version in .bazelversion changes, run `bazel mod deps` to
regenerate MODULE.bazel.lock and return the updated lockfile as an artifact.

* feat(bazelisk): add lockfile maintenance support

* docs(bazelisk): add lockfile support section linking to bazel-module docs

* refactor(bazel-module): extract shared lockfile update helper

* refactor(bazel-module): delegate lockfile update to shared helper

Replace inline lockfile update logic in artifacts.ts with a call to the
shared updateBazelLockfile() helper, and update tests to mock the helper.

* refactor(bazelisk): delegate lockfile update to shared helper

Replace inline lockfile update logic in bazelisk/artifacts.ts with a
call to the shared updateBazelLockfile() helper from bazel-module/lockfile.ts.

* fix(bazelisk): use index.md for cross-manager docs link

The docs pipeline renames readme.md to index.md, so cross-manager
links must reference index.md to pass the docs link checker.

* feat(bazel-module,bazelisk): support bazelisk version constraint

Pass config.constraints.bazelisk through to toolConstraints so users
can pin the bazelisk version if the newest release is broken.

* fix(bazel-module): rename lockFile to fileName in ArtifactError

Upstream renamed lockFile to fileName in ArtifactError type (#41631).

---------

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2026-03-12 16:40:24 +00:00
Jamie Tanna bc82cff059 feat(managers/npm): allow specifying toolSettings.nodeMaxMemory (#40957)
* feat(managers/npm): allow specifying `toolSettings.nodeMaxMemory`

As noted in #40942, we're seeing an increase in memory usage across
`pnpm` and `yarn` users in Mend-hosted apps.

To allow limiting the maximum memory that any `node` child processes
will use, we can add a new `toolSettings.nodeMaxMemory` to (hopefully)
mitigate this.

Similar to the `toolSettings.jvmMaxMemory`, the self-hosted
administrator can set a maximum, which cannot be exceeded by repo-level
configuration.

* fixup! feat(managers/npm): allow specifying `toolSettings.nodeMaxMemory`
2026-03-05 12:56:02 +00:00
Jamie Tanna 12ea4f2831 refactor(gradle): move gradleJvmArg to util/exec (#41511)
As this is the better place for this to be overall, and as well as
future changes that will need to pull it from a central location.
2026-02-26 13:35:21 +00:00
Jamie Tanna 01d2772b9c test(util/exec): add additional test coverage for GHSA-8wc6-vgrq-x6cf (#41150)
As an additional means to avoid this issue recurring, we can add
additional test coverage.
2026-02-13 10:41:26 +00:00
Michael Kriese a825cac81b fix(exec): don't extend env (#41024) 2026-02-09 09:48:01 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +00:00
Jamie Tanna 87b324dafa chore(util/exec): remove unnecessary optional operator (#40956)
As we've checked that it's not `undefined`.
2026-02-05 16:52:41 +00:00
Jamie Tanna 6eaa7869b5 test(util/exec): correct test naming (#40955) 2026-02-05 16:51:53 +00:00
Jamie Tanna 5ec2f17b22 test(lib/util/exec): refactor ahead of new tests (#40954)
To prefactor this to be a simpler change in the future as we add new
functionality to `getToolSettingsOptions`, we can:

- wrap the JVM settings in its own `describe` block
- use `toMatchObject`, so new default values don't break existing tests
2026-02-05 16:02:14 +00:00
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 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
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 9fe353adb4 test: add coverage (part1) (#40636) 2026-01-23 15:09:01 +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
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
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
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
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
Jamie Tanna 70c1075010 docs(constraints): clarify that binarySource=global ignores them (#39561)
* docs(constraints): clarify that `binarySource=global` ignores them

Although this is a somewhat commonly known behaviour, it's worth making
this more clear, by clarifying this in the `constraints` docs, as well
as add a debug log.

* docs(constraints): simplify message

As noted by Michael, these may not be user-facing `constraints`, but the
constraints a Manager sets.

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

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-11-27 17:41:39 +00:00
RahulGautamSingh 76f911041a refactor: use named exports (#39196)
* use named exports

* fix test

* add missing imnport

* fix prettier
2025-11-10 12:00:35 +00:00
Nils Plaschke 1482c0ab2a feat: add dynamic install for conan (#38834)
* feat: add dynamic install for conan

* chore: add test for dynamic conan install

* chore: reorder conan entry in tool config
2025-10-27 13:10:34 +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
Michael Kriese 871d9db367 feat(datasource/java-version): support os and architecture filter (#37254) 2025-08-01 12:11:16 +00:00
RahulGautamSingh 587b9a9cda refactor: use re2 (#36957) 2025-07-12 16:27:13 +00:00
Michael Kriese 49f1b00af2 fix(exec): pass CI env to child processes (#36153) 2025-05-26 10:12:20 +00:00
Michael Kriese bb9faed9c3 fix: properly pass configured env (#35835) 2025-05-09 11:31:00 +00:00
RahulGautamSingh 49fa1be464 feat(util): getEnv (#35161)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-06 18:37:28 +00:00
renovate[bot] 856f5dc5f7 build(deps): update dependency find-up to v7 (main) (#35752)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-06 09:42:33 +00:00
Trim21 e938454903 fix(tool/pixi): remove v prefix from raw version (#35277) 2025-04-09 07:03:31 +00:00
renovate[bot] fffd986fa7 chore(deps): update linters (main) (#35113)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-04-02 14:28:27 +00:00
RahulGautamSingh 80b7cdf1e0 refactor(util): move user env to util folder (#35103) 2025-04-02 10:27:27 +00:00
Trim21 2da6478b62 feat(manager/pixi): use conda versioning for tool contrainst (#35118) 2025-04-01 05:41:58 +00: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
Trim21 87ebf4c6a5 feat: new manager pixi (#34400)
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@gmx.de>
2025-03-06 16:57:26 +00:00