Skip to content

Update artifacts section to show when an artifact is locked

Frédéric Caplette requested to merge browse-locked-artifact into master

What does this MR do?

We recently added the ability to have locked artifact. In essence what it does is that the latest artifact of any given job will not expire (even if specified in the Gitlab CI yaml). This mean that even if the expire value is past, if it's the latest artifact it's still browsable/downloadable.

When we first started this issue, we thought we would need to do something special to expose the locked artifact to the frontend, but actually it was simply based on the browse_path of the artifact. By leaving that path on locked artifact, they are exposed in the UI by default.

So this MR insteads adds context in the UI to explain to the user that this artifact will not expire as usual since it's the latest of this given job. There is also a series of new tests to cover this new functionality and the tests were also re-written as they were still using legacy utils.

NOTES The locked artifact is behind the feature flag keep_latest_artifact_for_ref. On the frontend, we don't need to test for the flag because if it's not enabled, the locked property simply doesn't exist and the API will remove the feature as usual. The locked message will only appear if that feature is enable.

Screenshots

Before Screen_Shot_2020-05-25_at_3.21.03_PM

After (red rectangle is added to screenshot to highlight the change) Screen_Shot_2020-05-25_at_1.30.39_PM

Edited by Frédéric Caplette

Merge request reports