ci: add safe stale run janitor - #13143
Conversation
|
Warning Review limit reachedNext included review available in 14 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
|
|
Fixed a cleanup eligibility gap in 880fc84. Commit-to-PR association alone also matches main pushes and scheduled runs after a merge. Cleanup now accepts only ordinary pull_request events in queued/in_progress state, preserves missing/unknown PR state, and refreshes run/PR facts immediately before each action so completed runs and reopened PRs are skipped. Scheduled operation remains report-only. Regression commit: 345619f. The original classifier failed seven regression subcases locally; the fixed version passes all nine tests, including mocked cleanup requests and preservation on changed state. The suite is now wired into the existing CI workflow. git diff --check passes. Fresh hosted checks are pending; no cleanup workflow was dispatched. |
e77a6b1 feat: add current-work reads and Find Work (manaflow-ai#13269) 6386ba5 Cache Ghostty CLI helper builds across local invocations (manaflow-ai#13206) 8f6c0ea ci: measure compiled test artifact transfer cost (manaflow-ai#13172) 55092b9 docs: add a concise guide for public CMUX writing (manaflow-ai#13257) 9e7d3be fix(web): preserve locale preference during prefetch (manaflow-ai#13255) b093335 build: skip unchanged diff sidecar builds (manaflow-ai#13212) b79d77d perf: skip unchanged bundled resource builds (manaflow-ai#13209) 4c19fcb feat: expose stable surface and workspace IDs in catalog reads (manaflow-ai#13247) 95fdfd7 ci: add safe stale run janitor (manaflow-ai#13143) 0bcf003 docs: make the contributor verification ladder explicit (manaflow-ai#13242)
Problem
Queued and in-progress Actions runs can remain after their pull request is merged or closed. They consume queue capacity and make the live backlog hard to distinguish from useful work.
Change
workflow_dispatchcleanup mode, capped at 25 actions. Queued runs are deleted; in-progress runs are cancelled.actions: writepermission.Scheduled runs are always dry runs, so rollout starts with an auditable inventory. Manual cleanup is opt-in and bounded.
Validation
python3 -m unittest -v tests/test_cleanup_stale_runs.pypython3 -m py_compile scripts/ci/cleanup-stale-runs.py./tests/test_ci_self_hosted_guard.shgit diff --checkRelated: #13117, #13128
Summary by cubic
Adds a scheduled janitor that reports queued and in-progress Actions runs stranded by closed or merged pull requests, so stale runs stop hiding useful work in the backlog (addresses #13117, #13128). Scheduled runs are always dry runs, so rollout starts with an auditable inventory.
workflow_dispatchwithcleanup=truedeletes queued runs and cancels in-progress ones, capped at 25 actions.pull_requestruns older than 24 hours whose pull requests are all closed or merged are eligible; runs with no PR, any open PR, or non-PR events are preserved.actions: writescoped to this workflow only.max_actionsabove 25.Written for commit 880fc84. Summary will update on new commits.