From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Richard Henderson <richard.henderson@linaro.org>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Michael Tokarev" <mjt@tls.msk.ru>
Subject: [PULL 3/9] gitlab: allow overriding name of the upstream repository
Date: Mon, 26 Jun 2023 10:14:09 +0200 [thread overview]
Message-ID: <20230626081415.64615-4-thuth@redhat.com> (raw)
In-Reply-To: <20230626081415.64615-1-thuth@redhat.com>
From: Daniel P. Berrangé <berrange@redhat.com>
The CI rules have special logic for what happens in upstream. To enable
contributors who modify CI rules to test this logic, however, they need
to be able to override which repo is considered upstream. This
introduces the 'QEMU_CI_UPSTREAM' variable
git push gitlab <branch> -o ci.variable=QEMU_CI_UPSTREAM=berrange
to make it look as if my namespace is the actual upstream. Namespace in
this context refers to the path fragment in gitlab URLs that is above
the repository. Typically this will be the contributor's gitlab login
name.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230608164018.2520330-3-berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
docs/devel/ci-jobs.rst.inc | 6 ++++++
.gitlab-ci.d/base.yml | 19 ++++++++++++-------
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/docs/devel/ci-jobs.rst.inc b/docs/devel/ci-jobs.rst.inc
index f72537853b..3f6802d51e 100644
--- a/docs/devel/ci-jobs.rst.inc
+++ b/docs/devel/ci-jobs.rst.inc
@@ -75,6 +75,12 @@ in a handful of namespaces
'latest', but if running pipelines for different branches
concurrently, it should be overridden per pipeline.
+ * QEMU_CI_UPSTREAM - gitlab namespace that is considered to be
+ the 'upstream'. This defaults to 'qemu-project'. Contributors
+ may choose to override this if they are modifying rules in
+ base.yml and need to validate how they will operate when in
+ an upstream context, as opposed to their fork context.
+
* nnn - other misc variables not falling into the above
categories, or using different names for historical reasons
and not yet converted.
diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
index fba9d31cc6..a1d734267a 100644
--- a/.gitlab-ci.d/base.yml
+++ b/.gitlab-ci.d/base.yml
@@ -5,6 +5,11 @@ variables:
# for different branches in contributor forks.
QEMU_CI_CONTAINER_TAG: latest
+ # For purposes of CI rules, upstream is the gitlab.com/qemu-project
+ # namespace. When testing CI, it might be usefult to override this
+ # to point to a fork repo
+ QEMU_CI_UPSTREAM: qemu-project
+
# The order of rules defined here is critically important.
# They are evaluated in order and first match wins.
#
@@ -30,23 +35,23 @@ variables:
when: never
# Publishing jobs should only run on the default branch in upstream
- - if: '$QEMU_JOB_PUBLISH == "1" && $CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
+ - if: '$QEMU_JOB_PUBLISH == "1" && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
when: never
# Non-publishing jobs should only run on staging branches in upstream
- - if: '$QEMU_JOB_PUBLISH != "1" && $CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH !~ /staging/'
+ - if: '$QEMU_JOB_PUBLISH != "1" && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH !~ /staging/'
when: never
# Jobs only intended for forks should always be skipped on upstream
- - if: '$QEMU_JOB_ONLY_FORKS == "1" && $CI_PROJECT_NAMESPACE == "qemu-project"'
+ - if: '$QEMU_JOB_ONLY_FORKS == "1" && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM'
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"'
+ - if: '$QEMU_CI != "1" && $QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM'
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"'
+ - if: '$QEMU_JOB_AVOCADO && $QEMU_CI_AVOCADO_TESTING != "1" && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM'
when: never
@@ -66,7 +71,7 @@ variables:
allow_failure: true
# Avocado jobs can be manually start in forks if $QEMU_CI_AVOCADO_TESTING is unset
- - if: '$QEMU_JOB_AVOCADO && $CI_PROJECT_NAMESPACE != "qemu-project"'
+ - if: '$QEMU_JOB_AVOCADO && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM'
when: manual
allow_failure: true
@@ -78,7 +83,7 @@ variables:
# Forks pipeline jobs don't start automatically unless
# QEMU_CI=2 is set
- - if: '$QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != "qemu-project"'
+ - if: '$QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != $QEMU_CI_UPSTREAM'
when: manual
# Jobs can run if any jobs they depend on were successful
--
2.39.3
next prev parent reply other threads:[~2023-06-26 8:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 8:14 [PULL 0/9] Testing / CI patches Thomas Huth
2023-06-26 8:14 ` [PULL 1/9] tests/qtest: Fix a comment typo in vhost-user-test.c Thomas Huth
2023-06-26 8:14 ` [PULL 2/9] gitlab: centralize the container tag name Thomas Huth
2023-06-26 8:14 ` Thomas Huth [this message]
2023-06-26 8:14 ` [PULL 4/9] gitlab: stable staging branches publish containers in a separate tag Thomas Huth
2023-06-26 8:14 ` [PULL 5/9] gitlab: avoid extra pipelines for tags and stable branches Thomas Huth
2023-06-26 8:14 ` [PULL 6/9] gitlab: support disabling job auto-run in upstream Thomas Huth
2023-06-26 8:14 ` [PULL 7/9] gitlab-ci: grab msys2 meson-logs as artifacts Thomas Huth
2023-06-26 8:14 ` [PULL 8/9] gitlab-ci: add msys2 meson test to junit report Thomas Huth
2023-06-26 8:14 ` [PULL 9/9] tests/qtest/cxl-test: Clean up temporary directories after testing Thomas Huth
2023-06-26 10:45 ` [PULL 0/9] Testing / CI patches Richard Henderson
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=20230626081415.64615-4-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=berrange@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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).