renovate/lib/datasource
Sergei Zharinov 1392955a04
refactor: Identify tests relying on single snapshots (#11150)
Co-authored-by: Jamie Magee <jamie.magee@gmail.com>
2021-08-07 23:43:34 +00:00
..
__snapshots__ feat(internal): return registryUrl from datasources (#9177) 2021-03-17 13:34:47 +01:00
adoptium-java fix(datasource:adoptium-java): add caching (#11110) 2021-08-05 14:34:02 +02:00
bitbucket-tags refactor(bitbucket-tags): move datasource to class (#10957) 2021-07-29 08:10:45 +00:00
cdnjs fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
clojure fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
crate fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
dart fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
docker refactor(docker): better url parsing (#10996) 2021-07-28 08:07:20 +02:00
galaxy fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
galaxy-collection fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
git-refs feat: add git http basic auth support (#10513) 2021-06-21 10:55:22 +00:00
git-tags feat: add git http basic auth support (#10513) 2021-06-21 10:55:22 +00:00
github-releases feat(github-releases): getDigest() (#10947) 2021-08-05 17:05:22 +02:00
github-tags fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
gitlab-tags fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
go refactor(bitbucket-tags): move datasource to class (#10957) 2021-07-29 08:10:45 +00:00
gradle-version fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
helm fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
hex refactor(hex): convert to class-based (#10642) 2021-06-29 08:03:47 +02:00
jenkins-plugins test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
maven fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
npm fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
nuget fix(nuget): rethrow external host error (#10755) 2021-07-07 17:36:07 +02:00
orb refactor: Use GraphQL variables instead of string templates (#10926) 2021-07-27 08:50:27 +02:00
packagist fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
pod fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
pypi refactor(pypi): convert to class-based (#11064) 2021-08-03 11:38:46 +00:00
repology fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
ruby-version refactor(ruby-version): convert to class-based (#10508) 2021-06-27 08:25:29 +00:00
rubygems fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
sbt-package test: fix nock usage (#10451) 2021-06-16 09:13:33 +02:00
sbt-plugin test: fix nock usage (#10451) 2021-06-16 09:13:33 +02:00
terraform-module fix: Improve the default User-agent string. (#10606) 2021-06-26 07:02:35 +00:00
terraform-provider feat(terraform): implement lockfile support for Terraform community providers (#10619) 2021-07-30 11:24:59 +00:00
api.ts refactor(pypi): convert to class-based (#11064) 2021-08-03 11:38:46 +00:00
common.ts refactor: optimize type usage (#8947) 2021-03-02 21:44:55 +01:00
datasource.spec.ts test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
datasource.ts fix: rethrow ExternalHostError error (#10761) 2021-07-09 07:06:50 +00:00
index.spec.ts refactor: Identify tests relying on single snapshots (#11150) 2021-08-07 23:43:34 +00:00
index.ts feat(github-releases): getDigest() (#10947) 2021-08-05 17:05:22 +02:00
metadata.spec.ts refactor: Identify tests relying on single snapshots (#11150) 2021-08-07 23:43:34 +00:00
metadata.ts feat: add changelog url for tailwindcss-classnames (#10120) 2021-05-24 13:10:19 +02:00
readme.md docs: new datasources must follow class-based programming style (#11070) 2021-08-03 22:09:19 +02:00
types.ts feat(github-releases): getDigest() (#10947) 2021-08-05 17:05:22 +02: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.

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.