mojira / arisa-kt

:robot::sparkles: Run checks and perform automated tasks in Mojira
https://bugs.mojang.com
GNU General Public License v3.0
10 stars 6 forks source link

Copy crash report to the description when it is attached #281

Open misode opened 4 years ago

misode commented 4 years ago

The Problem

It is often useful to search for stack traces from crashes. Since Jira does not search through attachments, putting the head of the stack trace in the description is a good idea. Arisa could do this automatically when a crash report is attached.

Possible Implementation

When a crash report is attached to a report for the first time, Arisa should check if the crash report isn't already present in the description. Detecting the Java exception name in a code block could be a good start. The crash report would be added at the bottom of the description

The crash report should be formatted as follows:

{code:title=(VERSION) [^CRASH_REPORT_NAME]}
Description: XYZ
Exception: XYZ
  at ...
  at ...
{code}

Example: https://bugs.mojang.com/browse/MC-181313

Marcono1234 commented 4 years ago

if the crash report isn't already present in the description

Probably rather "if a crash report", otherwise it might add crash reports for multiple versions (unless that is desired).

urielsalis commented 3 years ago

mc-crash-lib returns all the info to the crash module, so should be easy :D

violine1101 commented 3 years ago

Can it also extract only the relevant strack trace? Because optimally the description should not contain the entire crash report, but just the stack trace.

urielsalis commented 3 years ago

the exception field contains only the stacktrace

Marcono1234 commented 3 years ago

Should Arisa consider crash reports attached by any users, or only by the reporter (and maybe helpers and moderators)? I think it would be best to only consider crash reports attached by the reporter, otherwise it could be abused, or by accident the issue a report is about could be changed.

Additionally, it would probably good to only consider Minecraft crash reports, but ignore JVM ones, since they might contain sensitive data and once included in the description it would be permanently in the history of the issue.

violine1101 commented 3 years ago

Personally I'd say it should only copy the stack trace initially after the bug report is first created. AKA only the reporter's crash report should be included. Afterwards we can take care of it manually.

urielsalis commented 3 years ago

Im going to add them as a comment, not description, so it can be hidden but its still searchable

urielsalis commented 3 years ago

And if its a comment I dont mind if new ones are added, we can always just restrict it and a lot of the crash reports are added after the fact