Repository navigation
Add a pytest job and cover the PR reporter fallback - #77
Draft
aiolibsbot wants to merge 1 commit into
Draft
aiolibsbot wants to merge 1 commit into
aiolibsbot wants to merge 1 commit into
Conversation
The repo had no test suite and no CI workflow, so nothing verified the Checks-API-vs-comment fallback that decides what a user actually sees while a backport runs. Add `pytest.ini`, a `tests` workflow (pytest only, no third-party deps needed -- `patchback.github_reporter` imports stdlib only) and a suite for `PullRequestReporter`: - `start_reporting` swallows a `PermissionError` from `create_check` and keeps reporting through the PR comment; - `update_progress` updates the PR comment even when the Checks API is unavailable -- the comment is the only channel in that case; - `finish_reporting` locks the PR on both paths and forwards the conclusion; - omitted `text`/`summary` render as empty strings, not `None`. `pytest.ini` and the workflow are byte-identical to the ones carried by the open backport-reporting branches, so they merge in any order.
This was referenced Sep 17, 2026
This branch has not been deployed
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.
What
Adds
pytest.ini, atestsCI workflow, and a suite coveringPullRequestReporter's Checks-API-vs-comment fallback.Why
The repo has no test suite and no CI workflow, so nothing verifies the logic
that decides what a user actually sees while a backport runs. Several open
backport branches (#72, #73, #74, #75, #76) add tests — without this, those
tests run nowhere once merged.
How
patchback.github_reporterimports stdlib only, so the job installs nothingbut
pytest. Pinning test deps via pip-tools is left for when the suitegrows any.
pytest.iniand.github/workflows/tests.ymlare byte-identical to thecopies carried by Report git output and conflicting hunks on backport failure #72/Explain ruleset and branch protection push rejections #73, so this merges in any order relative to them
(git resolves identical add/add without a conflict).
Covered:
create_checkraisingPermissionErrorkeeps reporting via the PRcomment;
update_progressupdates that comment even with no Checks API;finish_reportinglocks the PR on both paths and forwardsconclusion;omitted
text/summaryrender as''rather thanNone.Testing
python -m pytest— 8 passed. Mutation-checked: moving the_use_checks_apiearly return above the comment update makes thefallback test fail, as intended.
Not addressed here: a
pre-commitCI job —.pre-commit-config.yamlalready targets the hosted pre-commit.ci, so a duplicate workflow would
be noise.
Quality Report
Changes: 3 files changed, 224 insertions(+)
Code scan: clean
Tests: failed (command not found)
Branch hygiene: clean
Generated by Kōan