From nobody Mon Feb 9 01:21:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610622241; cv=none; d=zohomail.com; s=zohoarc; b=L1UaMyVtW16l9rKuMqfQrHU8EYG3PHvnTfKwAtyH/LgYDCnBA4bCjNNx396tcEAsdrjkJzcS0KOfkdtgnwi8Ka64YgS5iNGf6aya37MmaAeCoK5CPfblEeHrOLnJ0JukrcobHEYeOZ9AZ4L5LUVkL95vLcz97+KWMGENYglsYcw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610622241; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=c5AFzwC/ctETvuujuxYna6ufAnJ7lXqO39NDmEHCey4=; b=mxTdB5Tm5LAa1ITMShMCa1GBvcJfk/jS91G3NH6k+vELeQDJSXXO2eCgRg2Ns6RjdEBHsRiCoXt1S+F7jiC1rHHxLhRnF7KOh2XvBSpirIbxbfwBhx/5wl9R4r5ZAW5Xx10uPYrhVkcTQw1Ky6l+fH6WL+F9cg15wYu1mpiNu20= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1610622241680381.9221344008937; Thu, 14 Jan 2021 03:04:01 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-j0bXauQ9N0W6Sbz1Ncg_og-1; Thu, 14 Jan 2021 06:03:58 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AEA9C18C8C00; Thu, 14 Jan 2021 11:03:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8854D272DB; Thu, 14 Jan 2021 11:03:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 555C34E590; Thu, 14 Jan 2021 11:03:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10EB3heL002744 for ; Thu, 14 Jan 2021 06:03:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id F3F8B71D5E; Thu, 14 Jan 2021 11:03:42 +0000 (UTC) Received: from nautilus.local (unknown [10.40.192.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A5B91B4B4; Thu, 14 Jan 2021 11:03:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610622240; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=c5AFzwC/ctETvuujuxYna6ufAnJ7lXqO39NDmEHCey4=; b=WNE5/p5d1g5KldT6EsfPvmxoSaEZ6zjvnhw9mz2i5YpyrNQh/BSOGzr+baoU8gzP7M8jX/ N43cre03XCLLaTPDqOkyK8AfrbrgXHajJmkFK/3mXlAD/rk86BGo6rOVLdUJ7dru7VuZZM PA1k5okVDLQ2zTgYqUQZo5YdFbVNX18= X-MC-Unique: j0bXauQ9N0W6Sbz1Ncg_og-1 From: Erik Skultety To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/3] gitlab-ci.yml: Convert only/except to the rules syntax Date: Thu, 14 Jan 2021 12:03:31 +0100 Message-Id: <6fcba00b0aded2ff10e1fd2428c8ed8301e59fe2.1610621681.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: eskultet@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 'rules' syntax replaces the only/except syntax with which it is mutually exclusive. In some cases the 'rules' syntax is more readable than the 'only/except' equivalent, in some cases it is not. The idea behind this conversion is to introduce an explicit env variable controlling the 'allow_failure' attribute which would be then attached to a broken build job which would mark this broken build as a soft failure which is not possible with the 'only/except' syntax. Yes, the alternative here is to use 'allow_failure' directly on the broken job, but being explicit is always better for readability than implicit. Signed-off-by: Erik Skultety --- .gitlab-ci.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 018008ca1c..de6ead01d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,6 +43,8 @@ stages: .native_build_job_template: stage: builds image: $CI_REGISTRY_IMAGE/ci-$NAME:latest + rules: + - when: on_success cache: paths: - ccache/ @@ -98,10 +100,8 @@ stages: ci/cirrus/$NAME.yml - cat ci/cirrus/$NAME.yml - cirrus-run -v --show-build-log always ci/cirrus/$NAME.yml - only: - variables: - - $CIRRUS_GITHUB_REPO - - $CIRRUS_API_TOKEN + rules: + - if: "$CIRRUS_GITHUB_REPO && $CIRRUS_API_TOKEN" =20 .cross_build_default_job_template: stage: builds @@ -110,6 +110,8 @@ stages: paths: - ccache/ key: "$CI_JOB_NAME" + rules: + - when: on_success before_script: - *script_variables script: @@ -552,8 +554,8 @@ potfile: image: $CI_REGISTRY_IMAGE/ci-centos-8:latest needs: - x64-centos-8-container - only: - - master + rules: + - if: "$CI_COMMIT_BRANCH =3D=3D 'master'" before_script: - *script_variables script: @@ -580,9 +582,8 @@ check-dco: image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master script: - /check-dco - except: - variables: - - $CI_PROJECT_NAMESPACE =3D=3D 'libvirt' + rules: + - if: "$CI_PROJECT_NAMESPACE !=3D 'libvirt'" variables: GIT_DEPTH: 1000 =20 @@ -600,8 +601,5 @@ coverity: - cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C build - tar cfz cov-int.tar.gz cov-int - curl https://scan.coverity.com/builds?project=3D$COVERITY_SCAN_PROJE= CT_NAME --form token=3D$COVERITY_SCAN_TOKEN --form email=3D$GITLAB_USER_EMA= IL --form file=3D@cov-int.tar.gz --form version=3D"$(git describe --tags)" = --form description=3D"$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMI= T_REF_NAME:$CI_PIPELINE_ID" - only: - refs: - - schedules - variables: - - $COVERITY_SCAN_PROJECT_NAME && $COVERITY_SCAN_TOKEN + rules: + - if: "$CI_PIPELINE_SOURCE =3D=3D 'schedule' && $COVERITY_SCAN_PROJECT= _NAME && $COVERITY_SCAN_TOKEN" --=20 2.29.2