ci(prepare-images): respect disable-build-* PR labels#6029
Merged
Conversation
Plumb the disable-build-<platform> labels (already resolved into
build_enable_<platform> outputs in config.yml) through to the
prepare-images workflow so it skips image builds the PR has opted out of.
Mapping (label → skipped):
- disable-build-ubuntu-x64 → ubuntu22/x64, ubuntu24/x64
- disable-build-ubuntu-arm64 → ubuntu22/arm64, ubuntu24/arm64
- disable-build-emscripten → emscripten/arm64
- disable-build-linux-vcpkg → rockylinux8-vcpkg/{x64,arm64}
- disable-build-windows → vs2019, vs2022 vcpkg cache builds
Avoids burning runner time producing images no downstream build job
will consume.
First attempt referenced `matrix.*` from a job-level `if:` for the linux-image-build-upload job, which fails workflow validation: Unrecognized named-value: 'matrix'. The `matrix` context isn't available in job-level `if:` for reusable workflow inputs. Compute the include list in a tiny upstream job and feed it via `fromJSON()` instead.
Dynamic-include cells get auto-named from every key in the entry, so the previous shape produced linux-image-build-upload (ubuntu22, arm64, -arm64, ubuntu-24.04-arm) duplicating arm64 and leaking runner/image-suffix details. Drop image-suffix and os from the matrix entries and derive both from matrix.arch inline (runs-on + image env). Cell name is now just "(<distro>, <arch>)", matching the static-matrix baseline.
Grantim
approved these changes
May 3, 2026
MaxRayskiy
approved these changes
May 3, 2026
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.
Summary
The
prepare-imagesworkflow rebuilt every Docker image whenever the relevant Dockerfile / requirements /vcpkg/**paths changed, ignoring anydisable-build-<platform>PR labels. So a PR that legitimately disabled a platform still paid for that platform's image build (the slowest of which — the Windows vcpkg cache — is a 4-hour budget job).This PR plumbs the existing
build_enable_<platform>config outputs through toprepare-imagesand skips the matching cells / jobs. Live-label semantics from #6008 are inherited transparently —build_enable_*is already derived fromgh pr view-fetched labels at job time, so adding/removing adisable-build-*label and re-running CI takes effect on the next run.Label → skipped image build:
disable-build-ubuntu-x64ubuntu22/x64,ubuntu24/x64disable-build-ubuntu-arm64ubuntu22/arm64,ubuntu24/arm64disable-build-emscriptenemscripten/arm64disable-build-linux-vcpkgrockylinux8-vcpkg/{x64,arm64}disable-build-windowsImplementation:
prepare-images.yml— five new booleanworkflow_callinputs (disable_ubuntu_x64,disable_ubuntu_arm64,disable_emscripten,disable_linux_vcpkg,disable_windows), all defaulting tofalsesoworkflow_dispatchkeeps building everything.linux-vcpkg-build-upload,windows-vcpkg-build-upload) just AND!inputs.disable_<platform>into the existing rebuild-neededif:.linux-image-build-uploadjob needs per-cell skipping (dropubuntu*/x64cells while keepingubuntu*/arm64andemscripten/arm64).matrixcontext isn't available in job-levelif:for reusable workflow inputs, so a small upstreamcompute-linux-image-matrixjob emits ajq-filtered include list and the build job consumes it viamatrix.include: ${{ fromJSON(...) }}. Matrix entries carry only{distro, arch}so the auto-generated cell name stays(<distro>, <arch>);runs-onand the image suffix are derived frommatrix.archinline.build-test-distribute.yml— wires the existingneeds.config.outputs.build_enable_<platform>flags (negated, soenable=false→disable=true) into the new inputs. No new config outputs needed sincebuild_enable_*already collapsestag-disable-<platform>andtag-update-doc-only.Skipped matrix cells / jobs show as "Skipped" in the UI, and the called workflow remains a
success()for downstreamneeds:consumers (the existingalways-successjob guarantees at least one cell).Test plan
Verified end-to-end in sandbox PR #6030 (closed; HEAD preserved as tag
wip/sandbox-test-disable-labels-pr-6030), which toucheddocker/ubuntu22Dockerfile+thirdparty/vcpkg/triplets/x64-linux-meshlib.cmaketo force all threeneed_*_rebuild=true, with labelsdisable-build-{ubuntu-x64,windows,linux-vcpkg,macos}applied. Run 25277872552:disable-build-windowsskipswindows-vcpkg-build-upload(anddisable-build-linux-vcpkgskipslinux-vcpkg-build-upload) even when theirneed_*_rebuildistrue— both observedskipped.disable-build-ubuntu-x64dropsubuntu*/x64cells while keepingubuntu*/arm64andemscripten/arm64—compute-linux-image-matrixemitted exactly 3 cells ((ubuntu22, arm64),(ubuntu24, arm64),(emscripten, arm64)), no*/x64cells spawned.(emscripten, arm64)built green; the two ubuntu arm64 cells failed inside the Dockerfile on a transient Launchpad PPA timeout (add-apt-repository→api.launchpad.net), unrelated to this PR.disable-build-*labels behaves identically to today — verified by inspection: alldisable_*default tofalse, thejqfilter then keeps all 5 cells, and the two single-platform jobs reduce to the master-baselineif:expression.workflow_dispatchkeeps building everything — verified by inspection: every new input hasdefault: false; no preexistingneed_*_rebuildsemantics change.