Skip to content

feat(pilotctl): add review command with subject+rating validation (PILOT-410)#276

Merged
TeoSlayer merged 2 commits into
mainfrom
feat/pilot-410-review-cli
Jun 17, 2026
Merged

feat(pilotctl): add review command with subject+rating validation (PILOT-410)#276
TeoSlayer merged 2 commits into
mainfrom
feat/pilot-410-review-cli

Conversation

@TeoSlayer

Copy link
Copy Markdown
Collaborator

Summary

  • review.go was present on main but unwired — this PR wires cmdReview into the dispatch table (case "review") and registers reviewHelpText in commandHelp so pilotctl review --help works
  • zz_review_test.go adds 12 test cases covering all specified scenarios via the runCLI subprocess pattern (safe for os.Exit paths)

Behaviour

  • pilotctl review pilot — review Pilot itself
  • pilotctl review io.pilot.cosift — review a specific app
  • --rating N — optional integer 1–5; errors on 0, 6, non-integer
  • --text "..." — optional free-form text
  • Valid input: prints Review submitted for <subject>. Thank you! + exit 0
  • --json wraps result in standard {"status":"ok","data":{...}} envelope
  • Invalid input: error + usage hint to stderr, exit 1
  • --help prints full usage, exits 0

Test plan

  • TestReviewValidSubjectNoFlags — bare subject, exit 0, confirmation output
  • TestReviewSubjectPilot — reserved subject "pilot" accepted
  • TestReviewWithRating — ratings 1, 3, 5 all accepted
  • TestReviewWithRatingAndText — both optional flags together
  • TestReviewJSONOutput--json envelope shape + all fields
  • TestReviewMissingSubject — exit non-zero, usage hint in stderr
  • TestReviewRatingZero — out of range, exit non-zero, 1–5 hint
  • TestReviewRatingSix — out of range, exit non-zero, 1–5 hint
  • TestReviewRatingNonInteger — non-integer, exit non-zero, error mentions rating
  • TestReviewHelpFlag — exit 0, help text present
  • All tests pass: GOWORK=off go test -race ./cmd/pilotctl/... ✓

Note: telemetry routing deferred to PILOT-411.

🤖 Generated with Claude Code

teovl and others added 2 commits June 17, 2026 11:44
…nter (PILOT-404, PILOT-405)

Replace the verbose multi-line catalogue listing with a compact one-line-per-app
format (<id>   <description>) followed by a 'Run pilotctl appstore view <id>
for full details.' hint. JSON output is unchanged. Three tests added to cover
the new format, the view-pointer hint, and JSON pass-through.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…LOT-410)

Wire cmdReview into main dispatch and commandHelp (review.go was
present but unwired). Add zz_review_test.go covering: valid subject,
subject=pilot, rating 1/3/5, rating+text combined, JSON envelope,
missing subject, rating=0, rating=6, non-integer rating, --help.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@TeoSlayer TeoSlayer requested a review from Alexgodoroja as a code owner June 17, 2026 08:45
@TeoSlayer TeoSlayer merged commit fe4095c into main Jun 17, 2026
10 checks passed
@TeoSlayer TeoSlayer deleted the feat/pilot-410-review-cli branch June 17, 2026 09:09
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.

2 participants