Repository navigation
fix(git): skip commit statuses for state-only PR reads - #793
Open
BlackYuriJDU wants to merge 1 commit into
Open
BlackYuriJDU wants to merge 1 commit into
BlackYuriJDU wants to merge 1 commit into
Conversation
pr_status always paged the commit statuses when host CI was on, even for merge and apply, which only read the PR's state. Add a ci flag (default true) to the Git protocol and both providers; merge and apply pass ci=False, and the GitHub status test asserts the fetch makes no status request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pr_statusaciflag (defaultTrue), so callers that only need the PR state do not page the host CI.mergeandapplypassci=False; GitHub skips its Actions lookup and Gitea skips the commit-status read.Motivation
Fixes #775.
jobs/merge.pyandjobs/apply.pycallpr_statusonly for the PR's state, but the provider also fetched the CI on every open-PR read. With host CI on that spent extra GitHub Actions requests and made an Actions outage raiseGitUnavailablewhere only the PR read was needed.Changes
Gitprotocol and the base/GitHub/Gitea providers:pr_status(pr, *, ci=True).merge.py/apply.py: state-only reads passci=False.test_github_actions_ci.py: assert the state-only read requests only/pulls/7and returns no checks.Test Plan
pytest tests/service/test_github_actions_ci.py -q— 68 passed.ciguard removed, the new test fails because the Actions lookup runs andchecksis non-empty.state,head_sha,merge_sha) are unchanged.