feat(ci): Phase 0 D2 — opt-in reusable shape-validate workflow - #276
Merged
Conversation
…008) Lets a standalone Homelab.Stacks.* repo validate its own shapes in CI without the full engine build. Downloads the pinned portable validator from the Homelab schema-v1 release (D1) and runs the SAME C# engine `validate` over the repo's shapes on ubuntu-latest — no .NET SDK / private feeds / self-hosted. - .github/workflows/_validate-shapes.yml: reusable (workflow_call) with schema-ref (default schema-v1) + shapes-path (default repo root) inputs and a required schema-token secret (contents:read on Chrison-dev/Homelab). The engine's apiVersion gate skips non-shape YAML (CI/compose/.env), so validating the repo root is safe. Caller example in the file header. - publish-schema.yml: breadcrumb noting the hand-rolled release steps are interim pending native Fallout publish (#275). Opt-in mirror of the superproject's full-fidelity validate-shapes.yml — one validator (ADR-0001), made portable. Refs #272. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ChrisonSimtian
added a commit
that referenced
this pull request
Jul 20, 2026
**Phase 0, Deliverable 3** (final) of the stack-extraction epic (#272), per [ADR-0008](docs/adr/ADR-0008-stack-extraction-meta-repo.md). ## What `.github/workflows/bump-stack-submodules.yml` — a weekly (+ `workflow_dispatch`) bot that advances every `stacks/*` submodule pointer to its remote default-branch HEAD and opens **one** PR with the bumps. - Turns **submodule drift into a reviewable PR** — the exact stale-pointer trap we hit by hand this session. - Removes the manual **"second PR"** after a stack repo merges its own change. - The bump PR touches `stacks/**`, so **`validate-shapes.yml` gates** the newly-pinned shapes in the superproject before merge. ## Tokens & idempotency - `SUBMODULES_RO_PAT` fetches the private `Homelab.Stacks.*` repos (`--remote`); the default `GITHUB_TOKEN` (contents + pull-requests write) pushes the branch + opens the PR. - Fixed `automation/bump-stack-submodules` branch → one open PR, force-updated each run. ## Phase 0 status — complete | | Deliverable | PR | |---|---|---| | D1 | Schema + portable validator | #274 ✅ merged | | D2 | Opt-in reusable validate action | #276 | | D3 | Submodule auto-bump bot | this | With these merged, Phase 0 is done and stack extraction (SmartHome, BuildLab — Phase 1) is unblocked. Also filed #275 (move the interim hand-rolled release to native Fallout publish). Refs #272. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ChrisonSimtian
added a commit
that referenced
this pull request
Jul 20, 2026
…ken) (#279) Follow-up fix to D2 (#276). GitHub secret identifiers allow only alphanumerics + underscore — a **hyphen** in a `workflow_call` `secrets:` key is invalid, so `schema-token` would reject the reusable-workflow call. - `_validate-shapes.yml`: `schema-token` → **`schema_token`** (secret declaration + `GH_TOKEN` env ref + caller example comment). - Inputs (`schema-ref`, `shapes-path`) keep hyphens — allowed for inputs, only secrets are restricted. The SmartHome caller (#278) already uses `schema_token`, so once this + `SCHEMA_RO_PAT` land, the opt-in validation goes green. Refs #272. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <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.
Phase 0, Deliverable 2 of the stack-extraction epic (#272), per ADR-0008. Builds on D1 (#274), whose
schema-v1release is now live.What
.github/workflows/_validate-shapes.yml— a reusable, opt-in workflow a standaloneHomelab.Stacks.*repo calls from its own PR pipeline. It downloads the pinned portable validator from the Homelabschema-v1release and runs the same C# enginevalidateover the repo's shapes onubuntu-latest— no .NET SDK, no private feeds, no self-hosted runner.Caller example (added to each stack repo during Phase 1 extraction):
Correctness notes
validatehas anapiVersion: homelab/v1gate (ShapeValidator.IsHomelabShape), so it skips.github/workflows/*.yml,compose.yml,.env, etc. — pointing it at the repo root is safe.validate <dir>recurses (as proven by the superproject'svalidate stacks/), so shapes at the repo root and in service subdirs are all covered.homelab-infra+schema/shape.schema.json; the engine resolves the schema fromAppContext.BaseDirectory(verified with atest -f).Design
This is the lightweight, early-feedback mirror; the superproject's
validate-shapes.yml(./build.sh ValidateShapes) remains the full-fidelity gate. One validator (ADR-0001), made portable — not a second implementation.Also adds a
#275breadcrumb topublish-schema.yml(the hand-rolled release steps are interim pending native Fallout publish).Note
No stack repo consumes this yet — the first caller lands with the SmartHome extraction (Phase 1). Requires an org/repo secret
SCHEMA_RO_PATon consumers.Refs #272.
🤖 Generated with Claude Code