watchdog: fix stale-issue closeout + pagination + status semantics (mc#1789) #1897
Reference in New Issue
Block a user
Delete Branch "fix/main-red-watchdog-stale-cleanup"
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?
Fixes molecule-core#1789.
Changes
list_open_red_issues()— backlog can exceed 50 open issues; old code only fetched page 1.SCHEDULED_CONTEXT_PATTERNS+_is_scheduled_context()— scheduled jobs (Staging SaaS smoke, Continuous synthetic E2E, main-red-watchdog, ci-arm64-advisory) should not block stale-issue closeout when required CI is green.run_once()close logic forcombined=pending+ required-green — close stale issues when no non-scheduled context is failed or still pending._entry_state()to module level and use it consistently — Gitea 1.22.6 per-entry key isstatus, notstate.Test plan
python3 -m pytest .gitea/scripts/tests/test_main_red_watchdog.py -v— 19/19 passpython3 -m compileall -q .gitea/scripts/main-red-watchdog.py— cleanRisk
Low — the script is idempotent by title and the new logic only affects the closeout path (issue close, not open).
LGTM — watchdog pagination, scheduled-context closeout, and status/state handling are covered by focused regressions; scope is contained to main-red-watchdog and tests.
Second approval — mc#1789 fix is well-scoped and tested.
PM 2nd-approve per direct CTO request.
LGTM