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

label_exists: A label exists

A label exists on a pull request.

label_absent: A label is absent

A label is absent from a pull request.

ci_passes: CI passes

The checks of the last commit of a pull request passed.

ci_fails: CI fails

A check of the last commit of a pull request failed.

ci_unknown: CI unknown

The result of the checks of a pull request is not known.

merge_conflict: Merge conflict

A pull request has a merge conflict with its base branch.

branch_outdated: Branch out of date

The branch of a pull request is behind its base branch.

branch_up_to_date: Branch up to date

The branch of a pull request is up to date with its base branch.

auto_merge_enabled: Auto-merge enabled

Auto-merge is enabled on a pull request.

open: Open

A pull request is open.

draft: Draft

A pull request is a draft: not ready for review yet.

merged: Merged

A pull request was merged.

closed: Closed

A pull request was closed without being merged.

reviews: Reviews

A pull request has a number of reviews, without those of comments only.

review_ratio: Review to pull request ratio

The review to pull request ratio of the author compared with a number.

author_type: Type of author

The author of a pull request is an owner, a member, a collaborator, …

text_matches: Text matches

The title or the description of a pull request matches a text or a regex.

pr_sync: PR Sync on

The PR Sync of the project is on for a pull request: it has its Status Message.

step_skipped: A step skipped

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):

string

A text.

int

A whole number, with an optional smallest and largest number.

positive-int

A whole number from 1 up.

number

A number, also with a fraction, such as 1.5.

comparison

How a number is compared: above, below, at_most, at_least or exactly; at most and at least include the number.

range

Two whole numbers, [low, high], low not above high.

string-label

The name of a label of the repository.

bool

On or off: true or false; a switch in a form.

choice

One of a few names, such as title or description.

review-kinds

The kinds of reviews that count, of approved, changes_requested, commented and dismissed; all of them by default; a switch for each in a form. Every condition and state that counts reviews has it as kinds.

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.

issue

Whether the pull request is open, closed or merged.

labels

The labels of the repository and of the pull request.

pull_request

Whether the pull request can be merged, is behind its base, and merges itself.

checks

The checks and statuses of the last commit of the pull request.

reviews

The 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.