You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compare readiness run selection and workflow replacement timestamps as instants #1462
Readiness compares raw GitHub timestamp strings when two check-run rows have the same numeric ID (or both lack IDs) and when it looks for active workflow replacements. These comparisons can disagree with UTC instant order.
fromunittest.mockimportpatchfromloopzeroimportgithubhead="a"*40runs= [
dict(id=7, name="checks", started_at="2026-09-23T12:00:00Z", conclusion="success"),
dict(id=7, name="checks", started_at="2026-09-23T12:00:00.250Z", conclusion="failure"),
]
withpatch.object(github, "_paged", side_effect=[runs, []]):
print(github._check_signals("example/repo", head)[0])
# Actual: {"checks": "success"}. The newer row in this replay is the failure.check= {"check_suite": {"id": 2}, "completed_at": "2026-09-23T12:00:00Z"}
rerun=dict(id=7, check_suite_id=2, head_sha=head, workflow_id=1, status="in_progress",
run_attempt=2, run_started_at="2026-09-23T12:00:00.250Z")
print(github._has_active_replacement("example/repo", check, [rerun], head))
# Actual: False. The retry started 250 ms after the failed check completed.
The first result can let the required check pass readiness even though the newer row failed. The replay establishes the behavior if conflicting rows reach the selector. It does not establish how often GitHub delivers such rows. The second result can stop a readiness wait early even though a replacement is active. The replacement branch also orders workflow creation timestamps as strings.
Review the readiness policy in docs/ARCHITECTURE.md before changing which verdict wins. The change needs an explicit decision and tests for same-ID or missing-ID rows, equivalent offsets, malformed timestamps, and the existing numeric-ID precedence. #1453 leaves these selection rules unchanged.
Activity