Skip to content

Add kept badge to kept artifacts

Miranda Fluharty requested to merge 370149-add-kept-badge-to-kept-artifacts into master

What does this MR do and why?

For #370149

Add kept badge to kept artifacts

On the artifacts page for a project (Build => Artifacts),
Display a badge for artifacts that have been kept with an explanatory tooltip
(job.logs are kept by default, so show different badge styling/tooltip)
Define kept as artifact.expire_at.nil?, add that to the GraphQL type

Changelog: added

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
Screenshot_2024-02-22_at_18.46.28 Screenshot_2024-02-22_at_18.46.28
Screenshot_2024-02-22_at_18.46.35
Screenshot_2024-02-22_at_18.46.41

How to set up and validate locally

  1. find/make a project that generates artifacts
here's a .gitlab-ci.yml snippet for that:
# .gitlab-ci.yml

fruit:
  stage: build
  script:
    - echo 'banana' >> banana.txt
    - echo 'apple' >> apple.txt
  artifacts:
    paths: ['banana.txt', 'apple.txt']

potato:
  stage: build
  script:
    - echo 'potato' >> potato.txt
  artifacts:
    paths: ['potato.txt']
  1. run a pipeline in the project
  2. navigate to the job log for a job that generated artifacts
  3. click the Keep button in the artifacts section of the job log sidebar
  4. navigate to the artifacts page for the project
  5. verify that the Kept badge is shown next to the artifact files for the job that you kept artifacts for
  6. verify that the Kept badge is also shown next to the job.log files (these are automatically kept)
Edited by Miranda Fluharty

Merge request reports