Skip to content

feat(validator): accept --phase readiness as standalone CLI option#346

Closed
xdu31 wants to merge 1 commit intoNVIDIA:mainfrom
xdu31:latest
Closed

feat(validator): accept --phase readiness as standalone CLI option#346
xdu31 wants to merge 1 commit intoNVIDIA:mainfrom
xdu31:latest

Conversation

@xdu31
Copy link
Contributor

@xdu31 xdu31 commented Mar 11, 2026

Summary

  • Re-enable --phase readiness as a selectable CLI option so users can validate recipe constraints against the snapshot before deploying
  • Single shared runReadinessPhase() replaces the old checkReadiness(), serving both explicit and implicit paths
  • --phase all behavior unchanged: readiness runs as an implicit pre-flight gate

Motivation

V2 removed --phase readiness as a selectable option, breaking the CUJ1 workflow where users validate readiness standalone before deploying. This PR adds it back without duplicating logic.

Behavior

CLI Readiness behavior
--phase readiness Runs readiness only, returns CTRF report, no cluster access
--phase readiness,deployment Runs readiness first; if it fails, skips container phases
--phase all (default) Readiness runs implicitly as a gate; failure returns error before any Jobs deploy

Changes

File Change
pkg/validator/phases.go Add PhaseReadiness constant
pkg/validator/validator.go Replace checkReadiness() with runReadinessPhase(), update ValidatePhases()
pkg/cli/validate.go Accept "readiness" in CLI parser, update usage strings
pkg/cli/validate_test.go Change "readiness is invalid" test to expect success
pkg/validator/validator_test.go Replace checkReadiness tests with runReadinessPhase equivalents

Test plan

  • go test -race ./pkg/validator/... passes
  • go test -race ./pkg/cli/... passes
  • --phase readiness accepted by CLI parser
  • --phase all behavior unchanged (implicit readiness gate)
  • Nil/empty constraint edge cases covered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant