fix: alias pr update to pr edit#149
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
avivsinai
left a comment
There was a problem hiding this comment.
One present blocker plus a few optional nits.
Blocker: skills/bkt/rules/pr.md on this branch head is already drifted from fresh generator output. Running go run ./cmd/docgen -o skills/bkt/rules on a clean checkout adds a trailing newline at EOF — committed is 1368 lines, regenerated is 1369. This isn't a future hazard; the generated artifact on the branch is stale right now. (PR #148's staleness gate will start catching this automatically once it lands, but the drift exists today.) Fix: run make generate-skill from a clean tree and commit the result without any post-processing that strips EOF whitespace — some formatters and pre-commit hooks do.
Everything else looks good:
- Alias is on the leaf
newEditCmd, sobkt pr update <id> --title ...inherits all flags and examples for free with zero duplication. edit_alias_test.godrivesroot.NewCmdRoot(factory)+runCLI, so it exercises Cobra's real alias resolution through the root command — right level.- No subcommand collision: audited all 19
newXxxCmdregistrations inpkg/cmd/pr/pr.go, no existingupdate, no other alias using it. - The generator already handles
Aliasesrendering (internal/docgen/generate.go:313-316), so the docs change flowed through codegen rather than being hand-edited.
Non-blocking:
- Consider mentioning the alias in
newEditCmd.Long, e.g."Edit a pull request's title, description, and/or reviewers. Also available as 'pr update'."— carries context into the generated rules prose, not just the**Alias:**line. edit_alias_test.gocould additionally assert stdout byte-equality betweenpr edit --helpandpr update --helpto catch a future refactor that accidentally repointsupdateat a different command with the same flag shape.- If agent intuition is the motivator, a follow-up sweep for other verbs (
close→decline,reply→comment) would be consistent.
305e7d5 to
4851115
Compare
|
All addressed:
|
avivsinai
left a comment
There was a problem hiding this comment.
Reviewed the updated diff.
The alias wiring on pr edit looks correct, the generated docs were refreshed, and the tests now cover canonical help, alias help, and output equality. I did not find actionable issues in the current patch.
Summary
Add
bkt pr updateas an alias ofbkt pr editso agent and user command resolution can match the more intuitive verb. The motivation is to improve command resolving for agents and automation that may naturally chooseupdateovereditfor modifying an existing pull request.Changes
updateCobra alias to thepr editcommand.pr editandpr update.skills/bktPR rule doc so the alias is reflected in agent-facing help.Testing
pre-commit run --files pkg/cmd/pr/pr.go pkg/cmd/pr/edit_alias_test.go skills/bkt/rules/pr.mdgo test ./pkg/cmd/prRisks