renovate/lib/modules/datasource
Sergei Zharinov 9b4e515024
refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651)
2025-01-17 14:18:00 +00:00
..
__snapshots__ fix(datasource): remove unnecessary PyPI changelog URL overrides (#27725) 2024-03-15 19:46:07 +00:00
artifactory fix(artifactory): Fix timestamp handling (#33645) 2025-01-16 14:00:52 +00:00
aws-machine-image chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
aws-rds docs(datasource/aws-rds): improve readme (#29870) 2024-12-06 09:41:34 +00:00
azure-bicep-resource fix(datasource/bicep): suppress resourceFunctions (#28379) 2024-04-16 07:41:58 +00:00
azure-pipelines-tasks refactor(azure-pipelines): Simplify Zod result type inference (#33524) 2025-01-11 13:19:29 +00:00
bazel fix(bazel): use bazel-module versioning for bazel datasource (#25649) 2023-11-08 15:42:36 +00:00
bitbucket-tags refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
bitrise refactor(logger): remove templating from WARN log messages (#33488) 2025-01-14 13:03:05 +00:00
cdnjs refactor(cdnjs): Use single cache namespace (#31032) 2024-08-27 18:02:39 +00:00
clojure feat(maven): Use release post-fetch processing (#31261) 2024-09-26 13:20:54 +00:00
conan refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
conda refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
cpan feat(datasource/cpan): populate latest tag (#32677) 2024-11-25 08:23:12 +00:00
crate refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
custom refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
dart refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
dart-version refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
deb refactor(logger): remove templating from WARN log messages (#33488) 2025-01-14 13:03:05 +00:00
deno refactor(logger): remove templating from WARN log messages (#33488) 2025-01-14 13:03:05 +00:00
devbox feat(datasource): add devbox datasource module (#33418) 2025-01-10 11:52:45 +00:00
docker refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
dotnet-version feat(datasource): `sourceUrl` & `releaseTimestamp` support (#29122) 2024-05-21 07:04:12 +00:00
endoflife-date refactor: Rename `EndoflifeDatePackagesource` to `EndoflifeDateDatasource` (#30898) 2024-08-20 04:55:57 +00:00
flutter-version refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
galaxy feat(logger): replace INFO with DEBUG logs (#33478) 2025-01-16 09:11:05 +00:00
galaxy-collection refactor(logger): remove templating from WARN log messages (#33488) 2025-01-14 13:03:05 +00:00
git-refs chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
git-tags chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
gitea-releases feat(datasource): `sourceUrl` & `releaseTimestamp` support (#29122) 2024-05-21 07:04:12 +00:00
gitea-tags feat(datasource): `sourceUrl` & `releaseTimestamp` support (#29122) 2024-05-21 07:04:12 +00:00
github-release-attachments refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
github-releases feat(datasource): `sourceUrl` & `releaseTimestamp` support (#29122) 2024-05-21 07:04:12 +00:00
github-runners feat(datasource/github-runners): add windows 2025 (#33238) 2024-12-22 14:35:56 +00:00
github-tags refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
gitlab-packages refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
gitlab-releases refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
gitlab-tags refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
glasskube-packages refactor(http): Add `getYaml` and `getYamlSafe` methods (#33578) 2025-01-13 09:46:21 +00:00
go refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
golang-version feat(datasource): `sourceUrl` & `releaseTimestamp` support (#29122) 2024-05-21 07:04:12 +00:00
gradle-version refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
hackage feat(datasource): add Hackage datasource (#32944) 2024-12-13 07:17:26 +00:00
helm feat(helm): Use schema for datasource (#33577) 2025-01-16 10:54:10 +00:00
hermit refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
hex refactor(logger): remove templating from WARN log messages (#33488) 2025-01-14 13:03:05 +00:00
hexpm-bob feat(datasource): `sourceUrl` & `releaseTimestamp` support (#29122) 2024-05-21 07:04:12 +00:00
java-version refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
jenkins-plugins refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
kubernetes-api refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
maven feat(datasource/maven): Use relocation information (#32636) 2025-01-16 08:52:17 +00:00
node-version refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
npm refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
nuget refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
orb feat(datasource/orb): Add support for internal CircleCI Registries (#33213) 2024-12-20 16:07:28 +00:00
packagist refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
pod refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
puppet-forge refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
pypi refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
python-version refactor: Rename `EndoflifeDatePackagesource` to `EndoflifeDateDatasource` (#30898) 2024-08-20 04:55:57 +00:00
repology refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
ruby-version feat(datasource): `sourceUrl` & `releaseTimestamp` support (#29122) 2024-05-21 07:04:12 +00:00
rubygems refactor: Rename `unwrapOrElse` to `unwrapOr` for `Result` utility (#32787) 2024-11-28 17:04:02 +00:00
sbt-package refactor(maven): Unified result type for http fetch (#32813) 2024-12-09 18:58:07 +00:00
sbt-plugin refactor(maven): Unified result type for http fetch (#32813) 2024-12-09 18:58:07 +00:00
terraform-module refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
terraform-provider refactor(http): Separate `getJson` and `getJsonUnchecked` (#33651) 2025-01-17 14:18:00 +00:00
unity3d chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
api.ts feat(datasource): add devbox datasource module (#33418) 2025-01-10 11:52:45 +00:00
common.spec.ts fix: Handle `extractVersion` with release post-processing (#32540) 2024-11-16 10:32:33 +00:00
common.ts fix: Handle `extractVersion` with release post-processing (#32540) 2024-11-16 10:32:33 +00:00
datasource.spec.ts refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
datasource.ts refactor: Restrict `postprocessRelease` method types (#31626) 2024-09-26 04:56:14 +00:00
index.spec.ts chore(deps): update typescript-eslint monorepo to v8 (major) (#30750) 2024-08-14 10:33:02 +00:00
index.ts refactor(logger): remove templating from WARN log messages (#33488) 2025-01-14 13:03:05 +00:00
metadata-manual.ts test(lib/data): schemas for changelog and source urls (#32151) 2024-10-30 08:19:48 +00:00
metadata.spec.ts fix: Remove `normalizeDate` function (#33513) 2025-01-13 19:34:50 +00:00
metadata.ts fix: Remove `normalizeDate` function (#33513) 2025-01-13 19:34:50 +00:00
postprocess-release.spec.ts fix: Handle `extractVersion` with release post-processing (#32540) 2024-11-16 10:32:33 +00:00
postprocess-release.ts fix: Handle `extractVersion` with release post-processing (#32540) 2024-11-16 10:32:33 +00:00
readme.md test: Improve errors for missing/unused HTTP mocks (#31678) 2024-09-30 05:26:53 +00:00
schema.ts fix(datasource/cdnjs): update logic to accomodate api changes (#27212) 2024-02-11 10:57:56 +00:00
types.ts feat(datasource/cpan): populate latest tag (#32677) 2024-11-25 08:23:12 +00:00
util.ts refactor: refactor Google Auth util (#33486) 2025-01-09 10:35:47 +00:00
utils.spec.ts refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00

readme.md

Datasources

Datasources are used in Renovate primarily to fetch released versions of packages.

Follow the class-based programming style

New datasources must follow the class-based programming style. Use the java-version datasource as a reference.

Add the datasource to the API in api.ts so that the new datasource is usable. If you find Unused HTTP mocks errors in the Jest tests and your mocked URLs are correct, make sure the datasource is correctly registered.

getReleases

The minimum exported interface for a datasource is a function called getReleases that takes a lookup config as input.

The config has:

  • packageName: the package's full name including scope if present (e.g. @foo/bar)
  • registryUrls: an array of registry URLs to try

getReleases should return an object having:

  • releases: an array of strings of matched versions. This is the only mandatory field
  • deprecationMessage: a string description of the package's deprecation notice, if applicable
  • sourceUrl: a HTTP URL pointing to the source code (for example on GitHub)
  • homepage: a HTTP URL for the package's homepage. Ideally should be empty if the homepage and sourceUrl are the same
  • changelogUrl: a URL pointing to the package's changelog (could be a Markdown file, for example). If not present then Renovate will search the sourceUrl for a changelog file
  • tags: an object mapping tag -> version, for example tags: { latest: '3.0.0' }. This is only used by the followTags function

getDigest

Datasources that support digests (like Docker digests and Git commit hashes) can export a getDigest function.

The getDigest function has two inputs:

  • config: the Renovate config for the package being updated, has the same fields as getReleases
  • newValue: the version or value to retrieve the digest for

The getDigest function returns a string output representing the digest value. If no digest is found, the getDigest function should return null.