Commit Graph

30 Commits

Author SHA1 Message Date
Jamie Tanna 5b1749983c feat: always set CI=true for subprocesses
As noted in #43761, we had recently set `CI=true` for the Renovate and
Containerbase orgs on Mend-hosted apps due to a pnpm v11 requirement:

    ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY  Aborted removal of
      modules directory due to no TTY

    If you are running pnpm in CI, set the CI environment variable to
      "true", or set "confirmModulesPurge" to "false".

Similarly in #43606, it was noted that we should do this for `mise lock`
to mark the workspace as "trusted".

Although we went with a different situation, there will be cases where
this is useful for tools being executed, for instance when we invoke `yarn`.

We also make sure to keep our documentation up-to-date as we add to the
specific overrides.

With help from Claude Sonnet and Opus to:

- perform some of the mechanical updates as part of this change
- ensure that the Docker sidecar always has `hardcodedProcessEnv` passed
  into it
- catch a needed change to `exposeAllEnv` handling

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-08-24 17:21:24 +01:00
Jamie Tanna b017c7548a fix(exec/docker): single-quote the sidecar bash command
When executing commands for `binarySource=docker`, we have two areas
that a command could have shell expansion/injection:

- on the host (when constructing the `bash -l -c`)
- in the container (when running a manager-specific command)

When constructing the host's command, we previously would escape the
`"`, which allows Bash syntax for `${VAR}` and `$(...)` syntax inside
it.

While managers use `quote()` to make the inputs safer, the use of `"`
around that would not provide any protection, and lead to cases where
the `quote()` could be expanded on the host, before `docker run`
executes.

After recent changes to each manager - and removal of `shell: true` -
this doesn't seem to be exploitable, but this hardens it further.

Additionally, we never escaped `\`, so a value containing `\"` produces
a command that `shlex.split` rejects, and the update fails rather than
running.

Instead, we can quote the whole `-c` argument with `quote()`, which
round-trips through both `shlex.split` - the default, no-shell path - and
a real shell.

This removes the `lgtm [js/incomplete-sanitization]` suppression as
we're now correctly sanitising this.

