summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Wienand <iwienand@redhat.com>2022-08-25 13:17:57 +1000
committerIan Wienand <iwienand@redhat.com>2022-08-26 13:45:37 +1000
commit0887c2b85173fe6f9e756d346344f0d10e0f5cb6 (patch)
tree9f90830c399ca567e4188e41c5183206c7a54906
parentadadc0bdd72d98adb8896f46cf575765b5b2e874 (diff)
downloadzuul-0887c2b85173fe6f9e756d346344f0d10e0f5cb6.tar.gz
web: fix package task results in console
As noted inline, the package: task seems unique in sending back an array of strings. This completely messes up the output currently, splitting up every letter of the result into a separate item. This quick hack just reformats the list of strings into something that comes out correctly. Change-Id: I8a7e8172f784fc69aa0abb2e6787c63c33d3f802
-rw-r--r--web/src/containers/build/Console.jsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/src/containers/build/Console.jsx b/web/src/containers/build/Console.jsx
index 0b365df62..194e314ee 100644
--- a/web/src/containers/build/Console.jsx
+++ b/web/src/containers/build/Console.jsx
@@ -50,6 +50,19 @@ class TaskOutput extends React.Component {
renderResults(value) {
const interesting_results = []
+
+ // This was written to assume "value" is an array of
+ // key/value mappings to output. This seems to be a
+ // good assumption for the most part, but "package:" for
+ // whatever reason outputs a result that is just an array of
+ // strings with what packages were installed. So, if we
+ // see an array of strings as the value, we just swizzle
+ // that into a key/value so it displays usefully.
+ const isAllStrings = value.every(i => typeof i === 'string')
+ if (isAllStrings) {
+ value = [ {output: [...value]} ]
+ }
+
value.forEach((result, idx) => {
const keys = Object.entries(result).filter(
([key, value]) => shouldIncludeKey(