From 2f575c52fc829a999d8ab6531030a41176cd551c Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 28 Apr 2025 10:37:40 -0700 Subject: [PATCH] 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 Auto-Submit: Yiwei Zhang Commit-Queue: Yiwei Zhang Commit-Queue: Gavin Mak --- recipes/recipe_modules/presubmit/api.py | 5 +---- recipes/recipe_modules/presubmit/tests/execute.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/recipes/recipe_modules/presubmit/api.py b/recipes/recipe_modules/presubmit/api.py index 70e1d78bcf..9950d749ab 100644 --- a/recipes/recipe_modules/presubmit/api.py +++ b/recipes/recipe_modules/presubmit/api.py @@ -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): diff --git a/recipes/recipe_modules/presubmit/tests/execute.py b/recipes/recipe_modules/presubmit/tests/execute.py index 5fe4aee623..f9064c4ece 100644 --- a/recipes/recipe_modules/presubmit/tests/execute.py +++ b/recipes/recipe_modules/presubmit/tests/execute.py @@ -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',