Fix the problem of pipelines changes with external PRs [RUN ALL RSPEC] [RUN AS-IF-FOSS]
What does this MR do?
This MR fixes the problem of rules:changes
/ only:changes
for external pull request pipelines.
Related to #208692 (closed) (also my comments: #208692 (comment 564926644), #208692 (comment 568113733))
The problem is about
Ci::Pipeline#modified_paths
because we check it while executingrules:changes
andonly:changes
. The external PR is neither amerge_request?
nor abranch_updated?
. So it returnsnil
. Thensatisfied_by?
returns true whenmodified_paths
isnil
.
It's behind a feature flag ci_modified_paths_of_external_prs
(#330605 (closed)).
Screenshots (strongly suggested)
Example CI Config
build:
stage: build
script: echo build
test1:
stage: test
script: exit 0
only:
refs:
- external_pull_requests
changes:
- .gitlab-ci.yml
test2:
stage: test
script: exit 0
only:
refs:
- external_pull_requests
changes:
- README.md
test3:
stage: test
script: exit 0
only:
refs:
- external_pull_requests
test4:
stage: test
script: exit 0
only:
changes:
- .gitlab-ci.yml
test5:
stage: test
script: exit 0
only:
changes:
- README.md
Before this MR
Created PR
GitLab CI is seen in the PR
All jobs are run in the pipeline
After this MR
Created PR
GitLab CI is seen in the PR
Jobs with changes:.gitlab-ci.yml are excluded from the pipeline
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team