Skip to content

Add --check flag to schema and docs commands - #27

Merged
brahmlower merged 4 commits into
mainfrom
brahmlower/check-functionality
Aug 25, 2026
Merged

brahmlower merged 4 commits into
mainfrom
brahmlower/check-functionality

Conversation

@brahmlower

Copy link
Copy Markdown
Owner

Summary

  • Adds --check to schema and docs: generates in memory, compares against what's on disk, and exits non-zero listing every stale/missing file found — no writes, no shelling out to diff. This lets CI replace the hand-rolled --dry-run --stdout + manual diff pattern several projects were using.
  • schema --check additionally verifies that Chart.yaml's values-schema annotation references the chart's current version (a loose substring check); skipped silently if the annotation isn't set.
  • Fixes GenerateSchema/GenerateDocs swallowing real generation errors (logger.Error(...); return nil), which meant the CLI exited 0 even on genuine failures — necessary for --check's exit code (and any failure's exit code) to be meaningful.
  • Documents --check in the README's flag blocks; also backfills the previously-undocumented --git-add and --order flags while touching those blocks.

Test plan

  • go build ./..., go vet ./..., go test ./..., golangci-lint run ./... all clean
  • New table-driven tests: pkg/schema/plan_test.go (CheckSchema: matching/stale/missing schema file, version-matching/mismatched/absent annotation), pkg/docs/plan_test.go (CheckReadme: matching/stale/missing output file)
  • Manual smoke test against a scratch chart: schema --check/docs --check fail before first generation, pass after, and correctly re-fail on a stale values.yaml edit or a version bump without updating the values-schema annotation

🤖 Generated with Claude Code

brahmlower and others added 4 commits August 25, 2026 22:00
Lets CI verify generated files are up to date without hand-rolled
--dry-run/--stdout diffing. `schema --check` also verifies Chart.yaml's
values-schema annotation references the chart's current version. Also
fixes GenerateSchema/GenerateDocs swallowing real generation errors
(logging them but returning nil), which made exit codes meaningless.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Exercises the installed plugin end-to-end: --check fails before
generation, passes once up to date, fails again on a stale
values.yaml edit, and (schema only) fails when the values-schema
annotation stops referencing the chart's current version.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The 0.4.0 bucket's items were never started despite 0.4.0 already
being released, so bump it (and everything after) up one minor
version, freeing 0.4.0 for the --check flag that's actually landing
next.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@brahmlower
brahmlower merged commit c1a67b1 into main Aug 25, 2026
3 checks passed
@brahmlower
brahmlower deleted the brahmlower/check-functionality branch August 25, 2026 23:29
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