renovate/lib/datasource
INA Lintaro 9730079d0c
feat(sbt): extract source URL from POM file (#6756)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2020-07-17 10:14:50 +02:00
..
__snapshots__ feat(internal): datasource registryStrategy (#6549) 2020-06-19 21:29:34 +02:00
cdnjs refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
clojure fix(clojure): set registryStrategy 2020-06-22 22:51:03 +02:00
crate refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
dart refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
docker fix: prepare for got v11 (#6741) 2020-07-13 21:33:24 +02:00
galaxy refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
git-refs refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
git-submodules fix(git-submodule): disable pinDigests (#6754) 2020-07-14 16:50:19 +02:00
git-tags refactor: Import index for datasource tests (part 2) (#6546) 2020-06-18 21:31:40 +02:00
github-releases refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
github-tags refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
gitlab-tags refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
go refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
gradle-version refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
helm refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
hex refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
maven chore: fix lint 2020-07-11 09:01:44 +02:00
npm refactor: rename globalCache to packageCache (#6580) 2020-06-25 08:32:55 +02:00
nuget refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
orb refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
packagist refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
pod refactor(internal): prepare for got v11 (#6727) 2020-07-10 20:51:40 +02:00
pypi fix(pip): fix compatibility with some simple pip indexes (#6649) 2020-07-07 06:56:31 +02:00
repology docs: mention handlebars escaping 2020-07-03 15:57:01 +02:00
ruby-version refactor: rename globalCache to packageCache (#6580) 2020-06-25 08:32:55 +02:00
rubygems refactor: remove unnecessary catch code in datasources (#6583) 2020-06-25 14:07:03 +02:00
sbt-package feat(sbt): extract source URL from POM file (#6756) 2020-07-17 10:14:50 +02:00
sbt-plugin feat(sbt): extract source URL from POM file (#6756) 2020-07-17 10:14:50 +02:00
terraform-module fix: prepare for got v11 (#6741) 2020-07-13 21:33:24 +02:00
terraform-provider feat(terraform): Implement terraform service discovery (#6720) 2020-07-13 07:37:01 +02:00
cache.ts refactor: rename globalCache to packageCache (#6580) 2020-06-25 08:32:55 +02:00
common.ts feat(internal): make datasource loading syncronous (#6748) 2020-07-15 13:12:50 +02:00
index.spec.ts feat(internal): make datasource loading syncronous (#6748) 2020-07-15 13:12:50 +02:00
index.ts feat(internal): make datasource loading syncronous (#6748) 2020-07-15 13:12:50 +02:00
metadata.spec.ts fix(pypi): support more project urls (#6420) 2020-06-03 13:31:41 +02:00
metadata.ts fix(pypi): add mypy source url (#6442) 2020-06-05 13:19:55 +02:00
readme.md refactor(datasource): getPkgReleases -> getReleases (#5867) 2020-04-04 08:53:52 +02: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.