From 4caf5b7de710b17166717d636c2ef286409087d2 Mon Sep 17 00:00:00 2001 From: Jesse Seales <103135467+sealesj@users.noreply.github.com> Date: Tue, 23 May 2023 13:51:17 -0400 Subject: [PATCH] Vulnerability scanning print failed command in case of error (flutter/engine#42190) The 3p deps vulnerability scanner currently isn't providing helpful output in the case of errors during the processing of the dependencies. This change adds outputting which command caused the error, and conditionally add error output to help aid any changes that need to be made to the dependencies. *List which issues are fixed by this PR. You must list at least one issue.* b/282959127 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- engine/src/flutter/ci/scan_flattened_deps.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/ci/scan_flattened_deps.py b/engine/src/flutter/ci/scan_flattened_deps.py index ca400f21db..51cdee1041 100644 --- a/engine/src/flutter/ci/scan_flattened_deps.py +++ b/engine/src/flutter/ci/scan_flattened_deps.py @@ -236,7 +236,13 @@ def get_common_ancestor_commit(dep, deps_list): print('Ancestor commit: ' + ancestor_commit) return ancestor_commit except subprocess.CalledProcessError as error: - print("Subprocess error '{0}' occured.".format(error.output)) + print( + "Subprocess command '{0}' failed with exit code: {1}.".format( + error.cmd, str(error.returncode) + ) + ) + if error.output: + print("Subprocess error output: '{0}'".format(error.output)) return {}