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
2 changes: 1 addition & 1 deletion .github/workflows/pr-review-fix-scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ on:

concurrency:
group: central-pr-review-fix-scheduler-${{ inputs.target_repository || vars.PR_REVIEW_FIX_TARGET_REPOSITORY || github.repository }}
cancel-in-progress: false
cancel-in-progress: true

jobs:
dispatch-review-fixes:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/pr-review-merge-scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,14 @@ concurrency:

jobs:
scan-pr-queue:
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion != 'cancelled'
# workflow_dispatch review runs do not reliably carry pull_requests metadata.
# Without this guard, one completed central review can wake a repo-wide scan.
if: >-
github.event_name != 'workflow_run' ||
(
github.event.workflow_run.conclusion != 'cancelled' &&
github.event.workflow_run.pull_requests[0].number
)
runs-on: ubuntu-latest
permissions:
actions: write
Expand Down
13 changes: 13 additions & 0 deletions tests/test_required_workflow_queue_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,16 @@ def test_cancelled_review_workflow_runs_do_not_spawn_more_queue_work() -> None:
workflow = workflow_text(filename)

assert "github.event.workflow_run.conclusion != 'cancelled'" in workflow


def test_unassociated_review_workflow_runs_do_not_scan_the_whole_pr_queue() -> None:
workflow = workflow_text("pr-review-merge-scheduler.yml")

assert "github.event.workflow_run.pull_requests[0].number" in workflow


def test_fix_scheduler_cancels_superseded_cron_runs() -> None:
workflow = workflow_text("pr-review-fix-scheduler.yml")

assert "central-pr-review-fix-scheduler-" in workflow
assert "cancel-in-progress: true" in workflow
Loading