[go: up one dir, main page]

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:

  1. merge request pipelines like before_merging or merge_train.
  2. branch pipelines: master_branch pipelines
  3. scheduled pipelines: schedule_extended_test
  4. tag pipelines: e.g. release pipelines

According to the gitlab doc, this is how rules:change works for the cases listed above:

  1. rules:change takes into account the changes between the source branch and the target branch
  2. rules:change takes into account the changes between the branch and the previous commit
  3. and 4. rules:change always evaluate to true

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_branch pipeline.

Finally, 1. is fine, already used and no changes (no pun) is required in our pipelines.

How

  • Using grep to 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
  • grep to see that only before_merging.yml and merge_train.yml use changesets
% grep -l "changes:" .gitlab/ci/pipelines/*.yml
.gitlab/ci/pipelines/before_merging.yml
.gitlab/ci/pipelines/merge_train.yml

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.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR

Merge request reports

Loading