author_type: Type of author#
The author of a pull request is an owner, a member, a collaborator, …
Holds when the type of the author is one of the input types. GitHub tells
the association of the author with the repository with each pull request, its
author_association; the types group the associations:
Type |
Who it is |
Associations of GitHub |
|---|---|---|
|
The owner of the repository. |
|
|
A member of the organization of the repository. |
|
|
A collaborator who was invited to the repository. |
|
|
A contributor whose contributions were merged before; also an account imported from another platform, a mannequin. |
|
|
A first-timer: the pull request is the first contribution of the author, to the repository or to GitHub, or there is none yet. |
|
The types are exclusive: an author has exactly one type for a pull request, the most privileged that GitHub found, so a member of the organization is not a contributor, too. Inverting a column of some types therefore chooses the other types. The type is that of the pull request: a first-timer becomes a contributor on the next pull request after the first is merged. Bots are not a type of their own; they have the association of their account.
The column Type of author has it, with a switch for each type; its cell shows the type of the author.
It is checked on pull requests only. Until the repository was read again completely after dashboard.pycal.org kept the association (data version 4), the condition cannot be assessed yet.
Inputs#
Name |
Type |
Required |
What it is |
|---|---|---|---|
|
|
yes |
Some of |
The inputs as JSON:
{"types": ["contributor", "first_timer"]}
In the address of the table, such as author_type~applies~first_timer.
Data#
The update of the repository reads in the background:
issueThe pull request with the association of its author. Permissions of the GitHub App:
pull_requests: read; webhooks:pull_request.
API reference#
- class pycal_dashboard.conditions.condition.author_type.AuthorType#
Bases:
ConditionThe author of a pull request is an owner, a member, a collaborator, …
Holds when the type of the author, of the association that GitHub tells with the pull request (
author_association), is one of the inputtypes:owner,member,collaborator,contributor(also an imported account, a mannequin) orfirst_timer(whose first contribution it is, also on GitHub, or without any yet). The types are exclusive: an author has exactly one for a pull request.- classmethod complete(issue)#
The association is kept since data version 4.
- Parameters:
issue – The pull request.
- Returns:
True if its repository was read with it.
- classmethod assess(issue, values)#
Whether the type of the author is one of the types.
- Parameters:
issue – The pull request.
values –
types.
- Returns:
True if it is.