Skip to contentSkip to conversation

gitlab: skip cirrus jobs on master and stable branches

PATCH Applied Daniel P. Berrangé 6 participants 6 messages Nov 16, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitlab: skip cirrus jobs on master and stable branches

On the primary QEMU repository we want the CI jobs to run on the staging branch as a gating CI test.

Cirrus CI has very limited job concurrency, so if there are too many jobs triggered they'll queue up and hit the GitLab CI job timeout before they complete on Cirrus.

If we let Cirrus jobs run again on the master branch immediately after merging from staging, that just increases the chances jobs will get queued and subsequently timeout.

The same applies for merges to the stable branches.

User forks meanwhile should be allowed to run Cirrus CI jobs freely.

---
 .gitlab-ci.d/cirrus.yml | 3 +++
 1 file changed, 3 insertions(+)
.gitlab-ci.d/cirrus.yml +3 -0
index e7b25e7427..cc2f2e8906 100644
@@ -40,6 +40,9 @@
     - cat .gitlab-ci.d/cirrus/$NAME.yml
     - cirrus-run -v --show-build-log always .gitlab-ci.d/cirrus/$NAME.yml
   rules:
+    # Allow on 'staging' branch and 'stable-X.Y-staging' branches only
+    - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH !~ /staging/'
+      when: never
     - if: "$CIRRUS_GITHUB_REPO && $CIRRUS_API_TOKEN"
 
 x64-freebsd-12-build:
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Daniel P. Berrangé

On the primary QEMU repository we want the CI jobs to run on the staging branch as a gating CI test.

Cirrus CI has very limited job concurrency, so if there are too many jobs triggered they'll queue up and hit the GitLab CI job timeout before they complete on Cirrus.

If we let Cirrus jobs run again on the master branch immediately after merging from staging, that just increases the chances jobs will get queued and subsequently timeout.

Quoted 5 lines

The same applies for merges to the stable branches.

User forks meanwhile should be allowed to run Cirrus CI jobs freely.

r~

Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel P. Berrangé
Quoted 12 lines · Daniel P. Berrangé

On the primary QEMU repository we want the CI jobs to run on the staging branch as a gating CI test.

Cirrus CI has very limited job concurrency, so if there are too many jobs triggered they'll queue up and hit the GitLab CI job timeout before they complete on Cirrus.

If we let Cirrus jobs run again on the master branch immediately after merging from staging, that just increases the chances jobs will get queued and subsequently timeout.

Quoted 9 lines

The same applies for merges to the stable branches.

User forks meanwhile should be allowed to run Cirrus CI jobs freely.

---
 .gitlab-ci.d/cirrus.yml | 3 +++
 1 file changed, 3 insertions(+)
Reviewed-by on v1 1/1
#3 lore raw
In reply to Daniel P. Berrangé
Quoted 11 lines · Daniel P. Berrangé

On the primary QEMU repository we want the CI jobs to run on the staging branch as a gating CI test.

Cirrus CI has very limited job concurrency, so if there are too many jobs triggered they'll queue up and hit the GitLab CI job timeout before they complete on Cirrus.

If we let Cirrus jobs run again on the master branch immediately after merging from staging, that just increases the chances jobs will get queued and subsequently timeout.

Quoted 8 lines

The same applies for merges to the stable branches.

User forks meanwhile should be allowed to run Cirrus CI jobs freely.

---
 .gitlab-ci.d/cirrus.yml | 3 +++
 1 file changed, 3 insertions(+)
Reviewed-by on v1 1/1
#4 lore raw
In reply to Daniel P. Berrangé
Quoted 26 lines · Daniel P. Berrangé

On the primary QEMU repository we want the CI jobs to run on the staging branch as a gating CI test.

Cirrus CI has very limited job concurrency, so if there are too many jobs triggered they'll queue up and hit the GitLab CI job timeout before they complete on Cirrus.

If we let Cirrus jobs run again on the master branch immediately after merging from staging, that just increases the chances jobs will get queued and subsequently timeout.

The same applies for merges to the stable branches.

User forks meanwhile should be allowed to run Cirrus CI jobs freely.

---
  .gitlab-ci.d/cirrus.yml | 3 +++
  1 file changed, 3 insertions(+)
.gitlab-ci.d/cirrus.yml +0 -0
index e7b25e7427..cc2f2e8906 100644

.gitlab-ci.d/cirrus.yml line 48

Quoted 9 lines
.gitlab-ci.d/cirrus.yml +3 -0
@@ -40,6 +40,9 @@
      - cat .gitlab-ci.d/cirrus/$NAME.yml
      - cirrus-run -v --show-build-log always .gitlab-ci.d/cirrus/$NAME.yml
    rules:
+    # Allow on 'staging' branch and 'stable-X.Y-staging' branches only
+    - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH !~ /staging/'
+      when: never
      - if: "$CIRRUS_GITHUB_REPO && $CIRRUS_API_TOKEN"
 
  x64-freebsd-12-build:
Applied
#5 lore raw
In reply to Daniel P. Berrangé
Quoted 11 lines · Daniel P. Berrangé

On the primary QEMU repository we want the CI jobs to run on the staging branch as a gating CI test.

Cirrus CI has very limited job concurrency, so if there are too many jobs triggered they'll queue up and hit the GitLab CI job timeout before they complete on Cirrus.

If we let Cirrus jobs run again on the master branch immediately after merging from staging, that just increases the chances jobs will get queued and subsequently timeout.

Quoted 5 lines

The same applies for merges to the stable branches.

User forks meanwhile should be allowed to run Cirrus CI jobs freely.

Queued to pr/161121-for-6.2-1, thanks.

Signature · 1 line
Alex Bennée