fix(linter): downgrade needs optional:true missing-job to warning
release / Build and publish release (push) Successful in 1m12s
release / Build and publish release (push) Successful in 1m12s
parseNeedJobNames is replaced by parseNeedEntries which preserves the optional flag from each needs: entry. When a referenced job does not exist and optional:true is set, the finding is now WARNING instead of ERROR, matching GitLab CI runtime behavior (the dependency is silently skipped when the job is absent from a conditional include). Optional missing deps are also excluded from the cycle-detection graph since there is no real dependency edge to trace. Adds a fixture case in testdata/needs.yml to prevent regression. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vendored
+9
@@ -38,3 +38,12 @@ missing-needs-job:
|
||||
- echo "bad"
|
||||
needs:
|
||||
- nonexistent-job # ERROR: job doesn't exist
|
||||
|
||||
# optional: true — missing dep should be WARNING not ERROR
|
||||
optional-needs-job:
|
||||
stage: build
|
||||
script:
|
||||
- echo "I depend on something that may not exist"
|
||||
needs:
|
||||
- job: nonexistent-optional-job
|
||||
optional: true
|
||||
|
||||
Reference in New Issue
Block a user