-
Task
-
Resolution: Done-Errata
-
Major
-
None
To provide a good experience in insights, we need a way to return multiple messages to the end user. Some of the messages are end results such as we have now (SUCCESS, FAILURE, SKIP) and others are informational (WARNING).
After some thought, it seems like we can only have one end result but may have multiple informational messages in addition to that. So we should have two separate fields, one for results and one for informational items.
In cases where an Action could have multiple end results which do not depend on each other, it should be refactored to be multiple Actions instead (for example, the Efi Action)..
The initial design of these modifications has been made here:
https://hackmd.io/bsI89pUZRLC79HJpnCmJJQ
Acceptance Criteria
- Currently, action.run_actions() returns a dictionary keyed on action_id whose value is a dictionary with fields corresponding to the three pieces of data we have about an end result: error_id, error_message, and status. This is to be modified so actions.run_actions() will now return a dictionary, keyed on action_id whose values are a dict with two keys, result and messages. Result contains the data about an end result like the currently returned information but with the field names changed to id, message, and level. Messages contains a list with zero or more dictionaries. These dictionaries have the same format as the one stored in result..
-
- The messages in result can have any final status codes as their level: SUCCESS, ERROR, SKIP, OVERRIDABLE
- The messages in messages can have any non-final status codes as their level: WARNING
- See the hackmd link for a sample representation of what this set of nested dictionaries should look like.
- A new method is added to the Action class, add_message(). add_message() will add
a new message to the Action.messages list. - Add a helper function, Action.to_dict() that transforms the data stored in a completed Action into a dictionary, suitable for returning from run_actions().
- Change the report.summary() function to output the messages as well as the end results.
- Various functions other will need to be modified to work with the new format of the return data. See the hackmd link for places identified that need to be modified.
- Change at least one of the Actions to use add_message to return messages.
- Update unittests for the new format.
- Add unittests for any new functionality.
- links to
-
RHEA-2023:120152 convert2rhel bug fix and enhancement update
-
RHEA-2023:120153 convert2rhel bug fix and enhancement update