Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
15df85a0
Commit
15df85a0
authored
4 years ago
by
gabriel klawitter
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ci: check_polkadot: look for arbitrary link to polkadot pr eventually (#5415)
parent
ab0f7d21
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/.maintain/gitlab/check_polkadot.sh
+24
-11
24 additions, 11 deletions
substrate/.maintain/gitlab/check_polkadot.sh
with
24 additions
and
11 deletions
substrate/.maintain/gitlab/check_polkadot.sh
+
24
−
11
View file @
15df85a0
...
...
@@ -3,9 +3,11 @@
# check if a pr is compatible with polkadot companion pr or master if not
# available
#
# mark companion pr in the body of the polkadot pr like
# to override one that was just mentioned mark companion pr in the body of the
# polkadot pr like
#
# polkadot companion: paritytech/polkadot#567
#
github_api_substrate_pull_url
=
"https://api.github.com/repos/paritytech/substrate/pulls"
...
...
@@ -29,7 +31,9 @@ polkadot companion: paritytech/polkadot#567
it will then run cargo check from this polkadot's branch with substrate code
from this pull request.
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 the build against polkadot:master.
EOT
...
...
@@ -49,18 +53,27 @@ if expr match "${CI_COMMIT_REF_NAME}" '^[0-9]\+$' >/dev/null
then
boldprint
"this is pull request no
${
CI_COMMIT_REF_NAME
}
"
# get the last reference to a pr in polkadot
comppr
=
"
$(
curl
-H
"
${
github_header
}
"
-s
${
github_api_substrate_pull_url
}
/
${
CI_COMMIT_REF_NAME
}
\
|
sed
-n
-r
\
-e
's;^[[:space:]]+"body":[[:space:]]+".*polkadot companion: paritytech/polkadot#([0-9]+).*"[^"]+$;\1;p'
\
-e
's;^[[:space:]]+"body":[[:space:]]+".*polkadot companion: https://github.com/paritytech/polkadot/pull/([0-9]+).*"[^"]+$;\1;p'
\
pr_body
=
"
$(
curl
-H
"
${
github_header
}
"
-s
${
github_api_substrate_pull_url
}
/
${
CI_COMMIT_REF_NAME
}
\
|
sed
-n
-r
's/^[[:space:]]+"body": (".*")[^"]+$/\1/p'
)
"
pr_companion
=
"
$(
echo
"
${
pr_body
}
"
|
sed
-n
-r
\
-e
's;^.*polkadot companion: paritytech/polkadot#([0-9]+).*$;\1;p'
\
-e
's;^.*polkadot companion: https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p'
\
|
tail
-n
1
)
"
if
[
"
${
comppr
}
"
]
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
[
"
${
pr_companion
}
"
]
then
boldprint
"companion pr specified: #
${
comp
pr
}
"
git fetch
--depth
1 origin refs/pull/
${
comp
pr
}
/head:pr/
${
comp
pr
}
git checkout
pr
/
${
comp
pr
}
boldprint
"companion pr specified
/detected
: #
${
pr_
comp
anion
}
"
git fetch
--depth
1 origin refs/pull/
${
pr_
comp
anion
}
/head:pr/
${
pr_
comp
anion
}
git checkout
pr
/
${
pr_
comp
anion
}
else
boldprint
"no companion pr
declare
d - building polkadot:master"
boldprint
"no companion pr
foun
d - building polkadot:master"
fi
else
boldprint
"this is not a pull request - building polkadot:master"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment