Skip to content

feat(pr): vote, abandon, complete commands and --mine filter - #16

Merged
jonas1307 merged 1 commit into
mainfrom
feat/pr-actions
Jul 23, 2026
Merged

feat(pr): vote, abandon, complete commands and --mine filter#16
jonas1307 merged 1 commit into
mainfrom
feat/pr-actions

Conversation

@jonas1307

Copy link
Copy Markdown
Owner

Completes the pull request module with review and lifecycle actions, plus a "mine" filter.

What changed

User ID plumbing

pr-list --mine and pr-vote need the authenticated user's ID, which the CLI did not store. The connectiondata response's id is now mapped, persisted to config.json as UserId during both the Entra and PAT sign-in flows, and resolved via a new ConfigService.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

ListPullRequests gained a creatorId filter; new VotePullRequest (PUT reviewers/{userId}), SetPullRequestStatus and CompletePullRequest (PATCH). Response model now includes lastMergeSourceCommit.

Upgrade note

The user ID is captured on config --login / config --pat. After upgrading, re-run config once so --mine and pr-vote have the ID; both report a clear message if it is missing.

Verification

Validated against a real organization: after re-running config, config --show and pr-list --mine resolve the user; voting, abandoning and completing a PR behave as expected. pr-complete performs a real merge, so it was tested against a disposable PR.

@jonas1307
jonas1307 merged commit 7efae0b into main Jul 23, 2026
1 check passed
@jonas1307
jonas1307 deleted the feat/pr-actions branch July 23, 2026 22:12
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.

1 participant