guardian icon indicating copy to clipboard operation
guardian copied to clipboard

The comparison tool seems to consider blocks that contain the same values as different

Open Neurone opened this issue 1 year ago • 6 comments

Problem description

Occasionally differences in policies are highlighted, but it is not actually clear what the difference is. I suspect some spacing differences in the JSON file, but I am not sure.

Attached are two policies that are virtually identical, but in which differences are highlighted. Attached below also the screenshot.

Step to reproduce

Steps to reproduce the behavior:

  1. Download and unzip policies.zip
  2. Import policy1.policy
  3. Import policy2.policy
  4. Compare the policies
  5. Check some events are considered different, but they have actually the same values

Expected behavior

In the case of non-relevant differences, the block is considered equal.

Screenshots

Screenshot 2024-05-29 at 14 30 36

Neurone avatar May 29 '24 13:05 Neurone

@Neurone Guardian treats events as different if they 'go' to different blocks. Which is the case in this situation (see screenshot below). As you see the other policy has additional description and name fields into the block, which are absent from the original definition. Perhaps someone edited it via JSON editor/view? image

anvabr avatar Sep 05 '24 13:09 anvabr

To summarise, this is be design and not a bug. If a change in behaviour is needed let's please create a feature ticket.

Perhaps there is another bug to do with how name and description happen to appear in the block definition? tagging @Neurone for visibility

anvabr avatar Sep 05 '24 13:09 anvabr

@Neurone Just wanted to check if we can close this issue?

prernaadev01 avatar Sep 23 '24 19:09 prernaadev01

Hi @prernaadev01 @anvabr I understand the behavior, and I understand it can be useful in some contexts, but I would say it would be more useful if this can be configured in the UI (default = disabled), so I can only see the real differences, and not consider as different part of the policies that are not technically different.

In addition to letting users decide this comparison option, it would be useful to show it differently than the normal difference. Maybe a dedicated icon or color for the section?

As a side note, I think this has also an impact on the equality percentage summary shown for the comparison.

Neurone avatar Sep 29 '24 16:09 Neurone

Team brainstormed the approach, the proposal is to add an additional option (alongside already existing ones) enabling users to switch between the following comparison modes:

  1. strict comparison - includes exact matching of events their sources/destinations
  2. loose comparison - matching events but not their sources/destinations
  3. exclude events - events and their differences are ignored for the purposes of comparison

anvabr avatar Sep 30 '24 12:09 anvabr

It sounds good to me!

Neurone avatar Sep 30 '24 14:09 Neurone