From d3875c1867588613a3fbfa05ca95ab43cceda5b5 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 6 Dec 2024 11:42:53 -0800 Subject: [PATCH] Add Gerrit 3.11 image builds and testing This adds Gerrit 3.11 image builds an a system-config-run job for a 3.11 deployment. We don't add 3.10 to 3.11 upgrade testing yet. This will happen as a followup once we're happy with general image building and testing. This adds explicit push and force push permissions to the Administrators group via code reviewed changes. The reason for this is Gerrit 3.11 has decided that everything should be code reviewed by default including actions by Administrators. Since we're just doing this for bootstrapping of testing we quickly add the old expected permissions back via code review. This has a side effect of bumping up the change numbers for the cahnges we care about in review up by 2 integer values. The tests and screenshots are all updated to accomodate the shift in change numbers. Change-Id: Ib7090563a869577ed100ca71c496e8779e5b1010 --- playbooks/zuul/bootstrap-test-review.yaml | 51 ++++++----- testinfra/test_gerrit.py | 8 +- zuul.d/docker-images/gerrit.yaml | 104 ++++++++++++++++++++++ zuul.d/project.yaml | 10 +++ zuul.d/system-config-run.yaml | 9 ++ 5 files changed, 156 insertions(+), 26 deletions(-) diff --git a/playbooks/zuul/bootstrap-test-review.yaml b/playbooks/zuul/bootstrap-test-review.yaml index a3d697d5c7..cc204e2541 100644 --- a/playbooks/zuul/bootstrap-test-review.yaml +++ b/playbooks/zuul/bootstrap-test-review.yaml @@ -99,9 +99,13 @@ pushd All-Projects + # Setup change id hook. Adapted from Zuul quickstart setup. + f="$(git rev-parse --git-dir)/hooks/commit-msg"; curl -o "$f" http://localhost:8081/tools/hooks/commit-msg ; chmod +x "$f" + echo "{{ group_json.id }} CI-tools" >> groups # noqa 203 git commit -a -m "Add CI-tools group" - git push origin HEAD:refs/meta/config + git push origin HEAD:refs/for/refs/meta/config + ssh -i /root/.ssh/id_25519 -p 29418 -l 'admin' localhost gerrit review -l Code-Review=2 --submit -p All-Projects 1,1 cat >> project.config << EOF [label "Verified"] @@ -115,11 +119,14 @@ description = CI result votes. Maximum required to merge and is provided by the Zuul's gate queue. submittableIf = label:Verified=MAX AND -label:Verified=MIN canOverrideInChildProjects = false + [access "refs/*"] + push = +force group Administrators [access "refs/heads/*"] label-Verified = -2..+2 group CI-tools EOF git commit -a -m 'Update All-Project configuration' - git push origin HEAD:refs/meta/config + git push origin HEAD:refs/for/refs/meta/config + ssh -i /root/.ssh/id_25519 -p 29418 -l 'admin' localhost gerrit review -l Code-Review=2 --submit -p All-Projects 2,1 popd @@ -238,20 +245,6 @@ curl -Lo .git/hooks/commit-msg http://localhost:8081/tools/hooks/commit-msg chmod u+x .git/hooks/commit-msg - cat >file-1.txt <file-2.txt <file-3.txt <file-4.txt <file-5.txt < 3.11 upgrade #- system-config-upgrade-review: # dependencies: @@ -220,6 +225,11 @@ - name: opendev-buildset-registry - name: system-config-upload-image-gerrit-3.10 soft: true + - system-config-run-review-3.11: + dependencies: + - name: opendev-buildset-registry + - name: system-config-upload-image-gerrit-3.11 + soft: true - system-config-run-refstack: dependencies: - name: opendev-buildset-registry diff --git a/zuul.d/system-config-run.yaml b/zuul.d/system-config-run.yaml index 7751f55a95..eece6f7647 100644 --- a/zuul.d/system-config-run.yaml +++ b/zuul.d/system-config-run.yaml @@ -1103,6 +1103,15 @@ vars: zuul_test_gerrit_version: '3.10' +- job: + name: system-config-run-review-3.11 + parent: system-config-run-review-base + description: | + Run the playbook for gerrit 3.11 (in a container). + requires: gerrit-3.11-container-image + vars: + zuul_test_gerrit_version: '3.11' + # Disabled until we can test the 3.10 to 3.11 upgrade #- job: # name: system-config-upgrade-review