Skip to content
Closed
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
17 changes: 4 additions & 13 deletions .github/workflows/trigger-coverage-fanout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,10 @@
# ------------------------------------------------------------------
# This dispatch is fire-and-forget: no check is posted and there is no
# `if: failure()` fallback, so a cancellation silently drops the coverage
# fan-out. trigger-integration-tests.yml carries a workflow-level
# concurrency group keyed on PR number with `cancel-in-progress: true`.
# Workflow-level and job-level concurrency operate independently: a
# job-level group CANNOT exempt a job from a workflow-run-level
# cancellation. So while this job lived in that workflow, a stray
# post-merge `pull_request` event on the same PR number — e.g. a bot
# label action landing during the token-mint + dispatch window (`labeled`
# is in that workflow's trigger `types`) — would start a new run in the
# shared PR-number group and cancel the entire prior run, including this
# dispatch. Isolating it in its own workflow file removes it from that
# shared group entirely; its own concurrency group below (keyed on the
# merge commit, `cancel-in-progress: false`) then lets the dispatch always
# run to completion.
# fan-out. In its own workflow, no other PR event (e.g. a bot label
# landing during the token-mint + dispatch window) can cancel it, and its
# concurrency group below (keyed on the merge commit,
# `cancel-in-progress: false`) lets the dispatch always run to completion.
#
# ------------------------------------------------------------------
# Fork-merge assumption (why the fire-and-forget dispatch is safe here)
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/trigger-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,21 @@ on:
types: [opened, synchronize, reopened, labeled]
merge_group:

# Concurrency model:
# Concurrency model (job-level only):
# - No workflow-level group. Every run joins a workflow-level group, even
# one whose jobs are all skipped, so a no-op `labeled` run (e.g. a bot
# adding `ai-assisted` right after the PR opens) cancelled the `opened`
# run's auto-pass and left the required check unposted. Skipped jobs
# never join a job-level group.
Comment thread
vuanhphung marked this conversation as resolved.
Resolved
# - Dispatch-side jobs (`skip-integration-tests-pr`,
# `trigger-tests-pr`, `merge-queue-kernel`) coalesce per PR / merge
# group / branch so push-spam and label cycles don't burn through
# the GitHub App rate limit. `cancel-in-progress: true` lets a
# newer push supersede a stale dispatch.
# group so push-spam and label cycles don't burn through the GitHub
# App rate limit. `cancel-in-progress: true` lets a newer push
Comment thread
vuanhphung marked this conversation as resolved.
Resolved
# supersede a stale dispatch.
# - The label-cleanup job (`remove-label-on-new-commit`) runs in its
# own group with `cancel-in-progress: false` — cancelling
# mid-flight could leave the label attached after a push, which
# would defeat the "re-review on each push" security contract.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha || github.ref }}
cancel-in-progress: true

jobs:
# =============================================================================
Expand All @@ -106,7 +108,7 @@ jobs:
name: Reset integration-test label on push
if: github.event_name == 'pull_request' && github.event.action == 'synchronize'
# Own concurrency group with `cancel-in-progress: false` — see the
# workflow-level comment above. The label-cleanup is a
# concurrency comment above. The label-cleanup is a
# security-critical action; it MUST run to completion on every
# push regardless of how quickly subsequent pushes arrive.
concurrency:
Expand Down Expand Up @@ -202,6 +204,9 @@ jobs:
github.event_name == 'pull_request' &&
github.event.action != 'labeled' &&
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
concurrency:
group: ${{ github.workflow }}-autopass-${{ github.event.pull_request.number }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — Splitting auto-pass and dispatch into separate groups (-autopass-<PR> and -dispatch-<PR>) drops a guarantee the old shared group gave you. Before, if a maintainer added integration-test while a synchronize/opened run's auto-pass was still queued, the labeled run cancelled it. That meant the auto-pass could never post after the real dispatch had started.

Now the two can run concurrently. Here's the failure case: the auto-pass job sits waiting for a protected runner after a push, a maintainer labels the PR, and the receiver posts its Kernel Integration Tests run (in_progress → failure). The delayed auto-pass then calls checks.create(conclusion: 'success') on the same head SHA as the same app. Because that run is newer, it can hide the real failure on the PR.

The merge queue still gates, so the impact is limited to the advisory PR-time signal. Still, the old behaviour was strictly safer. Two options:

  • Put both jobs in one PR-keyed group, e.g. ${{ github.workflow }}-pr-${{ github.event.pull_request.number }}. This still fixes the reported bug, because a skipped job never joins a job-level group and so can't cancel anything.
  • Or have the auto-pass step skip posting when a Kernel Integration Tests run from the receiver already exists for that SHA.

If the split is intentional, a sentence in the concurrency comment explaining why would help.

cancel-in-progress: true
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
Expand Down Expand Up @@ -298,6 +303,9 @@ jobs:
github.event.action == 'labeled' &&
contains(github.event.pull_request.labels.*.name, 'integration-test') &&
vars.INTEGRATION_TESTS_ENABLED == 'true'
concurrency:
group: ${{ github.workflow }}-dispatch-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
Expand Down Expand Up @@ -444,6 +452,9 @@ jobs:
merge-queue-kernel:
name: Dispatch integration tests (merge queue)
if: github.event_name == 'merge_group'
concurrency:
group: ${{ github.workflow }}-merge-queue-${{ github.event.merge_group.head_sha }}
cancel-in-progress: true
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
Expand Down
Loading