You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update downstream check script on 21.x branch (#466)
The downstream change checking script has received a number of
improvements on trunk which should be cherry-picked to the release
branch, ahead of changes that fail to make branching being made. This
includes:
Check review approvals in downstream changes
0361b4e#408
Disable review approval portion of downstream change check
5522f06#449
Allow additional whitespace in downstream issue tagging
52fc4c2#459
Together, these make the following changes:
* The GutHub token being used is changed to one automatically generated
for the Action, instead of the LLVM Sync token which has different
permissions.
* When a pull request is detected as making a downstream change, a
comment is left by the bot to explain the downstream patch policy, and
the existence of the check.
* The pull request making the downstream change, and the tracking issue
are both automatically labelled with the downstream change tag.
* The regular expression for searching for the tagging line in the pull
request has been relaxed to allow for additional whietspace.
* A dry run option is added to script so it can be run to check without
the aboce automatic comment/labelling.
This patch series also added an additional check on who has reviewed the
downsteam change, but this check is reverted within the same series.
HELP_COMMENT_TEXT="""This pull review modifies files outside of the `arm-software` directory, so please ensure it follows the [Downstream Patch Policy](https://github.com/arm/arm-toolchain/blob/arm-software/CONTRIBUTING.md#downstream-patch-policy).
33
+
An automated check will test if the tagging requirements have been met. Please wait for approving reviews from both Arm Toolchain for Embedded and Arm Toolchain for Linux teams before merging."""
34
+
DOWNSTREAM_CHANGE_LABEL="downstream-change"
32
35
33
36
34
37
# Check gh is working before using it
@@ -55,7 +58,16 @@ def check_gh_status() -> None:
55
58
56
59
# Use gh to get information about the pull request.
help="Don't make modifications such as comments or labels",
301
+
)
200
302
201
303
args=parser.parse_args()
202
304
@@ -213,6 +315,9 @@ def main():
213
315
214
316
link_text="Please check https://github.com/arm/arm-toolchain/blob/arm-software/CONTRIBUTING.md#downstream-patch-policy for information on the downstream patch policy and how changes need to be tracked."
215
317
ifneeds_tagging:
318
+
ifnotargs.dryrun:
319
+
add_pr_label(args.pr, args.repo, pr_json)
320
+
add_help_comment(args.pr, args.repo, pr_json)
216
321
ifissue_numisNone:
217
322
logger.info(
218
323
f"Check failed. Pull request #{args.pr} contains downstream changes, but does not have a correctly formatted link to a downstream tracking issue. {link_text}"
@@ -225,6 +330,8 @@ def main():
225
330
)
226
331
sys.exit(1)
227
332
else:
333
+
ifnotargs.dryrun:
334
+
add_issue_label(args.pr, args.repo, pr_json)
228
335
logger.info(
229
336
f"Check passed. Pull request #{args.pr} contains downstream changes, and a correctly formatted link to a downstream tracking issue."
0 commit comments