From 4e6e0807ede27cbd243d6f77e6b61d55cec6a30e Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 24 Oct 2023 12:07:12 +0200 Subject: [PATCH 1/8] CI test From 6be092a1f33df2527a4b27fc8e5c506532641cf6 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 24 Oct 2023 12:14:01 +0200 Subject: [PATCH 2/8] disable cargo-check-each-crate-macos --- .gitlab/pipeline/test.yml | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.gitlab/pipeline/test.yml b/.gitlab/pipeline/test.yml index 7d7007acd8a8..30f531869a35 100644 --- a/.gitlab/pipeline/test.yml +++ b/.gitlab/pipeline/test.yml @@ -447,27 +447,27 @@ cargo-check-each-crate: - PYTHONUNBUFFERED=x time .gitlab/check-each-crate.py "$CI_NODE_INDEX" "$CI_NODE_TOTAL" parallel: 6 -cargo-check-each-crate-macos: - stage: test - extends: - - .docker-env - - .common-refs - - .run-immediately - # - .collect-artifacts - before_script: - # skip timestamp script, the osx bash doesn't support printf %()T - - !reference [.job-switcher, before_script] - - !reference [.rust-info-script, script] - - !reference [.pipeline-stopper-vars, script] - variables: - SKIP_WASM_BUILD: 1 - script: - # TODO: enable rusty-cachier once it supports Mac - # TODO: use parallel jobs, as per cargo-check-each-crate, once more Mac runners are available - # - time ./scripts/ci/gitlab/check-each-crate.py 1 1 - - time cargo check --workspace --locked - tags: - - osx +# cargo-check-each-crate-macos: +# stage: test +# extends: +# - .docker-env +# - .common-refs +# - .run-immediately +# # - .collect-artifacts +# before_script: +# # skip timestamp script, the osx bash doesn't support printf %()T +# - !reference [.job-switcher, before_script] +# - !reference [.rust-info-script, script] +# - !reference [.pipeline-stopper-vars, script] +# variables: +# SKIP_WASM_BUILD: 1 +# script: +# # TODO: enable rusty-cachier once it supports Mac +# # TODO: use parallel jobs, as per cargo-check-each-crate, once more Mac runners are available +# # - time ./scripts/ci/gitlab/check-each-crate.py 1 1 +# - time cargo check --workspace --locked +# tags: +# - osx cargo-hfuzz: stage: test @@ -520,6 +520,6 @@ test-syscalls: - ./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/polkadot-prepare-worker --only-used-syscalls | diff -u prepare-worker-syscalls - after_script: - if [[ "$CI_JOB_STATUS" == "failed" ]]; then - printf "The x86_64 syscalls used by the worker binaries have changed. Please review if this is expected and update polkadot/scripts/list-syscalls/*-worker-syscalls as needed.\n"; + printf "The x86_64 syscalls used by the worker binaries have changed. Please review if this is expected and update polkadot/scripts/list-syscalls/*-worker-syscalls as needed.\n"; fi allow_failure: true # TODO: remove this once we have an idea how often the syscall lists will change From f8ec324d5cd671f5553156beb4bc593e0cb05031 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 24 Oct 2023 12:22:48 +0200 Subject: [PATCH 3/8] disable cancel --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 069068369aba..57c7ed0ff8dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -320,10 +320,10 @@ cancel-pipeline-cargo-check-each-crate-6: needs: - job: "cargo-check-each-crate 6/6" -cancel-pipeline-cargo-check-each-crate-macos: - extends: .cancel-pipeline-template - needs: - - job: cargo-check-each-crate-macos +# cancel-pipeline-cargo-check-each-crate-macos: +# extends: .cancel-pipeline-template +# needs: +# - job: cargo-check-each-crate-macos cancel-pipeline-check-tracing: extends: .cancel-pipeline-template From d68289d0d32825e60b27e4b0ac55bf4c3ad19561 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 24 Oct 2023 14:36:22 +0200 Subject: [PATCH 4/8] add merge queue --- .gitlab-ci.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57c7ed0ff8dd..d1b70fa6f113 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -136,11 +136,13 @@ default: - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + - if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ # merge queues - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 .test-pr-refs: rules: - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + - if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ # merge queues # handle the specific case where benches could store incorrect bench data because of the downstream staging runs # exclude cargo-check-benches from such runs @@ -152,6 +154,7 @@ default: - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + - if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ # merge queues - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 .test-refs-no-trigger: @@ -162,6 +165,7 @@ default: - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + - if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ # merge queues - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ @@ -172,6 +176,7 @@ default: - if: $CI_PIPELINE_SOURCE == "web" - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + - if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ # merge queues .publish-refs: rules: @@ -192,9 +197,18 @@ default: - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + - if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ # merge queues +# run only in merge queues .zombienet-refs: - extends: .build-refs + rules: + - if: $CI_PIPELINE_SOURCE == "pipeline" + when: never + - if: $CI_PIPELINE_SOURCE == "web" + - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_REF_NAME == "master" + - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + - if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ # merge queues include: # check jobs From d1576101439a57fdfaead79919cf6a7e29af0e5b Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 24 Oct 2023 14:43:45 +0200 Subject: [PATCH 5/8] add merge queue condition --- .github/workflows/auto-label-issues.yml | 3 +++ .github/workflows/check-labels.yml | 3 +++ .github/workflows/check-licenses.yml | 7 +++++++ .github/workflows/check-prdoc.yml | 3 +++ .github/workflows/pr-custom-review.yml | 3 +++ 5 files changed, 19 insertions(+) diff --git a/.github/workflows/auto-label-issues.yml b/.github/workflows/auto-label-issues.yml index 12ffce702cdc..645ac0c2359b 100644 --- a/.github/workflows/auto-label-issues.yml +++ b/.github/workflows/auto-label-issues.yml @@ -10,6 +10,9 @@ jobs: label-new-issues: runs-on: ubuntu-latest steps: + - name: Skip in a merge queue + if: ${{ contains(github.ref, 'gh-readonly-queue') }} + run: exit 0 - name: Label drafts uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 # 1.0.4 if: github.event.issue.author_association == 'NONE' diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml index 83b52e823132..430e353abcc9 100644 --- a/.github/workflows/check-labels.yml +++ b/.github/workflows/check-labels.yml @@ -8,6 +8,9 @@ jobs: check-labels: runs-on: ubuntu-latest steps: + - name: Skip in a merge queue + if: ${{ contains(github.ref, 'gh-readonly-queue') }} + run: exit 0 - name: Pull image env: IMAGE: paritytech/ruled_labels:0.4.0 diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index e8def665bd08..27eb72456ee8 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -13,6 +13,13 @@ jobs: LICENSES: "'Apache-2.0' 'GPL-3.0-only' 'GPL-3.0-or-later WITH Classpath-exception-2.0'" NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: + - name: Skip in a merge queue + if: ${{ contains(github.ref, 'gh-readonly-queue') }} + run: exit 0 + - name: Simulate that it works + run: | + echo "it works!" + exit 0 - name: Checkout sources uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-node@v3.8.1 diff --git a/.github/workflows/check-prdoc.yml b/.github/workflows/check-prdoc.yml index 690f7a3f1333..9cc5c52388d8 100644 --- a/.github/workflows/check-prdoc.yml +++ b/.github/workflows/check-prdoc.yml @@ -17,6 +17,9 @@ jobs: check-prdoc: runs-on: ubuntu-latest steps: + - name: Skip in a merge queue + if: ${{ contains(github.ref, 'gh-readonly-queue') }} + run: exit 0 - name: Pull image run: | echo "Pulling $IMAGE" diff --git a/.github/workflows/pr-custom-review.yml b/.github/workflows/pr-custom-review.yml index b15d20c696fe..c7635b57fea0 100644 --- a/.github/workflows/pr-custom-review.yml +++ b/.github/workflows/pr-custom-review.yml @@ -19,6 +19,9 @@ jobs: pr-custom-review: runs-on: ubuntu-latest steps: + - name: Skip in a merge queue + if: ${{ contains(github.ref, 'gh-readonly-queue') }} + run: exit 0 - name: Skip if pull request is in Draft # `if: github.event.pull_request.draft == true` should be kept here, at # the step level, rather than at the job level. The latter is not From 117f597570b7f3e9fc8f64c7839f1ce93058db7c Mon Sep 17 00:00:00 2001 From: alvicsam Date: Tue, 24 Oct 2023 17:37:45 +0200 Subject: [PATCH 6/8] add merge_group: --- .github/workflows/auto-label-issues.yml | 3 --- .github/workflows/check-labels.yml | 1 + .github/workflows/check-licenses.yml | 1 + .github/workflows/check-prdoc.yml | 1 + .github/workflows/fmt-check.yml | 1 + .github/workflows/pr-custom-review.yml | 1 + 6 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-label-issues.yml b/.github/workflows/auto-label-issues.yml index 645ac0c2359b..12ffce702cdc 100644 --- a/.github/workflows/auto-label-issues.yml +++ b/.github/workflows/auto-label-issues.yml @@ -10,9 +10,6 @@ jobs: label-new-issues: runs-on: ubuntu-latest steps: - - name: Skip in a merge queue - if: ${{ contains(github.ref, 'gh-readonly-queue') }} - run: exit 0 - name: Label drafts uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 # 1.0.4 if: github.event.issue.author_association == 'NONE' diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml index 430e353abcc9..4af8817f9735 100644 --- a/.github/workflows/check-labels.yml +++ b/.github/workflows/check-labels.yml @@ -3,6 +3,7 @@ name: Check labels on: pull_request: types: [labeled, opened, synchronize, unlabeled] + merge_group: jobs: check-labels: diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index 27eb72456ee8..d8d7ba5c7fe7 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -2,6 +2,7 @@ name: Check licenses on: pull_request: + merge_group: permissions: packages: read diff --git a/.github/workflows/check-prdoc.yml b/.github/workflows/check-prdoc.yml index 9cc5c52388d8..1f7c3ef68d47 100644 --- a/.github/workflows/check-prdoc.yml +++ b/.github/workflows/check-prdoc.yml @@ -3,6 +3,7 @@ name: Check PRdoc on: pull_request: types: [labeled, opened, synchronize, unlabeled] + merge_group: env: IMAGE: paritytech/prdoc:v0.0.5 diff --git a/.github/workflows/fmt-check.yml b/.github/workflows/fmt-check.yml index 55e67f2799b8..a2f8785fbb47 100644 --- a/.github/workflows/fmt-check.yml +++ b/.github/workflows/fmt-check.yml @@ -6,6 +6,7 @@ on: - master pull_request: types: [opened, synchronize, reopened, ready_for_review] + merge_group: jobs: quick_check: diff --git a/.github/workflows/pr-custom-review.yml b/.github/workflows/pr-custom-review.yml index c7635b57fea0..28488b65358a 100644 --- a/.github/workflows/pr-custom-review.yml +++ b/.github/workflows/pr-custom-review.yml @@ -14,6 +14,7 @@ on: - ready_for_review - converted_to_draft pull_request_review: + merge_group: jobs: pr-custom-review: From b21d091fbedb953f3b696e2ddaf16f076241f389 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 25 Oct 2023 11:52:03 +0200 Subject: [PATCH 7/8] fix docker image tag --- .gitlab-ci.yml | 2 +- .gitlab/pipeline/publish.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1b70fa6f113..06478156097e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,7 +31,7 @@ variables: NEXTEST_FAILURE_OUTPUT: immediate-final NEXTEST_SUCCESS_OUTPUT: final ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.71" - DOCKER_IMAGES_VERSION: "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" + DOCKER_IMAGES_VERSION: "${CI_COMMIT_SHA}" default: retry: diff --git a/.gitlab/pipeline/publish.yml b/.gitlab/pipeline/publish.yml index a03d407c0409..9db3c7901c3b 100644 --- a/.gitlab/pipeline/publish.yml +++ b/.gitlab/pipeline/publish.yml @@ -71,8 +71,6 @@ publish-rustdoc: DOCKERFILE: "" # docker/path-to.Dockerfile IMAGE_NAME: "" # docker.io/paritypr/image_name script: - # - test "$PARITYPR_USER" -a "$PARITYPR_PASS" || - # ( echo "no docker credentials provided"; exit 1 ) - $BUILDAH_COMMAND build --format=docker --build-arg VCS_REF="${CI_COMMIT_SHA}" From f1ab718330add074666c5e42aa0072c8023622f9 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Wed, 25 Oct 2023 12:00:35 +0200 Subject: [PATCH 8/8] publish images only in merge queues --- .gitlab/pipeline/publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab/pipeline/publish.yml b/.gitlab/pipeline/publish.yml index 9db3c7901c3b..d1d261e3e08b 100644 --- a/.gitlab/pipeline/publish.yml +++ b/.gitlab/pipeline/publish.yml @@ -89,7 +89,7 @@ build-push-image-polkadot-parachain-debug: stage: publish extends: - .kubernetes-env - - .common-refs + - .zombienet-refs - .build-push-image needs: - job: build-linux-stable-cumulus @@ -102,7 +102,7 @@ build-push-image-test-parachain: stage: publish extends: - .kubernetes-env - - .common-refs + - .zombienet-refs - .build-push-image needs: - job: build-test-parachain @@ -168,7 +168,7 @@ build-push-image-polkadot-debug: stage: publish extends: - .kubernetes-env - - .common-refs + - .zombienet-refs - .build-push-image needs: - job: build-linux-stable @@ -181,7 +181,7 @@ build-push-image-colander: stage: publish extends: - .kubernetes-env - - .common-refs + - .zombienet-refs - .build-push-image needs: - job: build-test-collators @@ -194,7 +194,7 @@ build-push-image-malus: stage: publish extends: - .kubernetes-env - - .common-refs + - .zombienet-refs - .build-push-image needs: - job: build-malus @@ -207,7 +207,7 @@ build-push-image-substrate-pr: stage: publish extends: - .kubernetes-env - - .common-refs + - .zombienet-refs - .build-push-image needs: - job: build-linux-substrate