Skip to content

Conversation

@johanek
Copy link

@johanek johanek commented Jul 2, 2025

Closes: #205

What's Changed

This proposed change allows you to validate custom fields by referencing them as cf_<custom_field_name in ComplianceError exceptions.

This PR is more of a proposal than a final solution — I’m not sure if this is the approach you’d prefer for solving the issue, but I wanted to share some working code and get your feedback.

To Do

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)

@johanek johanek requested a review from a team as a code owner July 2, 2025 12:39
@glennmatthews
Copy link
Contributor

Conceptually this looks like a pretty reasonable and straightforward approach. Since this App has been inlined into Nautobot core for the upcoming 3.0 release of core, we'll want to make sure this enhancement gets ported over there as well once it's accepted and merged here.

"last_validation_date": self.result_date,
"validated_object_str": str(instance),
"validated_attribute_value": str(attribute_value) if attribute_value else "",
"validated_attribute_value": str(attribute_value)[:254] if attribute_value else "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! We should probably (at least in core/3.0) change this from a CharField to a TextField for more capability/flexibility.

@johanek
Copy link
Author

johanek commented Jul 18, 2025

Conceptually this looks like a pretty reasonable and straightforward approach. Since this App has been inlined into Nautobot core for the upcoming 3.0 release of core, we'll want to make sure this enhancement gets ported over there as well once it's accepted and merged here.

Great! I also added the changelog entry and doc changes, is there anything else needed for this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Custom Fields in Data Compliance Rules

2 participants