Repository navigation
Add --check flag to schema and docs commands - #27
Merged
Merged
Conversation
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>
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.
Summary
--checktoschemaanddocs: generates in memory, compares against what's on disk, and exits non-zero listing every stale/missing file found — no writes, no shelling out todiff. This lets CI replace the hand-rolled--dry-run --stdout+ manual diff pattern several projects were using.schema --checkadditionally verifies thatChart.yaml'svalues-schemaannotation references the chart's current version (a loose substring check); skipped silently if the annotation isn't set.GenerateSchema/GenerateDocsswallowing 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.--checkin the README's flag blocks; also backfills the previously-undocumented--git-addand--orderflags while touching those blocks.Test plan
go build ./...,go vet ./...,go test ./...,golangci-lint run ./...all cleanpkg/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)schema --check/docs --checkfail before first generation, pass after, and correctly re-fail on a stalevalues.yamledit or a version bump without updating thevalues-schemaannotation🤖 Generated with Claude Code