feat: add validate-config subcommand#1
Open
ivyrhodes wants to merge 4 commits into
Open
Conversation
Validates a local kploy.yaml file via the new github.com/bitcomplete/kployconfig module. Prints OK + sample rendered hostnames for prod/development/pr-1, plus the preview ingress hostnames for PR bitcomplete#1 when preview envs are enabled. JSON output supported via the existing --output flag. Companion to bitcomplete/kploy#105 (the library shipped) + https://github.com/bitcomplete/kployconfig (the module's new public home). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Restructure the text-mode output so the "example PR preview" framing is explicit: - Drop the synthetic pr-1 row from the Sample hostnames table. - Rename the ingress section header to "Example preview env (PR bitcomplete#1)" so the hypothetical-PR framing is unambiguous. - Only print the example-preview section when preview envs are actually enabled — projects without preview just see prod + development. Also adds a README section under Authenticate so the command is discoverable from public-facing docs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`go get` left the previous version's checksums behind when bumping to v0.1.1; CI catches it via `go mod tidy && git diff --exit-code`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
errcheck flags unchecked return values on new code; existing CLI commands using the same pattern are exempted via the lint config's only-new-issues setting. Match the convention by writing the discard explicitly. Co-Authored-By: Claude Opus 4.7 (1M context) <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
New CLI command:
kploy validate-config— parses + validates a localkploy.yamlfile and prints the hostnames it would render. Project owners can sanity-check their config locally before pushing.Backed by
bitcomplete/kployconfig. Tracks internal ticket KPL-19.Usage
The "Example preview env" section is only printed when preview envs are enabled in the file.
Errors propagate via cobra with a structured field path:
--output jsonalso supported, consistent with other commands.What's in this PR
cmd/validate_config.go— new command (~100 lines).cmd/root.go— register the command.README.md— new "Validatingkploy.yaml" section.go.mod/go.sum— addsgithub.com/bitcomplete/kployconfig v0.1.1.Test plan
go build ./...go vet ./.../gofmt -l .--output json→ consistent lowerCamelCase JSON