From d701738c4e5570f5ebdf56af5ecb013f86da3ddc Mon Sep 17 00:00:00 2001 From: mbakalarski <64490638+mbakalarski@users.noreply.github.com> Date: Fri, 31 Jul 2026 13:55:10 +0000 Subject: [PATCH] Give the Function build an explicit examples root, and build it in CI 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 --- .github/workflows/ci.yml | 18 ++++++++++++++++++ .github/workflows/release.yml | 12 ++++++++++++ pyproject.toml | 2 +- uv.lock | 2 +- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eee261e..d61c742 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,24 @@ jobs: --examples-root=examples/fabric \ -o configuration-avd-ci.xpkg + # The Function package's own build, minus the runtime image -- embedding + # needs a built tarball, and nothing here depends on it to answer the + # question this step asks: does `package/` plus the examples still parse? + # + # Added after the v0.1.4 release failed on exactly this. `--examples-root` + # defaults to ./examples, so this build collected a helm values file that + # had just landed under examples/ and rejected it -- a failure reachable + # only from the release, i.e. after the tag. The configuration build above + # could not have caught it: it names a narrower examples root, so the two + # builds disagreed about what "the examples" are. + - name: Build the Function package + run: | + set -euo pipefail + crossplane xpkg build \ + --package-root=package \ + --examples-root=examples/fabric \ + -o function-avd-ci.xpkg + # The offline suite runs on the runner's interpreter, so it says nothing about # the image the xpkg actually embeds. Without this job a Dockerfile, uv or # Python bump is only exercised by the release build -- i.e. after the tag, diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34b0175..944ce43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -128,11 +128,23 @@ jobs: sudo mv ./crossplane /usr/local/bin/crossplane crossplane version --client + # --examples-root is stated even though `package/` is the package root, + # because it is NOT optional: it defaults to ./examples, so leaving it out + # does not mean "no examples" -- it means "every YAML under examples/, + # whatever ends up there". That default broke the v0.1.4 release, when + # examples/lab/topology.yaml (helm values, no `kind`) landed beside the + # fabric examples and this build rejected it with "Object 'Kind' is + # missing". --ignore is no help: it does not reach --examples-root. + # + # examples/fabric is what both packages ship, and it holds Fabric XRs and + # nothing else. examples/lab is lab scaffolding, not a demonstration of + # the API. - name: Build the package run: | set -euo pipefail crossplane xpkg build \ --package-root=package \ + --examples-root=examples/fabric \ --embed-runtime-image-tarball="runtime-${{ matrix.arch }}.tar" \ -o "function-avd-${{ matrix.arch }}.xpkg" diff --git a/pyproject.toml b/pyproject.toml index 67bccf5..afd3ad0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "function-avd" -version = "0.1.4" +version = "0.1.5" description = "Living AVD model driven by Crossplane XRs (Fabric -> Device composite function)" readme = "README.md" authors = [ diff --git a/uv.lock b/uv.lock index 04f1d68..dbbba70 100644 --- a/uv.lock +++ b/uv.lock @@ -327,7 +327,7 @@ wheels = [ [[package]] name = "function-avd" -version = "0.1.4" +version = "0.1.5" source = { editable = "." } dependencies = [ { name = "crossplane-function-sdk-python" },