renovate/lib/datasource
Sergei Zharinov d004ca5fa8
refactor(maven): Remove file protocol support from datasource (#10191)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-05-28 12:27:17 +02:00
..
__snapshots__ feat(internal): return registryUrl from datasources (#9177) 2021-03-17 13:34:47 +01:00
bitbucket-tags test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
cdnjs test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
clojure refactor(maven): Remove file protocol support from datasource (#10191) 2021-05-28 12:27:17 +02:00
crate test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
dart test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
docker test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
galaxy test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
galaxy-collection test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
git-refs refactor: extract types to new files (#9951) 2021-05-11 12:51:21 +02:00
git-tags refactor: extract types to new files (#9951) 2021-05-11 12:51:21 +02:00
github-releases test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
github-tags test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
gitlab-tags test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
go test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
gradle-version test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
helm test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
hex test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
jenkins-plugins test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
maven refactor(maven): Remove file protocol support from datasource (#10191) 2021-05-28 12:27:17 +02:00
npm test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
nuget test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
orb test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
packagist test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
pod test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
pypi test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
repology test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
ruby-version test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
rubygems test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
sbt-package feat(test): Detect test utils callers and simplify helpers (#9707) 2021-04-26 16:15:03 +02:00
sbt-plugin feat(test): Detect test utils callers and simplify helpers (#9707) 2021-04-26 16:15:03 +02:00
terraform-module test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
terraform-provider test: simplify nock handling (#10170) 2021-05-27 14:13:31 +02:00
api.ts refactor(dart): migrate to class based datasource (#10134) 2021-05-25 06:42:14 +02: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 refactor(datasource): migrate to class based datasource (#6747) 2021-05-21 07:40:09 +02:00
index.spec.ts refactor(datasource): migrate to class based datasource (#6747) 2021-05-21 07:40:09 +02:00
index.ts refactor(datasource): migrate to class based datasource (#6747) 2021-05-21 07:40:09 +02:00
metadata.spec.ts feat(test): Detect test utils callers and simplify helpers (#9707) 2021-04-26 16:15:03 +02:00
metadata.ts feat: add changelog url for tailwindcss-classnames (#10120) 2021-05-24 13:10:19 +02:00
readme.md docs: capitalize proper noun Docker (#9197) 2021-03-18 13:06:56 +00:00
types.ts feat(internal): return registryUrl from datasources (#9177) 2021-03-17 13:34:47 +01:00

Datasources

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

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.