Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bff60a7
add cumulus companions
s3krit Jun 3, 2021
deaeab7
remove references to any specific repo in check_companion_build.sh
s3krit Jun 3, 2021
21c3d80
naughty naughty very naughty (revert me)
s3krit Jun 3, 2021
98030be
add custom build string option
s3krit Jun 3, 2021
4b68a08
add beefy
s3krit Jun 3, 2021
5f05ce8
Revert "naughty naughty very naughty (revert me)"
s3krit Jun 3, 2021
07747bc
out with the old
s3krit Jun 3, 2021
00a925b
add anchors
s3krit Jun 7, 2021
3b90256
move check-companion-build to test stage
s3krit Jun 7, 2021
cd97118
ugh...
s3krit Jun 7, 2021
98f83ce
fix
s3krit Jun 7, 2021
a9427dd
Merge branch 'master' of https://github.com/paritytech/substrate into…
s3krit Jun 10, 2021
359820c
dynamically patch crates as needed
s3krit Jun 10, 2021
3002789
Merge branch 'master' into mp-cumulus-companions
s3krit Jun 28, 2021
8c5363d
Merge remote-tracking branch 'origin/master' into mp-cumulus-companions
s3krit Jun 28, 2021
dc8d301
fix reviews
s3krit Jun 28, 2021
c90db6c
first attempt at deeper dependencies
s3krit Jun 28, 2021
7df4a60
include lib.sh
s3krit Jun 28, 2021
1b8c9d8
Merge remote-tracking branch 'origin/master' into mp-cumulus-companions
s3krit Jun 28, 2021
8181635
patch things correctly
s3krit Jun 28, 2021
c476a9d
improve comments, test something neat
s3krit Jun 28, 2021
f5f920d
Apply suggestions from code review
s3krit Jun 29, 2021
46988ba
update comments
s3krit Jun 29, 2021
c96f997
Merge branch 'master' into mp-cumulus-companions
s3krit Aug 6, 2021
a7ee4a3
use jq for parsing PRs
s3krit Aug 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use jq for parsing PRs
  • Loading branch information
s3krit committed Aug 6, 2021
commit a7ee4a3153b4b07c873ebefc482d7e4e6938e77a
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ check-cumulus-companion-build:
variables:
COMPANION_ORG: paritytech
COMPANION_REPO: cumulus
COMPANION_BUILD: "cargo check"
COMPANION_BUILD: "cargo check --all-targets --workspace"
COMPANION_DEPENDENCY: paritytech/polkadot
allow_failure: true

Expand All @@ -478,7 +478,7 @@ check-beefy-companion-build:
variables:
COMPANION_ORG: paritytech
COMPANION_REPO: grandpa-bridge-gadget
COMPANION_BUILD: "cargo check"
COMPANION_BUILD: "cargo check --all-targets --workspace"
allow_failure: true

test-browser-node:
Expand Down
10 changes: 4 additions & 6 deletions .maintain/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,16 @@ get_companion() {
origin_repo="$1"
pr_num="$2"
companion_repo="$3"
pr_data_file="$(mktemp)"
set_github_token
github_header="Authorization: token ${GITHUB_TOKEN}"
# get the last reference to a pr in the target repo
curl -sSL -H "${github_header}" -o "${pr_data_file}" \
"${api_base}/$origin_repo/pulls/$pr_num"

pr_body="$(sed -n -r 's/^[[:space:]]+"body": (".*")[^"]+$/\1/p' "${pr_data_file}")"
pr_body=$(
curl -sSL -H "${github_header}" "${api_base}/$origin_repo/pulls/$pr_num" | \
jq -r '.body'
)

echo "${pr_body}" | sed -n -r \
Copy link
Contributor

Choose a reason for hiding this comment

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

Does sed account for newlines in the JSON string?

This probably never happens but you might have a comment like this:

Something something companion

Bla bla another pull request: https://github.com/foo/pull/1

As I understand it, since you're not matching [Cc]ompanion: [regex] all in the same line, that comment would be detected although it should not be.

Using echo -e will output the JSON newlines as actual newlines so you'll be able to match it line-by-line.

-e "s;^.*[Cc]ompanion.*$companion_repo#([0-9]+).*$;\1;p" \
-e "s;^.*[Cc]ompanion.*https://github.com/$companion_repo/pull/([0-9]+).*$;\1;p" \
| tail -n 1
rm -f "${pr_data_file}"
}