[go: up one dir, main page]

Draft: Check job options for expire_in in artifacts

What does this MR do and why?

Fixes the nil in expire_at

References

#467457 (closed)

How to set up and validate locally

  1. Create .gitlab-ci.yml with:
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
  1. Run the pipeline and let it complete successfully
  2. Find the two jobs:
    1. job1 = Ci::Build.where(name: 'test_with_expire_in').last and
    2. job2 = Ci::Build.where(name: 'test_without_expire_in').last
  3. Check a few things for each of these jobs:
    1. job1.options -> this will give us what's in the yaml, which in this case will be 2 hours
    2. job2.options -> this will be nil
  4. job1.job_artifacts.first&.expire_at -> This should be 2 hours (YAML!)
  5. 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

Merge request reports

Loading