diff --git a/webapp/crashstats/libbugzilla.py b/webapp/crashstats/libbugzilla.py index c38ba05b14..1b6aa1d238 100644 --- a/webapp/crashstats/libbugzilla.py +++ b/webapp/crashstats/libbugzilla.py @@ -134,10 +134,12 @@ def crash_report_to_description(crash_report_url, processed_crash): ] if processed_crash.get("moz_crash_reason"): lines.append("") - lines.append(f"MOZ_CRASH Reason: ```{processed_crash['moz_crash_reason']}```") + lines.append( + f"MOZ_CRASH Reason:\n```\n{processed_crash['moz_crash_reason'].strip()}\n```\n" + ) elif processed_crash.get("reason"): lines.append("") - lines.append(f"Reason: ```{processed_crash['reason']}```") + lines.append(f"Reason:\n```\n{processed_crash['reason'].strip()}\n```\n") frames = None if threads := mini_glom(processed_crash, "json_dump.threads", default=None): diff --git a/webapp/crashstats/tests/test_libbugzilla.py b/webapp/crashstats/tests/test_libbugzilla.py index 704982923d..898f79f6e0 100644 --- a/webapp/crashstats/tests/test_libbugzilla.py +++ b/webapp/crashstats/tests/test_libbugzilla.py @@ -595,7 +595,10 @@ def test_comment(self): """\ Crash report: http://localhost:8000/report/index/2ae0a833-f43d-4d9b-8c13-f99e70240401 - Reason: ```SIGSEGV /0x00000080``` + Reason: + ``` + SIGSEGV /0x00000080 + ``` Top 1 frame: ``` @@ -666,7 +669,10 @@ def test_comment_reason(self): """\ Crash report: http://localhost:8000/report/index/2ae0a833-f43d-4d9b-8c13-f99e70240401 - Reason: ```SIGSEGV /0x00000080``` + Reason: + ``` + SIGSEGV /0x00000080 + ``` Top 1 frame: ``` @@ -701,7 +707,10 @@ def test_comment_moz_crash_reason(self): """\ Crash report: http://localhost:8000/report/index/2ae0a833-f43d-4d9b-8c13-f99e70240401 - MOZ_CRASH Reason: ```good data``` + MOZ_CRASH Reason: + ``` + good data + ``` Top 1 frame: ``` @@ -737,7 +746,10 @@ def test_comment_moz_crash_reason_upstages_reason(self): """\ Crash report: http://localhost:8000/report/index/2ae0a833-f43d-4d9b-8c13-f99e70240401 - MOZ_CRASH Reason: ```MOZ_CRASH(Quota manager shutdown timed out) (good)``` + MOZ_CRASH Reason: + ``` + MOZ_CRASH(Quota manager shutdown timed out) (good) + ``` Top 1 frame: ```