Skip to content

ci: gate template PRs on the deploy/ scaffold building#3

Merged
devantler merged 2 commits into
mainfrom
claude/ci-validate-scaffold
May 31, 2026
Merged

ci: gate template PRs on the deploy/ scaffold building#3
devantler merged 2 commits into
mainfrom
claude/ci-validate-scaffold

Conversation

@devantler
Copy link
Copy Markdown
Contributor

🤖 Generated by the Daily AI Assistant

Problem

The deploy/ Kustomize manifests are this template's core deliverable — every new tenant created from the template inherits them as its starting deploy/. Yet nothing in the template repo's own CI verified the scaffold still builds. A PR that broke the kustomization (a renamed or removed resource, a YAML error) could merge green and ship broken manifests downstream to every new tenant. The README only documented kubectl kustomize deploy/ as a manual, local check — easy to skip.

Change

Add .github/workflows/validate-scaffold.yaml — a small scaffold-integrity gate that runs kubectl kustomize deploy/ on every PR (the same command the README documents; kubectl with embedded kustomize is preinstalled on ubuntu-latest, so no cluster or CRDs are needed — it just renders the manifests to catch a broken kustomization).

  • Template-repo-only. Guarded with if: github.repository == 'devantler-tech/gitops-tenant-template', so it no-ops in tenants created from the template — symmetric to how cd.yaml/release.yaml use the inverse guard to run only in tenants and skip in the template repo. Tenants replace deploy/ with their own app and validate it via their own (owned) ci.yaml.
  • Conventions. Actions are hash-pinned (zizmor unpinned-uses-clean), the runner is harden-runner-fronted, top-level permissions: {} with a minimal contents: read on the job — matching portfolio standards.
  • README's Owned by the template table updated to list the new workflow.

Validation

  • kubectl kustomize deploy/renders 6 resources OK locally (the exact CI command).
  • actionlint → clean.

Trade-off for the maintainer to weigh (the reason this is a draft)

Because the file is template-owned, template-sync carries it into tenants, where it shows as a perpetually-skipped workflow run (the guard is false there). This is symmetric to cd.yaml being perpetually skipped in the template repo (which ships no app), so it follows an already-accepted pattern — but it is mild extra noise in tenant PR checks. If you'd rather keep scaffold validation local-only (status quo), close this; if you promote it, consider adding the Validate Scaffold check to the branch ruleset's required-status-checks so it actually blocks merges (a ruleset change is yours to make).

The deploy/ Kustomize manifests are this template's core deliverable — every
new tenant inherits them — yet nothing in the template repo's own CI verified
they still build. A PR that broke the kustomization (a renamed/removed
resource, a YAML error) could merge green and ship broken manifests to every
new tenant; the README only documented `kubectl kustomize deploy/` as a manual
local step.

Add a template-repo-only `validate-scaffold.yaml` that renders `deploy/` on
every PR (the same command the README documents). It is guarded with
`if: github.repository == 'devantler-tech/gitops-tenant-template'`, so it
no-ops in tenants created from the template — symmetric to how cd.yaml/
release.yaml run only in tenants and skip in the template. Actions are
hash-pinned (zizmor-clean) and the runner is harden-runner-fronted, matching
portfolio convention.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 31, 2026 13:23
Comment thread .github/workflows/validate-scaffold.yaml Fixed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a lightweight CI gate to ensure the template repository’s core deploy/ Kustomize scaffold continues to render successfully on pull requests, preventing broken scaffolds from being shipped to new tenants.

Changes:

  • Introduces a new GitHub Actions workflow that runs kubectl kustomize deploy/ on PRs to main, guarded to run only in devantler-tech/gitops-tenant-template.
  • Updates the README’s “Owned by the template” table to include the new workflow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
README.md Documents the new scaffold-validation workflow as template-owned.
.github/workflows/validate-scaffold.yaml Adds a PR workflow that renders deploy/ via Kustomize (template-repo only) to catch broken scaffolds early.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devantler devantler marked this pull request as ready for review May 31, 2026 13:26
The Validate Scaffold job only reads the repo to run `kubectl kustomize deploy/`
and never pushes, so the checkout does not need to keep the GITHUB_TOKEN. Setting
persist-credentials: false resolves the zizmor / code-scanning credential-persistence
(artipacked) finding that left PR #3 BLOCKED on an unresolved review thread.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@devantler devantler merged commit ca90dd5 into main May 31, 2026
6 checks passed
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.

3 participants