Note this doesn't remove the need for the managers to quote their own
values, as the second area above is still a real shell.

Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
2026-08-07 14:25:42 +01:00
Jamie Tanna 7279744cd6 fix(manager/maven-wrapper): quote distribution type in wrapper command
To prevent the possibility of the `distributionType` in a given
repository including shell metacharacters, which could lead to command
execution, we can make sure they are quoted appropriately.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-08-07 14:22:55 +01:00
Jamie Tanna 68cb7c71d5 test: ensure we set binarySource=global (#43382)
* test: ensure we set `binarySource=global`

As part of future changes, we'll correctly return the default value from
`GlobalConfig.get`, instead of `undefined` if no default is provided in
the `get` call.

As `binarySource=install` is the default, this then leads to these tests
failing, as they're intended to run with `binarySource=global`.

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

* fixup! test: ensure we set `binarySource=global`

* fixup! fixup! test: ensure we set `binarySource=global`

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-05-15 15:40:22 +00:00
Jamie Tanna f8abdb86cd fix(maven-wrapper): only delete old JAR if performing updates to the properties file (#42141)
As reported in #41994, in 49fbc8392e, we
assumed that `updateArtifacts` would only ever be called when updating
the `maven-wrapper.properties`.

As this isn't always the case, and we may be updating a `mvnw` file, we
should check what we're about to delete, before we do.
2026-03-25 17:12:56 +00:00
Gašper Kojek 49fbc8392e feat(maven-wrapper): support checksum updates when updating versions (#40481)
* feat(maven-wrapper): support checksum updates when updating versions

When updating Maven distribution or wrapper versions, Renovate now updates
the corresponding SHA-256 checksums (distributionSha256Sum, wrapperSha256Sum)
by downloading the new artifacts and computing their hashes.

- Add HTTP client to fetch artifacts and compute SHA-256 checksums
- Update checksums before running wrapper:wrapper command
- Delete old maven-wrapper.jar to prevent checksum validation failures
- Handle maven-only updates when distributionSha256Sum is present
- Preserve old checksums on network failures (PR still created)

Closes #33444

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Gasper Kojek <gkojek@gradle.com>

* fix(maven-wrapper): strip checksums before wrapper:wrapper to avoid validation failure

When wrapper:wrapper runs, mvnw downloads the new JAR and validates it
against checksums in the properties file. With old checksums still present,
this validation fails. Now checksums are stripped before running
wrapper:wrapper and recomputed afterward.

Signed-off-by: Gasper Kojek <gkojek@gradle.com>

* fix(maven-wrapper): preserve distributionType when running wrapper:wrapper

Use existing distributionType from properties file or default to 'script'
when running wrapper:wrapper. This ensures JAR-based mode is preserved
for repos using checksums.

Signed-off-by: Gasper Kojek <gkojek@gradle.com>

* fix(maven-wrapper): Fix after merge

* test(maven-wrapper): cover checksum branches

* fix(maven-wrapper): preserve checksums on failures

* test(maven-wrapper): cover missing content branch

* Merge branch 'main' into gk/mavenWrapperChecksums-old

* main: (215 commits)
  fix(deps): update ghcr.io/renovatebot/base-image docker tag to v13.1.15 (main) (#40929)
  docs(terraform): clarify release timestamp and limitation (#40923)
  feat(gradle): allow specifying Gradle daemon heap size (#40090)
  fix(deps): update ghcr.io/renovatebot/base-image docker tag to v13.1.14 (main) (#40911)
  docs(minimum-release-age): clarify lack of support for non-Docker Hub (#40910)
  build(deps): update dependency re2 to v1.23.2 (main) (#40906)
  fix(deps): update ghcr.io/renovatebot/base-image docker tag to v13.1.13 (main) (#40899)
  fix(gitlab): skip automerge retry when merge_when_pipeline_succeeds already set (#39979)
  chore(renovate): enable maintenance branch (#40871)
  chore(deps): update dependency globals to v17.2.0 (main) (#40883)
  chore(deps): update dependency type-fest to v5.4.2 (main) (#40882)
  fix(deps): update ghcr.io/renovatebot/base-image docker tag to v13.1.12 (main) (#40880)
  fix(workers): re-attempt platform automerge only in case of new commits (#40028)
  build(deps): update dependency protobufjs to v8 (main) (#40878)
  chore(deps): update github artifact actions (main) (major) (#40876)
  chore(deps): update peter-evans/create-pull-request action to v8 (main) (#40877)
  chore(deps): update dessant/lock-threads action to v6 (main) (#40874)
  chore(deps): update dessant/label-actions action to v5 (main) (#40873)
  chore(deps): update dependency vite-tsconfig-paths to v6 (main) (#40872)
  chore(deps): update dependency @containerbase/semantic-release-pnpm to v1.3.18 (main) (#40669)
  ...

# Conflicts:
#	lib/modules/manager/maven-wrapper/artifacts.spec.ts
#	lib/modules/manager/maven-wrapper/artifacts.ts

* refactor(maven-wrapper): address PR review comments

(cherry picked from commit 9084d356496f6258dc0e846d926598f39b65cda3)

* fix: use named capture group in getChecksumValue

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

---------

Signed-off-by: Gasper Kojek <gkojek@gradle.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-13 15:36:42 +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
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +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
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
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
RahulGautamSingh 0ca7f888d6 fix(maven-wrapper): handle artifacts update with mvnw as package file (#38253)
* fix: handle mnvw as filename

* Update lib/modules/manager/maven-wrapper/artifacts.spec.ts
2025-09-27 08:18:17 +00:00
Sergei Zharinov 7c79c11285 fix: Always use default import from upath and semver-stable (#37325) 2025-08-05 11:01:45 +00:00
Michael Kriese 19c115c813 test: cleanup (#34785) 2025-03-13 17:52:09 +00:00
Michael Kriese 4f60a8b7fe test: mock git globally (#34783) 2025-03-13 15:48:02 +00:00
Michael Kriese 1644d9cb18 test: migrate more to vitest (#34500) 2025-02-26 15:45:17 +00:00
Trim21 6e5731b554 test: migrate from jest to vitest (#34499) 2025-02-26 14:18:38 +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
renovate[bot] cbef575a2c chore(deps): update linters to v6.20.0 (#26925)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-02-12 09:09:29 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Michael Kriese 84a97a62fa test(perf): improve test speed (#24323) 2023-09-08 11:40:04 +00:00
Rhys Arkins c7832e55f8 feat!: remove BUILDPACK env support 2023-07-04 19:21:52 +02: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
Jamie Magee 176282e65f chore: use node: protocol imports (#21181) 2023-03-28 21:05:36 +00:00
Michael Kriese ec4b17b8b6 feat(config)!: default dockerImagePrefix to containerbase (#20150)
Sidecar containers will now use `containerbase/` prefix instead of `renovate/` prefix.

BREAKING CHANGE: containerbase/ account used for sidecar containers instead of renovate/
2023-03-10 09:34:40 +01:00
Michael Kriese ac598aae98 test: fix tests on windows (#20412) 2023-02-14 21:39:04 +00:00
Trystian Offerman ad9f9d3f99 fix(manager/maven-wrapper): preserve wrapper base url (#20092)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-02-01 23:28:23 +01:00
Bart Enkelaar 744488f724 feat(maven-wrapper): Add manager to update maven wrapper version (#15660) 2023-01-23 17:07:57 +01:00