Skip to content

feat(ci): Phase 0 D2 — opt-in reusable shape-validate workflow - #276

Merged
ChrisonSimtian merged 1 commit into
mainfrom
feat/phase0-validate-action
Jul 20, 2026
Merged

feat(ci): Phase 0 D2 — opt-in reusable shape-validate workflow#276
ChrisonSimtian merged 1 commit into
mainfrom
feat/phase0-validate-action

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Phase 0, Deliverable 2 of the stack-extraction epic (#272), per ADR-0008. Builds on D1 (#274), whose schema-v1 release is now live.

What

.github/workflows/_validate-shapes.yml — a reusable, opt-in workflow a standalone Homelab.Stacks.* repo calls from its own PR pipeline. It downloads the pinned portable validator from the Homelab schema-v1 release and runs the same C# engine validate over the repo's shapes on ubuntu-latest — no .NET SDK, no private feeds, no self-hosted runner.

Caller example (added to each stack repo during Phase 1 extraction):

jobs:
  shapes:
    uses: Chrison-dev/Homelab/.github/workflows/_validate-shapes.yml@main
    secrets:
      schema-token: ${{ secrets.SCHEMA_RO_PAT }}   # contents:read on Chrison-dev/Homelab

Correctness notes

  • The engine's validate has an apiVersion: homelab/v1 gate (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's validate stacks/), so shapes at the repo root and in service subdirs are all covered.
  • The tarball ships homelab-infra + schema/shape.schema.json; the engine resolves the schema from AppContext.BaseDirectory (verified with a test -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 #275 breadcrumb to publish-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_PAT on consumers.

Refs #272.

🤖 Generated with Claude Code

…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
ChrisonSimtian merged commit b3baa49 into main Jul 20, 2026
@ChrisonSimtian
ChrisonSimtian deleted the feat/phase0-validate-action branch July 20, 2026 07:27
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>
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