From d3d6b1d5e9ff9b74ee207495f34fc987f11a24ad Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Aug 2023 17:36:48 +0200 Subject: [PATCH 01/11] [ci] Add experimental feature in tests and cargo check --- .gitlab/pipeline/check.yml | 2 +- .gitlab/pipeline/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/pipeline/check.yml b/.gitlab/pipeline/check.yml index a282ec66fe71..f5a9cacf3739 100644 --- a/.gitlab/pipeline/check.yml +++ b/.gitlab/pipeline/check.yml @@ -20,7 +20,7 @@ check-try-runtime: - time cargo check --locked -p parachain-template-node --features try-runtime # add after https://github.com/paritytech/substrate/pull/14502 is merged # experimental code may rely on try-runtime and vice-versa - # - time cargo check --locked --features try-runtime,experimental + - time cargo check --locked --features try-runtime,experimental cargo-fmt-manifest: stage: check diff --git a/.gitlab/pipeline/test.yml b/.gitlab/pipeline/test.yml index 23202005045b..ca8da4ea7566 100644 --- a/.gitlab/pipeline/test.yml +++ b/.gitlab/pipeline/test.yml @@ -34,7 +34,7 @@ test-linux-stable: --release \ --verbose \ --no-fail-fast \ - --features runtime-benchmarks,try-runtime \ + --features runtime-benchmarks,try-runtime,experimental \ --partition count:${CI_NODE_INDEX}/${CI_NODE_TOTAL} # run runtime-api tests with `enable-staging-api` feature on the 1st node - if [ ${CI_NODE_INDEX} == 1 ]; then time cargo nextest run -p sp-api-test --features enable-staging-api; fi From 9cc9635f212d3041fb35025f6a2d6e0eca0f498a Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Aug 2023 17:46:29 +0200 Subject: [PATCH 02/11] fix labels GHA --- .github/workflows/check-D-labels.yml | 93 ++++++++++++++-------------- .github/workflows/check-labels.yml | 4 +- 2 files changed, 48 insertions(+), 49 deletions(-) diff --git a/.github/workflows/check-D-labels.yml b/.github/workflows/check-D-labels.yml index 94a818fcc2a3..23e645bce04a 100644 --- a/.github/workflows/check-D-labels.yml +++ b/.github/workflows/check-D-labels.yml @@ -1,54 +1,53 @@ -# name: Check D labels -# disabled in favor of pr-custom-review +name: Check D labels -# on: -# pull_request: -# types: [labeled, opened, synchronize, unlabeled] -# paths: -# - cumulus/primitives/** -# - polkadot/runtime/polkadot/** -# - polkadot/runtime/kusama/** -# - polkadot/runtime/common/** -# - polkadot/primitives/src/** -# - substrate/frame/** -# - substrate/primitives/** +on: + pull_request: + types: [labeled, opened, synchronize, unlabeled] + paths: + - cumulus/primitives/** + - polkadot/runtime/polkadot/** + - polkadot/runtime/kusama/** + - polkadot/runtime/common/** + - polkadot/primitives/src/** + - substrate/frame/** + - substrate/primitives/** -# jobs: -# check-labels: -# runs-on: ubuntu-latest -# steps: -# - name: Pull image -# env: -# IMAGE: paritytech/ruled_labels:0.4.0 -# run: docker pull $IMAGE +jobs: + check-labels: + runs-on: ubuntu-latest + steps: + - name: Pull image + env: + IMAGE: paritytech/ruled_labels:0.4.0 + run: docker pull $IMAGE -# - name: Check labels -# env: -# IMAGE: paritytech/ruled_labels:0.4.0 -# MOUNT: /work -# GITHUB_PR: ${{ github.event.pull_request.number }} -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# API_BASE: https://api.github.com/repos -# REPO: ${{ github.repository }} -# RULES_PATH: labels/ruled_labels -# CHECK_SPECS: specs_cumulus.yaml -# run: | -# echo "REPO: ${REPO}" -# echo "GITHUB_PR: ${GITHUB_PR}" -# # Clone repo with labels specs -# git clone https://github.com/paritytech/labels -# # Fetch the labels for the PR under test -# labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",") + - name: Check labels + env: + IMAGE: paritytech/ruled_labels:0.4.0 + MOUNT: /work + GITHUB_PR: ${{ github.event.pull_request.number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + API_BASE: https://api.github.com/repos + REPO: ${{ github.repository }} + RULES_PATH: labels/ruled_labels + CHECK_SPECS: specs_cumulus.yaml + run: | + echo "REPO: ${REPO}" + echo "GITHUB_PR: ${GITHUB_PR}" + # Clone repo with labels specs + git clone https://github.com/paritytech/labels + # Fetch the labels for the PR under test + labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",") -# if [ -z "${labels}" ]; then -# docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE check $MOUNT/$CHECK_SPECS --tags audit --no-label -# fi + if [ -z "${labels}" ]; then + docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE check $MOUNT/$CHECK_SPECS --tags audit --no-label + fi -# labels_args=${labels: :-1} -# printf "Checking labels: %s\n" "${labels_args}" + labels_args=${labels: :-1} + printf "Checking labels: %s\n" "${labels_args}" -# # Prevent the shell from splitting labels with spaces -# IFS="," + # Prevent the shell from splitting labels with spaces + IFS="," -# # --dev is more useful to debug mode to debug -# docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE check $MOUNT/$CHECK_SPECS --labels ${labels_args} --dev --tags audit + # --dev is more useful to debug mode to debug + docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE check $MOUNT/$CHECK_SPECS --labels ${labels_args} --dev --tags audit diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml index ea16bb9f3e4a..095fc56ca2fd 100644 --- a/.github/workflows/check-labels.yml +++ b/.github/workflows/check-labels.yml @@ -33,8 +33,8 @@ jobs: # Temporary, before https://github.com/paritytech/labels/pull/29 is not merged git clone https://github.com/paritytech/labels cd labels - git fetch origin the-right-joyce-monorepo-labels - git checkout the-right-joyce-monorepo-labels + git fetch origin main + git checkout main cd .. # Fetch the labels for the PR under test From ffeda2bbdf478e2ef0b94d918493d8e7e4acc19b Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Aug 2023 18:01:31 +0200 Subject: [PATCH 03/11] disable D-labels --- .github/workflows/check-D-labels.yml | 93 ++++++++++++++-------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/.github/workflows/check-D-labels.yml b/.github/workflows/check-D-labels.yml index 23e645bce04a..94a818fcc2a3 100644 --- a/.github/workflows/check-D-labels.yml +++ b/.github/workflows/check-D-labels.yml @@ -1,53 +1,54 @@ -name: Check D labels +# name: Check D labels +# disabled in favor of pr-custom-review -on: - pull_request: - types: [labeled, opened, synchronize, unlabeled] - paths: - - cumulus/primitives/** - - polkadot/runtime/polkadot/** - - polkadot/runtime/kusama/** - - polkadot/runtime/common/** - - polkadot/primitives/src/** - - substrate/frame/** - - substrate/primitives/** +# on: +# pull_request: +# types: [labeled, opened, synchronize, unlabeled] +# paths: +# - cumulus/primitives/** +# - polkadot/runtime/polkadot/** +# - polkadot/runtime/kusama/** +# - polkadot/runtime/common/** +# - polkadot/primitives/src/** +# - substrate/frame/** +# - substrate/primitives/** -jobs: - check-labels: - runs-on: ubuntu-latest - steps: - - name: Pull image - env: - IMAGE: paritytech/ruled_labels:0.4.0 - run: docker pull $IMAGE +# jobs: +# check-labels: +# runs-on: ubuntu-latest +# steps: +# - name: Pull image +# env: +# IMAGE: paritytech/ruled_labels:0.4.0 +# run: docker pull $IMAGE - - name: Check labels - env: - IMAGE: paritytech/ruled_labels:0.4.0 - MOUNT: /work - GITHUB_PR: ${{ github.event.pull_request.number }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - API_BASE: https://api.github.com/repos - REPO: ${{ github.repository }} - RULES_PATH: labels/ruled_labels - CHECK_SPECS: specs_cumulus.yaml - run: | - echo "REPO: ${REPO}" - echo "GITHUB_PR: ${GITHUB_PR}" - # Clone repo with labels specs - git clone https://github.com/paritytech/labels - # Fetch the labels for the PR under test - labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",") +# - name: Check labels +# env: +# IMAGE: paritytech/ruled_labels:0.4.0 +# MOUNT: /work +# GITHUB_PR: ${{ github.event.pull_request.number }} +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# API_BASE: https://api.github.com/repos +# REPO: ${{ github.repository }} +# RULES_PATH: labels/ruled_labels +# CHECK_SPECS: specs_cumulus.yaml +# run: | +# echo "REPO: ${REPO}" +# echo "GITHUB_PR: ${GITHUB_PR}" +# # Clone repo with labels specs +# git clone https://github.com/paritytech/labels +# # Fetch the labels for the PR under test +# labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",") - if [ -z "${labels}" ]; then - docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE check $MOUNT/$CHECK_SPECS --tags audit --no-label - fi +# if [ -z "${labels}" ]; then +# docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE check $MOUNT/$CHECK_SPECS --tags audit --no-label +# fi - labels_args=${labels: :-1} - printf "Checking labels: %s\n" "${labels_args}" +# labels_args=${labels: :-1} +# printf "Checking labels: %s\n" "${labels_args}" - # Prevent the shell from splitting labels with spaces - IFS="," +# # Prevent the shell from splitting labels with spaces +# IFS="," - # --dev is more useful to debug mode to debug - docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE check $MOUNT/$CHECK_SPECS --labels ${labels_args} --dev --tags audit +# # --dev is more useful to debug mode to debug +# docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE check $MOUNT/$CHECK_SPECS --labels ${labels_args} --dev --tags audit From 3d434973db150f2463b4c1f27ada410b9d80e14a Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Aug 2023 18:02:16 +0200 Subject: [PATCH 04/11] add check license --- .github/workflows/check-licenses.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/check-licenses.yml diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml new file mode 100644 index 000000000000..1e654f7b3070 --- /dev/null +++ b/.github/workflows/check-licenses.yml @@ -0,0 +1,26 @@ +name: Check licenses + +on: + pull_request: + +jobs: + check-licenses: + runs-on: ubuntu-22.04 + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - uses: actions/setup-node@v3.8.1 + with: + node-version: '18.x' + registry-url: 'https://npm.pkg.github.com' + scope: '@paritytech' + - name: Check the licenses + run: | + shopt -s globstar + + npx @paritytech/license-scanner@0.0.5 scan \ + --ensure-licenses=Apache-2.0 \ + --ensure-licenses=GPL-3.0-only \ + ./**/*.rs + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9b9456fb1879f87bde49f2daf065da48ff514682 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Aug 2023 18:13:40 +0200 Subject: [PATCH 05/11] add auto-label-issues --- .github/workflows/auto-label-issues.yml | 17 +++++++++++++++++ .../.github/workflows/auto-label-issues.yml | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/auto-label-issues.yml diff --git a/.github/workflows/auto-label-issues.yml b/.github/workflows/auto-label-issues.yml new file mode 100644 index 000000000000..12ffce702cdc --- /dev/null +++ b/.github/workflows/auto-label-issues.yml @@ -0,0 +1,17 @@ +# If the author of the issues is not a contributor to the project, label +# the issue with 'Z0-unconfirmed' + +name: Label New Issues +on: + issues: + types: [opened] + +jobs: + label-new-issues: + runs-on: ubuntu-latest + steps: + - name: Label drafts + uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 # 1.0.4 + if: github.event.issue.author_association == 'NONE' + with: + add-labels: "I10-unconfirmed" diff --git a/substrate/.github/workflows/auto-label-issues.yml b/substrate/.github/workflows/auto-label-issues.yml index 629966ed3961..12ffce702cdc 100644 --- a/substrate/.github/workflows/auto-label-issues.yml +++ b/substrate/.github/workflows/auto-label-issues.yml @@ -14,4 +14,4 @@ jobs: uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 # 1.0.4 if: github.event.issue.author_association == 'NONE' with: - add-labels: "J2-unconfirmed" + add-labels: "I10-unconfirmed" From 441fc552b17b1d2a99ef77736a999d73bb235d67 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Aug 2023 18:22:41 +0200 Subject: [PATCH 06/11] fix CHECK_SPECS for labels --- .github/workflows/check-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml index 095fc56ca2fd..a808fbaa6bf3 100644 --- a/.github/workflows/check-labels.yml +++ b/.github/workflows/check-labels.yml @@ -22,7 +22,7 @@ jobs: API_BASE: https://api.github.com/repos REPO: ${{ github.repository }} RULES_PATH: labels/ruled_labels - CHECK_SPECS: "[DRAFT]specs_monorepo.yaml" + CHECK_SPECS: "specs_polkadot-sdk.yaml" run: | echo "REPO: ${REPO}" echo "GITHUB_PR: ${GITHUB_PR}" From 122de91ff7d3ddc9d313fefe6600b394a8f77bdd Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Aug 2023 18:24:46 +0200 Subject: [PATCH 07/11] rm useless commands --- .github/workflows/check-labels.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml index a808fbaa6bf3..58cbb2b54972 100644 --- a/.github/workflows/check-labels.yml +++ b/.github/workflows/check-labels.yml @@ -31,11 +31,7 @@ jobs: echo "Cloning repo with labels specs" # Temporary, before https://github.com/paritytech/labels/pull/29 is not merged - git clone https://github.com/paritytech/labels - cd labels - git fetch origin main - git checkout main - cd .. + git clone https://github.com/paritytech/labels --depth 1 --main # Fetch the labels for the PR under test echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}" From caf567ff6459e0118ae49bd3c535c52a7794878d Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 25 Aug 2023 18:26:31 +0200 Subject: [PATCH 08/11] Update .github/workflows/check-labels.yml --- .github/workflows/check-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml index 58cbb2b54972..4e28d06448cd 100644 --- a/.github/workflows/check-labels.yml +++ b/.github/workflows/check-labels.yml @@ -31,7 +31,7 @@ jobs: echo "Cloning repo with labels specs" # Temporary, before https://github.com/paritytech/labels/pull/29 is not merged - git clone https://github.com/paritytech/labels --depth 1 --main + git clone https://github.com/paritytech/labels --depth 1 --branch main # Fetch the labels for the PR under test echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}" From 6eff0c17c99e5d1a609f38fc216aa592f3c43902 Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Aug 2023 18:27:59 +0200 Subject: [PATCH 09/11] fix --- .github/workflows/check-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml index 4e28d06448cd..83b52e823132 100644 --- a/.github/workflows/check-labels.yml +++ b/.github/workflows/check-labels.yml @@ -31,7 +31,7 @@ jobs: echo "Cloning repo with labels specs" # Temporary, before https://github.com/paritytech/labels/pull/29 is not merged - git clone https://github.com/paritytech/labels --depth 1 --branch main + git clone https://github.com/paritytech/labels # Fetch the labels for the PR under test echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}" From 98d6066dabb9063a03fc8e31c087695871100e27 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 25 Aug 2023 20:31:38 +0200 Subject: [PATCH 10/11] Fudge license scanner --- .github/workflows/check-licenses.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index 1e654f7b3070..39104c3a4a81 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -18,7 +18,7 @@ jobs: run: | shopt -s globstar - npx @paritytech/license-scanner@0.0.5 scan \ + npx --yes https://github.com/paritytech/license-scanner scan \ --ensure-licenses=Apache-2.0 \ --ensure-licenses=GPL-3.0-only \ ./**/*.rs From fc706e9ced6dd390b2ab9fbd41cf4e82d7ea890c Mon Sep 17 00:00:00 2001 From: alvicsam Date: Fri, 25 Aug 2023 22:47:05 +0200 Subject: [PATCH 11/11] remove spellcheck job --- .gitlab/pipeline/check.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.gitlab/pipeline/check.yml b/.gitlab/pipeline/check.yml index f5a9cacf3739..123e02a8cd1c 100644 --- a/.gitlab/pipeline/check.yml +++ b/.gitlab/pipeline/check.yml @@ -57,21 +57,6 @@ cargo-deny-licenses: paths: - deny.log -spellcheck: - stage: check - extends: - - .kubernetes-env - - .common-refs - script: - - cargo spellcheck --version - # compare with the commit parent to the PR, given it's from a default branch - - git fetch origin +${CI_DEFAULT_BRANCH}:${CI_DEFAULT_BRANCH} - - echo "___Spellcheck is going to check your diff___" - - cargo spellcheck list-files -vvv $(git diff --diff-filter=AM --name-only $(git merge-base ${CI_COMMIT_SHA} ${CI_DEFAULT_BRANCH} -- :^bridges)) - - time cargo spellcheck check -vvv --cfg=.gitlab/spellcheck.toml --checkers hunspell --code 1 - $(git diff --diff-filter=AM --name-only $(git merge-base ${CI_COMMIT_SHA} ${CI_DEFAULT_BRANCH} -- :^bridges)) - allow_failure: true - # from substrate # not sure if it's needed in monorepo check-dependency-rules: