Conditions#
A condition is checked on a pull request, such as whether it has a label. Each
has an id, the inputs that configure it, and the data that the update of the
repository reads for it in the background. A condition is a state of a pull
request that is true or false; the states of people
are numbers, and conditions such as review_ratio compare them with a number.
Each condition shows its evidence on the page of a pull request: the least that
shows why it holds or not, such as the checks on GitHub, or as many reviews as
decide it (Evidence). The data
specs give the links of their data, which the conditions reuse
(evidence()), and a
condition chooses the least of them
(evidence()).
Id |
What it checks |
|---|---|
A label exists on a pull request. |
|
A label is absent from a pull request. |
|
The checks of the last commit of a pull request passed. |
|
A check of the last commit of a pull request failed. |
|
The result of the checks of a pull request is not known. |
|
A pull request has a merge conflict with its base branch. |
|
The branch of a pull request is behind its base branch. |
|
The branch of a pull request is up to date with its base branch. |
|
Auto-merge is enabled on a pull request. |
|
A pull request is open. |
|
A pull request is a draft: not ready for review yet. |
|
A pull request was merged. |
|
A pull request was closed without being merged. |
|
A pull request has a number of reviews, without those of comments only. |
|
The review to pull request ratio of the author compared with a number. |
|
The author of a pull request is an owner, a member, a collaborator, … |
|
The title or the description of a pull request matches a text or a regex. |
|
The PR Sync of the project is on for a pull request: it has its Status Message. |
|
A pull request skips a step of the project, skipped by a person or for its author. |
Inputs#
The types of the inputs, which also make the field of a form that asks for them
(widget(), shown by the
partial conditions/_input.html):
stringA text.
intA whole number, with an optional smallest and largest number.
positive-intA whole number from 1 up.
numberA number, also with a fraction, such as
1.5.comparisonHow a number is compared:
above,below,at_most,at_leastorexactly; at most and at least include the number.rangeTwo whole numbers,
[low, high], low not above high.string-labelThe name of a label of the repository.
boolOn or off:
trueorfalse; a switch in a form.choiceOne of a few names, such as
titleordescription.review-kindsThe kinds of reviews that count, of
approved,changes_requested,commentedanddismissed; all of them by default; a switch for each in a form. Every condition and state that counts reviews has it askinds.
Data#
The data of a pull request that conditions need, with the permissions and
webhooks of the GitHub App that reading it needs. The state of the open pull
requests comes with one query of GraphQL for each repository, made of the
fields that every kind of data needs: about one point of GitHub for 50 pull
requests, where the REST API needs requests for each one. GraphQL needs a
token, so it reads only repositories with the GitHub App, and only the fields
whose permissions the owners of the installation accepted: the checks wait
until they accept checks and statuses. When GitHub gives up on a slow
query (502), the site asks for the same page with half as many pull requests. Data whose permissions the
app does not ask for is not read.
issueWhether the pull request is open, closed or merged.
labelsThe labels of the repository and of the pull request.
pull_requestWhether the pull request can be merged, is behind its base, and merges itself.
checksThe checks and statuses of the last commit of the pull request.
reviewsThe reviews of all pull requests of the repository, open and closed, and who closed each. One query of GraphQL reads 20 pull requests, the last changed first, and stops at those it read before; the first 100 reviews of a pull request are read.
See API reference for the classes.