Skip to content
Snippets Groups Projects

Expand CI variables before glob separation

Merged Manuel Grabowski requested to merge mg-fix-variable-directory-exists-20240723 into master

What does this MR do and why?

Expand CI variables before glob separation

We sort globs into three types depending on their content. Doing that before expanding variables can lead to them being sorted incorrectly. In consequence they are also applied incorrectly, leading to missing some matches when variables contain / or **.

Fixes #386595 (closed)

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.

How to set up and validate locally

  1. Set up new project
  2. Add directory and file folder/file
  3. Add this CI configuration:
    variables:
      dir: "folder"
      file: "file"
      full_path: "folder/file"
    
    a:
      rules:
        - exists:
            - $dir/$file
      script:
        - echo hi
    
    b:
      rules:
        - exists:
            - $full_path
      script:
        - echo hi 
  4. Observe both jobs running with this branch, but only job a running with latest default
Edited by Manuel Grabowski

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Allison Browne
  • Manuel Grabowski added 2774 commits

    added 2774 commits

    Compare with previous version

  • Manuel Grabowski reset approvals from @rutgerwessels by pushing to the branch

    reset approvals from @rutgerwessels by pushing to the branch

  • A deleted user added feature flag feature flagexists labels and removed feature flagskipped label

    added feature flag feature flagexists labels and removed feature flagskipped label

  • added 1 commit

    • 1592dac3 - Guard early variable expansion behind FF

    Compare with previous version

  • added 1 commit

    • 7c1d5f23 - Guard early variable expansion behind FF

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • requested review from @allison.browne

  • Allison Browne approved this merge request

    approved this merge request

  • Allison Browne resolved all threads

    resolved all threads

  • Allison Browne removed this merge request from the merge train because the pipeline did not succeed. Learn more.

    removed this merge request from the merge train because the pipeline did not succeed. Learn more.

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading