aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject aurora git commit: Convert carriage returns to newlines in reviews
Date Tue, 12 Dec 2017 09:07:06 GMT
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 <serb@apache.org>
Authored: Tue Dec 12 10:06:28 2017 +0100
Committer: Stephan Erb <serb@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):


Mime
View raw message