Commit Graph

50 Commits

Author SHA1 Message Date
Sebastian Poxhofer 290f5dcff3 refactor(datasource): normalise github getDigest signatures (#46187) 2026-10-07 07:07:07 +00:00
Sebastian Poxhofer f03acf6cd7 refactor(datasource): derive github-release-attachments from github-releases (#46186)
* refactor(datasource): derive github-release-attachments from github-releases

* refactor(datasource): keep the github-releases id readonly and inherit its timestamp note
2026-10-07 07:07:06 +00:00
Sebastian Poxhofer ee0e84f775 refactor(datasource): pass the http client through the Datasource constructor (#46108) 2026-10-07 07:07:03 +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 5ad36a2387 test(linters): add linting rule to enforce usage of host rules test util (#44692)
* ci(linter): add renovate/no-host-rules-mock rule

Flags vi.mock()/vi.doMock() calls whose module specifier contains
"host-rules" in spec files. Tests should configure real rules via
hostRules.add() instead of mocking the host-rules module.

Enabled at "warn" severity instead of "error": the repo currently has
35 pre-existing violations across 34 spec files, which exceeds the
agreed fix threshold of 12 files. No violation fixes are included;
migrating each spec to real hostRules.add()/clear() setup is a
semantic test rewrite that should be done incrementally, after which
the rule can be promoted to "error".

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

* ci(linter): enforce renovate/no-host-rules-mock at error

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

* test(datasource): use real host-rules instead of mocking

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

* test(manager): use real host-rules instead of mocking

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

* test(platform): use real host-rules instead of mocking

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

* test(util,workers): use real host-rules instead of mocking

Also narrow renovate/no-host-rules-mock to the host-rules module itself so that mocking e.g. host-rules-from-env is not flagged.

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

* ci(linter): mention '~test/host-rules.ts' util in no-host-rules-mock message

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 10:36:12 +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
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
Sebastian Poxhofer e17660ce9e docs(github): add readmes for GitHub datasources (#36223) 2025-05-30 05:04:05 +00:00
Michael Kriese 19c115c813 test: cleanup (#34785) 2025-03-13 17:52:09 +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
Sergei Zharinov a33d3eab9e feat: Switch to Timestamp type (#33648) 2025-01-22 20:15:25 +00:00
RahulGautamSingh d0b77e584a feat(datasource): sourceUrl & releaseTimestamp support (#29122) 2024-05-21 07:04:12 +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
Paul Gschwendtner 177ffedb85 feat(datasource/github-releases)!: digest computation use git tag, not file digest (#20178)
The github-releases datasource has been copied into a new datasource called github-release-attachments.
The github-releases general datasource is updated to use the underlying Git tag of a GitHub release entry for digest computation.

Fixes #20160, Fixes #19552

BREAKING CHANGE: Regex Manager configurations relying on the github-release data-source with digests will have different digest semantics. The digest
will now always correspond to the underlying Git SHA of the release/version. The old behavior can be preserved by switching to the
github-release-attachments datasource.
2023-03-10 09:34:40 +01:00
Rhys Arkins b17bcf2789 refactor(datasource): use packageName and not depName for datasource lookups (#20474) 2023-03-10 09:34:40 +01:00
Sergei Zharinov 91822a60cb feat(github-releases): Cache functions used for getDigest (#20458) 2023-02-17 06:32:39 +00:00
Sergei Zharinov 686cb17442 feat(github-releases): Fetch releases with cacheable GraphQL (#19623) 2023-01-07 09:34:22 +01:00
Sergei Zharinov e94aebebfe refactor(github): Remove old cache implementation (#19569) 2022-12-25 06:43:46 +00:00
RahulGautamSingh 1657c16136 chore(lint): add object shortand rule (#18080) 2022-10-02 21:20:24 +02:00
Sergei Zharinov ea69f81247 refactor(github): Uniform names for github datasource types (#17701) 2022-09-08 11:26:27 +02:00
Sergei Zharinov 81ee883e30 refactor(github): Extract utils/github from datasources (#17697) 2022-09-08 10:00:42 +02:00
Sergei Zharinov 1827b6f519 refactor(github): Don't inherit github-tags from github-releases (#17696) 2022-09-08 09:25:25 +03:00
Sergei Zharinov b5ac8f04a1 fix(github): Disable caching for GitHub datasources (#17685)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2022-09-08 08:11:01 +03:00
Sergei Zharinov 3f30119f71 fix(github): Error messages for empty repository result (#17645)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-09-06 10:37:02 +02:00
Sergei Zharinov 410d05c5be feat(github): Deduplicate cache github releases fetching (#17591) 2022-09-02 19:37:50 +02:00
Michael Kriese 6dd4ea3c74 feat(github): use repo url to get token (#17179) 2022-08-29 07:37:45 +00:00
Sergei Zharinov f3531226e9 fix(github): Check release date for undefined value (#17106) 2022-08-10 12:14:34 +00:00
Sergei Zharinov e4dbd4ad49 fix(ci): Restrict template expressions (#16834)
* fix(ci): Restrict template expressions

* Fix

* Fix

* Fix
2022-07-30 16:28:31 +02:00
IKEDA Sho 2241daaada refactor(datasource): Prefer interface over type (#16707)
https://github.com/renovatebot/renovate/blob/main/docs/development/best-practices.md#general
2022-07-22 12:18:58 +00:00
Yun Lai 9280430f4c feat: add datasource for Hermit package manager (#16257)
* feat: add datasource for Hermit package manager

* fix: make hermit datasource use http.stream instead of http.get

* chore: inline small function and return null on error in hermit datasource

* fix: use regExp to extract owner and repo from registryUrl

* fix: use http from super & use error instead of debug on datasource error

* fix: fix type check failure for github-release test

* Update lib/modules/datasource/hermit/index.spec.ts

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

* Update lib/modules/datasource/hermit/index.spec.ts

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

* Update lib/modules/datasource/hermit/index.spec.ts

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

* Update lib/modules/datasource/hermit/index.ts

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

* fix: wrap JSON.parse to avoid breaking process, plus more comment onto the search manifest streaming process

* fix: add test to cover the invalid json case

* fix: change some logger.errors to logger.warn in hermit datasource, error will exit the whole process

* Update lib/modules/datasource/hermit/index.spec.ts

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

* Update lib/modules/datasource/hermit/index.spec.ts

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

* Update lib/modules/datasource/hermit/index.ts

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

* Update lib/modules/datasource/hermit/index.ts

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

* Update lib/modules/datasource/hermit/index.ts

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

* fix: use parseUrl and use hermit as GithubHttp id

* fix: added test to include HermitDatasource type in GITHUB_API_USING_HOST_TYPES

* fix: handle invalid url & achieve code coverage

* fix: move url parsing to parent function

* Update lib/modules/datasource/hermit/index.ts

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

* chore: clean up HermitDataSource class doc

* fix: getHermitSearchManifest cache key function should expect undefined

* fix: pass GetReleasesConfig into getHermitSearchManifest to get proper caching working

* Update lib/modules/datasource/hermit/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/datasource/hermit/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/datasource/hermit/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/datasource/hermit/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/datasource/hermit/readme.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore: fix json block in datasource readme.md

* Put packageRules example in step 4

* fix: fix lint error

* fix: pass parsedUrl into getHermitSearchManifest, add warning and simplifies type

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2022-07-15 09:57:05 +00:00
Sergei Zharinov 1454b602fc fix(github): Shrink pages for specific types of errors (#16388) 2022-07-02 18:41:02 +02:00
Sergei Zharinov b5df686fb7 refactor(github): Introduce misc query function for GraphQL (#16387)
* refactor(github): Introduce misc `query` function for GraphQL

* Update lib/modules/datasource/github-releases/cache/cache-base.ts

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

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-07-02 15:24:17 +02:00
Sergei Zharinov 49f7bac4e0 refactor(github): Consume pages entirely during tags/releases caching (#16386) 2022-07-02 10:13:55 +02:00
RahulGautamSingh 93dd940574 refactor(modules/datasource): fix null-check issues (#16153)
* fix null-check issues

* Update index.spec.ts

* apply suggestion from review

* fix coverage issue

* Update index.spec.ts

* Apply suggestions from code review

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

* Update datasource.spec.ts

* Update lib/modules/datasource/conan/index.spec.ts

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

* Update datasource.spec.ts

* fix null-check issue

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-06-20 16:24:37 +02:00
Sergei Zharinov 61f2d813e2 feat(github): Datasource cache busting (#16014) 2022-06-20 10:10:31 +02:00
Sergei Zharinov f19eb5b841 fix(github): Don't append /api/v3/ to the endpoint twice (#16097)
* fix(github): Don't attach `/api/v3/` to the endpoint twice

* Add test

* More correct replacing
2022-06-16 08:42:23 +02:00
Sergei Zharinov 244e18ab77 feat(github): Different cache update frequency for fresh packages (#15901) 2022-06-06 06:23:25 +00:00
Sergei Zharinov 4b6fc85146 fix(github): Never return null results for getReleases (#15894) 2022-06-04 17:54:39 +00:00
Sergei Zharinov e4d5a0e2fd fix(github): Throw on GraphQL errors during cache fetching (#15891) 2022-06-04 11:02:31 +00:00
Sergei Zharinov dbad9e5848 fix(github-releases): Return gitRef field (#15890) 2022-06-04 12:26:11 +02:00
Sergei Zharinov a9c2f4762e fix(github): Re-throw datasource cache errors (#15878) 2022-06-03 17:41:54 +02:00
Sergei Zharinov 2e957baed9 feat(github): long-term datasource caching (#15653) 2022-06-03 11:27:26 +02:00
Michael Kriese 5cf9123017 refactor: more strict null checks (#15140) 2022-04-16 06:32:17 +00:00
Michael Kriese 64f5bd5f03 test: enforce lint style rules (#15085) 2022-04-12 14:49:49 +00:00
Michael Kriese 443bef5c52 test: cleanup snapshot tests (#15082) 2022-04-12 15:09:19 +01:00
Rhys Arkins 143c9a6751 refactor: rename lookupName -> packageName (#14494)
Renames `lookupName` to be `packageName`.

BREAKING CHANGE: Use `packageName` instead of `lookupName` if interacting with Renovate datasources directly.
2022-03-04 09:04:02 +01:00
Rhys Arkins dca3418bbd refactor: lib/modules (#14488)
Moves datasource, manager, platform and versioning code from lib/ into new lib/modules/

BREAKING CHANGE: External tools must update paths to datasource, manager, platform and versioning
2022-03-04 09:04:02 +01:00