Skip to content

Commit 1e0c66d

Browse files
authored
GH-50133: [CI] Make extra labels entirely manual on PRs (#50256)
### Rationale for this change Our "Extra" labels for CI are currently both manual and automatic: * manual, such that a committer can add a label to force an additional of CI jobs to run on a PR * automatic, such that specific file changes can also force those additional CI jobs to run However, the two mechanisms can conflict with each other, when an Extra label is manually added by a committer, but none of the file changes match. The label can then be later removed by the automatic labelling bot. ### What changes are included in this PR? Make the "Extra" labels manual-only. The corresponding CI workflows are still triggered automatically on non-PR events (such as pushes and cron schedules). ### Are these changes tested? Manually on this PR. ### Are there any user-facing changes? No. * GitHub Issue: #50133 Authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 1a579c7 commit 1e0c66d

6 files changed

Lines changed: 92 additions & 131 deletions

File tree

.github/workflows/check_labels.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ on:
2828
ci-extra-labels:
2929
description: "The extra CI labels"
3030
value: ${{ jobs.check-labels.outputs.ci-extra-labels }}
31-
force:
32-
description: "Whether to force running the jobs"
33-
value: ${{ jobs.check-labels.outputs.force }}
3431

3532
permissions:
3633
contents: read
@@ -43,7 +40,6 @@ jobs:
4340
timeout-minutes: 5
4441
outputs:
4542
ci-extra-labels: ${{ steps.check.outputs.ci-extra-labels }}
46-
force: ${{ steps.check.outputs.force }}
4743
steps:
4844
- name: Checkout Arrow
4945
if: github.event_name == 'pull_request'
@@ -58,9 +54,7 @@ jobs:
5854
run: |
5955
set -ex
6056
case "${GITHUB_EVENT_NAME}" in
61-
push|schedule|workflow_dispatch)
62-
echo "force=true" >> "${GITHUB_OUTPUT}"
63-
;;
57+
# On PRs, extra builds are only triggered manually using labelling
6458
pull_request)
6559
{
6660
echo "ci-extra-labels<<LABELS"
@@ -70,13 +64,6 @@ jobs:
7064
--repo ${GITHUB_REPOSITORY}
7165
echo "LABELS"
7266
} >> "${GITHUB_OUTPUT}"
73-
git fetch origin ${GITHUB_BASE_REF}
74-
git diff --stat origin/${GITHUB_BASE_REF}..
75-
if git diff --stat origin/${GITHUB_BASE_REF}.. | \
76-
grep \
77-
--fixed-strings ".github/workflows/${PARENT_WORKFLOW}.yml" \
78-
--quiet; then
79-
echo "force=true" >> "${GITHUB_OUTPUT}"
80-
fi
8167
;;
68+
# Other event types trigger through specific rules in `*_extra.yml`
8269
esac

.github/workflows/cpp_extra.yml

Lines changed: 30 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,7 @@ on:
4545
tags:
4646
- '**'
4747
pull_request:
48-
paths:
49-
- '.dockerignore'
50-
- '.github/workflows/check_labels.yml'
51-
- '.github/workflows/cpp_extra.yml'
52-
- '.github/workflows/cpp_windows.yml'
53-
- '.github/workflows/report_ci.yml'
54-
- 'ci/conda_env_*'
55-
- 'ci/docker/**'
56-
- 'ci/scripts/ccache_setup.sh'
57-
- 'ci/scripts/cpp_*'
58-
- 'ci/scripts/install_azurite.sh'
59-
- 'ci/scripts/install_gcs_testbench.sh'
60-
- 'ci/scripts/install_minio.sh'
61-
- 'ci/scripts/msys2_*'
62-
- 'ci/scripts/util_*'
63-
- 'cpp/**'
64-
- 'compose.yaml'
65-
- 'dev/archery/archery/**'
66-
- 'format/Flight.proto'
67-
- 'testing'
48+
# This trigger ensures that the `check_labels` workflow runs on manual label changes
6849
types:
6950
- labeled
7051
- opened
@@ -85,19 +66,30 @@ permissions:
8566

