38 Commits

Author SHA1 Message Date
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
Gregor Zeitlinger 0d9888a4f2 feat(datasource): add GraalVM version datasource (#40497)
* feat(datasource): add GraalVM version datasource with support for JDK and JRE releases

* feat(datasource): add GraalVM version datasource with support for JDK and JRE releases

* feat(datasource): add GraalVM version datasource with support for JDK and JRE releases

* feat(datasource): add GraalVM version datasource with support for JDK and JRE releases

* feat(datasource): add GraalVM version datasource with support for JDK and JRE releases

* add coverage

* fix

* fix

* fix

* code cov

* code cov

* code cov

* refactor(datasource): integrate GraalVM into java-version datasource

Merges graalvm-version datasource into java-version as a unified multi-vendor
Java distribution datasource. Implements vendor-based modular architecture with
routing layer for Adoptium (Eclipse Temurin) and Oracle GraalVM.

Architecture:
- Vendor-specific handlers (adoptium.ts, graalvm.ts) with routing in index.ts
- Vendor-aware system detection with different arch/os mappings per vendor
- Custom registry support for GraalVM's mise-java API
- Adoptium remains the default registry for backwards compatibility

Package names:
- New explicit: adoptium-jdk, adoptium-jre, oracle-graalvm-jdk, oracle-graalvm-jre
- Legacy (map to Adoptium): java, java-jdk, java-jre

Changes:
- Created adoptium.ts and graalvm.ts vendor handlers
- Enhanced common.ts with vendor detection and vendor-specific system mappings
- Updated index.ts with routing layer and custom registry support
- Merged test suites with comprehensive coverage for both vendors
- Updated mise manager integration to use JavaVersionDatasource
- Removed graalvm-version datasource directory

All 65 datasource tests and 93 mise manager tests passing.

* fix

* test(datasource): add coverage for non-HttpError paths in java-version

* fix(datasource): remove dead code and add coverage for java-version

Remove unreachable HttpError handling from _getReleases catch block
since both getAdoptiumReleases and getGraalvmReleases handle HttpError
internally. Add test for the graalvmRegistryUrl fallback when
registryUrl is undefined.

* fix(datasource): address review comments for GraalVM datasource

- Remove unused 'datasource-graalvm-version' cache namespace
- Convert MiseJavaRelease interface to Zod schema and derive type from it
- Use http.getJson() with the Zod schema in getGraalvmReleases instead
  of getJsonUnchecked, letting the schema handle invalid/empty responses
- Update getGraalvmReleases test mock to use getJson

* docs: remove unused datasource-graalvm-version from cacheTtlOverride docs

* fix(datasource): preserve Adoptium config typing

* fix(datasource): harden GraalVM release parsing

* fix(datasource): address GraalVM review feedback

* test: cover GraalVM mise package mapping

* test(datasource): cover default GraalVM registry fallback

* test(datasource): cover legacy registry resolution

* test(datasource): type legacy datasource mocks

* fix(datasource): harden GraalVM defaults and responses

* refactor(datasource): use function-only registry accessors

* test(datasource): cover registry accessor functions

* test: restore coverage exclusions

* chore: retrigger CI checks
2026-09-23 08:40:24 +00:00
Sebastian Poxhofer 1e6ffa8171 refactor(datasource): add cached() helper to the Datasource base class (#46102)
Every datasource that caches its releases hand-wrote the same
`withCache({ namespace: `datasource-${id}`, ... }, () => this._getReleases(config))`
wrapper, repeating the namespace literal and using underscore-prefixed
method names that `docs/development/best-practices.md` discourages.

Add `Datasource.cacheNamespace` (derived from the datasource id) and a
protected `Datasource.cached()` helper that defaults `namespace` to it,
exporting `CachedOptions` from `with-cache.ts`. Migrate 29 datasources
onto the helper, dropping their namespace literals, the static
`cacheNamespace` field in `github-digest`, and renaming the wrapped
`_getX` methods to `fetchX`.

Behaviour change: `golang-version` used the constant cache key `'all'`
while declaring `customRegistrySupport = true`, so a custom registryUrl
shared the cache entry with the default one. The key is now
`${config.registryUrl}`, which invalidates existing entries once.
2026-09-22 19:30:25 +00:00
Jamie Tanna 0253f4b23e fix(manager/dockerfile): don't attempt to update apk/apt for unknown image families (#46325)
If we don't discover the image family for a given image, instead of
suggesting a package update that may not exist - as we may look up a
`defaultRegistryUrls` entry that doesn't match the distro we're using -
we should not suggest any update.

In these cases, we can specify the `skipReason: unknown-registry`.

In #45706, we'll try and auto-detect this where possible.

Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
2026-09-18 15:59:58 +00:00
Jamie Tanna 6add79a9a5 feat(manager/dockerfile): extract apt install packages from RUN instructions (#46247)
* feat(manager/dockerfile): extract `apt install` packages from `RUN` instructions

Similar to the support we've recently added for extracting `apk`
packages in `Dockerfile`s, we can also extract `apt install` and
`apt-get install`s.

We can build on top of our shared extraction layer, and:

- preserving an `:arch` qualifier when replacing the version
- skipping versions/constraints we can't update

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

* docs(manager/dockerfile): clarify where to find skipped logs

---------

Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
2026-09-18 08:25:59 +00:00
Michael Kriese 3a723b7891 test(datasource): close branch coverage gaps (#45943)
* test(versioning/aws-machine-image): cover the empty version guard

`_parse()` returns null for a falsy version before it tries the AMI id
regex, and no test passed one. Checking that an empty string is not
valid closes the only branch the module was missing.

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

* test(datasource/buildpacks-registry): cover a response without a homepage

`latest.homepage` is optional in the registry response, but every test
supplied one, so the release result was never built without it. A
buildpack whose latest entry carries no homepage now checks that the
releases still come back and no source url is derived.

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

* test(datasource): cover optional-field branches in four datasources

Each of these datasources builds its release result by attaching fields
only when the registry supplies them, and the "not supplied" path was
never exercised:

- cdnjs: a library with neither homepage nor repository
- cpan: a search result where no release is marked latest, so no tag
- dart: a latest release carrying no pubspec
- ruby-version: a release table row whose first column is not a version

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

* test(datasource): cover missing-metadata branches in hex and pypi

Two more datasources only attached fields when the registry supplied
them, and the absent case was untested: a hex package with neither an
html_url nor a github link in its meta, and a pypi response carrying no
releases at all.

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

* test(datasource): cover galaxy and repology fallbacks, mark unreachable guards

Adds a galaxy role with empty github fields, so no source url is
derived, and a repology lookup where the api fallback after a 403 finds
no matching package.

Marks four guards that are not worth a test: cpan and dart both check a
variable that is only null when the request threw, and
`handleGenericErrors()` always rethrows; conan's registry url is always
supplied by the datasource layer; and repology's resolver either returns
a body or throws.

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

* test(datasource): cover pod CDN branches, mark the sbt listing guards

Adds two pod lookups: an empty CDN body, and a CDN index that lists no
matching pod.

Marks the guards whose tests would need multi-level directory listing
fixtures: both sbt datasources walk nested index pages, and pod's github
helper checks a body that an empty json response never produces because
parsing throws first.

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

* test(datasource): cover maven metadata without a latest tag

Adds maven metadata carrying a release but no latest, so respectLatest
is left alone. Marks the three deb guards, which would each need a
crafted package index: a block missing a required key, a repeated
package in the final block, and two component indexes whose meta agrees.

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

* test(datasource): cover npmrc registry fallback, mark cache-bound guards

Adds a resolveRegistryUrl lookup for a package no npmrc rule matches.

Marks the guards whose tests would need a primed cache or a specific
blob shape: nuget's services index, deno's release cache, the docker hub
cache window, docker's manifest and config handling, go's pseudo-version
fallback, and both rubygems cache layers.

Three implicit elses are left counted: a coverage-ignore hint does not
attach to an `else if`, so the registry strategy chain, the npmrc reset
and docker's digest-header branch carry a plain note instead.

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

* fix(datasource/repology): pass the mock body as a string

`ResponseMock.body` is typed as a string, and every other call in the
spec passes `'[]'`. The new api fallback test passed an array literal,
which tsc rejected.

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

---------

Co-authored-by: Claude Opus 5 <michael.kriese+claude-code@mend.io>
2026-09-14 12:11:52 +00:00
Sebastian Poxhofer b2d3b64c48 refactor(lint): enforce err key for errors in logger metadata (#45759)
* refactor(lint): enforce err key for errors in logger metadata

* refactor(lint): flag error message and stack strings in logger-err-key
2026-09-09 13:55:14 +00:00
Sebastian Poxhofer 05e1271376 test: use expect().resolves instead of awaiting inside expect (#45672)
Enables the vitest/prefer-expect-resolves oxlint rule and applies its
autofix across the spec suite.
2026-09-04 10:40:46 +00:00
Sebastian Poxhofer a473e73b3e fix(linters): forbid inert counts in v8 coverage-ignore comments (#45287)
Adds a custom oxlint rule renovate/v8-ignore-no-count that flags the
count form '/* v8 ignore next <N> */'. The count is not honored by
vitest's ast-v8-to-istanbul hint parser, which captures only the
keyword (if/else/next/file); 'next' always exempts exactly the next
AST node. Trailing counts therefore suggest a line range that is never
applied and mislead readers.

The rule is autofixable (drops the count, preserving actual behavior)
and has been applied to all existing occurrences.
2026-08-22 11:25:31 +00:00
Sebastian Poxhofer 41da033756 refactor: remove escapeRegExp and replace with RegExp.escape (#45322) 2026-08-18 06:24:47 +00:00
Sebastian Poxhofer ad0b59f8b7 refactor(oxlint): enable vitest/require-to-throw-message (#44421) 2026-07-07 17:47:04 +00:00
Felipe Santos 392105b7c6 chore(oxlint): enable unicorn plugin and prefer-node-protocol (#43283)
chore(oxlint): enable unicorn plugin and prefer-node-protocol
2026-05-29 06:55:58 +00:00
Sebastian Poxhofer 9a27d7aa78 ci(prettier): add prettier plugin for admonitions (#43615)
* ci: add local mkdocs-admonitions plugin for prettier to allow admonition preservation

* docs: remove uses of `prettier-ignore` for admonitions

* test: rather use await expect

* chore: use named group exclusively
2026-05-27 09:39:52 +00:00
Jamie Tanna 33e857e04a docs: migrate all admonitions and lists to using 2-space indents (#43607)
* docs: ensure 2 spaces used for generated admonitions

As a follow-up to 4b0146ab7b and
1844916259b6dc17f532e491eb93f6116327c324., this correctly renders
admonitions with 2 spaces (1 indent).

* fixup! docs: use 2-space indentation for Markdown (#43537)

Plus using 3-space for mixed-style `<ul>` and `<ol>`s.

* fixup! docs: use 2-space indentation for Markdown (#43537)

As otherwise it breaks the rendering of the table.
2026-05-26 20:03:23 +00:00
Sebastian Poxhofer 0793274b86 refactor: prefer templates rather than + in test files (#43441)
refactor: prefer templates rather than `+`
2026-05-19 09:52:28 +00:00
Sebastian Poxhofer 03baf6ee4a test(noNewURL): add new rule enforcing parseUrl() from 'lib/util/url.ts' (#43247)
* test(noNewURL): add new rule enforcing parseUrl() from 'lib/util/url.ts'

* replace newURL with parseUrl

* remove non-null assertions marks if appropiate

* test: add additional tests

* test: add additional tests and ignore where it makes sense

* implement suggestions

* test: further improve coverage

* apply suggestion
2026-05-13 16:23:10 +00:00
renovate[bot] 766db6fc6f build(deps): update dependency upath to v3 (main) (#43121)
* build(deps): update dependency upath to v3

| datasource | package | from  | to    |
| ---------- | ------- | ----- | ----- |
| npm        | upath   | 2.0.1 | 3.0.7 |

* chore: fix types

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-05-06 12:09:33 +00:00
Sergei Zharinov 7df11ed734 chore(lint): add enforce-ts-extension oxlint rule (#42389)
* refactor(lint): extract custom oxlint rules into separate files

Split `tools/lint/rules.js` into one file per rule under
`tools/lint/rules/`. Also simplify `test-root-describe` with
early-exit guard clauses.

* feat(lint): add `enforce-ts-extension` oxlint rule

Add a custom JS-based oxlint rule that enforces `.ts` extensions on
local imports. The rule catches two problems:

- `.js` extension used instead of `.ts` (auto-fixable)
- missing file extension entirely (report only)

Checked locations:
- static import/export declarations
- dynamic `import()` expressions
- vitest module APIs: `vi.mock`, `vi.doMock`, `vi.unmock`,
  `vi.doUnmock`, `vi.importActual`, `vi.importMock`

Both relative paths (`./`, `../`) and path aliases (`~test/`)
are treated as local. Package imports are ignored.

Also fixes 26 pre-existing violations across 18 spec files.

* Update tools/lint/rules/enforce-ts-extension.js

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

---------

Co-authored-by: Anne Stellingwerf <1637358+astellingwerf@users.noreply.github.com>
2026-04-07 15:36:16 +00:00
Michael Kriese b35d7c9cad chore(tools): use async execa (#41712)
* chore(tools): use async execa

* chore: fix lint errors
2026-03-10 16:55:44 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +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 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 5c796e1a47 refactor: replace nanoid with crypto.randomUUID (#40695)
refactor: replace nanoid with `crypto.randomUUID`
2026-01-26 16:40:12 +00:00
Sergei Zharinov 558bdc159d feat: Cleanup mutexes before each run (#38987)
* feat: Cleanup mutexes before each run

* Update setup.ts

* Update mutex.spec.ts

* Update setup.ts

* Unmock mutex in deb datasource spec to prevent race condition

* Update index.spec.ts
2025-11-15 21:24:43 +00:00
Steffen Sassalla 5d36cf1d14 refactor(deb): Split DebDatasource in smaller pieces and prepare for mutli-compression feature (#38254)
refactor(deb): Split  DebDatasource in smaller peaces and prepare for multi-compression feature
2025-11-07 17:48:52 +00:00
RahulGautamSingh bc7d0595d0 feat(config): managerFilePatterns (#34615)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-05-04 08:30:24 +00:00
alessio-pascolini b4d2f24c9c docs(datasource/deb): fix example typo (#35429) 2025-04-18 07:07:00 +00:00
Michael Kriese 059df43d60 fix(datasource/deb): use only suite as parameter (#35152) 2025-04-04 05:05:35 +00:00
Michael Kriese 19c115c813 test: cleanup (#34785) 2025-03-13 17:52:09 +00:00
Michael Kriese b5ff90f2bd fix: improve coverage (#34667) 2025-03-06 17:05:19 +00:00
Michael Kriese 593a92655e feat: refactor http (#34550) 2025-02-28 14:40:04 +00:00
Trim21 6e5731b554 test: migrate from jest to vitest (#34499) 2025-02-26 14:18:38 +00:00
renovate[bot] 55845508b6 chore(deps): update eslint monorepo to v9 (major) (#33573)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-02-20 11:31:13 +00:00
RahulGautamSingh 0d23707604 refactor(logger): remove templating from WARN log messages (#33488) 2025-01-14 13:03:05 +00:00
RahulGautamSingh 5a9f3696b2 refactor(logger): remove templating from ERROR logs (#33489) 2025-01-10 11:46:44 +00:00
HonkingGoose 557088a9c0 docs(datasource/deb): fix note admonition (#31538) 2024-09-23 14:24:27 +00:00
Sebastian Poxhofer 4f47b4d0e4 docs(datasource/deb): document steps for Artifactory (#31110)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-09-17 05:20:00 +00:00
oxdev03 c3958c9bd6 feat(datasource): add debian datasource (#30071)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Sergei Zharinov <zharinov@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Aleksandr Mezin <mezin.alexander@gmail.com>
Co-authored-by: Jasmin Müller <9011011+jazzlyn@users.noreply.github.com>
2024-08-28 17:26:56 +00:00