Skip to content

tags: gate on a resource-tagging standard via --standard-file#31

Merged
stxkxs merged 1 commit into
mainfrom
tags-standard-file
Jun 15, 2026
Merged

tags: gate on a resource-tagging standard via --standard-file#31
stxkxs merged 1 commit into
mainfrom
tags-standard-file

Conversation

@stxkxs

@stxkxs stxkxs commented Jun 15, 2026

Copy link
Copy Markdown
Member

Phase 5 (final) of the tagging rollout — the enforcement seam. The tags audit's required-key set was CLI-only (--require); it now also reads the required AWS keys from a published nanohype resource-tagging standard, so CI gates against the org's source of truth instead of a hand-typed list that drifts.

What changed

  • internal/tags/standard.goLoadRequired(path) reads content.required_by_surface.aws (the PascalCase keys the standard pre-renders — no rendering logic in Go) and validates the kind.
  • cmd/tags.go — new --standard-file flag. Precedence: explicit --require wins (ad-hoc override) → else --standard-file → else error. Pair with the global --fail-on medium to gate CI.
  • README — documents --standard-file + the CI gate usage.

cloudgov stays decoupled: --standard-file takes any compatible standard JSON by path (CI checks out / fetches it); nothing nanohype-specific is vendored. The multi-cloud slices (required_by_surface.gcp/.azure) wait on the GCP/Azure TagProviders.

Verification

task build + go vet + gofmt clean · go test ./... green · internal/tags coverage 96.3% (floor 90%) · flag registered, precedence + missing-both error confirmed.

Rollout note

This ships the capability. The live gate (a governance CI job running cloudgov tags --standard-file … --fail-on medium against AWS) flips on after the conform PRs (landing-zone #54, eks-agent-platform #41) are applied to the live account — run report-only first to confirm green. Not wired here (no creds in this repo's CI; wrong place).

The tags audit's required-key set was CLI-only (--require). It now also reads
the required AWS keys from a published nanohype resource-tagging standard, so CI
can gate against the org's source of truth instead of a hand-typed list that
drifts.

- internal/tags/standard.go — LoadRequired(path) reads content.required_by_surface.aws
  from the standard JSON (the PascalCase keys the standard pre-renders, so no
  rendering logic in Go) and validates the kind discriminator.
- cmd/tags.go — new --standard-file flag. Precedence: explicit --require wins
  (ad-hoc override) → else --standard-file → else error. Pair with the global
  --fail-on medium to gate CI (all tag findings are MEDIUM).
- README — documents --standard-file + the CI gate usage.

cloudgov stays decoupled: --standard-file takes any compatible standard JSON by
path (CI checks out or fetches it); nothing nanohype-specific is vendored. The
multi-cloud slices (required_by_surface.gcp/.azure) wait on the GCP/Azure
TagProviders.

Verified: task build + go vet + gofmt clean; go test ./... green; internal/tags
coverage 96.3% (floor 90%); --standard-file registered and the
--require/--standard-file precedence + missing-both error confirmed.
@stxkxs stxkxs merged commit 8a4841e into main Jun 15, 2026
4 checks passed
@stxkxs stxkxs deleted the tags-standard-file branch June 15, 2026 06:28
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