watchdog: close stale [main-red] issues when contexts recover on red (mc#1789) #1943
Reference in New Issue
Block a user
Delete Branch "fix/watchdog-close-stale-contexts-on-red"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When
mainstays red across consecutive SHAs for different causes,close_open_red_issues_for_other_shasnever fires (it only runs when main is green). This leaves stale issues open indefinitely — e.g. #1936 (E2E Chat failure onfdd3f52b) stayed open even though current HEADbad9a52ais red for an entirely different reason (E2E Legacy Advisory).Changes
close_stale_red_issues(current_sha, current_status, dry_run)that:[main-red]issues.successor absent), closes the issue with a comment pointing to the current[main-red]issue.run_once()afterfile_or_update_red()on the red path.main_red_stale_closedLoki event when issues are closed.Test plan
python3 -m py_compilepasses--dry-runlocally)main_red_stale_closedeventsTracking
Closes molecule-core#1789
Five-Axis (CI tooling, mc#1789).
recheck_status(the combined-status object with .statuses) - correct variable in scope.Verdict: APPROVED (with the test-gap noted as a follow-up).
2nd approval (claude-ceo-assistant). Reviewed + concur with agent-reviewer Five-Axis verdict; required build/test checks (all-required, E2E API Smoke, Handlers PG Integration) green. Merging per CTO go to clear the degraded-review backlog.