Skip to content

Add redirect for downloading/browsing build artifacts by git ref rather than build ID

Description including problem, use cases, benefits, and/or goals

People need to be able to share links to artifacts based on a git ref (branch, tag, etc.), without knowing a specific build ID. Examples include sharing a link in the README to the latest generated PDF. Because there can be multiple artifacts generated by different jobs in a pipeline, require a specific job to be specified as well.

Proposal

Make /user/repo/builds/artifacts/git-ref/*?job=name redirect to /user/repo/builds/{build-id}/artifacts/* where:

  • build-id would be the most recent successful build matching the git-ref and job
  • Any URL parameters after artifacts would be included in the redirect.

Examples:

Notes

  • This should likely be exposed in the API as well, so GET /project/:id/builds/artifacts/master/download?job=build would work.
  • This only supports downloading of files. If a generated file is static HTML, like a coverage report for example, people might want to show the file as a web page rather than a download. This would be overly complicated and out of scope of this proposal.
  • So far, I haven't seen anyone explicitly ask to download artifacts for all jobs in a single URL.
  • Is the URL pattern unique enough that it won't mismatch? e.g. can someone name a job with a slash so job/name could be confused with git-ref/job-name? Or a job-name of all numbers might be confused with a build-id? Do we need to use /releases instead of /builds so it's more unique?

Links / references

\cc @ayufan @JobV @sytses