komrad

list_pull_requests

List the pull requests komrad has recorded for a repository, open ones first.

read-onlyidempotentMCP toolPull Request

A repository without a live agent may be out of date. list_forge_pull_requests reads the forge directly.

Calling it#

curl -X POST http://127.0.0.1:8787/komrad.pullrequest.v1.PullRequestService/ListPullRequests \
  -H 'Content-Type: application/json' \
  -d '{
  "repository_url": "<repository_url>"
}'

Request#

ListPullRequestsRequest#

FieldTypeDescription
repository_urlstring*

at most 2048 characters

The repository the pull requests merge into, as a git remote or a web address.

head_branchstring

at most 512 characters

The branch the pull requests merge from. Empty lists every pull request komrad has recorded for the repository.

paginationPagination

The page to read. The page size defaults to twenty and is at most a hundred.

Response#

ListPullRequestsResponse#

FieldTypeDescription
pull_requestsPullRequest[]

One page of pull requests, open ones first, each group newest first.

next_page_tokenstring

The cursor for the next page. Unset on the last page.

Types#

Pagination#

Pagination selects one page of a listing.

FieldTypeDescription
limitint32

at least 0

How many records to return. Komrad caps the value, and picks one when unset.

cursorstring

at most 2048 characters

The next_page_token from the previous response. Unset to start from the first page.

PullRequest#

PullRequest is a pull request as komrad last read it from the forge.

FieldTypeDescription
iduuid*

The pull request's id.

forgeKind

The kind of forge the pull request is on.

provider_idstring

The forge's own stable id for the pull request, such as GitHub's node_id.

urlstring

The pull request's web address.

repository_urlstring

The web address of the repository the pull request merges into.

head_repository_urlstring

The web address of the repository the pull request's branch is in. Empty when the forge no longer has that repository.

numberint32

The pull request's number, unique within its repository.

titlestring

The pull request's title.

head_branchstring

The branch the pull request merges from.

head_shastring

The commit at the tip of the pull request's branch.

base_branchstring

The branch the pull request merges into.

base_shastring

The commit at the tip of the branch the pull request merges into.

draftbool

Whether the pull request is a draft.

statePullRequestState

The pull request's state.

opened_attimestamp

When the pull request was opened.

changed_attimestamp

When the pull request last changed on the forge.

merged_attimestamp

When the pull request merged. Unset until the pull request merges.

closed_attimestamp

When the pull request closed, merged or not. Unset while the pull request is open.

merge_readinessMergeReadiness

How close the forge is to merging the pull request.

authorstring

The login of the pull request's author. Empty when the forge no longer has the account.

bodystring

The pull request's description. Empty when it has none.

MergeReadiness#

MergeReadiness is how close a pull request's head commit is to merging.

FieldTypeDescription
decisionReviewDecision

The forge's review decision.

checksChecks

The state of the checks on the head commit. Unspecified when the forge last reported on an older head.

mergeabilityMergeability

The forge's mergeability, or the last value for the same head while the forge recomputes it.

mergeability_unconfirmedbool

Whether mergeability is the last value for this head, not yet confirmed by a new read.

auto_mergebool

Whether auto-merge is on, so the forge merges once the checks and reviews pass.

auto_mergeablebool

Whether the forge would let komrad turn auto-merge on now. The forge refuses for a draft, a pull request with nothing left to wait for, and a repository that does not allow auto-merge.

credential_approvedbool

Whether komrad's credential has an approval standing on the pull request.

credential_can_approvebool

Whether the forge would take an approval from komrad's credential now. The forge refuses one from the pull request's author and from a user it does not let approve.

reviewersReviewer[]

The users who have reviewed the pull request or have a review request waiting, without its author. Empty before the forge has been read.

Reviewer#

Reviewer is one user who has reviewed a pull request or been asked to.

FieldTypeDescription
loginstring

The reviewer's login on the forge.

verdictReviewerVerdict

Where the reviewer's latest review leaves them.

requestedbool

Whether a review request to the reviewer is waiting.

Kind#

Kind is the kind of forge a host runs.

ValueDescription
github

GitHub, or a GitHub Enterprise host.

gitlab

GitLab, or a self-managed GitLab host.

PullRequestState#

PullRequestState is the state of a pull request, worked out from the forge's report. A finished state wins over an open one.

ValueDescription
unread

Komrad has not read the repository yet.

none

Komrad read the repository and found no pull request from the branch.

open

Open, without a review decision that decides it.

approved

Open, and the forge would merge it now.

changes_requested

Open, with a reviewer asking for changes.

draft

A draft, whatever its reviews say.

merged

Merged.

closed

Closed without merging.

failing

Open, with a failing check on the head commit, whatever its reviews say.

approved_waiting

Approved, but behind its base branch or blocked by a branch rule.

conflicting

Open, and in conflict with its base branch, whatever its reviews say.

checks_running

Open, with checks running on the head commit and no reviewer asking for changes.

rereview_requested

Open, and every reviewer who asked for changes has been asked to review again.

ReviewDecision#

ReviewDecision is the forge's decision on a pull request's reviews.

ValueDescription
none

The forge reports no decision.

pending

A required review has not been given.

approved

The forge counts the pull request as approved.

changes_requested

A reviewer is asking for changes.

rereview_requested

Every reviewer who asked for changes has been asked to review again.

Checks#

Checks is the overall state of the checks on a pull request's head commit.

ValueDescription
none

The head commit has no checks.

pending

Checks are still running.

passing

Every check passed.

failing

At least one check failed, and every check has finished.

failing_running

At least one check failed, and others are still running.

Mergeability#

Mergeability is whether the forge would merge a pull request, given its base branch and branch rules.

ValueDescription
unknown

The forge has not worked it out yet.

clean

The forge would merge the pull request now.

unstable

Some checks are not passing.

blocked

A branch rule is not met, such as a required review.

behind

The base branch has commits the pull request's branch does not.

conflicting

The branch is in conflict with its base branch.

ReviewerVerdict#

ReviewerVerdict is where one reviewer's latest review of a pull request leaves them.

ValueDescription
none

The reviewer has not reviewed the pull request.

approved

The reviewer approved.

changes_requested

The reviewer asked for changes.

commented

The reviewer left comments without approving or asking for changes.

dismissed

The reviewer's latest review was dismissed.