Skip to content

Commit the lab topology, and let a test guard it - #19

Merged
mbakalarski merged 1 commit into
mainfrom
commit-lab-topology
Jul 31, 2026
Merged

Commit the lab topology, and let a test guard it#19
mbakalarski merged 1 commit into
mainfrom
commit-lab-topology

Conversation

@mbakalarski

Copy link
Copy Markdown
Member

Why

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 scripts/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.sh reads the committed file at the default subset, so the lab boots the reviewed artifact instead of something regenerated beside it.

LAB_HOSTS still works and still regenerates: --hosts is 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

  • The generator is now fed examples/fabric/single-dc-l3ls.yaml directly instead of the rendered examples/lab overlay, which drops a kubectl kustomize from the path. Both inputs produce byte-identical output apart from the provenance header — the overlay only adds management_eapi and push, neither of which affects cabling.
  • The committed file sits outside --examples-root=examples/fabric, so it never reaches the Configuration package. It has no kind and 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_CHART is still pinned to 0.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

`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>
@mbakalarski
mbakalarski merged commit 855772f into main Jul 31, 2026
4 checks passed
@mbakalarski
mbakalarski deleted the commit-lab-topology branch July 31, 2026 12:41
@mbakalarski mbakalarski mentioned this pull request Jul 31, 2026
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>
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.

1 participant