Fix expired artifacts causing dependency failures on locked pipelines
What does this MR do?
This MR resolves GitLab bug# 293554. The bug is regarding jobs considering artifacts as expired even if the pipeline is locked because it's the newest one for the branch. Even if the artifacts for a locked branch are past the normal expiration date, they are kept until another successful build, so they should be used by any jobs that depend on them.
Closes #293554 (closed)
Screenshots or Screencasts (strongly suggested)
How to setup and validate locally (strongly suggested)
Based on original bug report:
- Define
Job A
with artifacts that has a shortexpire_in
. - Define
Job B
in another stage, that has aneeds
dependency onJob A
. Let there be an error so the job will fail or set the job to be manually started. - Run the pipeline.
- Let enough time pass that the artifacts from
Job A
would normally expire. - Verify that the artifacts from
Job A
are in fact still available due to being latest for the job/branch. - Retry
Job B
. -
Job B
will fail with the errorThis job depends on other jobs with expired/erased artifacts: Job A Please refer to https://docs.gitlab.com/ee/ci/yaml/README.html#dependencies
.
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
I need assistance with resolving unit tests failures in spec/services/ci/register_job_service_spec.rb
. The fix I did in the other unit tests is not working here and it's unclear if the failures in "stale" job test should be fixed in the same way, or if they are an actual issue with the code.
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
CC: @greg (asked me to ping him on this MR)
Related to #293554 (closed)