8667
jobs:
8768
check-labels:
88-
if: github.event_name != 'schedule' || github.repository == 'apache/arrow'
69+
if: github.event_name == 'pull_request'
8970
uses: ./.github/workflows/check_labels.yml
9071
with:
9172
parent-workflow: cpp_extra
9273

93-
docker:
74+
check-enabled:
75+
# Check whether the CI builds in this workflow need to be run
9476
needs: check-labels
77+
runs-on: ubuntu-latest
78+
outputs:
79+
is_enabled: ${{ steps.set_enabled.outputs.is_enabled }}
80+
steps:
81+
- id: set_enabled
82+
if: >-
83+
(github.event_name == 'schedule' && github.repository == 'apache/arrow') ||
84+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
85+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
86+
run: echo "is_enabled=true" >> "$GITHUB_OUTPUT"
87+
88+
docker:
89+
needs: check-enabled
90+
if: needs.check-enabled.outputs.is_enabled == 'true'
9591
name: ${{ matrix.title }}
9692
runs-on: ${{ matrix.runs-on }}
97-
if: >-
98-
needs.check-labels.outputs.force == 'true' ||
99-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
100-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
10193
timeout-minutes: 75
10294
strategy:
10395
fail-fast: false
@@ -189,11 +181,8 @@ jobs:
189181
run: archery docker push ${{ matrix.image }}
190182

191183
msvc-arm64:
192-
needs: check-labels
193-
if: >-
194-
needs.check-labels.outputs.force == 'true' ||
195-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
196-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
184+
needs: check-enabled
185+
if: needs.check-enabled.outputs.is_enabled == 'true'
197186
name: ARM64 Windows 11 MSVC
198187
uses: ./.github/workflows/cpp_windows.yml
199188
with:
@@ -202,13 +191,10 @@ jobs:
202191
simd-level: NONE
203192

204193
jni-linux:
205-
needs: check-labels
194+
needs: check-enabled
195+
if: needs.check-enabled.outputs.is_enabled == 'true'
206196
name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.arch }}
207197
runs-on: ${{ matrix.platform.runs-on }}
208-
if: >-
209-
needs.check-labels.outputs.force == 'true' ||
210-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
211-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
212198
timeout-minutes: 240
213199
permissions:
214200
actions: read
@@ -276,13 +262,10 @@ jobs:
276262
run: archery docker push cpp-jni
277263

278264
jni-macos:
279-
needs: check-labels
265+
needs: check-enabled
266+
if: needs.check-enabled.outputs.is_enabled == 'true'
280267
name: JNI macOS
281268
runs-on: macos-14
282-
if: >-
283-
needs.check-labels.outputs.force == 'true' ||
284-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
285-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
286269
timeout-minutes: 45
287270
env:
288271
MACOSX_DEPLOYMENT_TARGET: "14.0"
@@ -369,13 +352,10 @@ jobs:
369352
key: jni-macos
370353

371354
odbc-linux:
372-
needs: check-labels
355+
needs: check-enabled
356+
if: needs.check-enabled.outputs.is_enabled == 'true'
373357
name: ODBC Linux
374358
runs-on: ubuntu-latest
375-
if: >-
376-
needs.check-labels.outputs.force == 'true' ||
377-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
378-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
379359
timeout-minutes: 75
380360
strategy:
381361
fail-fast: false
@@ -437,13 +417,10 @@ jobs:
437417
run: archery docker push ubuntu-cpp-odbc
438418

