From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADFC6C4361B for ; Mon, 14 Dec 2020 15:04:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 40D81225AB for ; Mon, 14 Dec 2020 15:04:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40D81225AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kopOl-0001jR-7w for qemu-devel@archiver.kernel.org; Mon, 14 Dec 2020 10:04:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kopN4-00080Z-Kh for qemu-devel@nongnu.org; Mon, 14 Dec 2020 10:02:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kopN1-0002Xm-P6 for qemu-devel@nongnu.org; Mon, 14 Dec 2020 10:02:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607958158; h=from:from: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; bh=51bnO84bjW36kzT8Ht39JI3JwlkPuwCQolSFjTDbQ/s=; b=Q2MukdhmpNzG+rfYB5SRO6Nv8Gi8SbRZkARc06zmdYYyP7HYd6XbX5zOSa3SyHGxCA90fF XcllOCCRgB/tGDaVJcw2ISbSrqnFbpNl5diCFrvNKuXXBmgcEm1j8zq5ha0j+vCOFJzbgm M2atScoS/R9QBevQrJ7lsger1C+wU/8= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-PTzmMPWDN92Lifz4lLXF6g-1; Mon, 14 Dec 2020 10:02:35 -0500 X-MC-Unique: PTzmMPWDN92Lifz4lLXF6g-1 Received: by mail-wr1-f71.google.com with SMTP id g16so5433569wrv.1 for ; Mon, 14 Dec 2020 07:02:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=51bnO84bjW36kzT8Ht39JI3JwlkPuwCQolSFjTDbQ/s=; b=hbpiTAATwOgnMP8bgn/LG+XzMCjDPFkB4Y9+9vCK4X0aApR4Ieo6XgZ6NqXA2Ee6ll 9KdrcdWthjODTT4hjSH9WhpIRwyMDTKa1ae9eQFd0InYA1xPFQtT+UGpX5g1pYXmcDit CFDNEb7w8AM13K+Hg/FZQzyqm3S6sxZ0sWkADHGWo5Atc5DoVQXJYAEVGnHlKIcuAjIz yh73PL0BOXi/9Dqoz3pHGLABAYpxrZJdjXukmGTowin5y2OWfy8vJzYmzVV4Op3JOPfP 83bEYPeFBV3qQTy+L9FnygQ3biLbf5YJullDZwTyPYSJTcqHreDFkSZyNCUhyf2yJVc0 FJaA== X-Gm-Message-State: AOAM533XqKxeSyN/VQPWkGgivN7wl6hAq/ix6kfiht4XSu1oaVLxQHR0 HE7CZ54C4ju5eF5CVdEXTd5qwPScikeMkqMzTsx7xOsqIKEEk3XugvJgg9uGU8/PNn1diXNvHm2 vnAt/fwOl03xCq54= X-Received: by 2002:a1c:1c1:: with SMTP id 184mr27945954wmb.112.1607958154191; Mon, 14 Dec 2020 07:02:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAXUf7e9PmQx9MXml9CLoyGbZ4RKCWJ6U6wxm7gZjdC+4CtQSlU/olCIjrho9p7X7J/X1VTA== X-Received: by 2002:a1c:1c1:: with SMTP id 184mr27945915wmb.112.1607958153887; Mon, 14 Dec 2020 07:02:33 -0800 (PST) Received: from [192.168.1.36] (101.red-88-21-206.staticip.rima-tde.net. [88.21.206.101]) by smtp.gmail.com with ESMTPSA id b73sm37272068wmb.0.2020.12.14.07.02.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Dec 2020 07:02:33 -0800 (PST) Subject: Re: [RFC PATCH 2/2] gitlab-ci: Introduce allow_skipping_job_template To: Thomas Huth , qemu-devel@nongnu.org, Cleber Rosa , Willian Rampazzo References: <20201211171703.537546-1-philmd@redhat.com> <20201211171703.537546-3-philmd@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Mon, 14 Dec 2020 16:02:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Alex_Benn=c3=a9e?= , =?UTF-8?Q?Daniel_P_=2e_Berrang=c3=a9?= , virt-ci-maint-team@redhat.com, Wainer dos Santos Moschetta Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 12/14/20 2:32 PM, Thomas Huth wrote: > On 11/12/2020 18.17, Philippe Mathieu-Daudé wrote: >> It might be overkill (and frustrating) to rerun all the jobs when >> iterating over a single code unit. As some users are interested >> in only rerunning a specific set of jobs, allow them to use a >> "manual" profile, when jobs are created in the pipeline but not >> started. It is up to the user to manually start the jobs of >> interest. >> >> To switch a repository to manual, set QEMU_DEFAULT_WORKFLOW_MANUAL >> in the project UI, following [1]. >> >> Once a repository is using the manual workflow, the user can still >> automatically start the jobs by explicitly set the >> QEMU_IGNORE_DEFAULT_WORKFLOW which disable the manual mode. >> >> Example while pushing a branch/tag from command line (see [2]): >> >> $ git push -o ci.variable="QEMU_IGNORE_DEFAULT_WORKFLOW=1" \ >> myrepo mybranch >> >> [1] https://docs.gitlab.com/ee/ci/variables/#create-a-custom-variable-in-the-ui >> [2] https://docs.gitlab.com/ee/user/project/push_options.html#push-options-for-gitlab-cicd >> >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> .gitlab-ci.d/crossbuilds.yml | 4 ++++ >> .gitlab-ci.yml | 18 ++++++++++++++++++ >> 2 files changed, 22 insertions(+) >> >> diff --git a/.gitlab-ci.d/crossbuilds.yml b/.gitlab-ci.d/crossbuilds.yml >> index 864cad7cec5..56b053cbb52 100644 >> --- a/.gitlab-ci.d/crossbuilds.yml >> +++ b/.gitlab-ci.d/crossbuilds.yml >> @@ -1,4 +1,5 @@ >> .cross_system_build_job: >> + extends: .allow_skipping_job >> stage: build >> image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest >> timeout: 80m >> @@ -18,6 +19,7 @@ >> # KVM), and set extra options (such disabling other accelerators) via the >> # $ACCEL_CONFIGURE_OPTS variable. >> .cross_accel_build_job: >> + extends: .allow_skipping_job >> stage: build >> image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest >> timeout: 30m >> @@ -30,6 +32,7 @@ >> - make -j$(expr $(nproc) + 1) all check-build >> >> .cross_user_build_job: >> + extends: .allow_skipping_job >> stage: build >> image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest >> script: >> @@ -40,6 +43,7 @@ >> - make -j$(expr $(nproc) + 1) all check-build >> >> .cross_sanity_check_job: >> + extends: .allow_skipping_job > > So "extends" is possible .... > >> stage: build >> image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest >> timeout: 3m >> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml >> index 98bff03b47b..26b85f08f35 100644 >> --- a/.gitlab-ci.yml >> +++ b/.gitlab-ci.yml >> @@ -13,7 +13,21 @@ include: >> - local: '/.gitlab-ci.d/containers.yml' >> - local: '/.gitlab-ci.d/crossbuilds.yml' >> >> +.allow_skipping_job_template: &allow_skipping_job_definition >> + rules: >> + # Skip if the user set the QEMU_DEFAULT_WORKFLOW_MANUAL variable for its >> + # project. Can be overridden by setting the QEMU_IGNORE_DEFAULT_WORKFLOW >> + # variable. >> + - if: $CI_PIPELINE_SOURCE == "push" && $QEMU_DEFAULT_WORKFLOW_MANUAL && $QEMU_IGNORE_DEFAULT_WORKFLOW == null >> + when: manual >> + allow_failure: true >> + - when: always >> + >> +.allow_skipping_job: >> + <<: *allow_skipping_job_definition > > ... before the anchestor has been defined? That's nice! 'extends' is indeed more powerful and less hackish. > I'm basically fine with this patch, but can you please also add some > sentence how to use this to docs/devel/testing.rst ? Thanks, I later discovered this isn't complete, because if a children job is in automatic state and a parent (dependency) is in manual, there is some "dead lock": the pipeline waits until manual job is started. To be complete, I have to ensure if a job is in manual state, all its dependencies also are. Then we are back to 'extends' VS 'anchors', as this doesn't work with anchors, I have to convert all jobs to 'extends'. Good news is I already did it, I simply need to rebase this series: https://www.mail-archive.com/qemu-devel@nongnu.org/msg758331.html Thanks for reviewing, Phil.