-
Bug
-
Resolution: Won't Do
-
Undefined
-
None
-
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:
- lint:
Unknown macro: {errors}
- errors: [
{description: "package chrony required by policy is not present", name: "Compliance"}
]
- 0: {description: "package chrony required by policy is not present", name: "Compliance"}
- warnings: [
{description: "package usbguard is no longer required by policy", name: "Compliance"}
]
- 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.
- mentioned on