439419
odbc-macos:
440-
needs: check-labels
420+
needs: check-enabled
421+
if: needs.check-enabled.outputs.is_enabled == 'true'
441422
name: ODBC ${{ matrix.build-type }} ${{ matrix.architecture }} macOS ${{ matrix.macos-version }}
442423
runs-on: macos-${{ matrix.macos-version }}
443-
if: >-
444-
needs.check-labels.outputs.force == 'true' ||
445-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
446-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
447424
timeout-minutes: 120
448425
strategy:
449426
fail-fast: false
@@ -569,13 +546,10 @@ jobs:
569546
ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
570547
571548
odbc-msvc:
572-
needs: check-labels
549+
needs: check-enabled
550+
if: needs.check-enabled.outputs.is_enabled == 'true'
573551
name: ODBC Windows
574552
runs-on: windows-2022
575-
if: >-
576-
needs.check-labels.outputs.force == 'true' ||
577-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
578-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: C++')
579553
timeout-minutes: 240
580554
permissions:
581555
actions: read

.github/workflows/cuda_extra.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,16 @@ name: CUDA Extra
1919

2020
on:
2121
push:
22+
branches:
23+
- '**'
24+
- '!dependabot/**'
25+
paths:
26+
- '**/*cuda*'
27+
- '**/*gpu*'
2228
tags:
2329
- '**'
2430
pull_request:
31+
# This trigger ensures that the `check_labels` workflow runs on manual label changes
2532
types:
2633
- labeled
2734
- opened
@@ -42,19 +49,30 @@ permissions:
4249

4350
jobs:
4451
check-labels:
45-
if: github.event_name != 'schedule' || github.repository == 'apache/arrow'
52+
if: github.event_name == 'pull_request'
4653
uses: ./.github/workflows/check_labels.yml
4754
with:
4855
parent-workflow: cuda_extra
4956

50-
docker:
57+
check-enabled:
58+
# Check whether the CI builds in this workflow need to be run
5159
needs: check-labels
60+
runs-on: ubuntu-latest
61+
outputs:
62+
is_enabled: ${{ steps.set_enabled.outputs.is_enabled }}
63+
steps:
64+
- id: set_enabled
65+
if: >-
66+
(github.event_name == 'schedule' && github.repository == 'apache/arrow') ||
67+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
68+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: CUDA')
69+
run: echo "is_enabled=true" >> "$GITHUB_OUTPUT"
70+
71+
docker:
72+
needs: check-enabled
73+
if: needs.check-enabled.outputs.is_enabled == 'true'
5274
name: ${{ matrix.title }}
5375
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.xlarge/image=ubuntu24-gpu-x64/spot=capacity-optimized"
54-
if: >-
55-
needs.check-labels.outputs.force == 'true' ||
56-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
57-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: CUDA')
5876
timeout-minutes: 75
5977
strategy:
6078
fail-fast: false

.github/workflows/dev_pr/labeler.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,3 @@
7373
- any-glob-to-any-file:
7474
- docs/**/*
7575
- "**/*.{md, rst, Rmd, Rd}"
76-
77-
"CI: Extra: C++":
78-
- changed-files:
79-
- any-glob-to-any-file:
80-
- .github/workflows/cpp_extra.yml
81-
- cpp/src/arrow/flight/sql/odbc/**/*
82-
83-
"CI: Extra: Package: Linux":
84-
- changed-files:
85-
- any-glob-to-any-file:
86-
- .github/workflows/package_linux.yml
87-
- dev/release/binary-task.rb
88-
- dev/release/verify-apt.sh
89-
- dev/release/verify-yum.sh
90-
- dev/tasks/linux-packages/**/*

.github/workflows/package_linux.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,7 @@ on:
3838
tags:
3939
- "apache-arrow-*-rc*"
4040
pull_request:
41-
paths:
42-
- '.github/workflows/check_labels.yml'
43-
- '.github/workflows/package_linux.yml'
44-
- '.github/workflows/report_ci.yml'
45-
- 'cpp/**'
46-
- 'c_glib/**'
47-
- 'dev/archery/archery/**'
48-
- 'dev/release/binary-task.rb'
49-
- 'dev/release/verify-apt.sh'
50-
- 'dev/release/verify-yum.sh'
51-
- 'dev/tasks/linux-packages/**'
52-
- 'format/Flight.proto'
41+
# This trigger ensures that the `check_labels` workflow runs on manual label changes
5342
types:
5443
- labeled
5544
- opened
@@ -69,24 +58,35 @@ permissions:
6958

