All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org, "Cleber Rosa" <crosa@redhat.com>,
	"Willian Rampazzo" <wrampazz@redhat.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	virt-ci-maint-team@redhat.com,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>
Subject: Re: [RFC PATCH 2/2] gitlab-ci: Introduce allow_skipping_job_template
Date: Mon, 14 Dec 2020 14:32:29 +0100	[thread overview]
Message-ID: <f8f902a9-026f-7059-2d61-5ae3051acf15@redhat.com> (raw)
In-Reply-To: <20201211171703.537546-3-philmd@redhat.com>

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é <philmd@redhat.com>
> ---
>  .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!

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,
  Thomas



  reply	other threads:[~2020-12-14 13:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 17:17 [RFC PATCH 0/2] gitlab-ci: Maintain a public runner, allow manual pipeline Philippe Mathieu-Daudé
2020-12-11 17:17 ` [RFC PATCH 1/2] gitlab-ci: Step in to maintain the fedora-i386-cross runner Philippe Mathieu-Daudé
2020-12-14 12:35   ` Thomas Huth
2020-12-14 17:52     ` Philippe Mathieu-Daudé
2020-12-15 10:01       ` Daniel P. Berrangé
2020-12-11 17:17 ` [RFC PATCH 2/2] gitlab-ci: Introduce allow_skipping_job_template Philippe Mathieu-Daudé
2020-12-14 13:32   ` Thomas Huth [this message]
2020-12-14 15:02     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8f902a9-026f-7059-2d61-5ae3051acf15@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=virt-ci-maint-team@redhat.com \
    --cc=wainersm@redhat.com \
    --cc=wrampazz@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.