From b497ce4372e09be11399a55ac05e7de6eb845c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Fri, 27 Dec 2024 09:08:43 +0100 Subject: [PATCH] ci: make check-tree optional for branches other than main Old branches tend to be formatted with a different versions of clang-format, so when patches are backported, they introduce some differences in formatting, making the check-tree job to fail. These changes in formatting are normally small, and we don't pay much attention to them, causing that the pipelines are always red, increasing the work required to check if there are important failures or not. Make check-tree optional for branches other than main. This way, failures will be shown as a "warning", and if a pipeline only shows a warning we don't need to inspect it. (cherry picked from commit 9e47c9bc6aecd3a6621d4702a8299b18ce199619) --- .gitlab-ci.yml | 14 +++++++++----- .gitlab-ci/ci.template | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fac5857874..5d2aba954f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,11 +60,11 @@ variables: # # This is done by running `ci-fairy generate-template` and possibly bumping # ".default_tag". - ALPINE_TAG: 'tag-3521f7e9a13d' - CENTOS_TAG: 'tag-291e6c0e0a5b' - DEBIAN_TAG: 'tag-03f424f0cc55' - FEDORA_TAG: 'tag-291e6c0e0a5b' - UBUNTU_TAG: 'tag-03f424f0cc55' + ALPINE_TAG: 'tag-1a1fa0d53067' + CENTOS_TAG: 'tag-4960ce3d0698' + DEBIAN_TAG: 'tag-e9c1178c8d3b' + FEDORA_TAG: 'tag-4960ce3d0698' + UBUNTU_TAG: 'tag-e9c1178c8d3b' ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh' CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh' @@ -491,6 +491,10 @@ check-tree: needs: - "tier1:fedora:41@prep" rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH + allow_failure: true + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH + allow_failure: true - if: $CI_PIPELINE_SOURCE != 'schedule' stage: tier1 script: diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 7da38ab7b3..a804a2ee97 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -212,6 +212,10 @@ check-tree: needs: - "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep" rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH + allow_failure: true + - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH + allow_failure: true - if: $CI_PIPELINE_SOURCE != 'schedule' stage: tier1 script: