Skip to content

Change rules for jobs in pipeline

Version Control Information

Source branch: chore/change-pipeline-rules-for-trivial-changes
Target branch: devel

Commits:

* Change rules for jobs in pipeline

Only run docs related jobs when docs where changed.
Only run cluster related jobs when code was changed.

Closes: #478

Description

  • run linting only when corresponding file type was changed, e.g
  rules:
    - changes:
      - '**/*.sh'
      when: on_success
    - when: never
  • run build-docs-check only if something within docs/ was changed (which is not in docs/_releasenotes)

    • checks that one of the changed files lies within docs/ and not within a folder starting with _
  rules:
    - if: "$CI_COMMIT_REF_NAME =~ /^(devel|stable)$/"
      when: never
    - changes:
      - 'docs/[!_]*/**/*'
      - 'docs/[!_]*'  # the above does not include files directly in docs/
      when: on_success
    - when: never
  • proposal: run all linting-jobs on merge_train (open for suggestions)

  • run cluster-tests only if changes outside docs where made

    • checks that one of the changed files lies not within a folder starting with d (it's not save if we happen to have another directory starting with d, but currently gitlab does not support rules like "if anything outside a directory has changed, do..."
.test-rules-changes: &test-rules-changes
      changes:
          # match files/directories in the root which are not "docs"
          - '{[^d]*,d,d[^o]*,do,do[^c]*,doc,doc[^s]*,docs?*}'
          # match changes in subdirs other than "docs"
          - '{[^d]*,d,d[^o]*,do,do[^c]*,doc,doc[^s]*,docs?*}/**/*'
  • put the cluster-spawn/-upgrade test into one stage and start the upgrade only if spawning was successful
  needs:
    - job: containerd
  • proposal:
    • til now: run spawn-cluster everytime¹ expect merge:merged_result, merge:detached_head, here run the job manual
    • til now: run containerd-upgrade on merge:merge_train and release_prepare, otherwise manual
    • now: when one of the jobs is supposed to run, check whether there have been changes outside docs, otherwise make it again a manual job

¹- for the cases defined in workflow:rules

Closes: #478 (closed)

Merge Prerequisites

  • MR title (and description) are descriptive
  • Code is readable and syntactically correct
  • Code is understandable
  • Documentation has been updated, if necessary
  • Commit messages look good
  • Release note file added in latest commit

As a developer: please do not tick these boxes yourself. As a reviewer: please get yourself a hot cold beverage.

Edited by Anika Borchmann

Merge request reports

Loading