Unify PR build into a single workflow with a dispatcher#18295
Merged
Conversation
- Introduce reusable-pr-build.yml that owns all build orchestration (common, test-latest-deps, test-native, muzzle, markdown checks, and the required-status-check aggregator). - Convert build-pull-request.yml into a thin dispatcher: it listens to pull_request events (including 'labeled' for 'test native', 'test openj9', 'test windows') and calls reusable-pr-build.yml with the appropriate skip flags. - Delete rebuild-pull-request-on-label.yml; the dispatcher absorbs its role via the 'labeled' trigger and the shared concurrency group. Branch protection must be updated to require 'build / required-status-check' instead of 'required-status-check'.
trask
commented
Apr 25, 2026
Member
Author
There was a problem hiding this comment.
this file is essentially the old build-pull-request.yml file
diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/reusable-pr-build.yml
index 57e6027cd0..1a7ae02f52 100644
--- a/.github/workflows/build-pull-request.yml
+++ b/.github/workflows/reusable-pr-build.yml
@@ -1,21 +1,19 @@
-name: Build pull request
+name: Reusable PR build
+# Always invoked from build-pull-request.yml (the dispatcher).
+# All gating decisions are made by the dispatcher and passed in as inputs.
on:
- pull_request:
- types:
- - opened
- - synchronize
- - reopened
- # called from rebuild-pull-request-on-label.yml
workflow_call:
-
-concurrency:
- # fixed group name (not github.workflow) so that runs triggered by pull_request
- # and runs triggered via workflow_call from rebuild-pull-request-on-label.yml
- # share the group, otherwise the PR build would run twice in parallel whenever
- # a "test *" label is added
- group: build-pull-request-${{ github.event.pull_request.number }}
- cancel-in-progress: true
+ inputs:
+ skip-native-tests:
+ type: boolean
+ default: false
+ skip-openj9-tests:
+ type: boolean
+ default: false
+ skip-windows-smoke-tests:
+ type: boolean
+ default: false
permissions:
contents: read
@@ -24,9 +22,8 @@ jobs:
common:
uses: ./.github/workflows/build-common.yml
with:
- # it's rare for only the openj9 tests, openj9 smoke variants, or the windows smoke tests to break
- skip-openj9-tests: ${{ !contains(github.event.pull_request.labels.*.name, 'test openj9') }}
- skip-windows-smoke-tests: ${{ !contains(github.event.pull_request.labels.*.name, 'test windows') }}
+ skip-openj9-tests: ${{ inputs.skip-openj9-tests }}
+ skip-windows-smoke-tests: ${{ inputs.skip-windows-smoke-tests }}
cache-read-only: true
test-latest-deps:
@@ -37,7 +34,7 @@ jobs:
test-native:
uses: ./.github/workflows/reusable-native-tests.yml
with:
- skip-native-tests: ${{ !contains(github.event.pull_request.labels.*.name, 'test native') }}
+ skip-native-tests: ${{ inputs.skip-native-tests }}
muzzle:
uses: ./.github/workflows/reusable-muzzle.yml
@@ -61,7 +58,7 @@ jobs:
- muzzle
- markdown-lint-check
runs-on: ubuntu-latest
- if: always()
+ if: ${{ always() }}
steps:
- if: |
needs.common.result != 'success' ||
laurit
approved these changes
Apr 27, 2026
Member
Author
|
this requires updating the required status check on the branch protections: https://github.com/open-telemetry/admin/pull/627 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#18235 introduced a new issue where all the old jobs are left as canceled / failed on the PR which is super confusing.