Skip to content

Commit

Permalink
bug-1918223: fix moz_crash_reason and reason formatting in create bug…
Browse files Browse the repository at this point in the history
… Description field.
  • Loading branch information
biancadanforth committed Sep 20, 2024
1 parent 5994075 commit 634b552
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions webapp/crashstats/libbugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ 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):
Expand Down
20 changes: 16 additions & 4 deletions webapp/crashstats/tests/test_libbugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
Expand Down Expand Up @@ -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:
```
Expand Down Expand Up @@ -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:
```
Expand Down Expand Up @@ -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:
```
Expand Down

0 comments on commit 634b552

Please sign in to comment.