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

Conversation

biancadanforth
Copy link
Contributor

@biancadanforth biancadanforth commented Sep 20, 2024

Because:

  • The moz_crash_reason value (and similarly, the reason value) was not displaying properly in the Bugzilla create bug page due to some extra whitespace and missing newline characters in the value of the comment query parameter passed in the create bug URL.

This commit:

  • Trims any whitespace on these values.
  • Adds a newline character before and after the triple backticks.

Note: Shortly after bug-1919789 was fixed (which temporarily blocked this bug), I can no longer reproduce the issue in this bug locally or in prod, however, it makes sense to make these changes anyway, so that the formatting will reflect standard Markdown formatting regardless of the current Bugzilla create bug URL implementation.

Here's a screenshot of what the Preview looks like in the Bugzilla create bug page with the crash from the ticket (2827f0eb-4a80-421e-a287-4c77f0240911) in local development:

Screenshot 2024-09-20 at 12 01 19 PM

@biancadanforth biancadanforth requested a review from a team as a code owner September 20, 2024 15:57
@biancadanforth biancadanforth merged commit 7ff1b0e into main Sep 20, 2024
1 check passed
@biancadanforth biancadanforth deleted the bug-1918223 branch September 20, 2024 21:48
@@ -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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants