Repository navigation
ci: skip product checks in the other workflows for infra-only pull requests - #823
Merged
Merged
Conversation
…quests Add the reusable change-scope job to the security, quality report, compatibility, pipeline e2e, perf A/B and visual workflows, and gate their product jobs on its output. A pull request that changes only infra paths now skips Security / runtime, report, loki-pinned, vl-pinned, drilldown-pinned-runtime, drilldown-grafana-pr-matrix, e2e-pipeline, perf-smoke and visual-smoke. A skipped job reports success, so the required checks still pass. The gate is "!cancelled() && needs.scope.outputs.product != 'false'", combined with each job's existing condition. If the scope job fails its output is empty, so the product jobs run. Pushes to main, scheduled runs and manual dispatches are unchanged: the classifier reports product for every event that is not a pull request. Security / static, the matrix-source jobs, the scheduled matrices and the visual publish and comment jobs keep their current conditions; the last two already skip when visual-smoke is skipped. visual-smoke combines the gate with its label condition, and the scope job carries the same condition so a label that does not re-run the check does not start a scope run either. PR Quality Report moves pull-requests: write from the workflow to the report job, which is the only job that needs it.
This was referenced Oct 22, 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
Pull requests that change only infra paths (workflows, scripts, Dependabot, test-stack compose files, docs and the other paths the classifier in #820 treats as infra) do not touch the proxy, but they still run the full product layer in the security, quality report, compatibility, pipeline e2e, perf A/B and visual workflows. This PR gates the product jobs of those workflows on the
productoutput of the reusablechange-scopeworkflow, so an infra-only pull request skips them. A skipped job reports success, so the required checks still pass.Pushes to
main, scheduled runs and manual dispatches are unchanged: the classifier reportsproduct=truefor every event that is not a pull request, for theci-fulllabel and for any error.This builds on #820 (merged), which added
change-scope.yamland the classifier.ci.yamlis gated in a separate pull request.Changes per workflow
Every changed workflow gets a
scopejob (uses: ./.github/workflows/change-scope.yaml, permissionscontents: readandpull-requests: read). The product jobs getscopeinneedsandif: ${{ !cancelled() && needs.scope.outputs.product != 'false' }}, combined with whatever they already had.!cancelled()replaces the implicitsuccess(). If the scope job fails, its output is empty and!= 'false'holds, so the product jobs run: only a scope job that succeeds and reportsfalseskips anything.security-pr.yaml:Security / runtimeneeds[security-static, scope],if: !cancelled() && needs.security-static.result == 'success' && needs.scope.outputs.product != 'false'.Security / staticis unchanged.pr-quality-report.yaml:reportis gated.pull-requests: writemoves from the workflow to thereportjob, the only job that needs it.compat-loki.yaml,compat-vl.yaml,compat-drilldown.yaml:loki-pinned,vl-pinned,drilldown-pinned-runtimeanddrilldown-grafana-pr-matrixgetif: !cancelled() && github.event_name != 'schedule' && needs.<x>-matrix-source.result == 'success' && needs.scope.outputs.product != 'false'andneeds: [<x>-matrix-source, scope]. The matrix-source jobs and the scheduled and dispatch matrices are unchanged.e2e-pipeline.yml:e2e-pipelineis gated.perf-ab.yaml:perf-smokeis gated; its own shape selection is unchanged.visual-smoke.yaml:visual-smokecombines the gate with its existing label condition. Thescopejob carries the same label condition, so a label other thanvisual-change-expecteddoes not start a scope run.visual-publishandvisual-commentalready skip whenvisual-smokeis skipped (needs.visual-smoke.result != 'skipped'), so they are unchanged.The
uses: ./...lines carry an inlinezizmor: ignore[self-repository]comment. zizmor 1.30 prefers the new$/...form, but actionlint (1.7.7 as pinned, and 1.7.12) rejects it as a reusable workflow reference and the workflow pin test only accepts./.Per-job behaviour
Infra PR means the scope job succeeded with
product=false. "Scope failed" and every non-pull-request event run the job as before.product=trueA job skipped by
if:concludes as skipped, which branch protection treats as passing for a required check; that is howreport,Security / runtime,loki-pinned,vl-pinnedanddrilldown-pinned-runtimestay green on an infra PR. A product PR with a failing job still fails it, and an error in the scope job fails safe to running everything.Known limits:
report,perf-smokeandvisual-smokerun only onpull_request, so no later push or schedule exercises them; an infra PR that edits only those workflow files is not tested by them until the next product PR or until theci-fulllabel is applied.Known leftover: on a pull request that first changed product code and later became infra-only, the sticky perf, visual and quality comments from the earlier commits stay as they were; they are not removed by the skip.
Proofs
--offline --no-progress --format plain .github/workflows): exit 0, no findings. Before this change the same command also exits 0.python3 -m unittest scripts.ci.tests.test_workflow_pins scripts.ci.tests.test_tool_pins: 10 tests pass. All 120 tests underscripts/ci/testspass as well, andbench.ab.tests.test_selectionpasses.change-scopecontract:productisfalseonly for an unlabelled pull request whose changed paths are all infra, andtruefor every other event, forci-fulland for any error.Not applicable: infra-only PR; product checks (e2e vs Loki, Grafana range matrix, visual, A/B, benchstat, load) do not apply.