Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ check-polkadot-companion-build:
artifacts: false
script:
- ./.maintain/gitlab/check_polkadot_companion_build.sh
after_script:
- cd polkadot && git rev-parse --abbrev-ref HEAD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why put it as a after_script? the companion being used is already printed from within the script.
if you want it shown in the end i would prefer to have this statement there, as this will eventually fail depending on what the script does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why put it as a after_script? the companion being used is already printed from within the script.

Yes but it is printed in the beginning and it is not easy to read. When I check a build failure I usually start at the end of the logs to see what is the error. But here the first important information that everyone should see when they open this log is what branch has been used for the build before even reading the error messages.

if you want it shown in the end i would prefer to have this statement there, as this will eventually fail depending on what the script does.

I wanted to place it at the end of the build, no matter if it fails or not (since false success are also important). Where do you think I should move it?

allow_failure: true

test-browser-node:
Expand Down
13 changes: 1 addition & 12 deletions .maintain/gitlab/check_polkadot_companion_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ polkadot companion: paritytech/polkadot#567


it will then run cargo check from this polkadot's branch with substrate code
from this pull request. in absence of that string it will check if a polkadot
pr is mentioned and will use the last one instead. if none of the above can be
found it will check if polkadot has a branch of the exact same name than the
substrate's branch. if it can't find anything, it will uses master instead
from this pull request. otherwise, it will uses master instead


EOT
Expand Down Expand Up @@ -74,14 +71,6 @@ then
-e 's;^.*polkadot companion: https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p' \
| tail -n 1)"

if [ -z "${pr_companion}" ]
then
pr_companion="$(echo "${pr_body}" | sed -n -r \
-e 's;^.*paritytech/polkadot/#([0-9]+).*$;\1;p' \
-e 's;^.*https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p' \
| tail -n 1)"
fi

if [ "${pr_companion}" ]
then
boldprint "companion pr specified/detected: #${pr_companion}"
Expand Down
11 changes: 1 addition & 10 deletions .maintain/gitlab/check_polkadot_companion_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ this job checks if there is a string in the description of the pr like

polkadot companion: paritytech/polkadot#567

or any other polkadot pr is mentioned in this pr's description and checks its
status.
and checks its status.


EOT
Expand All @@ -48,14 +47,6 @@ pr_companion="$(echo "${pr_body}" | sed -n -r \
-e 's;^.*polkadot companion: https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p' \
| tail -n 1)"

# get companion mentioned in the description
if [ -z "${pr_companion}" ]
then
pr_companion="$(echo "${pr_body}" | sed -n -r \
's;^.*https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p' \
| tail -n 1)"
fi

if [ -z "${pr_companion}" ]
then
boldprint "no companion pr found"
Expand Down