Skip to content
18 changes: 17 additions & 1 deletion .github/workflows/delta_spark_ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,24 @@ env:
DELTA_NUM_SHARDS: '8'

# Cancel older `pull_request` and `/delta-test` runs for the same PR.
#
# `issue_comment` fires on every comment posted on an issue or a PR, and
# `github.event.issue.number` is that issue's number, which for a comment on a
# PR is the PR's own number. Such a run would therefore join the PR's group and
# cancel an in-flight suite while `delta-test-requested` below skips it, losing
# the suite and replacing it with nothing. Give only that case a group of its
# own, so every other trigger keeps the exact group name it has today. The
# negated condition is that job's `if` verbatim.
Comment on lines 151 to +159
concurrency:
group: ${{ github.repository }}-${{ github.event.pull_request.number || github.event.issue.number || github.head_ref || github.sha }}-${{ github.workflow }}
group: >-
${{ github.repository }}-${{ github.event.pull_request.number || github.event.issue.number || github.head_ref || github.sha }}-${{ github.workflow }}${{
!(github.event_name != 'issue_comment' ||
(github.event.issue.pull_request &&
(github.event.comment.body == '/delta-test' ||
startsWith(github.event.comment.body, '/delta-test ') ||
startsWith(github.event.comment.body, format('/delta-test{0}', fromJSON('"\r"'))) ||
startsWith(github.event.comment.body, format('/delta-test{0}', fromJSON('"\n"'))))))
&& format('-comment-{0}', github.run_id) || '' }}
cancel-in-progress: true

jobs:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/velox_backend_ansi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,20 @@ env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
SPARK_ANSI_SQL_MODE: true

# `issue_comment` fires on every comment posted on an issue or a PR, and
# `github.event.issue.number` puts such a run in the same group as an in-flight
# ANSI run for that PR, so `cancel-in-progress` kills it while `check-comment`
# below skips the newcomer, leaving no replacement. Give only that case a group
# of its own, so every other trigger keeps the exact group name it has today.
# The negated condition is that job's `if` verbatim.
concurrency:
group: ${{ github.repository }}-ansi-${{ github.event.issue.number || inputs.pr_number }}
group: >-
${{ github.repository }}-ansi-${{ github.event.issue.number || inputs.pr_number }}${{
!((github.event_name == 'workflow_dispatch') ||
(github.event.issue.pull_request &&
(contains(github.event.comment.body, '/ansi-test') ||
contains(github.event.comment.body, '/ansi-analyze'))))
&& format('-comment-{0}', github.run_id) || '' }}
cancel-in-progress: true

jobs:
Expand Down
Loading