Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

feat: add validate-config subcommand - #1

Closed
ivyrhodes wants to merge 4 commits into
bitcomplete:mainfrom
ivyrhodes:ivy/kpl-19-validate-config
Closed

feat: add validate-config subcommand#1
ivyrhodes wants to merge 4 commits into
bitcomplete:mainfrom
ivyrhodes:ivy/kpl-19-validate-config

Conversation

@ivyrhodes

Copy link
Copy Markdown
Contributor

Summary

新建 CLI command: kploy validate-config — parses + validates a local kploy.yaml file 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

$ kploy validate-config --file kploy.yaml
OK

Sample hostnames:
ENV          HOSTNAME
prod         myapp.bitcomplete.dev
development  myapp-development.bitcomplete.dev

Example preview env (PR #1):
HOSTNAME                       SERVICE  PORT
myapp-pr-1.bitcomplete.dev     app      3000
myapp-pr-1-ws.bitcomplete.dev  socket   1999

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:

$ kploy validate-config --file bad.yaml
Error: project: must match ^[a-z][a-z0-9-]{2,12}$ (got "BadName")

--output json also 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 "Validating kploy.yaml" section.
  • go.mod / go.sum — adds github.com/bitcomplete/kployconfig v0.1.1.

Test plan

  • go build ./...
  • go vet ./... / gofmt -l .
  • Smoke: valid file with preview → text output renders cleanly
  • Smoke: valid file without preview → no "Example preview env" section
  • Smoke: --output json → consistent lowerCamelCase JSON
  • Smoke: missing file → useful error message
  • Smoke: invalid config → validation errors with field paths

ivyrhodes and others added 4 commits June 11, 2026 11:04
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>
@ivyrhodes

Copy link
Copy Markdown
Contributor Author

Closing without merging — this work has re-landed in the kploy monorepo per the consolidation decision (bitcomplete/design-docs/0001-kploy-repo-structure.md).

The CLI source moved back into bitcomplete/kploy at cli/ (KPL-33 / https://github.com/bitcomplete/kploy/pull/108), and the validate-config command came along as part of that move. The validation library it depends on (kployconfig) folds in next under the re-scoped KPL-19.

bitcomplete/kploy-cli stays as the public release host so brew install bitcomplete/tap/kploy keeps working post-migration (per KPL-32). Source archival happens under KPL-34 once the monorepo migration is complete.

@ivyrhodes ivyrhodes closed this Jun 12, 2026
ivyrhodes added a commit that referenced this pull request Jun 16, 2026
* feat: add `validate-config` subcommand (KPL-19)

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 #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>

* refactor(validate-config): clearer output, README entry

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 #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>

* fix: drop stale kployconfig v0.1.0 entries from go.sum

`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>

* fix(lint): discard fmt.Fprint return values explicitly

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>

* docs: add moved-to-monorepo banner (KPL-34)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
注册 for free to subscribe to this conversation on GitHub. Already have an account? 登录.

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant