Skip to content

Commit b03978e

Browse files
authored
ci: collapse status into finalize_pr, fix cancel hang (#3282)
`status` aggregated test results and built CI Summary; `finalize_pr` only re-checked status.result and exited 0/1, adding a second runner per PR with no extra signal. ASF branch protection (.asf.yaml) requires context `finalize_pr` as the sole required check on master. Rename `status` -> `finalize_pr` and drop `name: CI Status` so GitHub resolves the context from the job key. Delete the old pass-through. Job-level `if: always()` re-evaluates after cancel-in-progress fires, schedules itself, and waits indefinitely for a runner that never arrives, holding the concurrency lock and blocking the next PR push for tens of minutes. Replace with `!cancelled()` on all aggregator/release jobs (pre-merge finalize_pr, _common.yml summary, publish-docker, docker-manifests, publish, release final aggregator). Step-level `always()` untouched (no phantom-queue risk).
1 parent 29caa3d commit b03978e

3 files changed

Lines changed: 7 additions & 22 deletions

File tree

‎.github/workflows/_common.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ jobs:
280280
binary-artifacts,
281281
typos,
282282
]
283-
if: always()
283+
if: ${{ !cancelled() }}
284284
runs-on: ubuntu-latest
285285
steps:
286286
- name: Summary

‎.github/workflows/pre-merge.yml‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,10 @@ jobs:
191191
task: ${{ matrix.task }}
192192

193193
# Final status check
194-
status:
195-
name: CI Status
194+
finalize_pr:
196195
runs-on: ubuntu-latest
197196
needs: [common, detect, test-rust, test-python, test-node, test-go, test-java, test-csharp, test-cpp, test-bdd, test-examples, test-other]
198-
if: always()
197+
if: ${{ !cancelled() }}
199198
steps:
200199
- name: Get job execution times
201200
id: times
@@ -439,17 +438,3 @@ jobs:
439438
echo "" >> $GITHUB_STEP_SUMMARY
440439
echo "✅ **CI Passed** - All checks completed successfully!" >> $GITHUB_STEP_SUMMARY
441440
fi
442-
443-
finalize_pr:
444-
runs-on: ubuntu-latest
445-
needs:
446-
- status
447-
if: always()
448-
steps:
449-
- name: Everything is fine
450-
if: ${{ !(contains(needs.*.result, 'failure')) }}
451-
run: exit 0
452-
453-
- name: Some tests failed
454-
if: ${{ contains(needs.*.result, 'failure') }}
455-
run: exit 1

‎.github/workflows/publish.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ jobs:
733733
name: Docker ${{ matrix.name }} (${{ matrix.arch }})
734734
needs: [validate, plan, check-tags, build-python-wheels, publish-rust-crates]
735735
if: |
736-
always() &&
736+
!cancelled() &&
737737
needs.validate.outputs.has_targets == 'true' &&
738738
needs.plan.outputs.has_docker == 'true' &&
739739
fromJson(needs.plan.outputs.docker_matrix).include[0].key != 'noop' &&
@@ -837,7 +837,7 @@ jobs:
837837
name: Docker manifests
838838
needs: [validate, plan, publish-docker]
839839
if: |
840-
always() &&
840+
!cancelled() &&
841841
needs.validate.outputs.has_targets == 'true' &&
842842
needs.plan.outputs.has_docker == 'true' &&
843843
fromJson(needs.plan.outputs.docker_components).include[0].key != 'noop' &&
@@ -1040,7 +1040,7 @@ jobs:
10401040
name: ${{ matrix.name }}
10411041
needs: [validate, plan, check-tags, build-python-wheels, publish-rust-crates]
10421042
if: |
1043-
always() &&
1043+
!cancelled() &&
10441044
needs.validate.outputs.has_targets == 'true' &&
10451045
fromJson(needs.plan.outputs.non_docker_targets).include[0].key != 'noop' &&
10461046
(needs.build-python-wheels.result == 'success' || needs.build-python-wheels.result == 'skipped') &&
@@ -1350,7 +1350,7 @@ jobs:
13501350
docker-manifests,
13511351
publish,
13521352
]
1353-
if: always() && needs.validate.outputs.has_targets == 'true'
1353+
if: ${{ !cancelled() && needs.validate.outputs.has_targets == 'true' }}
13541354
runs-on: ubuntu-latest
13551355
steps:
13561356
- name: Download latest copy script from master

0 commit comments

Comments
 (0)