Uploaded image for project: 'Insights Experiences'
  1. Insights Experiences
  2. HMS-9804

fixup and editblueprint functions reset the compliance snapshot and causes all lint warnings to disappear by mistake.

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Undefined Undefined
    • None
    • None
    • Image Builder
    • None
    • None

      While implementing this warning info message at the frontend side, I found a backend issue with how compliance data is processed.
      It looks like the problem is in the buildServiceSnapshots function, which is used in both the “Fix errors automatically” (FixupBlueprint) and “Edit blueprint” (UpdateBlueprint) flows.
      Right now, this function resets the compliance snapshot and causes all lint warnings to disappear by mistake.

       

      steps to reproduce:

      1) create image with custom compliance policy -

      before you finish to create the image go to 'Additional packages'  and remove any package - >  compliance errors will show after pressing on 'create blueprint' button

      2) go to SCAP Policies (in compliance) and open rules of specific custom compliance policy

      3) Edit rules and remove any package - for example remove 'firewalld'

      4) go back to images and refresh the page, now you will see both error and warning messages -

      backend response: 

      1. lint:
        Unknown macro: {errors}
      1. errors: [ {description: "package chrony required by policy is not present", name: "Compliance"}

        ]

      1. 0: {description: "package chrony required by policy is not present", name: "Compliance"}
      1. warnings: [ {description: "package usbguard is no longer required by policy", name: "Compliance"}

        ]

      1. 0: {description: "package usbguard is no longer required by policy", name: "Compliance"}

      5) press on 'Fix error automatically' in compliance errors message -> this message disapear 

      refresh the page and look on response from the backend side - 

      actual:

      both error and warnings get 'null' result

      expected: 

      I expect that only error will get reset, and warning stay there

      this reporudce sceario 1:

      Scenario 1 – Fix errors automatically
      When the user clicks “Fix errors automatically”, the backend removes both errors and warnings.
      Because of that, info alerts disappear even though the warnings weren’t fixed.
      We expect that only errors message should be removed and warnings message should stay.

      Scenario 2 – Edit blueprint
      When the user edits any blueprint field, for example; update the blueprint name, the backend also resets all lint warnings, even if nothing related to compliance was changed.
      We except that: warnings should stay unless the user actually fixes the issue that display in the message.

      In short, the frontend works correctly, but the backend resets all warnings after fixing or editing a blueprint, which makes the UI look like it’s not working as expected.

              Unassigned Unassigned
              mgold@redhat.com Michal Gold
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: