Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docs/doctoring/org-queue-sweep-rotation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Org-queue-sweep review-dispatch rotation

> **Superseded for queue hygiene.** The organization sweep no longer inventories
> or cancels repository-wide queued/in-progress Actions runs. That duplicate
> queue-hygiene path was removed by `.github#1878` (`1b65dbc35e7183722ad77894e2d80b39993be90d`),
> and current-head coalescing was later integrated into the merge scheduler.
> The rotation material below remains historical evidence for the former
> review-dispatch fairness mechanism, not a description of current stale-run
> ownership.

## Problem

`org-queue-sweep` in `pr-review-merge-scheduler.yml` walks every organization
Historically, `org-queue-sweep` in `pr-review-merge-scheduler.yml` walked every organization
repository once per 15-minute tick and consumes bounded, organization-wide
review-dispatch budgets across that entire walk. Default-base work uses
`ORG_SWEEP_REVIEW_DISPATCH_LIMIT` (default `1`); stacked work uses the separate
Expand All @@ -23,6 +31,15 @@ required review.

## Decision

The current ownership boundary is:

- `pr-review-merge-scheduler` owns review, merge, and branch-update state.
- The integrated current-head coalescer owns same-PR stale-run cleanup.
- The organization sweep does not repeat an Actions inventory per repository.

The rotation decision below is retained as historical operational evidence for
the former review-dispatch fairness implementation.

Rotate the sweep's repository walk order by a rotation index before applying
the unchanged organization-wide budgets. `rotation_offset = rotation_index %
repository_count`; the walk starts at that offset and wraps. This spreads each
Expand Down
17 changes: 17 additions & 0 deletions tests/test_org_queue_sweep_documentation_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Contract for the superseded organization queue-sweep runbook."""

from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]
RUNBOOK = ROOT / "docs" / "doctoring" / "org-queue-sweep-rotation.md"


def test_runbook_marks_removed_queue_hygiene_as_historical() -> None:
"""The runbook must not describe removed repository-wide inventory as current."""
source = RUNBOOK.read_text(encoding="utf-8")

assert "Superseded for queue hygiene" in source
assert "does not repeat an Actions inventory per repository" in source
assert "#1878" in source
assert "historical operational evidence" in source
Loading