-
Task
-
Resolution: Done
-
Undefined
-
None
-
None
Goal:
- Collect the stdout output after running the script that is sent to the worker
- Parse the JSON output from the stdout and wrap it around another json before submitting it to RHC again.
- Link for the notes related to this change, with textual format of what needs to be delivered: https://docs.google.com/document/d/1MGGUpWLCtRk4ZIxmSQxmE3r3VammcRGdg2vSSb6Rz1M/edit#bookmark=id.vmd12927wztx
Acceptance Criteria:
A list of verification conditions, successful functional tests, or expected outcomes in order to declare this story/task successfully completed.
- Capture the stdout output from the bash script and wrap it around a struct to dump its content as a JSON before submitting this over to RHC.
- Both the script and the worker have some responsibility to format this data correctly.
Notes:
The script's responsibility, the script will output to its stdout:
- Anything that should be logged in the Tasks App
- A begin marker (Talk to Dank when you have decided what this will be)
- a json dictionary with the following fields:
- Alert
- will be True if convert2thel had exit code != 0, otherwise False
- Summary
- Short message like: "convert2rhel did not detect issues", "convert2rhel detected 5 issues"
- Report
- Empty
- Report_json
- The json output from convert2rhel
- Alert
- An end marker (Talk to Dank when you have decided what this will be)
- Anything else that should be logged in the Task app
The Worker's responsibility is to return data formatted like this:
- Worker will create a dictionary with two fields:
- stdout
- holds stdout from the script
- correlaction_id
- The correlation_id from the request (metadata)
- stdout
- Turn the dictionary into a json string
- send the string to rhcd to deliver to ingress