presubmit: do not include long_text in uploaded findings

The long_text includes stack_trace[1] which is very verbose and not
providing much value. If user really need stacktrace or long_text,
they can access it by going to the build page.

[1]: https://screenshot.googleplex.com/5dcPwjNrtizEVBK

Change-Id: I2c5a5c2703875906f4ccaa1c8b1e83fe3a2f6115
Bug: 404837554
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6486346
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
changes/46/6486346/3
Yiwei Zhang 7 months ago committed by LUCI CQ
parent 998f7bfaf2
commit 2f575c52fc

@ -242,13 +242,10 @@ class PresubmitApi(recipe_api.RecipeApi):
[]), findings_pb.Finding.SEVERITY_LEVEL_INFO)
]:
for result in results:
message = result.get('message', '')
if result.get('long_text', None):
message += '\n\n' + result['long_text']
for loc in result.get('locations', []):
f = findings_pb.Finding()
f.CopyFrom(base_finding)
f.message = message
f.message = result.get('message', '')
f.severity_level = level
f.location.file_path = loc['file_path'].replace(self.m.path.sep, '/')
if loc.get('start_line', None):

@ -353,7 +353,7 @@ def GenTests(api):
end_line=1,
end_column=5,
)),
message='typo!!\n\nreplace foo with bar',
message='typo!!',
severity_level=findings_pb.Finding.SEVERITY_LEVEL_WARNING),
findings_pb.Finding(
category='chromium_presubmit',

Loading…
Cancel
Save