feat: optional netbox-dlm integration + provision table preflight (2.5.0)#47
Merged
Merged
Conversation
…5.0) Preflight: Django registers ContentTypes for every installed app even when its migrations never ran, so netbox_branching's provision runs CREATE TABLE branch.T (LIKE public.T) for a missing table and the sync dies mid-provision with an opaque ProgrammingError (field report: netbox_dlm_contract). missing_branch_table_report() diffs get_tables_to_replicate() against the database's real tables; the single-branch executor now fails in seconds with the app labels and remedy, and a new Database tables Health check surfaces the gap before anyone syncs. netbox-dlm integration: three opt-in NQE maps (disabled by default) sync Forward's end-of-life analysis into the optional netbox-dlm plugin — SoftwareVersion from device.platform.osSupport per (platform, osVersion), HardwareNotice from chassis part support per device type, and DeviceSoftware one row per device (the adapter ensures the referenced SoftwareVersion without overwriting announced dates). Wired end to end through the optional-plugin pattern: registry integration + adapter contract, choices (+migration 0032), query registry, decision/budget/contract/identity tables, runner dispatch, and delete ordering (children before the PROTECTed SoftwareVersion). Dates are parsed to date objects so unchanged rows do not churn. Also fixes a latent import-order bug the new models exposed: branch_budget's _fallback_bucket_key_family was defined after the module-level shard-contract build and NameError'd for any supported model without a structured contract. Live against ADP: 35 software versions, 48 hardware notices, 4960 device- software rows; queries lint clean. Full suite (1012) + lint + harness green; adversarial review findings (delete ranks, date churn, reporting filter) fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Field report (design partner)
Sync crashed mid-provision with
ProgrammingError: relation "public.netbox_dlm_contract" does not exist— the netbox-dlm plugin was installed without its migrations applied (it ships none), and branch provisioning clones every registered model's table.1. Provision table preflight (fixes the crash class permanently)
missing_branch_table_report()diffs netbox_branching'sget_tables_to_replicate()(the exact list provision clones) against the database's real tables and maps gaps to app labels.apply migrations or remove the plugin) instead of dying mid-CREATE TABLE.2. Optional netbox-dlm integration (3 opt-in maps, disabled by default)
device.platform.osSupportSoftwareVersion(platform, version, EOL date, announcement URL)components[].supportHardwareNoticeper DeviceType (EoS / security patches / SW releases)device.platform.osVersionDeviceSoftware(one per device; ensures its SoftwareVersion without overwriting announced dates)Wired end-to-end via the optional-plugin pattern (registry + adapter contract on
sync_dlm, choices + migration 0032, query registry, decision/budget/contract/identity tables, runner dispatch, delete ordering children-before-PROTECTed-parent). Degrades cleanly when the plugin is absent.Also fixes a latent import-order bug the new models exposed (
branch_budget._fallback_bucket_key_familydefined after its module-scope caller).Verification