feat(pr): vote, abandon, complete commands and --mine filter - #16
Merged
Conversation
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.
Completes the pull request module with review and lifecycle actions, plus a "mine" filter.
What changed
User ID plumbing
pr-list --mineandpr-voteneed the authenticated user's ID, which the CLI did not store. Theconnectiondataresponse'sidis now mapped, persisted toconfig.jsonasUserIdduring both the Entra and PAT sign-in flows, and resolved via a newConfigService.ResolveUserId()with a clear error when it is missing.New commands
pr-vote -i <id> -v <vote>— casts your vote (approve,approve-suggestions,reject,wait,reset), self-adding as a reviewer if needed.pr-abandon -i <id>— sets the PR status to abandoned (reversible).pr-complete -i <id> [--delete-source]— merges the PR using its last merge source commit; fails clearly when there is no merge commit (draft or conflicts).pr-list --mine(-m) — filters to PRs you created.All three new commands work by PR ID and resolve the repository automatically from the PR, so they need neither project nor repo.
Backing HTTP methods
ListPullRequestsgained acreatorIdfilter; newVotePullRequest(PUT reviewers/{userId}),SetPullRequestStatusandCompletePullRequest(PATCH). Response model now includeslastMergeSourceCommit.Upgrade note
The user ID is captured on
config --login/config --pat. After upgrading, re-runconfigonce so--mineandpr-votehave the ID; both report a clear message if it is missing.Verification
Validated against a real organization: after re-running
config,config --showandpr-list --mineresolve the user; voting, abandoning and completing a PR behave as expected.pr-completeperforms a real merge, so it was tested against a disposable PR.