Skip to content

Commit a67b395

Browse files
Tidy up Discord notification formatting (#739)
1 parent dd3c869 commit a67b395

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

master/custom/discord_reporter.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,9 @@
2323
MESSAGE = """\
2424
:warning: **Buildbot failure** :warning:
2525
26-
The buildbot **{buildername}** ({tier}) has failed when building commit {sha}(https://github.com/python/cpython/commit/{sha}).
26+
The buildbot **{buildername}** ({tier}) has failed when building commit [{sha:.12}](https://github.com/python/cpython/commit/{sha}).
2727
28-
You can take a look at the buildbot page here:
29-
30-
{build_url}
31-
32-
```
33-
{failed_test_text}
34-
```
28+
[Jump to the build page.]({build_url})
3529
"""
3630

3731

@@ -159,9 +153,12 @@ def createReport(
159153
builder["builderid"], build["number"]
160154
),
161155
sha=sha,
162-
failed_test_text=logs.format_failing_tests(),
163156
)
164157

158+
failed_test_text = logs.format_failing_tests()
159+
if failed_test_text and failed_test_text.strip():
160+
message += "\n```\n{}\n```\n".format(failed_test_text)
161+
165162
payload = {"content": message, "embeds": []}
166163

167164
return self._http.post("", json=payload)

0 commit comments

Comments
 (0)