17301: Log all messages in details
authorPeter Amstutz <peter.amstutz@curii.com>
Tue, 19 Apr 2022 19:41:24 +0000 (15:41 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 19 Apr 2022 20:00:41 +0000 (16:00 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/executor.py

index 5f24d2407d1ad727a9aa534382973399f89b0090..f04f3047606e74d79f26231a080595e79b8aee5a 100644 (file)
@@ -262,45 +262,22 @@ The 'jobs' API is no longer supported.
                 return
             runtime_status = current.get('runtime_status', {})
             # In case of status being an error, only report the first one.
                 return
             runtime_status = current.get('runtime_status', {})
             # In case of status being an error, only report the first one.
-            if kind == 'error':
-                if not runtime_status.get('error'):
-                    runtime_status.update({
-                        'error': message
-                    })
-                    if detail is not None:
-                        runtime_status.update({
-                            'errorDetail': detail
-                        })
-                # Further errors are only mentioned as a count.
-                else:
-                    # Get anything before an optional 'and N more' string.
-                    try:
-                        error_msg = re.match(
-                            r'^(.*?)(?=\s*\(and \d+ more\)|$)', runtime_status.get('error')).groups()[0]
-                        more_failures = re.match(
-                            r'.*\(and (\d+) more\)', runtime_status.get('error'))
-                    except TypeError:
-                        # Ignore tests stubbing errors
-                        return
-                    if more_failures:
-                        failure_qty = int(more_failures.groups()[0])
-                        runtime_status.update({
-                            'error': "%s (and %d more)" % (error_msg, failure_qty+1)
-                        })
-                    else:
-                        runtime_status.update({
-                            'error': "%s (and 1 more)" % error_msg
-                        })
-            elif kind in ['warning', 'activity']:
-                # Record the last warning/activity status without regard of
-                # previous occurences.
+            if kind in ('error', 'warning', 'activity'):
+                updatemessage = runtime_status.get(kind, "")
+                if updatemessage:
+                    updatemessage += "\n"
+                updatemessage += message
+
+                # Subsequent messages tacked on as detail
+                updatedetail = runtime_status.get(kind+'Detail', "")
+                if updatedetail:
+                   updatedetail += "\n"
+                if detail:
+                    updatedetail += message + "\n" + detail
                 runtime_status.update({
                 runtime_status.update({
-                    kind: message
+                    kind: updatemessage,
+                    kind+'Detail': updatedetail,
                 })
                 })
-                if detail is not None:
-                    runtime_status.update({
-                        kind+"Detail": detail
-                    })
             else:
                 # Ignore any other status kind
                 return
             else:
                 # Ignore any other status kind
                 return