prevent exhausting the maximum size of bug reports

Authored by sitter on Jul 11 2019, 1:18 PM.

Description

prevent exhausting the maximum size of bug reports

Summary:
bugzilla has a hardcoded server-side limit for how large a given comment
may be. this can somewhat easily get triggered by heavily threaded
applications as the backtrace would include a lot of "noise" threads.
when this previously happened drkonqi would find itself incapable of
filing the report and leaving the user to their own devices.

now we are much smarter about this
if the reportinterface finds that the bug description is too long it will
try to use a reduced backtrace (only a couple of lines from the relevant
thread) or when that too is too long to exclude the backtrace entirely.
in both events it would then additionally attach the complete backtrace
to the bug.

for this there's a bunch of rejiggering necessary:

  • generateReportFullText has had its signature changed, instead of using a lazy bool now use enums to control the output. this should be vastly more readable
  • new Backtrace control on generateReportFullText ranging Complete> Redcued>Exclude
  • addedToCC was renamed to attachBacktraceWithReport which is a more suitable name for what it does. it's logic has been moved to a new attachBacktrace which requires the caller to set the actual comment
  • attachBacktrace is called with a full report comment when used via \ attachBacktraceWithReport (i.e. the user indicated that their crash is in fact the same as another report, so their report gets attached to the other one). it's called with a simplified message when attaching as part of a reduced/excluded backtrace dance

the end result is that the reports can no longer exhaust the hardcoded
character limit.

there is one caveat: the user can still write a super long description
manually and exhaust the limit. this is however very hard to do in
real life without "abusing" the description for something.

CHANGELOG: Bug reporting can no longer exhaust the maximum character size enforced by Bugzilla
BUG: 248807
FIXED-IN: 5.17.0

Test Plan:

  • file bug report with ETOOLONGTRACE -> gets reduced and attached
  • regular attaching still works
  • exhausting the limit *exactly* works as expected

Reviewers: Plasma, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D22399

Details

Committed
sitterJul 12 2019, 12:49 PM
Reviewer
apol
Differential Revision
D22399: prevent exhausting the maximum size of bug reports
Parents
R871:854c95323993: only benchmark once
Branches
Unknown
Tags
Unknown