Commit the lab topology, and let a test guard it - #19
Merged
Conversation
`netclab_topology` derives the lab's cabling from the AVD model, and had no test at all: no unit test, and its only consumer is `kind-up.sh`, which CI never runs because cEOS is licensed and cannot be pulled in Actions. So an AVD upgrade that changed the peering would have been invisible -- the topology was regenerated into a temp file on a developer's laptop and never reviewed. Generating the default subset once and committing it makes that diff visible, and `test_topology_golden` fails when the committed file stops matching what the generator produces. It runs offline with the rest of the suite, so it fits the constraint that keeps the cEOS path out of CI. `kind-up.sh` now reads the committed file at the default subset, so the lab boots the reviewed artifact rather than something regenerated beside it. A different `LAB_HOSTS` still regenerates: --hosts is an input to generation, not a filter applied to the result, because a link survives only when both of its ends are selected -- cutting nodes out of a finished topology would leave networks with one end. The generator is fed `examples/fabric/single-dc-l3ls.yaml` directly instead of the rendered `examples/lab` overlay, which drops a `kubectl kustomize` from the path. Checked before relying on it: both inputs produce byte-identical output apart from the provenance header, because the overlay only adds `management_eapi` and `push`, and neither affects cabling. The committed file sits outside `--examples-root=examples/fabric`, so it does not reach the Configuration package -- it has no `kind` and would fail the build. Verified by building it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
mbakalarski
added a commit
that referenced
this pull request
Jul 31, 2026
Carries the committed lab topology from #19, which netclab-xp's fabric scenario needs at a tag: it fetches both the design and the topology from one ref, and `examples/lab/topology.yaml` does not exist in v0.1.3. uv.lock records the project version too, so it moves with pyproject.toml or `uv sync --locked` fails the build. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
mbakalarski
added a commit
that referenced
this pull request
Jul 31, 2026
…#21) The v0.1.4 release failed after the tag: the Function package build passes no --examples-root, and that flag is not optional -- it defaults to ./examples. So the build collected examples/lab/topology.yaml, helm values with no `kind`, which had landed there in #19, and rejected it. --ignore would not have helped; it does not reach --examples-root. Naming examples/fabric explicitly makes both packages ship the same thing, and says what that thing is: Fabric XRs. examples/lab is scaffolding for running a lab, not a demonstration of the API. CI could not have caught this. It built the Configuration package, which names a narrower examples root, so the two builds disagreed about what "the examples" are -- and the Function package's build existed only in the release, where a failure costs a tag. It now runs on PRs too, without embedding the runtime image, since that is irrelevant to whether the package and its examples parse. Released as v0.1.5 rather than retrying v0.1.4: configuration-avd:v0.1.4 was published before the function leg failed, and moving a tag that has already put an artifact on a registry is how a version number starts meaning two things. v0.1.4 is not broken for consumers -- configuration-avd depends on the function by range, so it resolves to v0.1.3. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
Why
netclab_topologyderives the lab's cabling from the AVD model, and had no test at all — no unit test, and its only consumer isscripts/kind-up.sh, which CI never runs because cEOS is licensed and cannot be pulled in Actions.So an AVD upgrade that changed the peering would have been invisible: the topology was regenerated into a temp file on a developer's laptop and never appeared in a diff.
What
examples/lab/topology.yaml— the default subset, generated once and committed.tests/test_topology_golden.py— fails when the committed file stops matching what the generator produces. Runs offline with the rest of the suite, so it fits the constraint that keeps the cEOS path out of CI. Regeneration command is in its docstring.kind-up.shreads the committed file at the default subset, so the lab boots the reviewed artifact instead of something regenerated beside it.LAB_HOSTSstill works and still regenerates:--hostsis an input to generation, not a filter applied to the result. A link survives only when both ends are selected, so cutting nodes out of a finished topology would leave networks with one end and interfaces pointing at nothing.Two things checked rather than assumed
examples/fabric/single-dc-l3ls.yamldirectly instead of the renderedexamples/laboverlay, which drops akubectl kustomizefrom the path. Both inputs produce byte-identical output apart from the provenance header — the overlay only addsmanagement_eapiandpush, neither of which affects cabling.--examples-root=examples/fabric, so it never reaches the Configuration package. It has nokindand would fail the build. Verified by building the package with the file present.Also confirmed while writing the test that it can actually fail — perturbing the committed file makes it red, which is the only thing that makes a golden test worth having.
Follow-up, deliberately not here
NETCLAB_CHARTis still pinned to0.5.9. Two RESTCONF defects now sit below that pin (netclab/netclab-chart#18 fixed the second), and this lab is eAPI-only so it is unaffected — but the bump is worth its own change.🤖 Generated with Claude Code