Skip uninvolved CI jobs on cross-stack publish pushes#4548
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/289ef771-49e0-4434-9031-ab70cfee9088 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize CI workflows to reduce publish wait times
Skip uninvolved CI jobs on cross-stack publish pushes
May 15, 2026
Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/8eaaf2ae-c138-4ab2-9c94-6adc094dfff4 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
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.
actions.yml,bazel.yml,docker.yml,py.yml,rust.yml)Original prompt
Problem
On
pushtomain, when one of the publishable stacks goes non-dev (i.e. itsVERSION.txtis bumped to a non-dev version),_publish.ymlis triggered viaworkflow_runafter each of the five CI workflows (Bazel CI,Docker CI,Github/actions CI,Python CI,Rust CI) completes, and waits on all five to complete before publishing (see_publish.yml#L131-L138).This means a publish of e.g.
actionsends up waiting for full Bazel/Docker/Python/Rust CI runs that have nothing to do with the publish, making publishes very slow.Goal
When stack X is publishing (its VERSION bumped to non-dev) and stack Y is not, Y's CI should internally skip its heavy jobs so its workflow run completes quickly. The waiting structure in
_publish.ymlstays unchanged — we just make the "uninvolved" CI runs finish in ~30s (only therequestjob runs).This must be done purely via an additional step in each CI yaml file — do NOT modify the
actions/github/should-runcomposite action.Rule
On
pushevents only:On
pull_requestevents the new step must be a no-op — PR CI continues to behave exactly as today.Stack ↔ VERSION file ownership
actions.ymlactions/VERSION.txtbazel.ymlbazel/VERSION.txt,BINS_VERSION.txtdocker.ymldocker/build/VERSION.txtpy.ymlpy/VERSION.txtrust.ymlBINS_VERSION.txt"Others" for a given workflow = the union of all the above minus that workflow's self set.
Note:
BINS_VERSION.txtis "self" for bothbazel.ymlandrust.ymlbecause_publish.ymllists bothBazel CIandRust CIunder bins'artifact-workflows(_publish.yml#L160-L168).Implementation
For each of the 5 workflow files (
actions.yml,bazel.yml,docker.yml,py.yml,rust.yml):In the
requestjob, after the existingshould-runstep (which already doesactions/checkout@... fetch-depth: 0, seeshould-run/action.yml#L42-L45), add a new stepid: publishingthat runs only whengithub.event_name == 'push'. It usesgit diff --name-only HEAD^1 HEAD(matching whatshould-runitself does on push, seeshould-run/action.yml#L52-L57) to classify changed files intoself_changedandothers_changedvia acasestatement, then setsskip=trueto$GITHUB_OUTPUTonly ifothers_changed == true && self_changed == false. Otherwiseskip=false.Expose
skip-publishing: ${{ steps.publishing.outputs.skip }}in therequestjob'soutputs:.Add
&& needs.request.outputs.skip-publishing != 'true'to theif:expression of every heavy job in that workflow (i.e. every job that currently gates onfromJSON(needs.request.outputs.run)). Do NOT add it to thestatusjob (which is alreadypull_request-only) and do NOT add it to therequestjob itself.Snippet template (adapt the
casearms per workflow)Per-workflow
casearmsactions.ymlHeavy jobs to gate:
actions.bazel.ymlHeavy jobs to gate:
test,build,test-gcc,test-macos.docker.yml