Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 1.21 KB

url-generators.md

File metadata and controls

23 lines (16 loc) · 1.21 KB

URL Generators

URL generators are used to generate URLs for the packages listed in a diff:

  • GitHubGenerator: Generates URLs for GitHub repositories.
  • GitLabGenerator: Generates URLs for GitLab repositories. Supports custom domains.
  • BitbucketGenerator: Generates URLs for Bitbucket repositories.
  • DrupalGenerator: Generates URLs for Drupal packages.

They are chosen automatically based on the package URL or other conditions specified in supportsPackage() method.

When both packages have the same version, for example a tag moved to another commit and reported with --with-metadata, the built-in generators use their short commit hashes in the compare URL instead. If the source reference is the same too, the release URL is shown instead, as there is nothing to compare.

Each generator must have following methods:

  • supportsPackage(): Checks if the generator supports the package.
  • getCompareUrl(): Generates URL for comparing two versions of the package.
  • getReleaseUrl(): Generates URL for viewing a release or commit of a package.
  • getProjectUrl(): Mainly used to generate URL to the project repository root.

Other packages can add URL generators, see Extensions.