7059
jobs:
7160
check-labels:
72-
if: github.event_name != 'schedule' || github.repository == 'apache/arrow'
61+
if: github.event_name == 'pull_request'
7362
uses: ./.github/workflows/check_labels.yml
7463
with:
7564
parent-workflow: package_linux
7665

66+
check-enabled:
67+
# Check whether the CI builds in this workflow need to be run
68+
needs: check-labels
69+
runs-on: ubuntu-latest
70+
outputs:
71+
is_enabled: ${{ steps.set_enabled.outputs.is_enabled }}
72+
steps:
73+
- id: set_enabled
74+
if: >-
75+
(github.event_name == 'schedule' && github.repository == 'apache/arrow') ||
76+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
77+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: Package: Linux')
78+
run: echo "is_enabled=true" >> "$GITHUB_OUTPUT"
79+
7780
package:
81+
needs: check-enabled
82+
if: needs.check-enabled.outputs.is_enabled == 'true'
7883
permissions:
7984
# Upload artifacts to GitHub Release
8085
contents: write
8186
# Upload cached Docker images to GitHub Packages
8287
packages: write
8388
name: ${{ matrix.id }}
8489
runs-on: ${{ contains(matrix.id, 'amd64') && 'ubuntu-latest' || 'ubuntu-24.04-arm' }}
85-
needs: check-labels
86-
if: >-
87-
needs.check-labels.outputs.force == 'true' ||
88-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
89-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: Package: Linux')
9090
timeout-minutes: 160
9191
strategy:
9292
fail-fast: false

.github/workflows/r_extra.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,7 @@ on:
4040
tags:
4141
- '**'
4242
pull_request:
43-
paths:
44-
- '.dockerignore'
45-
- '.github/workflows/check_labels.yml'
46-
- '.github/workflows/r_extra.yml'
47-
- '.github/workflows/report_ci.yml'
48-
- 'ci/docker/**'
49-
- 'ci/etc/rprofile'
50-
- 'ci/scripts/PKGBUILD'
51-
- 'ci/scripts/cpp_*.sh'
52-
- 'ci/scripts/install_minio.sh'
53-
- 'ci/scripts/r_*.sh'
54-
- 'cpp/**'
55-
- 'compose.yaml'
56-
- 'dev/archery/archery/**'
57-
- 'r/**'
43+
# This trigger ensures that the `check_labels` workflow runs on manual label changes
5844
types:
5945
- labeled
6046
- opened
@@ -75,19 +61,30 @@ permissions:
7561

7662
jobs:
7763
check-labels:
78-
if: github.event_name != 'schedule' || github.repository == 'apache/arrow'
64+
if: github.event_name == 'pull_request'
7965
uses: ./.github/workflows/check_labels.yml
8066
with:
8167
parent-workflow: r_extra
8268

83-
docker:
69+
check-enabled:
70+
# Check whether the CI builds in this workflow need to be run
8471
needs: check-labels
72+
runs-on: ubuntu-latest
73+
outputs:
74+
is_enabled: ${{ steps.set_enabled.outputs.is_enabled }}
75+
steps:
76+
- id: set_enabled
77+
if: >-
78+
(github.event_name == 'schedule' && github.repository == 'apache/arrow') ||
79+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
80+
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: R')
81+
run: echo "is_enabled=true" >> "$GITHUB_OUTPUT"
82+
83+
docker:
84+
needs: check-enabled
85+
if: needs.check-enabled.outputs.is_enabled == 'true'
8586
name: ${{ matrix.title }}
8687
runs-on: ${{ matrix.runs-on }}
87-
if: >-
88-
needs.check-labels.outputs.force == 'true' ||
89-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra') ||
90-
contains(fromJSON(needs.check-labels.outputs.ci-extra-labels || '[]'), 'CI: Extra: R')
9188
timeout-minutes: 75
9289
strategy:
9390
fail-fast: false

0 commit comments

Comments
 (0)