feat(pilotctl): add review command with subject+rating validation (PILOT-410)#276
Merged
Conversation
…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>
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
review.gowas present onmainbut unwired — this PR wirescmdReviewinto the dispatch table (case "review") and registersreviewHelpTextincommandHelpsopilotctl review --helpworkszz_review_test.goadds 12 test cases covering all specified scenarios via therunCLIsubprocess pattern (safe foros.Exitpaths)Behaviour
pilotctl review pilot— review Pilot itselfpilotctl review io.pilot.cosift— review a specific app--rating N— optional integer 1–5; errors on 0, 6, non-integer--text "..."— optional free-form textReview submitted for <subject>. Thank you!+ exit 0--jsonwraps result in standard{"status":"ok","data":{...}}envelope--helpprints full usage, exits 0Test plan
TestReviewValidSubjectNoFlags— bare subject, exit 0, confirmation outputTestReviewSubjectPilot— reserved subject "pilot" acceptedTestReviewWithRating— ratings 1, 3, 5 all acceptedTestReviewWithRatingAndText— both optional flags togetherTestReviewJSONOutput—--jsonenvelope shape + all fieldsTestReviewMissingSubject— exit non-zero, usage hint in stderrTestReviewRatingZero— out of range, exit non-zero, 1–5 hintTestReviewRatingSix— out of range, exit non-zero, 1–5 hintTestReviewRatingNonInteger— non-integer, exit non-zero, error mentions ratingTestReviewHelpFlag— exit 0, help text presentGOWORK=off go test -race ./cmd/pilotctl/... ✓Note: telemetry routing deferred to PILOT-411.
🤖 Generated with Claude Code