Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug-1918223: fix moz_crash_reason and reason formatting in create bug Description field. #6728

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions webapp/crashstats/libbugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lines array is joined using \n as a separator, so I probably would have done this like we do the stack below:

lines.append("```")
lines.append(processed_crash("moz_crash_reason").strip())
lines.append("```")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay -- yeah that would have been a little cleaner. Would you like me to open another PR to update this?

)
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