|
1 | 1 | import os |
2 | 2 |
|
| 3 | +from twisted.internet import defer |
| 4 | + |
3 | 5 | from buildbot.plugins import reporters, secrets, util |
4 | 6 | from constants import GITHUB_STATUS_BUILDERS |
5 | 7 | from schedulers_definition import SCHEDULERS |
6 | 8 |
|
7 | 9 |
|
| 10 | +@util.renderer |
| 11 | +@defer.inlineCallbacks |
| 12 | +def branch_url_message(props): |
| 13 | + return util.Interpolate( |
| 14 | + "Full test results available at %(kw:url)s#/grid?branch=%(prop:branch)s", |
| 15 | + url=os.environ["BUILDMASTER_URL"], |
| 16 | + ) |
| 17 | + |
| 18 | + |
| 19 | +# for BB update: "endDescription=branch_url_message" gets replaced with "generator=branch_url_generator" |
| 20 | +# for GithubCommentPush, withe below code removed. |
| 21 | +# branch_url_generator = reporters.BuildStatusGenerator( |
| 22 | +# message_formatter=reporters.message.MessageFormatterRenderable(branch_url_message) |
| 23 | +# ) |
| 24 | + |
| 25 | + |
8 | 26 | def base_master_config( |
9 | 27 | config: dict, |
10 | 28 | title=os.environ["TITLE"], |
@@ -45,7 +63,13 @@ def base_master_config( |
45 | 63 | endDescription="Build done.", |
46 | 64 | verbose=True, |
47 | 65 | builders=GITHUB_STATUS_BUILDERS, |
48 | | - ) |
| 66 | + ), |
| 67 | + reporters.GitHubCommentPush( |
| 68 | + token=github_access_token, |
| 69 | + context="pr_status_url", |
| 70 | + endDescription=branch_url_generator, |
| 71 | + builder="tarball-docker", |
| 72 | + ), |
49 | 73 | ], |
50 | 74 | "secretsProviders": [secrets.SecretInAFile(dirname=secrets_provider_file)], |
51 | 75 | # 'protocols' contains information about protocols which master will |
|
0 commit comments