`needs` requires to replicate previous `only:`/`except:` filters
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=31310) </details> <!--IssueSummary end--> ### Summary When having something like ```yaml ### generic.yml .filter-A: only: variables: - $A - $B .filter-B: only: variables: - $C - $D ### .gitlab-ci.yml # include: generic.yml job-A: stage: build extends: [.filter-A] script: echo a job-B: stage: build extends: [.filter-B] script: echo b job-C: only: variables: - $E stage: deploy needs: [job-A, job-B] script: echo c ``` gitlab fails when `$E` + `$A` is defined but not any of the other variables: ``` The form contains the following error: job-C: needs 'job-B' ``` It does not make any sense to require replication of `only:`/`except:` filters from previous jobs here. In some cases (like above), it is nearly impossible because: - filters are implemented in an external `.yml` - multiple `only:` are very difficulty to combine and their complexity raises exponentially ### Steps to reproduce Run script above with `A=t` + `E=t`. ### Example Project https://gitlab.com/ensc/test-ci-needs/pipelines ### What is the current *bug* behavior? Pipeline fails ### What is the expected *correct* behavior? only `job-A` runs; `job-B` + `job-C` are silently skipped ### Output of checks This bug happens on GitLab.com #### Results of GitLab environment info <details> <summary>Expand for output related to GitLab environment info</summary> <pre> (For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`) </pre> </details>
issue