nautobot-app-data-validation-engine
nautobot-app-data-validation-engine copied to clipboard
Inclusion test for the set of rule-breaking attributes
Environment
- Nautobot version: 2.3.0
- nautobot-data-validation-engine version: 3.1.1
Proposed Functionality
Allow to update an object if it does not break more validation rules.
More formally:
A: set of rule-breaking attributes before the update
B: set of rule-breaking attributes after the update
if B is a subset of A:
allow the update
else:
reject the update
With this feature, we can continue updating problematic objects without having to disable validation rules.
Use Case
- I have a device called Foo with no serial number.
- I set a regex rule for device names. It must begin with a D.
- I set a required rule for device serial.
- Foo breaks both rules.
- I find the missing serial number.
- I want to add the serial number in Nautobot.
Problem: I must fix all the issues caused by Foo. I also have to rename it, right now.
An easier way to relax the constraint might be to focus on the compliant boolean variable. We can reject an update if and only if it makes a compliant object non-compliant.
| Before | After | Update | Remark |
|---|---|---|---|
| 0 | 0 | Yes | still non-compliant |
| 0 | 1 | Yes | makes the object compliant |
| 1 | 0 | No | makes the object non-compliant |
| 1 | 1 | Yes | still compliant |