|
15 | 15 |
|
16 | 16 | GITHUB_PROPERTIES_WHITELIST = ["*.labels"]
|
17 | 17 |
|
18 |
| -BUILD_SCHEDULED_MESSAGE_TEMPLATE = """\ |
| 18 | +BUILD_MESSAGE_HEADER = """\ |
19 | 19 | :robot: New build scheduled with the buildbot fleet by @{user} for commit {commit} :robot:
|
20 | 20 |
|
21 | 21 | Results will be shown at:
|
22 | 22 |
|
23 |
| -https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F30617%2Fmerge |
| 23 | +https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F{pr_number}%2Fmerge |
24 | 24 |
|
25 |
| -If you want to schedule another build, you need to add the <kbd>{label}</kbd> label again. |
26 | 25 | """
|
27 | 26 |
|
28 |
| -BUILD_COMMAND_SCHEDULED_MESSAGE_TEMPLATE = """\ |
29 |
| -:robot: New build scheduled with the buildbot fleet by @{user} for commit {commit} :robot: |
| 27 | +BUILD_SCHEDULED_MESSAGE_TEMPLATE = BUILD_MESSAGE_HEADER + """\ |
| 28 | +If you want to schedule another build, you need to add the <kbd>{label}</kbd> label again. |
| 29 | +""" |
30 | 30 |
|
| 31 | +BUILD_COMMAND_SCHEDULED_MESSAGE_TEMPLATE = BUILD_MESSAGE_HEADER + """\ |
31 | 32 | The command will test the builders whose names match following regular expression: `{filter}`
|
32 | 33 |
|
33 | 34 | The builders matched are:
|
@@ -83,11 +84,15 @@ def _remove_label_and_comment(self, payload, label):
|
83 | 84 | url = payload["pull_request"]["comments_url"]
|
84 | 85 | username = payload["sender"]["login"]
|
85 | 86 | commit = payload["pull_request"]["head"]["sha"]
|
| 87 | + pr_number = payload["issue"]["number"] |
86 | 88 | yield http.post(
|
87 | 89 | url.replace(self.github_api_endpoint, ""),
|
88 | 90 | json={
|
89 | 91 | "body": BUILD_SCHEDULED_MESSAGE_TEMPLATE.format(
|
90 |
| - user=username, commit=commit, label=label |
| 92 | + user=username, |
| 93 | + commit=commit, |
| 94 | + label=label, |
| 95 | + pr_number=pr_number, |
91 | 96 | )
|
92 | 97 | },
|
93 | 98 | )
|
@@ -281,6 +286,7 @@ def handle_issue_comment(self, payload, event):
|
281 | 286 | user=payload["sender"]["login"],
|
282 | 287 | commit=head_sha,
|
283 | 288 | filter=builder_filter,
|
| 289 | + pr_number=number, |
284 | 290 | builders="\n".join(
|
285 | 291 | {
|
286 | 292 | f"- `{builder}`"
|
|
0 commit comments