Fix duplicate required check identity handling#22
Conversation
mberman84
left a comment
There was a problem hiding this comment.
Requesting changes for a regression against current main's exact-commit fallback. Please normalize check identity consistently across the GraphQL rollup and REST check-run feeds (or let exact data replace the corresponding rollup entry), add coverage for a stale pending rollup plus a successful exact check, and compose this with #21's PASSED_CHECK_STATES. GitHub CI is still action_required; re-request review after updating the head.
| app_slug = app.get("slug") if isinstance(app, dict) else "" | ||
| source = str( | ||
| app_slug | ||
| or check.get("workflowName") |
There was a problem hiding this comment.
statusCheckRollup CheckRun entries use workflowName, while commit_check_runs() REST entries use app.slug. The exact-check fallback concatenates those feeds, so one CI run becomes two identities: a stale pending rollup plus an exact successful REST run still reduces to pending. Normalize a stable identity across both shapes, or replace the rollup identity with exact data, and add that regression case.
91d0354 to
4f67689
Compare
|
Addressed the review feedback in the updated head. The exact-check fallback now treats rollup CheckRun data and REST exact CheckRun data for the same named run as the same CheckRun identity, while still evaluating same-name commit statuses separately as GitHub requires. Added regression coverage for the stale rollup plus exact REST CheckRun case. Verification: |
Aggregate same-name check runs and commit statuses fail-closed after reducing each identity to its latest state so DeployBot does not mark a required context passed while another matching entry is failed or pending. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
4f67689 to
457fd0a
Compare
mberman84
left a comment
There was a problem hiding this comment.
Re-reviewed after rebasing onto #21. The reducer now keeps separate CheckRun/status identities while accepting SUCCESS, SKIPPED, and NEUTRAL only when every retained identity passes. Full suite: 222 passed, 3 skipped, 202 subtests; Ruff clean; structured autoreview clean.
Summary
Closes #17
Validation
PYTHONPATH=src python3 -m pytest tests/test_cli.py -qPYTHONPATH=src python3 -m pytest -qPYTHONPATH=src python3 -m ruff check src testsPYTHONPATH=src python3 -m unittest discover -s tests -vPYTHONPATH=src python3 -m buildautoreview --mode local: clean, no accepted/actionable findings