From db7448cd1eafeda028aa63219ebcb06095bd0507 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 01:03:48 +0100 Subject: [PATCH] perf: decouple scheduled review comment sync --- .github/workflows/sweep.yml | 31 ++++++++++++++++++++++++++++++- docs/scheduler.md | 6 ++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sweep.yml b/.github/workflows/sweep.yml index 4a866f6090..bd30f200f2 100644 --- a/.github/workflows/sweep.yml +++ b/.github/workflows/sweep.yml @@ -869,8 +869,37 @@ jobs: --path results/sweep-status \ --rebase-strategy theirs + - name: Dispatch scheduled review comment sync + if: ${{ success() && github.event_name == 'schedule' && needs.plan.outputs.hot_intake != 'true' }} + env: + GH_TOKEN: ${{ github.token }} + TARGET_REPO: ${{ needs.plan.outputs.target_repo }} + run: | + set -euo pipefail + item_numbers="$(pnpm run --silent workflow -- artifact-item-numbers --artifact-dir artifacts)" + if [ -z "$item_numbers" ]; then + echo "No review artifacts to sync comments for." + exit 0 + fi + for attempt in 1 2 3; do + if gh workflow run sweep.yml \ + --ref main \ + -f target_repo="$TARGET_REPO" \ + -f apply_existing=true \ + -f apply_sync_comments_only=true \ + -f apply_item_numbers="$item_numbers" \ + -f apply_limit=0 \ + -f apply_comment_sync_min_age_days=7 \ + -f apply_progress_every=25; then + echo "Dispatched scheduled comment sync for item numbers: $item_numbers" + exit 0 + fi + sleep "$((attempt * 10))" + done + echo "::warning::Unable to dispatch scheduled comment sync after three attempts; apply/comment-sync backstops can pick it up later." + - name: Sync selected review comments - if: ${{ success() && (needs.plan.outputs.hot_intake != 'true' || github.event.inputs.item_number != '' || github.event.inputs.item_numbers != '') }} + if: ${{ success() && (github.event_name != 'schedule' || needs.plan.outputs.hot_intake == 'true') && (needs.plan.outputs.hot_intake != 'true' || github.event.inputs.item_number != '' || github.event.inputs.item_numbers != '') }} timeout-minutes: 15 env: GH_TOKEN: ${{ steps.target-write-token.outputs.token }} diff --git a/docs/scheduler.md b/docs/scheduler.md index a88cf45a27..aa77e8680b 100644 --- a/docs/scheduler.md +++ b/docs/scheduler.md @@ -184,6 +184,12 @@ association, paired issue/PR state, snapshot drift, and repository profile rules. It closes only unchanged high-confidence proposals and otherwise updates or syncs the durable ClawSweeper review comment. +Scheduled normal review publishes records first, then dispatches durable review +comment sync into the separate apply/comment-sync lane. This keeps slow GitHub +comment writes from holding the normal review concurrency group and delaying the +next 100-shard backfill wave. Exact and manual targeted review runs still sync +their selected comments inline before finishing. + Long apply runs commit checkpoints and can dispatch continuation runs when they reach the configured close limit.