CI: do not use changesets in non-MR pipelines
What
Removes rules:change in non-merge request pipelines.
Why
We have the following pipelines in the ci:
- merge request pipelines like
before_mergingormerge_train. - branch pipelines:
master_branchpipelines - scheduled pipelines:
schedule_extended_test -
tagpipelines: e.g. release pipelines
According to the gitlab doc, this is how rules:change works for the cases listed above:
-
rules:changetakes into account the changes between the source branch and the target branch -
rules:changetakes into account the changes between the branch and the previous commit - and 4.
rules:changealways evaluate totrue
For 3. and 4. (tag or scheduled pipelines), rules:changes are pointless and can be safely removed.
For 2, using rules:changes must be avoided as we want to run the jobs no matter what is the content of the last commit.
- in particular, this meant that the doc is updated less than possible because the doc jobs are not part of every
master_branchpipeline.
Finally, 1. is fine, already used and no changes (no pun) is required in our pipelines.
How
- Using
grepto detect which changesets should be removed.% grep -l "changes:" .gitlab/ci/pipelines/*.yml .gitlab/ci/pipelines/before_merging.yml .gitlab/ci/pipelines/master_branch.yml .gitlab/ci/pipelines/merge_train.yml .gitlab/ci/pipelines/schedule_documentation.yml % grep -nH "changes:" .gitlab/ci/pipelines/{master_branch,schedule_documentation}.yml .gitlab/ci/pipelines/master_branch.yml:416: - changes: .gitlab/ci/pipelines/master_branch.yml:477: - changes: .gitlab/ci/pipelines/master_branch.yml:522: - changes: .gitlab/ci/pipelines/master_branch.yml:581: - changes: .gitlab/ci/pipelines/master_branch.yml:629: - changes: .gitlab/ci/pipelines/schedule_documentation.yml:104: - changes: .gitlab/ci/pipelines/schedule_documentation.yml:166: - changes: .gitlab/ci/pipelines/schedule_documentation.yml:212: - changes: .gitlab/ci/pipelines/schedule_documentation.yml:272: - changes: .gitlab/ci/pipelines/schedule_documentation.yml:321: - changes: - Simple change in
master_branch.ml.
Manually testing the MR
make -C ci check-
grepto see that onlybefore_merging.ymlandmerge_train.ymluse changesets
% grep -l "changes:" .gitlab/ci/pipelines/*.yml
.gitlab/ci/pipelines/before_merging.yml
.gitlab/ci/pipelines/merge_train.yml
- test pipelines
- master_branch: https://gitlab.com/tezos/tezos/-/pipelines/1894039797
- schedule_documentation: https://gitlab.com/tezos/tezos/-/pipelines/1894055185
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR