From 9b4f62b64f8132beba168c0153eeacf27a63c459 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 11 Jul 2026 11:30:13 +0000 Subject: [PATCH] fix(scheduler): pass --project-flow in the org-queue-sweep loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first live org-queue-sweep run (dispatched after #451 merged) failed every repository with '--project-flow is required': pr_review_merge_scheduler.py requires --project-flow, and the sweep loop — unlike the single-repository scan-pr-queue job — never derived or passed it. Derive project_flow per target the same way the single-repository job does (main/master -> github-flow, develop -> git-flow, else github-flow) and pass --project-flow. Add a contract-test assertion so the sweep can never regress to the missing-flag state. The credential path and per-repo iteration already worked in that run; the HTTP 403 lines were the non-fatal stale-queue cancel fallback, not this failure. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_018Fxd76REwJfmQcXCJjLi6Z --- .github/workflows/pr-review-merge-scheduler.yml | 11 +++++++++++ tests/test_required_workflow_queue_contract.py | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/pr-review-merge-scheduler.yml b/.github/workflows/pr-review-merge-scheduler.yml index b2582fa0..a61a9c7e 100644 --- a/.github/workflows/pr-review-merge-scheduler.yml +++ b/.github/workflows/pr-review-merge-scheduler.yml @@ -609,9 +609,20 @@ jobs: continue fi + # The scheduler requires --project-flow. Derive it per target the + # same way the single-repository job does: main/master default + # branches are GitHub Flow, develop is Git Flow, anything else + # defaults to GitHub Flow. + case "$default_branch" in + main|master) project_flow="github-flow" ;; + develop) project_flow="git-flow" ;; + *) project_flow="github-flow" ;; + esac + args=( --repo "$repo_full_name" --base-branch "$default_branch" + --project-flow "$project_flow" --max-prs "$ORG_SWEEP_MAX_PRS" --review-workflow "Required OpenCode Review" --review-dispatch-limit "$ORG_SWEEP_REVIEW_DISPATCH_LIMIT" diff --git a/tests/test_required_workflow_queue_contract.py b/tests/test_required_workflow_queue_contract.py index b23f126b..52ee3b4c 100644 --- a/tests/test_required_workflow_queue_contract.py +++ b/tests/test_required_workflow_queue_contract.py @@ -260,6 +260,12 @@ def test_org_queue_sweep_covers_target_repositories_on_a_heartbeat() -> None: # Queue hygiene: stale queued runs are cancelled with a logged identity. assert "ORG_SWEEP_STALE_QUEUE_HOURS" in workflow assert "/actions/runs?status=queued&per_page=100" in workflow + # The scheduler requires --project-flow; the sweep must derive and pass it + # per target repository (regression: the first sweep failed every repo with + # "--project-flow is required"). + assert "--project-flow" in workflow + assert 'main|master) project_flow="github-flow"' in workflow + assert 'develop) project_flow="git-flow"' in workflow def test_fix_scheduler_cancels_superseded_cron_runs() -> None: