Draft: Check job options for expire_in in artifacts
What does this MR do and why?
Fixes the nil in expire_at
References
How to set up and validate locally
- Create
.gitlab-ci.ymlwith:
test_with_expire_in:
script:
- echo "Testing with expire_in" > test.txt
artifacts:
expire_in: 2 hours
paths:
- test.txt
test_without_expire_in:
script:
- echo "Testing without expire_in" > test2.txt
artifacts:
paths:
- test2.txt
- Run the pipeline and let it complete successfully
- Find the two jobs:
-
job1 = Ci::Build.where(name: 'test_with_expire_in').lastand job2 = Ci::Build.where(name: 'test_without_expire_in').last
-
- Check a few things for each of these jobs:
-
job1.options-> this will give us what's in the yaml, which in this case will be 2 hours -
job2.options-> this will benil
-
-
job1.job_artifacts.first&.expire_at-> This should be 2 hours (YAML!) -
job1.job_artifacts.first&.expire_at-> This should be 30 days (which is the instance default)
Repeat steps 2-6 on master.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Laura Montemayor