feat(pr): add `anvil pr edit` command #8
feat/pr-edit
into main
Summary
Adds anvil pr edit <N> [--title ...] [--body ...] mirroring anvil issue edit. PATCHes /{org}/{name}/pulls/{number} with whichever of title / body are supplied. If neither is given, prints a warning and makes no API call.
Server constraint
PullRequest.update_changeset/2 (anvil repo, lib/anvil/code_review/pull_request.ex:92) only casts :title and :body. Base branch, head branch, and labels are not editable via the existing PATCH endpoint, so they are out of scope here. Widening that would require a separate server-side change.
Verification
This PR’s title and body were themselves written by the new command — the initial pr create used a placeholder title (“TYPO in titl: add anvil pr edit”) and body, and this edit rewrote both. That is the end-to-end test.
-
anvil pr edit <N> --title "..."updates title -
anvil pr edit <N> --body "..."updates body - Both flags combine in a single call
- Empty invocation prints warning, makes no request (manually checked)
-
anvil pr --helplists the new subcommand -
cargo build --release,cargo clippy -- -D warnings,cargo test --releaseall clean
Closes #3