You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by se...@apache.org on 2017/12/12 09:07:06 UTC
aurora git commit: Convert carriage returns to newlines in reviews
Repository: aurora
Updated Branches:
refs/heads/master ef24c2ce3 -> 0cdaa1509
Convert carriage returns to newlines in reviews
Spotbugs prints multiple lines with \r [1][2]. This looks like a single
line for shell commands but will be converted to multiple lines once
read by Python.
By performing the conversion before the tail command, we will get a
consistent line count in Bash and Python.
[1] https://github.com/spotbugs/spotbugs/blob/fe8a8d66e97d3ae0b830731461aab0f8b39791f6/spotbugs/src/main/java/edu/umd/cs/findbugs/TextUIProgressCallback.java#L103
[2] https://github.com/spotbugs/spotbugs/issues/506
Bugs closed: AURORA-1961
Reviewed at https://reviews.apache.org/r/64508/
Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/0cdaa150
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/0cdaa150
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/0cdaa150
Branch: refs/heads/master
Commit: 0cdaa15096032e7dca39001f5b81ea5027352e95
Parents: ef24c2c
Author: Stephan Erb <se...@apache.org>
Authored: Tue Dec 12 10:06:28 2017 +0100
Committer: Stephan Erb <se...@apache.org>
Committed: Tue Dec 12 10:06:28 2017 +0100
----------------------------------------------------------------------
build-support/jenkins/review_feedback.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/aurora/blob/0cdaa150/build-support/jenkins/review_feedback.py
----------------------------------------------------------------------
diff --git a/build-support/jenkins/review_feedback.py b/build-support/jenkins/review_feedback.py
index a6eecee..e1e1e8d 100755
--- a/build-support/jenkins/review_feedback.py
+++ b/build-support/jenkins/review_feedback.py
@@ -172,10 +172,13 @@ class RequestProcessor(object):
# Pipe to a file in case output is large, also tee the output to simplify
# debugging. Since we pipe the output, we must set pipefail to ensure
# a failing build command fails the bash pipeline.
+ # AURORA-1961: Convert carriage returns to newlines to prevent shell cmds
+ # seing spotbugs output on a single line, which is then translated to
+ # multiple lines by Python subprocess.
result = subprocess.call([
'bash',
'-c',
- 'set -o pipefail; %s 2>&1 | tee %s' % (self._command, build_output)])
+ 'set -o pipefail; %s 2>&1 | tr -u "\r" "\n" | tee %s' % (self._command, build_output)])
if result == 0:
review_text = 'Master (%s) is green with this patch.\n %s' % (sha, self._command)
if self._missing_tests(latest_diff):