renovate/lib/datasource
Rhys Arkins 4e4bfe9256
feat(internal): http util wrapper (#5841)
Co-Authored-By: Michael Kriese <michael.kriese@visualon.de>
2020-04-03 13:45:55 +02:00
..
__snapshots__ feat: replace datasource constants with IDs (#5595) 2020-03-01 08:01:12 +01:00
cdnjs feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
crate feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
dart feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
docker feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
galaxy feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
git-refs fix(git): remove sort flag from git ls-remote 2020-04-02 07:39:58 +02:00
git-submodules feat: add git-refs datasource (#5727) 2020-03-27 17:41:29 +01:00
git-tags fix(git-refs): git-refs always returning null (#5848) 2020-04-01 22:09:37 +02:00
github-releases feat(github-releases): Add support for "releaseTimestamp" (#5711) 2020-03-13 14:11:47 +01:00
github-tags fix: revert datasource error handling changes 2020-03-12 12:48:57 +01:00
gitlab-tags feat(gitlab-tags): Add support for "releaseTimestamp" for GitLa… (#5712) 2020-03-18 12:32:17 +01:00
go feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
gradle-version feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
helm feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
hex feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
maven feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
npm feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
nuget feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
orb feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
packagist feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
pod chore(internal): disallow implicit braces (#5730) 2020-03-17 12:15:22 +01:00
pypi feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
ruby-version feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
rubygems feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
sbt-package chore(internal): disallow implicit braces (#5730) 2020-03-17 12:15:22 +01:00
sbt-plugin chore(internal): disallow implicit braces (#5730) 2020-03-17 12:15:22 +01:00
terraform-module feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
terraform-provider feat(internal): http util wrapper (#5841) 2020-04-03 13:45:55 +02:00
common.ts feat(internal): generate dynamic datasource imports (#5500) 2020-03-24 07:17:59 +01:00
index.spec.ts feat(internal): generate dynamic datasource imports (#5500) 2020-03-24 07:17:59 +01:00
index.ts feat(internal): generate dynamic datasource imports (#5500) 2020-03-24 07:17:59 +01:00
metadata.spec.ts fix: revert datasource error handling changes 2020-03-12 12:48:57 +01:00
metadata.ts feat(datasource): gatsby changelog file (#5856) 2020-04-02 14:35:23 +02:00
readme.md feat: rename github/gitlab datasources (#5581) 2020-02-27 21:36:31 +01:00

Datasources

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

getPkgReleases

The minimum exported interface for a datasource is a function called getPkgReleases 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

getPkgReleases 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 getPkgReleases
  • 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.