renovate/lib/datasource
2022-02-18 07:30:59 +01:00
..
__snapshots__ test(datasource): Refactor index tests (#14187) 2022-02-12 10:05:21 +01:00
adoptium-java refactor: introduce Fixtures util class (#12638) 2022-01-23 21:23:54 +00:00
artifactory refactor: introduce Fixtures util class (#12638) 2022-01-23 21:23:54 +00:00
aws-machine-image refactor(datasource/aws): Strict null checks (#13449) 2022-02-05 06:54:18 +01:00
bitbucket-tags refactor(datasource/bitbucket-tags): Strict null checks (#13558) 2022-02-17 10:01:01 +00:00
cdnjs fix: improve coverage (#14117) 2022-02-09 19:12:14 +01:00
clojure refactor: Convert Maven-based datasources to class (#14188) 2022-02-15 05:12:30 +00:00
conan refactor(conan): retrieve raw content directly from GitHub (#14195) 2022-02-13 05:39:15 +00:00
conda feat(datasource/conda): add conda datasource (#14257) 2022-02-17 21:11:09 +01:00
crate refactor(datasource/crate): Enable strict null checks (#13915) 2022-02-07 06:14:23 +00:00
dart refactor: set importsNotUsedAsValues to error (#14052) 2022-02-07 06:37:17 +00:00
docker refactor(datasource/docker): Convert to class (#14194) 2022-02-13 19:13:13 +00:00
galaxy fix: improve coverage (#14117) 2022-02-09 19:12:14 +01:00
galaxy-collection refactor: introduce Fixtures util class (#12638) 2022-01-23 21:23:54 +00:00
git-refs refactor: Use Windows-compatible regex for newlines (#13956) 2022-02-02 07:31:11 +00:00
git-tags refactor(datasource): Make "DigestConfig::lookupName" a required field (#13608) 2022-01-28 11:50:03 +00:00
github-releases refactor(github): Convert datasources to class form (#14124) 2022-02-13 03:24:40 +00:00
github-tags refactor(github): Convert datasources to class form (#14124) 2022-02-13 03:24:40 +00:00
gitlab-packages fix(gitlab-packages): Add missing hostType for datasource calls (#13696) 2022-01-20 19:55:10 +00:00
gitlab-releases fix(core/changelogs): pass though known project info (#11515) 2021-09-01 13:07:55 +02:00
gitlab-tags refactor(datasource/gitlab-tags): Convert to class (#14055) 2022-02-11 05:42:14 +00:00
go refactor(github): Convert datasources to class form (#14124) 2022-02-13 03:24:40 +00:00
golang-version feat(datasource/golang-version): add golang-version datasource (#13291) 2022-01-31 08:44:00 +01:00
gradle-version refactor: no implicit override (#11395) 2021-08-23 20:50:37 +00:00
helm refactor(datasource/helm): Enable strict null checks (#14040) 2022-02-06 16:50:31 +00:00
hex refactor(datasource/hex): Enable strict null checks (#13983) 2022-02-03 15:36:29 +00:00
jenkins-plugins refactor(jenkins-plugins): convert to class-based datasource (#12702) 2021-11-18 19:55:21 +00:00
maven refactor: Convert Maven-based datasources to class (#14188) 2022-02-15 05:12:30 +00:00
node refactor(datasource/node): Enable strict null checks (#14041) 2022-02-06 16:28:10 +01:00
npm refactor(datasource/npm): Convert to class (#14193) 2022-02-15 08:20:45 +00:00
nuget fix(datasource/nuget): Encode whitespace for source and homepage URLs (#14043) 2022-02-17 06:15:44 +00:00
orb fix: improve coverage (#14117) 2022-02-09 19:12:14 +01:00
packagist feat: migrate packagist to v2 (#14104) 2022-02-18 07:30:59 +01:00
pod refactor(datasource/pod): Convert to class (#14133) 2022-02-10 20:07:16 +00:00
pypi refactor: refactor static regex out of for loops (#13065) 2021-12-29 07:26:13 +01:00
repology refactor(datasource/repology): Convert to class (#14132) 2022-02-11 08:05:55 +00:00
ruby-version refactor: set importsNotUsedAsValues to error (#14052) 2022-02-07 06:37:17 +00:00
rubygems refactor: set importsNotUsedAsValues to error (#14052) 2022-02-07 06:37:17 +00:00
sbt-package refactor: Convert Maven-based datasources to class (#14188) 2022-02-15 05:12:30 +00:00
sbt-plugin refactor: Convert Maven-based datasources to class (#14188) 2022-02-15 05:12:30 +00:00
terraform-module refactor(datasource/terraform): Enable strict null checks (#14050) 2022-02-08 11:48:43 +00:00
terraform-provider refactor(datasource/terraform): Enable strict null checks (#14050) 2022-02-08 11:48:43 +00:00
api.ts feat(datasource/conda): add conda datasource (#14257) 2022-02-17 21:11:09 +01:00
common.ts refactor: optimize type usage (#8947) 2021-03-02 21:44:55 +01:00
datasource.spec.ts test: Fix test descriptions and enforce it via new linting rule (#11285) 2021-08-18 05:46:56 +00:00
datasource.ts refactor(datasource/aws): Strict null checks (#13449) 2022-02-05 06:54:18 +01:00
index.spec.ts test(datasource): Refactor index tests (#14187) 2022-02-12 10:05:21 +01:00
index.ts feat: defaultRegistryUrls (#13907) 2022-01-29 13:36:08 +00:00
metadata-manual.ts test(datasource): Refactor index tests (#14187) 2022-02-12 10:05:21 +01:00
metadata.spec.ts refactor(datasource/npm): Convert to class (#14193) 2022-02-15 08:20:45 +00:00
metadata.ts test(datasource): Refactor index tests (#14187) 2022-02-12 10:05:21 +01:00
readme.md docs: add information about adding a new datasource to api.ts (#14275) 2022-02-17 12:56:25 +00:00
types.ts feat: defaultRegistryUrls (#13907) 2022-01-29 13:36:08 +00:00

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 adoptium-java datasource as a reference.

Add the datasource to the API in api.ts so that the new datasource is usable. If you encounter Pending mocks! errors in the jest tests and your mocked URLs are correct, ensure 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 contains:

  • lookupName: 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 containing:

  • 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 (e.g. 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, e.g. tags: { latest: '3.0.0' }. This is only used by the followTags function.

getDigest

Datasources that support the concept of digests (e.g. Docker digests and Git commit hashes) also can export a getDigest function.

The getDigest function has two inputs:

  • config: the Renovate config for the package being updated, contains 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 none is found then a return value of null should be returned.