Conversation
|
The ADRS have been discussed
|
Each device routes through its highest-weighted GoldenConfigSetting and honors that Setting's per-feature enable_* flag. All in-scope Settings' repos still sync (so read-only consumers stay current); push is gated by the enable_* flag on the winning Setting. Skipped devices log E3038 naming the winning Setting and weight; jobs with no eligible devices log E3039 per feature. Plugin-level ENABLE_* settings stay as backwards-compat defaults for the new model fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the new per-Setting enable_* flags to GoldenConfigSettingTable (colored BooleanColumn rendering plus Meta.default_columns), the filter-form sidebar, and the bulk-edit form. Centralizes E3039 emission in _log_no_eligible_devices with three branches (no devices / single device suppressed / many devices summarized) so single-device AllGoldenConfig runs no longer log redundant "no devices found" summaries. Suppresses the per-play "Device(s) with settings enabled/disabled" debug logs when the job's queryset has only one device. Picks up two pylint cleanups (E0712 on except tuple, W0108 redundant lambdas in test patches) plus a startswith fix on the _e30xx test helper. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@nickydavey @itdependsnetworks @nkallergis I believe this is finally ready. Better late then never, but manually tested all the test cases again from the PR description. The two ADRS in the thread were implemented from #984 (comment). The app as a whole settings from NautobotAppConfig are used as the defaults for all the new GC settings that get created, this is for backwards compatibility. |
Co-authored-by: Ken Celenza <ken@celenza.org>
|
Looks like Config Plans doesn't work as intended. Even when the feature is disabled, config plans are created. Will look at this. Also deploys are the same, settings don't seem to take account. |
|
@itdependsnetworks thoughts on these two enable_sotagg and enable_postprocessing? Should these remain app level? Or settings level like the rest are moving towards? |
| ) | ||
| gcs = {gc.id: gc for gc in models.GoldenConfigSetting.objects.all()} | ||
| return {device.id: gcs[device.gc_settings] for device in annotated_queryset} | ||
| return {device.id: gcs[device.gc_settings] for device in annotated_queryset if device.gc_settings} |
There was a problem hiding this comment.
why is this needed now?
There was a problem hiding this comment.
I had seen a instance where if I created a device and immediately ran a GC job it seemed like a race condition existed where members were updated in the middle of a run and gc_settings didn't exist yet for that device. This was a catch for that, but I think it was largely a issue with my local environment as I've never seen it again. Will get it removed.
There was a problem hiding this comment.
Side note as well @itdependsnetworks curious your thoughts on:
A config plan can outlive its device leaving any GC setting's scope, so device.gc_settings legitimately can be None from that callsite. What do we want to happen if a config plan is built while a device is in-scope for a setting and if that device gets removed or DG changes and now they shouldn't be able to create a config plan
|
@jeffkala what assurance do you have that we are not introducing an N+1 issue here with settings here? |
Will do some research on this. |
|
With most recent commits the following UI test plan was done:
|
@itdependsnetworks from my research of what N+1 is I think we're safe here. I don't see multiple queries happening that would indicate this is a concern we should have. |
| @@ -0,0 +1,47 @@ | |||
| # Generated by Django 5.2.14 on 2026-05-30 03:35 | |||
|
|
|||
There was a problem hiding this comment.
Move to true removal of nautobot_config and just pull from there during data migration.
keep this migrations
new second migration to update from nautobot_config values
There was a problem hiding this comment.
look for deprecation warning from SSoT to follow existing pattern.
| .order_by("-weight") | ||
| # Match Meta.ordering (`-weight`, `name`) so a weight tie resolves deterministically | ||
| # to the lower-sorted name rather than an arbitrary DB row. | ||
| .order_by("-weight", "name") |
There was a problem hiding this comment.
Maybe implement weight being unique? To avoid this "guess" of a winner.
| verbose_name="Backup Path in Jinja Template Form", | ||
| help_text="The Jinja path representation of where the backup file will be found. The variable `obj` is available as the device instance object of a given device, as is the case for all Jinja templates. e.g. `{{obj.location.name|slugify}}/{{obj.name}}.cfg`", | ||
| ) | ||
| enable_backup = models.BooleanField( |
There was a problem hiding this comment.
change all these defaults from the plugin constant to just 'true"
| if ENABLE_SOTAGG and not self.sot_agg_query: | ||
| raise ValidationError("A GraphQL query must be defined when `ENABLE_SOTAGG` is True") |
There was a problem hiding this comment.
add this back.
Also important going through all these iterations now that we don't have global + overrides in a GC setting
| # if GoldenConfigSetting.objects.filter(enable_compliance=True).exists(): | ||
| extensions.append(ConfigComplianceDeviceCheck) | ||
| extensions.append(ConfigComplianceLocationCheck) | ||
| extensions.append(ConfigComplianceTenantCheck) |
There was a problem hiding this comment.
don't do append add to actual extensions list
| "golden_config": golden_config, | ||
| "template_type": "device-configs", | ||
| "config_features": CONFIG_FEATURES, | ||
| "config_features": { |
There was a problem hiding this comment.
validate its using same structure as before and no html template changes are needed.
| # Gate generation on each device's winning GoldenConfigSetting.enable_plan flag — | ||
| # devices whose winning Setting has enable_plan=False are dropped here (E3038 names | ||
| # the Setting and weight; E3039 fires if nothing remains). | ||
| self._device_qs = filter_devices_by_feature_enabled(self.logger, self._device_qs, "plan") |
There was a problem hiding this comment.
Provide better docs on what this is doing and where its doing it.
|
double check filters are implemented for GCS list view. |
gsnider2195
left a comment
There was a problem hiding this comment.
Looks good to me pending feedback added in today's review







Test Plan Executed
Backups
Intended
Sot agg query,Jinja repositoryandJinja Template Pathare not set.Compliance
All in One (Single)
All in One (Multiple)
Questions to Answer (ADRs)
Extra Details
What do we need for each job related to repositories?
From a device qs, we need to get the following:
Other considerations for (only for compliance job, and all jobs)
Backup job:
Intended job:
Compliance job: