fix(experimental): make circuit_service and modules_routing_engine loadable - #79
Open
minitriga wants to merge 2 commits into
Open
fix(experimental): make circuit_service and modules_routing_engine loadable#79minitriga wants to merge 2 commits into
minitriga wants to merge 2 commits into
Conversation
`CircuitEndpoint` is defined in extensions/circuit with `namespace: Dcim`,
so its resolved kind is `DcimCircuitEndpoint` — which is how circuit.yml
itself references it. circuit_service referenced it bare, so the reference
never resolved and the extension could not load:
Unable to load the schema:
Unable to find the schema 'CircuitEndpoint' in the registry
Verified with `infrahubctl schema check` over the extension's full
dependency closure against a throwaway Infrahub: red before, green after.
Refs opsmill/infrahub-marketplace#110
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`DeviceRoutingEngine` inherits its `device` relationship from
`DeviceGenericModule`, which peers to the `DcimPhysicalDevice` generic.
That generic carries `position`, `serial` and `rack_face` — but no `name`,
which lives on `DcimGenericDevice`. Both the human_friendly_id and the
order_by traversed `device__name__value`, so the extension could not load:
Unable to load the schema:
DeviceRoutingEngine.order_by: name is not a valid attribute of
DcimPhysicalDevice
Adding `name` to `DcimPhysicalDevice` is not an option: nodes inherit both
generics, so it would collide with the existing attribute.
- human_friendly_id becomes `serial_number__value`, matching the node's own
uniqueness constraint and the DeviceGenericModule default. The old value
was not backed by a uniqueness constraint either way — the device/slot one
is commented out.
- order_by keeps grouping by device, via `device__serial__value`, which the
declared peer does have. This mirrors how the sibling linecards extension
orders through a parent (`linecard__serial_number__value`).
Verified with `infrahubctl schema check` over the extension's full
dependency closure against a throwaway Infrahub: red before, green after.
Refs opsmill/infrahub-marketplace#116
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Deploying schema-library with
|
| Latest commit: |
1b9aca0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d4b058cb.schema-library.pages.dev |
| Branch Preview URL: | https://atg-fix-experimental-schema.schema-library.pages.dev |
PhillSimonds
approved these changes
Aug 18, 2026
| - serial_number__value | ||
| order_by: | ||
| - device__name__value | ||
| - device__serial__value |
There was a problem hiding this comment.
Routing engine is serial_number__value where this is serial__value. Probably a very negligable thing, but it might be nice to make that consistent
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.
What
Two experimental extensions cannot be loaded into Infrahub at all. Both are published to the Infrahub marketplace, where they break the install check for the
infrahub/circuits-peeringandinfrahub/physical-cablingCollections.experimental/circuit_serviceCircuitEndpointis defined inextensions/circuit/circuit.yml:82withnamespace: Dcim, so its resolved kind isDcimCircuitEndpoint— which is exactly howcircuit.yml:77refers to it.circuit_service.ymlreferenced it bare in two places, so the reference never resolved.experimental/modules_routing_engineDeviceRoutingEngineinheritsdevicefromDeviceGenericModule, which peers to theDcimPhysicalDevicegeneric (extensions/modules/modules.yml:61). That generic carriesposition,serialandrack_face—namelives onDcimGenericDevice. Bothhuman_friendly_idandorder_bytraverseddevice__name__value.Adding
nametoDcimPhysicalDeviceis not a viable fix: nodes inherit both generics (base/dcim.yml:429-430), so it would collide with the existing attribute.So:
human_friendly_id→serial_number__value, matching the node's own uniqueness constraint and theDeviceGenericModuledefault. The old value had no uniqueness constraint behind it either way — the device/slot one is commented out.order_by→device__serial__value, keeping the grouping-by-device intent using an attribute the declared peer actually has. This mirrors how the sibling linecards extension orders through a parent (linecard__serial_number__value).DeviceLinecardinherits the same generic but never traversesdevice__name__value, so it is unaffected — as arepatch_panel,dwdmandoptical_transport, which inheritDcimPhysicalDevicewithout that traversal.Why CI never caught this
invoke schemas.load-all-schemasskips everything underexperimental/unlessTEST_EXPERIMENTALis set (tasks/schemas.py:92), and CI does not set it. These extensions are published to the marketplace regardless, so the only place the breakage surfaces is downstream. Worth deciding separately whether the load test should coverexperimental/— this PR does not change that.Verification
Ran
infrahubctl schema checkover each extension's full transitive dependency closure (from.metadata.yml, matching what the marketplace ships as the Collection bundle) against a throwaway Infrahub viainfrahub-testcontainers:experimental/circuit_serviceUnable to find the schema 'CircuitEndpoint'experimental/modules_routing_engineDeviceRoutingEngine.order_by: name is not a valid attributeBoth errors reproduced verbatim against unfixed
mainfirst, so the check is not vacuous.infrahubctl schema checkalways exits 0, so the assertion greps the output for load-error text.Reference docs regenerated with
invoke docs.generate. That command also produces unrelated diffs indcim.mdx,security.mdx,lag.mdx,mlag.mdx,sfp.mdx,optical_transport.mdx,circuit_contract.mdxandhome.mdxfrom earlier commits that did not regenerate; those are left out of this PR. Note thecheck-documentationjob diffsdocs/reference/while the files live indocs/docs/reference/, so that drift currently goes unnoticed.Downstream
Unblocks opsmill/infrahub-marketplace#110 and opsmill/infrahub-marketplace#116, the two known reds in that repo's Collection install check. They clear once this lands and the schema-library sync re-publishes.
🤖 Generated with Claude Code