Skip to content

Added configurable empty_compliance_behavior setting to `GoldenConf… - #1105

Open
itdependsnetworks wants to merge 2 commits into
nautobot:developfrom
itdependsnetworks:add-na
Open

Added configurable empty_compliance_behavior setting to `GoldenConf…#1105
itdependsnetworks wants to merge 2 commits into
nautobot:developfrom
itdependsnetworks:add-na

Conversation

@itdependsnetworks

Copy link
Copy Markdown
Contributor

…igSetting` to control how compliance is evaluated when configurations are empty.

Fixes: #421 and potentially solution for #518

…igSetting` to control how compliance is evaluated when configurations are empty.
@github-actions

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  nautobot_golden_config
  choices.py
  models.py 159, 164-165
  tables.py
  views.py 438-440
Project Total  

This report was generated by python-coverage-comment-action

Comment thread nautobot_golden_config/metrics.py
Comment thread nautobot_golden_config/models.py Outdated
Comment thread nautobot_golden_config/models.py
Comment thread nautobot_golden_config/tables.py
Comment thread nautobot_golden_config/template_content.py
Comment thread nautobot_golden_config/template_content.py
Comment thread nautobot_golden_config/views.py
Co-authored-by: Jeff Kala <48843785+jeffkala@users.noreply.github.com>

@jeffkala jeffkala left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review looking good. I'm excited for this option.

"compliance_int",
aggregation=Max,
)
features = self.queryset.values_list("rule__feature__slug", flat=True).distinct()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let's document this better.

division-by-zero.
"""
device_filter = Q(feature__rule__device__in=device_ids)
# Exclude N/A records (compliance is NULL when configs are empty and behavior is non-default)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let's add on to this documentation as well.

@itdependsnetworks

itdependsnetworks commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Feedback:

  1. Document the complex queries
  2. Determine what to do with compliance_int, either revert, or make the interface respect query and filterset's.
  3. Re-run through nautobot-review

@gsnider2195 gsnider2195 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me pending feedback added in today's review

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.

Configurable Output When Nothing to Compare

4 participants