73 Commits

Author SHA1 Message Date
Michael Kriese 4ebd20edc9 feat(util/exec): look up jb versions from containerbase/jb-prebuild (#47303)
Co-authored-by: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
2026-10-23 11:28:22 +00:00
Michael Kriese dff2bd5068 refactor(util/exec): use isContainerbase from the base image package directly (#47247)
* refactor(util/exec): use isContainerbase from the base image package

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
Co-Authored-By: Claude Sonnet 5.5 <michael.kriese+claude-code@mend.io>

* refactor(util/exec): read CONTAINERBASE from the process environment only

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
Co-Authored-By: Claude Sonnet 5.5 <michael.kriese+claude-code@mend.io>

* refactor(util/exec): use isContainerbase from the base image package directly

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
Co-Authored-By: Claude Sonnet 5.5 <michael.kriese+claude-code@mend.io>

---------

Co-authored-by: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
2026-10-21 11:07:04 +00:00
Sebastian Poxhofer 0070fc5e6a refactor: remove unused exports and types (#47130)
Found with knip.
2026-10-17 09:10:12 +00:00
RahulGautamSingh df201a98ff fix(util/exec): pick tool releases compatible with their parent tool version (#47090)
* fix(util/exec): pick tool releases compatible with resolved node version

* refactor(util/exec): pass resolved runtimes as an object

* refactor(util/exec): match tools against their containerbase parent

* test(util/exec): run real constraints filtering for parent versions
2026-10-16 08:13:04 +00:00
Michael Kriese f64ec3975a fix(cache): build all cache keys with a shared helper (#46811)
* refactor(datasource): separate registry URLs in cache keys with a colon

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
Co-Authored-By: Claude Sonnet 5.5 <michael.kriese+claude-code@mend.io>

* fix(datasource/go): separate the remaining cache key parts with a colon

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>

* refactor(datasource): build cache keys with a shared colon-joining helper

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>

* refactor: build all cache keys with buildCacheKey

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>

* refactor(http): keep GET package cache keys as the bare URL

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>

* refactor(cache): extend cache key helper to memory cache keys

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>

* refactor(datasource/go): prefix the goproxy cache keys with their purpose

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>

---------

Co-authored-by: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
2026-10-10 10:46:09 +00:00
Jamie Tanna 7027ee5ced fix(util/exec): add a strong type for Containerbase's known tools (#46580)
* chore(util/exec): add a strong type for Containerbase's known tools

As noted in #41849, we currently don't have a way of enforcing the usage
of a `ContainerbaseToolName` being a tool that Containerbase actually
knows.

To handle this, we can use the new `@containerbase/base` and
`@renovatebot/base-image` packages to see what Tools we currently have
support for, and make sure that our types use the tools supported by
`@renovatebot/base-image` (and therefore `@containerbase/base`).

As well as the Typescript compilation error a user will receive, we can
add a test that provides a better note to the user about how to add a
new tool.

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

* fixup! chore(util/exec): add a strong type for Containerbase's known tools

* fixup! chore(util/exec): add a strong type for Containerbase's known tools

So we can get better confidence that we're not clashing with type names
between Containerbase tools and non-tool constraints.

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-10-09 12:12:53 +00:00
Michael Kriese 2ca2bc0ba0 fix(exec): re-run install-tool when switching back to an earlier tool version (#46823)
`install-tool` installs a version and also makes it the active one. The
memo skipped `install-tool` for any tool version already installed in the
run, so after A -> B -> A the last command ran on B. Track the active
version per tool instead and skip only when the requested version is
already active.

Co-authored-by: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
2026-10-07 16:15:34 +00:00
Jamie Tanna 4a0935d711 fix(util/exec): remove java-maven tool (#46587)
As it's not an official tool Renovate supports, and was added for
Mend-internal usage.

However, as we work towards #41849, we should make sure that we don't
document a tool that isn't used by Renovate.
2026-10-07 12:02:27 +00:00
Jamie Tanna b2135e41b7 fix(exec): memoise which install-tools we've run (#46084)
When running Renovate with `binarySource=install` on a repository with
many branches, the amount of time running `install-tool` - on already
installed tools - can take a significant percentage of the overall run.

For instance, on one repository we have instrumented with OpenTelemetry,
we see:

- initial `install-tool golang`: 8.7s
- follow-up `install-tool golang`: median 635ms, max 2.4s

However, because we run `install-tool golang` 640 times, this adds up to
24.8/29.2m (85%) of the repo's run time, which is an overwhelming
percentage when we're not even re-installing the tool.

To handle this more effectively, we can add an in-memory cache of all
the tools (and resolved versions) that we've installed in a given run.

We can't do this with `binarySource=docker`, as it has a fresh container
each time.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-09-14 20:33:10 +00:00
Victor Sollerhed 6d747ea8ff feat(manager): add apm manager for Agent Package Manager (#44390)
* feat(manager): add apm manager for Agent Package Manager

Add a new `apm` manager that updates git-pinned dependencies in APM
(Agent Package Manager) `apm.yml` manifests, as requested in
renovatebot/renovate#42507.

The manager parses the string entries under `dependencies.apm` and
`devDependencies.apm` (`[host/]owner/repo[/subpath]#<ref>`) and selects
the datasource dynamically from the git host, reusing the existing
github-tags, gitlab-tags and git-tags datasources. MCP entries carry no
pinnable version and are ignored.

When an `apm.lock.yaml` lockfile is present, it is refreshed by running
`apm install` via a new `apm` tool constraint (pypi `apm-cli`).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vfjt3BpqDriiVsvwqVe9M9

* fix(manager/apm): resolve apm tool from github releases

APM ships self-contained binaries as GitHub release assets
(apm-linux-<arch>.tar.gz under vX.Y.Z tags), not as the PyPI apm-cli
wheel. Point the apm tool constraint at the github-releases datasource so
the version Renovate resolves matches the artifact that actually gets
installed, stripping the leading `v` from the tag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vfjt3BpqDriiVsvwqVe9M9

* docs(manager/apm): point to canonical microsoft/apm repository

The APM project's canonical home is github.com/microsoft/apm (originally
danielmeppiel/apm). Update the manager URL and readme accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vfjt3BpqDriiVsvwqVe9M9

* refactor(manager/apm): validate manifest with zod schema

Address review feedback on the apm manager:

- parse `apm.yml` with a dedicated zod schema via
  `parseSingleYaml(content, { customSchema })` instead of casting the
  parsed YAML to `ApmManifest`
- `LooseArray(z.string())` keeps only the string dependency entries, so
  MCP objects and other non-string values are dropped by the schema and
  the manual `Array.isArray`/`is.string` guards are no longer needed
- drop the `as SkipReason` casts now that the literals are inferred
- remove the now-unused `types.ts`

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UbMAQBiMRNkCNxc8EGQw1C

* Update schema.ts

Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>

* Update readme.md

Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>

* Update readme.md

Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>

* refactor(manager/apm): simplify manifest schema and host detection

Address review feedback:

- default the `apm` array to `[]` in the schema (`LooseArray(...).catch([])`)
  since LooseArray already discards non-string entries, so downstream code
  no longer needs to handle `undefined`
- use `coerceArray` when mapping the optional dependency sections
- drop the redundant `host === 'github.com'` / `host === 'gitlab.com'`
  checks in datasource selection; `detectPlatform` already resolves those
  hosts (the explicit host comparison is only kept to decide registryUrls
  for self-hosted instances)
- document that APM only supports remote git references and that dots in
  repo names / subpaths are handled, with a regression test

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UbMAQBiMRNkCNxc8EGQw1C

* docs(manager/apm): fix readme trailing newline

Remove the trailing blank line left after the readme edits so it passes
`prettier` and `markdown-lint`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UbMAQBiMRNkCNxc8EGQw1C

* refactor(manager/apm): parse dependency path with named capture groups

Replace the manual host/owner/repo splitting (and the standalone dot
regex) with a single named-capture regex, as suggested in review. `owner`
excludes dots so the optional hostname segment is unambiguous, while repo
names and subpaths may still contain dots.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UbMAQBiMRNkCNxc8EGQw1C

* test(manager/apm): align admin config with InternalGlobalConfigOptions

`localDir` moved out of `RepoGlobalConfig` into `InternalGlobalConfigOptions`
on main, so annotate the test admin config as
`RepoGlobalConfig & InternalGlobalConfigOptions`, matching the other
manager artifacts specs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UbMAQBiMRNkCNxc8EGQw1C

* fix(manager/apm): resolve GitLab nested groups and recognize SHA-pinned refs

- resolve nested GitLab project slugs (e.g. `group/subgroup/project`)
  instead of capping at `owner/repo`, splitting the project from any
  virtual-package subpath using APM's primitive-dir / virtual-file markers
- recognize the documented SHA-pinned form and skip it
  (`unversioned-reference`) rather than treating the SHA as a version or
  rewriting it

* feat(manager/apm): support digest pinning for SHA-pinned deps

Recover the release tag from the trailing YAML comment of a SHA-pinned
entry (`owner/repo#<sha> # v2.0.0`) - which the structured parse strips -
so it extracts as a digest (`currentDigest` + `currentValue`) and updates
both via `pinDigests`, mirroring the github-actions manager. A bare SHA
with no tag comment (or a quoted form we can't rewrite verbatim) is left
skipped.

* fix(manager/apm): map SHA-pin tag recovery per line to handle duplicates

The raw-manifest scan matched the first line for the entry regardless of
section, so the same `owner/repo#<sha>` pinned in both `dependencies` and
`devDependencies` resolved to the first line's tag/replaceString. Consume
each line at most once (in file order) so duplicate pins map to distinct
lines.

* fix(manager/apm): recognize `.chatmode.md` virtual files

APM's VIRTUAL_FILE_EXTENSIONS includes `.chatmode.md`; add it to the
subpath-boundary regex so a `*.chatmode.md` virtual dependency on a
nested-group host (GitLab, Azure DevOps) is not folded into the repo path.

* test(manager/apm): cover SHA-pin digest updates on git-tags hosts

Lock in that a SHA-pinned dep on a non-github/gitlab host resolves via the
git-tags datasource (which supports `getDigest` through `git ls-remote`),
so the commit is preserved on a bump rather than dropped.

* fix(manager/apm): commit regenerated harness files, not just the lockfile

`apm install` re-deploys the harness directories APM consumers commit
(`.github/`, `.claude/`, ...), but updateArtifacts only returned
`apm.lock.yaml`, leaving instruction files stale after a bump. Capture
every file the install changed via `getRepoStatus` (additions +
deletions); the gitignored `apm_modules/` cache is excluded, and the
manifest stays with `updatedPackageFiles`.

* fix(manager/apm): declare lockFileMaintenanceIsDelegatedToPackageManager

main now requires managers with `supportsLockFileMaintenance` to set this
field. apm regenerates the lockfile via `apm install`, so it delegates to
the package manager (`true`).

* refactor(manager/apm): reuse shared regex and git-sha helpers

Adopt the shared utilities per review:

- use the exported `newlineRegex` from `util/regex` instead of a local copy
- use `isLongCommitSha` from `util/schema-utils/git` instead of a bespoke
  SHA regex
- filter path segments with `isTruthy` instead of `Boolean`

* test(manager/apm): align docker exec snapshot with current base-image wrapper

The shared `util/exec` docker wrapper now injects `-e CI` and single-quotes
the `bash -l -c` payload. Update the docker-mode expectation to match, so the
snapshot tracks the current wrapper output.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2026-09-02 16:17:15 +00:00
Sebastian Poxhofer 97327c3d28 refactor(linters): add prefer-coerce-array rule (#45492)
* refactor(linters): add prefer-coerce-array rule

Refs #45217

`x ?? []` and `coerceArray(x)` say the same thing, but only the second
one is searchable and consistent. The rule flags a `??` whose default is
a bare `[]` literal; a non-empty default or an asserted `([] as Foo[])`
still passes.

Applying it across `lib/` surfaced three spots the helper cannot cover,
which keep `?? []` with a disable comment or a narrower fix:

- `package-files.ts` destructures a tuple, which `coerceArray()` widens
- `generate.spec.ts` defaults `matchAll()`, an iterator rather than an array
- `mise/upgradeable-tooling.ts` declares a `Record` return, so its
  `?? []` fallback was wrong to begin with and becomes `coerceObject()`

* refactor(platform/github): hoist the GHE version header lookup

`Object.entries(...).find()` returns a tuple, and defaulting it with
`?? []` only to destructure the second element reads as an array
default when it is not one. Name the found entry instead, which drops
the `?? []` rather than routing a tuple through `coerceArray()`.
2026-08-28 09:27:58 +00:00
Sebastian Poxhofer a1971afa78 fix(linters): add linting rule to enforce usage of our regEx utility (#44690)
* ci(linter): add renovate/require-regex-util rule

Adds a custom oxlint rule that flags raw RegExp usage in lib/
production code: any `new RegExp(...)` call and any regex literal
that is not the direct first argument of `regEx(...)`. The regEx()
helper from lib/util/regex.ts uses the RE2 engine for ReDoS-safe
matching and caches compiled patterns. lib/util/regex.ts itself is
exempt.

The rule is disabled for **/*.spec.ts, test/**, and tools/** via
config overrides, because vitest APIs such as expect.stringMatching
need bare RegExp instances (a past commit reverted regEx() there).

Severity is set to "warn" instead of "error": the repo currently has
197 pre-existing violations (above the agreed mechanical-fix
threshold of 80), and a number of them are deliberately
RE2-incompatible patterns (lookahead/lookbehind/named backreferences,
see TODO #12872/#12875 markers in e.g. lib/modules/versioning/rez/
pattern.ts and lib/modules/manager/dockerfile/extract.ts) that need
per-site judgment before they can be wrapped in regEx() or suppressed
with a justified disable comment. No violation fixes are included in
this commit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci(linter): enforce renovate/require-regex-util at error

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor: use regEx() for regex literals and RegExp construction in lib

Burn down all renovate/require-regex-util violations (197):

- wrap RE2-compatible regex literals and RegExp constructions in regEx()
- rewrite lookaround patterns where behavior is provably preserved:
  goproxy separator split, sbt-package link extraction, leiningen
  comment stripping and keyword search, npm GitHub owner validation
  (unit-count bound replaced by an explicit length check)
- keep native RegExp with disable comments where RE2 cannot be used:
  moo / good-enough-parser lexer patterns (moo rejects RE2 instances),
  MigrationsService propertyName (matched via isRegExp, which RE2
  instances fail), rez named backreferences and lookaheads, GitHub
  markdown link negative lookbehind, emoji astral-plane matching
- drop stale TODO #12875 comments for patterns current re2 handles

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor: reduce require-regex-util disable comments

Rewrite the github massage-markdown-links URL regex to capture an
optional `api.` prefix in a named group (skipped in code) instead of
relying on a negative lookbehind, so both the base and global variants
can use regEx()/RE2 and their two disable comments are removed. Add
spec cases for api-prefixed URLs that match the URL shape.

Consolidate the four related line disables in rez/pattern.ts (bound and
range patterns emulating Python conditional patterns via named
backreferences and lookaheads, which RE2 cannot express) into a single
block disable/enable pair, matching the treatment of the lexer files.

Disable comment count drops from 13 to 8.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(datasource/sbt-package): use named capture group in link regex

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(manager/cake): restore original multiLineComment regex spelling

The [^] -> [\\s\\S] rewrite was only needed for an RE2 wrap that was
later reverted; keep the diff minimal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(datasource/go): skip empty GOPROXY segments

The switch from a lookahead split to a capture-group split (needed because
RE2 has no lookahead support) changed how empty GOPROXY segments parse:
`a|,b` yielded `{ url: ',', fallback: '|' }` before and
`{ url: '', fallback: ',' }` after. The comma fallback only continues on
404/410, so a failing proxy ahead of an empty segment silently stopped the
lookup instead of falling through to the remaining proxies.

Empty segments carry no url to query, so drop them.

* refactor(datasource/go): use isTruthy for empty segment filter

* fix(datasource/go): filter empty segments before mapping

Filtering after the map broke the contextual typing from the
GoproxyItem[] annotation, widening fallback to string.

* refactor(platform/github): use regEx() for merge queue query stripping

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 14:30:46 +00:00
Jamie Tanna 45372476c8 feat(util/exec): add support for gh tool (#45192)
* feat(deps): update ghcr.io/renovatebot/base-image docker tag to v13.84.0

| datasource | package                        | from    | to      |
| ---------- | ------------------------------ | ------- | ------- |
| docker     | ghcr.io/renovatebot/base-image | 13.83.0 | 13.84.0 |

* feat(util/exec): add support for `gh` tool

As a prerequisite for #44753 and #45190, we need to support the `gh`
CLI.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-10 13:55:09 +00:00
Sebastian Poxhofer 9717259ffc refactor(oxlint): enable no-else-return and unicorn/no-lonely-if (#44553)
Enable no-else-return (with allowElseIf: false) and unicorn/no-lonely-if
as errors in .oxlintrc.json and fix all 131 pre-existing violations
(91 no-else-return, 40 unicorn/no-lonely-if) across 98 files.

The no-else-return violations were fixed with the oxlint autofix
(iterated to a fixpoint, plus two else-if chains that required
--fix-dangerously) followed by Prettier formatting. One comment dropped
by the autofix in lib/modules/manager/pub/artifacts.ts was restored
manually. The unicorn/no-lonely-if violations were merged by hand,
preserving comments and coverage-ignore hints.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:11:21 +00:00
Jamie Tanna b8c4eb2088 fix(containerbase): support constraints.rust=nightly (#43543)
As noted in #43489, it's not currently possible to install the nightly
variant of Rust.

Although Containerbase does have support for `install-tool rust nightly`
it never gets that far, as the version lookup occurs through the
`docker` datasource.

We can instead make sure we move to the `rust-version` datasource and
its associated `rust-release-channel` versioning.

The result from the `rust-release-channel` returns a version like
`nightly-2026-06-19`, which needs extra handling in Containerbase.

We can also update **??** what supported Rust versions we'd accept.
2026-06-19 17:50:41 +00:00
Gregor Zeitlinger a2b96944f9 feat(mise): add lock file support (#42591)
* feat(mise): add lock file support

- Add lockfile.ts with getLockFileName() for deriving lock file paths
- Add artifacts.ts with updateArtifacts() and updateLockedDependency()
- Add MiseLockFile Zod schema for parsing lock files
- Update extract.ts to be async and extract lockedVersion from lock files
- Export supportsLockFileMaintenance, lockFileNames, updateArtifacts, updateLockedDependency

* refactor(mise): remove redundant comments

Remove comments that simply restate what the code already clearly
communicates. Keep valuable comments that explain non-obvious behavior
(e.g., why temporary errors are rethrown) and move helpful examples
into JSDoc comments.

* fix(mise): improve lock file version lookup and add tests

- Fix lock file key lookup for non-registry tools (aqua:, ubi:, etc.)
  Registry tools use short names (node), non-registry use full names
  (aqua:cli/cli). New getLockedVersion() tries both patterns.

- Add injection prevention test for shell quoting
- Add update-failed test for error handling
- Add comprehensive tests for getLockedVersion()
- Add null check for depName in updateLockedDependency
- Add JSDoc to updateArtifacts and extractPackageFile
- Add lock file support documentation to README
- Remove code duplication by consolidating into lockfile.ts

* fix(mise): pass --local flag and MISE_ENV for env/local config files

When updating mise.local.toml, `mise lock` updates mise.lock, not
mise.local.lock. Add --local flag to target the correct lock file.

For env-specific configs (mise.test.toml), set MISE_ENV=test so mise
reads and locks the correct configuration.

Extracted getConfigType() from getLockFileName() to share the parsing
logic between lock file name derivation and command flag generation.

Builds on #42099 by altendky.

* test(mise): cover tool absent from lock file

* refactor(mise): remove dead branches in extractPackageFile

tools is required by MiseFile schema so if(tools) is always true.
depName is always set by createDependency so if(dep.depName) is always true.

Add test for tool absent from lock file to cover the lockedVersion
assignment branch.

* fix(mise): address review feedback on lock file support

* fix(mise): remove unsupported tool constraint

* fix(mise): add containerbase tool definition

* fix(mise): add typed exec constraint support

* fix(config): restore requireConfig typing

* test(mise): await registry extraction cases

* Update lib/modules/manager/mise/artifacts.ts

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

* fix: revert unrelated types cleanup

* fix: drop missing VersioningName import

* fix(mise): use npm versioning string after import removal

* test(mise): set binarySource=global in artifacts spec

GlobalConfig.get now returns defaults; without explicit binarySource the
test fell into containerbase dynamic install and tried to resolve the
mise version via the github-releases datasource, causing missing HTTP
mock errors. Force binarySource=global so the spec only exercises the
mocked exec path.

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2026-05-19 15:23:23 +00:00
Jamie Tanna 0a1b54a852 feat(manager/renovate-config): extract constraints (#42873)
* feat(manager/renovate-config): extract `constraints`

As noted in #41571, it would be useful to detect and suggest updates
when specifying `constraints` in Renovate config, where it's a known
tool we provide versioning information for.

We can extend our existing `renovate-config` manager to add support for
`constraints` that are known Containerbase tools.

We can support top-level `constraints` as well as `constraints` inside
`packageRules`.

* refactor(renovate-config): remove nesting
2026-05-06 18:16:09 +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
Hajime-san 0004fcf69b feat(managers): add Deno manager support (#37828)
* works

* fix ci

Base branch is: main
Base branch ref for this PR is: c3a9360ecd
❌ Error: Snapshots have been added in this PR. Use toMatch instead.

* fix ci

Base branch is: main
Base branch ref for this PR is: c3a9360ecd
✅ Snapshot code check passed.
Added files in '__fixtures__':
lib/modules/manager/deno/__fixtures__/.gitignore
lib/modules/manager/deno/__fixtures__/npm-compat-workspace/deno.lock
lib/modules/manager/deno/__fixtures__/npm-compat-workspace/package.json
lib/modules/manager/deno/__fixtures__/npm-compat-workspace/sub/package.json
lib/modules/manager/deno/__fixtures__/workspace-01/deno.json
lib/modules/manager/deno/__fixtures__/workspace-01/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-01/docs/deno.json
lib/modules/manager/deno/__fixtures__/workspace-01/docs/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-01/packages/pkg1/deno.jsonc
lib/modules/manager/deno/__fixtures__/workspace-01/packages/pkg1/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-02/deno.json
lib/modules/manager/deno/__fixtures__/workspace-02/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-02/docs/deno.json
lib/modules/manager/deno/__fixtures__/workspace-02/import_map.json
lib/modules/manager/deno/__fixtures__/workspace-03/deno.json
lib/modules/manager/deno/__fixtures__/workspace-03/deno.lock
lib/modules/manager/deno/__fixtures__/workspace-03/node/package.json
Total number of added files in '__fixtures__': 17
Deleted files in '__fixtures__':

Total number of deleted files in '__fixtures__': 0

Updated total number of added files in '__fixtures__': 17
Updated total number of deleted files in '__fixtures__': 0
❌ Error: More files have been added to '__fixtures__' directories than deleted.
Error: Process completed with exit code 1.

* nit fix

* fix import map

* remove unnecessary mock

* nested workspace is invalid

* cleanup to postExtract

* revert JSR datasource files

* move to schema

* move

* cleanup lock

* importMapReferrer

* cleanup artifact test

* comment

* remove support deno-cli detailed behaviour due to complexity

* cleanup

* fix schema

* cleanup

* schema for updateDependency

* nit

* lint

* update doc

* tmp-promise

* no need filter deno

* returns an error

* remove delete lockfile

* store the importMapReferrer result

* constraints

* use parseJson

* remove processDenoCompatiblePackageJson

* move to types.ts

* Update lib/modules/manager/deno/post.ts

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

* Revert "Update lib/modules/manager/deno/post.ts"

This reverts commit 64bd57649c.

* Revert "remove delete lockfile"

This reverts commit e701333519.

* Reapply "remove delete lockfile"

This reverts commit 89c3d79a43.

* remove comment

* bump ci

* fix eslint

* Apply suggestion from @RahulGautamSingh

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

* Update lib/modules/manager/deno/compat.spec.ts

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

* Update lib/modules/manager/deno/post.ts

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

* Update lib/modules/manager/deno/compat.spec.ts

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

* prettier

* Revert "Reapply "remove delete lockfile""

This reverts commit 85af6a506e.

* falling back for lockFileMaintenance

* mock statically

* use mockExecAll

* avoid cloning

* avoid cloning

* add `.ts` extension

* fix versioning

* fix `.ts` extension

* c8

* c8 update

* c8 post

* c8 extract

* c8 versiong

* c8 schema

* c8 compat

* revert deno versioning

* pnpm lint-fix

* lockFileNames

* zod/v3

* comment

* Apply suggestions from code review

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

* Apply suggestions from code review

review batch lib/modules/manager/deno/compat.ts

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

* fix import

* fix

* Apply suggestions from code review

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

* isObject

* Apply suggestions from code review

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

* named import @sindresorhus/is

* Apply suggestions from code review

* review

* rm test

* Apply suggestions from code review

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

* Redundant radix parameter.

* review

* review

* c8 lib/modules/manager/deno/update.ts

* fix

* named import

* clean up

* rm unnecessary

* named import

* Missing radix parameter.

* better

* move to beforeAll

* `lockFile` to `fileName`

https://github.com/renovatebot/renovate/pull/41631

* `lockFile` to `fileName`

https://github.com/renovatebot/renovate/pull/41631

* Update lib/modules/manager/deno/schema.ts

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

* update containerbase

* oxlint

* refactor for

https://github.com/renovatebot/renovate/pull/42253

* Apply suggestions from code review

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

* use `Record`

* use type `Upgrade`

* update README.md

---------

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-04-29 14:36:41 +00:00
Jamie Tanna 53dcdba84d fix(validation): validate constraints (#42825)
* fix(validation): validate `constraints`

To provide better coverage for our users of what is a valid option for a
`constraints` value, we can validate the overall format of the
`constraints` block, as well as the given names of constraints.

Where we have a Tool defined, we can use the default versioning for that
Tool to validate the constraint's value.

For now, both the validation of the `constraints`' value, and the
validation of `constraints`' names will be a warning, but in the future
may be made an error.

* chore(validation): remove check for `compatibility`

As this was renamed in #7308. It's been long enough since then that we
can remove this check.

* chore(validation): add logger in `else` case

For coverage fix, and also to provide insight when this does happen

* fixup! chore(validation): add logger in `else` case

* fixup! chore(validation): add logger in `else` case

* key

* coverage

* Remove duplicate function

As it's been pulled in via another PR.

* fixup! docs(constraints): document the possible `constraints` and `installTools` (#42837)

As it can't be `undefined`.

* test: coverage

And more whitespace to make it clearer they're two separate `if` blocks.

* typo

* typo

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-04-28 10:21:41 +00:00
Jamie Tanna 8278ce5370 docs(constraints): document the possible constraints and installTools (#42837)
* docs(constraints): list the possible `constraints` and `installTools`

Now we have a stronger type for what a valid tool constraint is, and
what additional constraints are, we should be very explicit with what
each option is, and specify them in the `constraints` as well as our
`installTools` docs.

* test: add coverage

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

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-04-26 16:13:09 +00:00
Jamie Tanna 1044a80642 chore(types): add a strong type for ToolName and ConstraintName (#42589)
* chore(types): add a strong type for `ToolName`s

Until #41849, we can use our local definitions of the tool names that
Containerbase supports by extracting out a `ToolName` type.

* fixup! chore(types): add a strong type for `ToolName`s

Co-authored-by: Claude Opus 4.6 <jamie.tanna+claude-code@mend.io>
Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>

* fixup! fixup! chore(types): add a strong type for `ToolName`s

* no-never

* simplify

* coverage

* sq

* warn

* sq

* fixup! sq

* sq

* fixup! sq

---------

Co-authored-by: Claude Opus 4.6 <jamie.tanna+claude-code@mend.io>
Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>
2026-04-14 08:55:42 +00:00
Michael Kriese 440e353145 chore: use ts extension (#42300) 2026-04-01 07:46:34 +00:00
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
Sergei Zharinov 2b0e80b884 feat!: Switch to ESM modules (#40756) 2026-01-29 14:21:41 +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 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
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
Michael Kriese 871d9db367 feat(datasource/java-version): support os and architecture filter (#37254) 2025-08-01 12:11:16 +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
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
Trim21 2da6478b62 feat(manager/pixi): use conda versioning for tool contrainst (#35118) 2025-04-01 05:41:58 +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
Michael Kriese 3f0f6a04b6 build: compile with nodenext target (still cjs) (#34584) 2025-03-04 07:37:06 +00:00
Rhys Arkins 492a0fefab fix(containerbase): use prebuild repos (#34470) 2025-02-26 05:59:57 +00:00
Will Brennan dab6fa1a4e fix(devbox): add devbox install tool to containerbase (#34002) 2025-02-06 06:08:57 +00:00
Rhys Arkins c4d4658569 chore: ensure versioning/versioningApi used consistently (#31856) 2024-10-08 15:24:46 +00:00
Mathieu Kniewallner e8d872f7d1 feat(managers): add support for uv universal locking (#30756)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-08-19 14:34:22 +00:00
jeanluc 70376ccfa8 feat(manager/copier): Implement manager (#29215) 2024-08-06 08:07:27 +00:00
Jason Sipula 283cda0f29 feat: support gleam lang (#30345)
Co-authored-by: cdaringe <cdaringe@gmail.com>
Co-authored-by: Christopher Dieringer <cdaringe@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-07-31 20:29:06 +00:00
Hans Knecht db1b0d8b66 feat(vendir): add vendir support (#25113)
Co-authored-by: Zoltán Reegn <reegnz@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Zoltán Reegn <zoltan.reegn@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-03-21 15:46:10 +00:00
RahulGautamSingh 290e15752e fix(containerbase): support ranges in flutter and dart sdks (#26535) 2024-01-07 13:11:57 +00:00
Michael Kriese 7d2a3018d9 fix(containerbase): remove circular datasource import (#25685) 2023-11-10 08:39:49 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Rhys Arkins c11170fabb feat(npm)!: drop explicit lerna support (#24542) 2023-09-27 14:29:07 +02:00
Rhys Arkins d036c044c9 feat: initial bun support (#24464)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-09-18 18:10:00 +00:00
Rhys Arkins c7832e55f8 feat!: remove BUILDPACK env support 2023-07-04 19:21:52 +02:00
Rhys Arkins f017f05fbb chore(containerbase): log details when no releases found (#23008) 2023-06-27 13:42:41 +00:00