Skip to content
Merged
Changes from all commits
Commits
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
18 changes: 12 additions & 6 deletions master/custom/pr_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@

GITHUB_PROPERTIES_WHITELIST = ["*.labels"]

BUILD_SCHEDULED_MESSAGE_TEMPLATE = """\
BUILD_MESSAGE_HEADER = """\
:robot: New build scheduled with the buildbot fleet by @{user} for commit {commit} :robot:

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F30617%2Fmerge
https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F{pr_number}%2Fmerge

If you want to schedule another build, you need to add the <kbd>{label}</kbd> label again.
"""

BUILD_COMMAND_SCHEDULED_MESSAGE_TEMPLATE = """\
:robot: New build scheduled with the buildbot fleet by @{user} for commit {commit} :robot:
BUILD_SCHEDULED_MESSAGE_TEMPLATE = BUILD_MESSAGE_HEADER + """\
If you want to schedule another build, you need to add the <kbd>{label}</kbd> label again.
"""

BUILD_COMMAND_SCHEDULED_MESSAGE_TEMPLATE = BUILD_MESSAGE_HEADER + """\
The command will test the builders whose names match following regular expression: `{filter}`

The builders matched are:
Expand Down Expand Up @@ -83,11 +84,15 @@ def _remove_label_and_comment(self, payload, label):
url = payload["pull_request"]["comments_url"]
username = payload["sender"]["login"]
commit = payload["pull_request"]["head"]["sha"]
pr_number = payload["issue"]["number"]
yield http.post(
url.replace(self.github_api_endpoint, ""),
json={
"body": BUILD_SCHEDULED_MESSAGE_TEMPLATE.format(
user=username, commit=commit, label=label
user=username,
commit=commit,
label=label,
pr_number=pr_number,
)
},
)
Expand Down Expand Up @@ -281,6 +286,7 @@ def handle_issue_comment(self, payload, event):
user=payload["sender"]["login"],
commit=head_sha,
filter=builder_filter,
pr_number=number,
builders="\n".join(
{
f"- `{builder}`"
Expand Down
Loading