Uploaded image for project: 'RHEL Conversions'
  1. RHEL Conversions
  2. RHELC-1106

Construct convert2rhel assessment messages from templates and return them in json

XMLWordPrintable

    • Testable

      Messages need to be usable by third party tools, not just convert2rhel.  Specifically, satellite will need the ability to construct messages in a similar manner to how insights does.  To do that, we need convert2rhel to provide message templates to satellite that mirror the message templates which are hosted in insights.

      Doing this means that we need to make use of the templates inside of convert2rhel as well.

      Acceptance Criteria

      • In convert2rhel.action.report.summary()
        • Where we construct the message from the four fields, title, description, diagnosis, and remediation,.use jinja2 to template diagnosis and remediation.
          • After templating, the string should be valid markdown but we will just display the plain text.  It's insights, satellite and other external tools that should be able to rely on it being markdown.
          • Use the variables that we added in https://issues.redhat.com/browse/RHELC-1091to render the templates
      • In the action plugins:
        • For each Action, we need to look at the diagnosis and remediation fields and make those into jinja2 templates.
        • All variables presently used to construct those fields should have been added to variables by RHELC-1091 (but if they weren't, then do so here).
        • There should not be dynamic data used to construct the title and description fields.  If so, then rectify that here by making them generic and putting the dynamic data into diagnosis.
      • Add python-jinja2 as a dependency to convert2rhel in the rpm spec file(s) (in the git repo and in distgit).
        • We don't have dependencies listed in setup.py at the time of writing.  If we add that, we will need to add the jinja2 dep there as well.
      • Update https://issues.redhat.com/browse/RHELC-1093 to reflect whether stretch goals here were implemented or not.

      Stretch Goals:

      If these are not done as part of this ticket, they will be done as part of  https://issues.redhat.com/browse/RHELC-1091

      • Move messages into a json file. Format is:
        • a dictionary keyed on ACTION_ID:MESSAGE_ID
        • Value is a set of three fields that we will use to construct the convert2rhel messages: title, description, diagnosis, remediation.  convet2rhel displays those as a single message.
      • convert2rhel code changes
        • In convert2rhel.action.report.summary()
          • read the messages from the json file

            Unassigned Unassigned
            tkuratom@redhat.com Toshio Kuratomi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: