tags: gate on a resource-tagging standard via --standard-file#31
Merged
Conversation
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.
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 5 (final) of the tagging rollout — the enforcement seam. The
tagsaudit'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.go—LoadRequired(path)readscontent.required_by_surface.aws(the PascalCase keys the standard pre-renders — no rendering logic in Go) and validates thekind.cmd/tags.go— new--standard-fileflag. Precedence: explicit--requirewins (ad-hoc override) → else--standard-file→ else error. Pair with the global--fail-on mediumto gate CI.README— documents--standard-file+ the CI gate usage.cloudgov stays decoupled:
--standard-filetakes 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/tagscoverage 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 mediumagainst 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).