Open Bug 1918223 Opened 10 days ago Updated 20 hours ago

"Create a bug" template has broken triple-backtick markdown formatting (missing newlines) for MOZ_CRASH Reason

Categories

(Socorro :: General, defect, P2)

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: dholbert, Assigned: bdanforth)

Details

Attachments

(2 files)

STR:

  1. View the Bugzilla tab for a crash report with a "MOZ_CRASH Reason" field, like
    https://crash-stats.mozilla.org/report/index/2827f0eb-4a80-421e-a287-4c77f0240911#tab-bugzilla
  2. Next to "Create a Bug", click "Core"
  3. Click "Preview" on the initial comment of the bug to see how it would look if you filed it.

ACTUAL RESULTS:
The triple-backtick markdown formatting is wrong, because the triple-backtick didn't get its own line. Specifically: the "MOZ_CRASH Reason" has three backticks and then the value, shown directly as regular text (the triple-backtick doesn't start a source code block). Then the triple-backtick that's meant to end that source block ends up starting a block instead, etc.

EXPECTED RESULTS:
The pre-populated text should include a newline character before and after the triple-backtick sequence just before the "MOZ_CRASH Reason" value.

The special Bugzilla URL that Soccorro offers is here.

You can reproduce this issue just by directly clicking that^ link (and then clicking "Preview").

And here's a manually edited version of that link where I've inserted %0A (URL-encoded newline) before and after the first %60%60%60 (which is the URL-encoded triple-backtick). This avoids the issue.

Looks like the moz_cras_reason for that crash report has a \n at the end so then the fenced code block gets interpreted differently and that messes it up.

We should strip the moz crash reason of whitespace at the beginning and ending in the template.

Then we could switch to single-backtick code for that string or triple-backtick single-line fenced-block or triple-backtick multi-line fenced-block like you suggested. I think any of those would work, though I think we've had instances where there are single-backticks in the moz crash reason for whatever reason which is why we went with triple-backtick single-line.

Priority: -- → P2
Assignee: nobody → bdanforth
Status: NEW → ASSIGNED

Looks like there's been a change more recently somewhere that's caused the Description field to be empty now. I'll have to look into that first and come back to this one to see if it's still an issue.

Depends on: 1919823

Okay there was an upstream Bugzilla bug with the comment query parameter in the create bug URL that has since been fixed (Bug 1919789, listed as a regressing bug for Bug 1919823 that this bug depends on), so I can now reproduce this issue. I will start working on a fix.

Edit: Actually I can't reproduce this issue anymore -- the formatting looks correct to me now. I've submitted a patch anyway to have the desired effect with Markdown formatting.

No longer depends on: 1919823

Hoping to deploy this to production next week. When I do, I'll add a comment here linking to the deploy bug.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: