branch_up_to_date: Branch up to date#
The branch of a pull request is up to date with its base branch.
Holds when the pull request is neither behind its base branch nor has a conflict with it.
Special case: merged pull requests#
A merged pull request is always up to date: its branch is in the base branch, so it cannot be behind it or in conflict with it. GitHub no longer tells the state of its branch, so the condition holds for it without that data. Accordingly, branch_outdated: Branch out of date and merge_conflict: Merge conflict do not hold for a merged pull request, and the column Branch of the table of pull requests says up to date for it.
It is checked on pull requests only. While the data of a pull request is not complete, the condition cannot be assessed yet.
Inputs#
The condition has no inputs.
Data#
The update of the repository reads in the background:
issueWhether the pull request is open, closed or merged. Permissions of the GitHub App:
pull_requests: read; webhooks:pull_request.pull_requestWhether the pull request can be merged, is behind its base, and merges itself. Permissions of the GitHub App:
pull_requests: read,contents: read; webhooks:pull_request,push.
API reference#
- class pycal_dashboard.conditions.condition.branch_up_to_date.BranchUpToDate#
Bases:
ConditionThe branch of a pull request is up to date with its base branch.
Holds when the pull request is neither behind its base branch nor has a conflict with it.
Special case: a merged pull request is always up to date. Its branch is in the base branch, so it cannot be behind it or in conflict with it, and GitHub no longer tells the state of its branch; the condition holds without that data.
branch_outdatedandmerge_conflictdo not hold for it, accordingly.- classmethod assess(issue, values)#
Whether the branch is up to date.
- Parameters:
issue – The pull request.
values – Nothing: the condition has no inputs.
- Returns:
True if it was merged, or is neither behind nor in conflict.