reviews: Reviews#
A pull request has a number of reviews, of the kinds that count: all by default.
Holds when the number of reviews of the pull request compares with the input
reviews as the input comparison says, such as at least 2. The input
kinds says which reviews count, the switches Which reviews count of the
column: approved, changes requested, commented and dismissed, all of them by
default. A dismissed review is an approval or a request for changes that a
maintainer dismissed later, such as after new commits. The same input is in the
states reviews_given: Reviews given and
review_ratio: Review to pull request ratio and the condition review_ratio: Review to pull request ratio.
It is checked on pull requests only. While the data of a pull request is not complete, the condition cannot be assessed yet.
Inputs#
Name |
Type |
Required |
What it is |
|---|---|---|---|
|
|
no, |
How the reviews compare with the number. |
|
|
yes |
The number of reviews to compare with, from 0 up. |
|
|
no, all of them |
The kinds of reviews that count: |
The type comparison is one of these; at most and at least include the
number itself:
Value |
Reads |
Holds when the number of reviews is |
|---|---|---|
|
more than > |
larger than the number |
|
fewer than < |
smaller than the number |
|
at most ≤ |
the number or smaller |
|
at least ≥ |
the number or larger |
|
exactly = |
the number |
The inputs as JSON:
{"comparison": "at_least", "reviews": 2, "kinds": ["approved", "changes_requested"]}
In the address of the table, a column that counts some kinds only ends with
them, such as reviews~applies~at_least~2~approved~changes_requested; without
kinds, all of them count. A column saved with ~comments before counts all of
them.
Data#
The update of the repository reads in the background:
reviewsThe reviews of the pull requests and who closed them. Permissions of the GitHub App:
pull_requests: read; webhooks:pull_request_review,pull_request.
API reference#
- class pycal_dashboard.conditions.condition.reviews.Reviews#
Bases:
ConditionA pull request has a number of reviews: at least, at most, more, fewer, or exactly.
Holds when the number of reviews of the pull request compares with the input
reviewsas the inputcomparisonsays, such as at least 2; at least and at most include the number. The inputkindssays which reviews count: approved, changes requested, commented and dismissed (an approval or a request for changes dismissed later); all of them by default.- classmethod assess(issue, values)#
Whether the number of reviews compares with the input.
- Parameters:
issue – The pull request.
values –
comparison,reviewsandkinds.
- Returns:
True if it holds.