Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 1202643

Browse files
authored
Merge branch 'master' into gui-impl-iter-for-doublemap
2 parents ddcbd1d + 48b8adb commit 1202643

File tree

229 files changed

+9623
-5920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+9623
-5920
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ indent_style=space
1414
indent_size=2
1515
tab_width=8
1616
end_of_line=lf
17+
18+
[*.sh]
19+
indent_style=space
20+
indent_size=2
21+
tab_width=8
22+
end_of_line=lf

.github/ISSUE_TEMPLATE/release.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Release failure for {{ ref }}
3+
---
4+
5+
Pipeline for release {{ ref }} failed. Please investigate.
6+
7+
If the pipeline has failed before pushing to crates.io, delete the release tag
8+
and fix the release as necessary, retagging after complete. If the pipeline has
9+
failed after pushing to crates.io, create a new tag incrementing the version.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# A github action to track the status of the gitlab pipeline for tagged
2+
# releases, and cancel the release/create a new issue if it fails
3+
4+
name: Monitor gitlab pipeline status
5+
6+
on:
7+
push:
8+
tags:
9+
- v*
10+
- ci-release-*
11+
12+
jobs:
13+
monitor:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Monitor pipeline
19+
run: env; ./.maintain/github/check_gitlab_pipeline.sh
20+
id: monitor_pipeline
21+
env:
22+
TAGGER: ${{ github.event.pusher.name }}
23+
- name: Create Issue
24+
if: failure()
25+
uses: JasonEtco/create-an-issue@v2
26+
with:
27+
filename: .github/ISSUE_TEMPLATE/release.md
28+
assignees: ${{ github.event.pusher.name }}
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitlab-ci.yml

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ test-linux-stable: &test-linux
196196
- WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked |&
197197
tee output.log
198198
- sccache -s
199-
after_script:
200-
- echo "___Collecting warnings for check_warnings job___"
199+
- echo "____Test job successful, checking for warnings____"
201200
- awk '/^warning:/,/^$/ { print }' output.log > ${CI_COMMIT_SHORT_SHA}_warnings.log
202-
artifacts:
203-
name: $CI_COMMIT_SHORT_SHA
204-
expire_in: 3 days
205-
paths:
206-
- ${CI_COMMIT_SHORT_SHA}_warnings.log
201+
- if [ -s ${CI_COMMIT_SHORT_SHA}_warnings.log ]; then
202+
cat ${CI_COMMIT_SHORT_SHA}_warnings.log;
203+
exit 1;
204+
else
205+
echo "___No warnings___";
206+
fi
207207

208208
test-dependency-rules:
209209
stage: test
@@ -287,7 +287,7 @@ test-runtime-benchmarks:
287287
- $DEPLOY_TAG
288288
script:
289289
- cd bin/node/cli
290-
- BUILD_DUMMY_WASM_BINARY=1 time cargo check --verbose --features runtime-benchmarks
290+
- WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features runtime-benchmarks
291291
- sccache -s
292292

293293
test-linux-stable-int:
@@ -417,26 +417,6 @@ build-rust-doc-release:
417417
- echo "<meta http-equiv=refresh content=0;url=sc_service/index.html>" > ./crate-docs/index.html
418418
- sccache -s
419419

420-
check_warnings:
421-
stage: build
422-
<<: *docker-env
423-
except:
424-
variables:
425-
- $DEPLOY_TAG
426-
variables:
427-
GIT_STRATEGY: none
428-
needs:
429-
- job: test-linux-stable
430-
artifacts: true
431-
script:
432-
- if [ -s ${CI_COMMIT_SHORT_SHA}_warnings.log ]; then
433-
cat ${CI_COMMIT_SHORT_SHA}_warnings.log;
434-
exit 1;
435-
else
436-
echo "___No warnings___";
437-
fi
438-
439-
440420
check-polkadot-companion-status:
441421
stage: post-build-test
442422
image: parity/tools:latest
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
SUBSTRATE_API_BASEURL="https://gitlab.parity.io/api/v4/projects/145"
3+
4+
TAG_NAME=$(echo "$GITHUB_REF" | sed -E 's_refs/tags/(.*)_\1_')
5+
PIPELINE_ID=$(curl -s $SUBSTRATE_API_BASEURL/pipelines | jq -r "map(select(.ref==\"$TAG_NAME\")) | .[0] | .id")
6+
if [ "$PIPELINE_ID" == "null" ]; then
7+
echo "[!] Pipeline for $TAG_NAME not found. Exiting."
8+
exit 1
9+
fi
10+
11+
echo "[+] Pipeline path: https://gitlab.parity.io/parity/substrate/pipelines/$PIPELINE_ID"
12+
13+
# 130 minute job max
14+
for (( c=0; c < 130; c++ )); do
15+
out=$(curl -s "$SUBSTRATE_API_BASEURL/pipelines/$PIPELINE_ID" | jq -r .status)
16+
case $out in
17+
"success")
18+
echo "[+] Pipeline $PIPELINE_ID for $TAG_NAME succeeded!"
19+
exit 0
20+
;;
21+
"failed")
22+
echo "[!] Pipeline $PIPELINE_ID for $TAG_NAME failed. Cannot proceed. Check job output on gitlab!"
23+
exit 1
24+
;;
25+
"cancelled")
26+
echo "[!] Pipeline $PIPELINE_ID for $TAG_NAME was cancelled. Cannot proceed!"
27+
exit 1
28+
;;
29+
"running")
30+
echo "[-] Pipeline $PIPELINE_ID for $TAG_NAME still in progress..."
31+
esac
32+
sleep 60
33+
done
34+
# If we reach here, we timed out after 30 minutes
35+
echo "[!] Pipeline $PIPELINE_ID for $TAG_NAME timed out! Cannot proceed"
36+
echo "::set-output name=pipeline_status::timedout"
37+
exit 1

.maintain/gitlab/check_polkadot_companion_status.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ fi
8787
curl -H "${github_header}" -sS -o companion_pr_reviews.json \
8888
${github_api_polkadot_pull_url}/${pr_companion}/reviews
8989

90-
if [ "$(jq -r -e '.[].state' < companion_pr_reviews.json | uniq)" != "APPROVED" ]
90+
if [ -n "$(jq -r -e '.[].state | select(. == "CHANGES_REQUESTED")' < companion_pr_reviews.json)" ] && \
91+
[ -z "$(jq -r -e '.[].state | select(. == "APPROVED")' < companion_pr_reviews.json)" ]
9192
then
9293
boldprint "polkadot pr #${pr_companion} not APPROVED"
9394
exit 1

0 commit comments

Comments
 (0)