🤖 ci: gate CI jobs by changed paths#12
Conversation
|
@codex review Please review the CI path-filtering workflow changes. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9560070f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Add a changes-classifier job using dorny/paths-filter and gate lint/test/lint-actions by relevant file changes. Update publish-main to tolerate intentionally skipped dependencies while still requiring success when jobs do run. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.16`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.16 -->
e956007 to
aba488a
Compare
|
@codex review Addressed the workflow feedback:
Please take another look. |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Introduce path-aware CI orchestration so expensive Go jobs only run when Go-relevant files change.
Background
Docs-only pull requests were still triggering full Go lint/test/build workflows. This change preserves CI signal while reducing unnecessary job execution.
Implementation
changesjob using pinneddorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36.go,workflows, andpublishoutputs from that job.lintandtestonneeds.changes.outputs.go == 'true'.lint-actionsonneeds.changes.outputs.workflows == 'true'.publish-mainto depend onchangesand to allow upstreamsuccessorskippedoutcomes while still requiringpublish == 'true'.Validation
make verify-vendormake testmake buildgo run github.com/rhysd/actionlint/cmd/actionlint@v1.7.10Risks
Low. Scope is limited to workflow orchestration. Main risk is incorrect path classification causing a job to skip unexpectedly; mitigated by explicit filters and preserving required job dependency/result checks for publish.
📋 Implementation Plan
Plan: Option 2 — Per-job path filtering in CI
Context / Why
The current
.github/workflows/ci.yamlruns Go-heavy jobs (lint,test) for every pull request, including docs-only changes (for example, markdown edits under.mux/andAGENTS.md). The goal is to keep CI signal quality while avoiding unnecessary Go setup/lint/test/build work when no Go-relevant files changed.Evidence
.github/workflows/ci.yamlcurrently has nopaths/paths-ignorefilters at trigger or job level.lintandtestalways run onpull_requestandpushtomain.publish-maincurrently depends on[test, lint, lint-actions], so any job-level skipping logic must avoid accidentally blocking publish when dependencies are skipped by design.These sources are sufficient to plan the workflow-only change because the optimization is isolated to CI orchestration in
.github/workflows/ci.yaml.Implementation details
Add a
changesclassifier job in.github/workflows/ci.yamldorny/paths-filter(SHA-pinned).go(Go source/build/vendor/tooling inputs)workflows(.github/workflows/**)publish(files that should triggerpublish-main, usually superset ofgoplus container build files)Gate expensive jobs using
needs: changes+if:guardslintandtestshould run only whenneeds.changes.outputs.go == 'true'.lint-actionsshould run only whenneeds.changes.outputs.workflows == 'true'.codex-commentsbehavior unchanged (PR-only, cheap, policy-oriented).Update
publish-mainso intentionally skipped dependencies do not block itpush/maingating.needs: [changes, test, lint, lint-actions].if:expression withalways()and explicit dependency result checks (successorskipped) pluspublish == 'true'.Validate behavior with targeted scenarios
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.10locally after YAML edits.lint/testare skipped and required checks remain mergeable.lint/testexecute.mainwith docs-only diff does not publish image (publish == false), while code-related push still publishes.Why this structure (brief)
paths-ignore) preserves visibility of all jobs/check names while avoiding unnecessary work.changesjob centralizes path logic so future categories can be added in one place.success || skippedchecks avoid accidental publish blockage when upstream jobs are intentionally skipped.Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh• Cost:$0.16