qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Beraldo Leal" <bleal@redhat.com>
Subject: Re: [PATCH 5/5] gitlab: don't run CI jobs in forks by default
Date: Thu, 26 May 2022 18:08:28 +0100	[thread overview]
Message-ID: <87r14gz0em.fsf@linaro.org> (raw)
In-Reply-To: <20220526110705.59952-6-berrange@redhat.com>


Daniel P. Berrangé <berrange@redhat.com> writes:

> To preserve CI shared runner credits we don't want to run
> pipelines on every push.
>
> This sets up the config to that pipelines are never created
> for contributors by default. To override this the QEMU_CI
> variable can be set to a non-zero value. If set to 1, the
> pipeline will be created but all jobs will remain manually
> started. The contributor can selectively run jobs that they
> care about. If set to 2, the pipeline will be created and
> all jobs will immediately start.
>
> This behavior can be controlled using push variables
>
>   git push -o ci.variable=QEMU_CI=1
>
> To make this more convenient define an alias
>
>    git config --local alias.push-ci "push -o ci.variable=QEMU_CI=1"
>    git config --local alias.push-ci-now "push -o ci.variable=QEMU_CI=2"
>
> Which lets you run
>
>   git push-ci
>
> to create the pipeline, or
>
>   git push-ci-now
>
> to create and run the pipeline

I think these useful tips on running the pipelines should go in the rst
so you don't have to grep the commit log to find them.

>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  .gitlab-ci.d/base.yml      |  9 +++++++++
>  docs/devel/ci-jobs.rst.inc | 12 ++++++++++++
>  2 files changed, 21 insertions(+)
>
> diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
> index 6a918abbda..62f2a850c3 100644
> --- a/.gitlab-ci.d/base.yml
> +++ b/.gitlab-ci.d/base.yml
> @@ -28,6 +28,10 @@
>      - if: '$QEMU_JOB_ONLY_FORKS == "1" && $CI_PROJECT_NAMESPACE == "qemu-project"'
>        when: never
>  
> +    # Forks don't get pipelines unless QEMU_CI=1 or QEMU_CI=2 is set
> +    - if: '$QEMU_CI != "1" && $QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != "qemu-project"'
> +      when: never
> +
>      # Avocado jobs don't run in forks unless $QEMU_CI_AVOCADO_TESTING is set
>      - if: '$QEMU_JOB_AVOCADO && $QEMU_CI_AVOCADO_TESTING != "1" && $CI_PROJECT_NAMESPACE != "qemu-project"'
>        when: never
> @@ -59,5 +63,10 @@
>      # an earlier criteria
>      #############################################################
>  
> +    # Forks pipeline jobs don't start automatically unless
> +    # QEMU_CI=2 is set
> +    - if: '$QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != "qemu-project"'
> +      when: manual
> +
>      # Jobs can run if any jobs they depend on were successfull
>      - when: on_success
> diff --git a/docs/devel/ci-jobs.rst.inc b/docs/devel/ci-jobs.rst.inc
> index 0b4926e537..e36c8cc68d 100644
> --- a/docs/devel/ci-jobs.rst.inc
> +++ b/docs/devel/ci-jobs.rst.inc
> @@ -98,6 +98,18 @@ Contributor controlled runtime variables
>  The following variables may be set by contributors to control
>  job execution
>  
> +QEMU_CI
> +~~~~~~~
> +
> +By default, no pipelines will be created on contributor forks
> +in order to preserve CI credits
> +
> +Set this variable to 1 to create the pipelines, but leave all
> +the jobs to be manually started from the UI
> +
> +Set this variable to 2 to create the pipelines and run all
> +the jobs immediately, as was historicaly behaviour
> +
>  QEMU_CI_AVOCADO_TESTING
>  ~~~~~~~~~~~~~~~~~~~~~~~
>  By default, tests using the Avocado framework are not run automatically in


-- 
Alex Bennée


  parent reply	other threads:[~2022-05-26 17:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 11:07 [PATCH 0/5] gitlab: restrict running jobs in forks and upstream master Daniel P. Berrangé
2022-05-26 11:07 ` [PATCH 1/5] gitlab: introduce a common base job template Daniel P. Berrangé
2022-05-26 11:07 ` [PATCH 2/5] gitlab: convert Cirrus jobs to .base_job_template Daniel P. Berrangé
2022-05-26 11:07 ` [PATCH 3/5] gitlab: convert static checks " Daniel P. Berrangé
2022-05-26 11:07 ` [PATCH 4/5] gitlab: convert build/container jobs " Daniel P. Berrangé
2022-06-02 17:41   ` Thomas Huth
2022-06-06 10:50     ` Daniel P. Berrangé
2022-05-26 11:07 ` [PATCH 5/5] gitlab: don't run CI jobs in forks by default Daniel P. Berrangé
2022-05-26 15:34   ` Marc-André Lureau
2022-05-26 17:08   ` Alex Bennée [this message]
2022-05-27 13:27 ` [PATCH 0/5] gitlab: restrict running jobs in forks and upstream master Alex Bennée

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=87r14gz0em.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=wainersm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).