Repository navigation
fix(ci): skip iOS/Android/JVM builds for docs-only PR diffs - #415
Conversation
PR #414 was a single-commit, non-draft, docs-only PR (one markdown file) that still ran the full iOS Simulator build, the iOS UI test job, and the Android Core Modules build in ios-app-build.yml, plus jvm-tests.yml's full suite — none of which could possibly be affected by a docs change. None of the workflows had any path filtering at all. The existing draft-PR skip (PR #368) doesn't cover this: it only gates intermediate pushes on a still-draft PR, and #414 was neither draft nor multi-commit. Adds a `changes` job (dorny/paths-filter) to both workflows that computes whether the diff touches iOS-relevant / Android-relevant paths, and gates the expensive jobs on it. Deliberately an allow-list of real source paths (ios/**, app/**, core/**, feature/**, gradle files, ...) rather than a deny-list of doc/asset paths, since an allow-list only needs the finite, stable set of source dirs and can't silently go stale the way "ignore everything that isn't code" can. Two things had to change to make a job-level path-filter skip safe here, both specific to how this repo's CI already handles the draft-PR skip: - ios-app-build.yml's `report-status` job posts a PR comment and has a "fail if either build failed" step that both treated any non- 'success' result — including 'skipped' — as a failure. That was fine while 'skipped' only ever meant "draft PR, report-status itself also skipped identically" (see that job's own comment). A path-filter skip is the first time a *required* build job can report 'skipped' while report-status still runs for real, so both now treat 'skipped' as passing, and the PR comment stays silent entirely when both builds skipped (docs-only PR) instead of posting a "PASSED" for work that never ran. - jvm-tests.yml's job has no such wrapper (it's the required check directly), so it only needed the `needs`/`if` gate. 'skipped' job results are trigger-level-safe here specifically because skip is applied via job-level `if` (not `on.paths-ignore`, which would leave a required check permanently "Expected" and block merge outright) — GitHub Actions reports a 'skipped' conclusion for a job-level-conditioned job that GitHub's branch protection accepts as satisfying a required status check. jvm-tests.yml's filter additionally includes scripts/** — that workflow directly runs scripts/coverage-summary.py and scripts/check-test-plan-modules.py, which ios-app-build.yml doesn't. Verified: YAML parses clean and actionlint reports no issues on both files. Not yet verified live (untested until the first real PR exercises the skip path) — see the PR description for what to watch for. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
This PR was opened outside the automated pipeline (author isn't |
There was a problem hiding this comment.
Principal review
Risk classification: risk:high confirmed correct and fresh — re-ran classify_pr_risk.py against the current single commit (7200f98) and it still returns risk:high (.github/workflows/ios-app-build.yml matches the .github/workflows/** sensitive-path glob). No commits landed after the label was applied, so it's not stale. This alone routes to human-merge regardless of the rest of this review, per .github/agent-policy.yml.
What I checked:
- Full diff of both workflow files, plus the surrounding unchanged context in each (not just the hunks).
actionlint v1.7.12on both files: no issues — confirms the PR description's claim.- Live CI on this PR itself:
Detect Changed Pathspassed on both workflows,Build Android AppandUnit & Integration Tests (JVM)passed (both filters correctly include the workflow files themselves, so this PR exercises the real-build path, not the skip path — consistent with the PR description's own "not yet verified live" caveat about the skip path). AGENTS.mdconventions — this PR is CI-config-only, no application code/tests to check against the unit-test-required rule; N/A here, correctly not included..github/agent-policy.ymlsensitive paths — only.github/workflows/**is touched, correctly reflected byrisk:high. No other sensitive path touched.- New dependency:
dorny/paths-filter@v3is a new third-party Action pulled into two required-check workflows. Pinned by version tag, consistent with this repo's existing convention for other third-party actions (maxim-lobanov/setup-xcode@v1, etc.), so not a new pattern. This PR was authored directly by a human (rob@libravault.xyz, co-authored with Claude Code) rather than through the autonomous issue→dev-agent pipeline — confirmed viapr-intake.yml's own comment on this PR ("opened outside the automated pipeline... doesn't link an issue") — so the "no new networking dependency without prior human sign-off" check is satisfied by construction here; the human is the direct author, not something a dev-agent introduced unilaterally.
CONFIRMED finding — filed as #416
needs: changes on the gated build/test jobs means those jobs are skipped not only when the path filter legitimately says "this diff can't affect this build," but also whenever the changes job itself fails for any infra reason (transient failure fetching the action, GitHub outage, runner provisioning failure, etc.) — GitHub Actions' default if: success() implied by needs: doesn't distinguish the two.
Both workflows were changed to treat 'skipped' as passing:
ios-app-build.yml'sreport-status"Fail if either build failed" step ignores'skipped'regardless of why the upstream job skipped.jvm-tests.yml'stestjob is the required check directly, with no wrapper at all — ifchangesfails,testreports'skipped'with zero fail-safe anywhere in the workflow.
Since GitHub branch protection accepts a 'skipped' conclusion as satisfying a required status check (the exact mechanic this PR's design relies on for the intentional skip to work), a failure in the cheap changes job would make all three required checks (Unit & Integration Tests (JVM), Build & Test iOS (Simulator), Build Android App) report green with no tests or builds ever having run, on any PR. Before this PR, 'skipped' only ever meant "draft PR, safe by construction" — a single, intentional, verifiable condition. After this PR, 'skipped' is ambiguous between that and "our own path-detection step broke," and nothing in either workflow can currently tell the two apart.
Full detail and suggested direction (not prescriptive — needs a human decision, especially for jvm-tests.yml which has no wrapper job to hang a fix on today) in #416.
Everything else
No other correctness issues found. The path-filter logic itself (allow-list construction, ios/android filter contents, needs.changes.outputs.* wiring, draft-PR guard composition, the "both skipped → stay silent" comment logic) is correct and matches the PR description. The rationale for job-level if: over on.paths-ignore (to avoid a required check sitting "Expected" forever) is correct and well-explained.
Outcome: human-merge — both because risk:high is correctly set (sensitive path) and because of the CONFIRMED finding above (#416). A human should decide the right fix (or explicitly accept the residual risk) before merge.
📱 iOS Build Status: PASSED✅ iOS Simulator Build & Unit Tests - success iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
|
Not merging via the sweep: this PR touches |
|
Holding this one rather than merging now: real CI is green and the diff is sound, but #416 (found while reviewing this PR) is a genuine gap this PR introduces — if the new |
Closes #416. build-ios-simulator, build-android-app (ios-app-build.yml) and test (jvm-tests.yml) are each themselves a required branch-protection status check. Previously, if the changes job errored instead of determining relevance, its outputs read empty, the 'outputs.* == true' guards evaluated false, and the job landed on 'skipped' — which GitHub treats as a passing required check, identically to a legitimate docs-only-diff skip. Each job's condition now also runs (instead of skipping) when changes.result != 'success', and a new first step in each fails explicitly in that case instead of silently passing. Also merged current dev (jvm-tests.yml conflict, straightforward — dev added scripts/** and .circleci/config.yml wasn't touched there) and threaded needs.changes.result into ios-app-build.yml's report-status job for an accurate PR comment, even though that job isn't itself a required check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Pushed a fix for #416 directly onto this branch: |
📱 iOS Build Status: PASSED✅ iOS Simulator Build & Unit Tests - success iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
Squash-merging under the standing PR-merge mandate. Sensitive path (.github/workflows/**), same direct-human-authored-PR pattern as issue #267's precedent. All applicable checks pass/correctly skip (pure workflow-YAML change, no app code touched — same paths-filter behavior as #415); principal-review-agent's 'review' check passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Why
PR #414 was a single-commit, non-draft, docs-only PR (one markdown file) that still ran the full iOS Simulator build, the informational iOS UI test job, and the Android Core Modules build (
ios-app-build.yml), plusjvm-tests.yml's full suite — none of which could be affected by a docs change. None of our workflows had any path filtering at all:The existing draft-PR skip (#368) doesn't cover this case: it only gates intermediate pushes on a still-draft PR, and #414 was neither draft nor multi-commit.
What
Adds a
changesjob (dorny/paths-filter) to bothios-app-build.ymlandjvm-tests.ymlthat computes whether the diff touches iOS-relevant / Android-relevant source paths, and gates the expensive build jobs on it.Deliberately an allow-list of real source paths (
ios/**,app/**,core/**,feature/**, gradle files, ...) rather than a deny-list of doc/asset paths — an allow-list only needs the finite, stable set of source dirs fromsettings.gradle.ktsand can't silently go stale the way "ignore everything that isn't code" can.The two things that had to change to make this safe
ios-app-build.yml'sreport-statusjob posts the PR comment and has a "fail if either build failed" step. Both previously treated any non-'success'result — including'skipped'— as a failure. That was fine while'skipped'only ever meant "draft PR,report-statusitself skipped identically" (see that job's own pre-existing comment). A path-filter skip is the first time a required build job can report'skipped'whilereport-statusstill runs for real, so both now treat'skipped'as passing, and the comment stays silent entirely when both builds skip (docs-only PR) instead of posting a "PASSED" for work that never ran.jvm-tests.yml's job has no such wrapper — it is the required check directly — so it only needed theneeds/ifgate.jvm-tests.yml's filter additionally includesscripts/**, since that workflow directly runsscripts/coverage-summary.pyandscripts/check-test-plan-modules.py, whichios-app-build.ymldoesn't.Why this doesn't just break branch protection
dev's required status checks areUnit & Integration Tests (JVM),Build & Test iOS (Simulator),Build Android App— one per job, not per-workflow-run. The skip here is a job-levelif(the job still runs, just does nothing and reports'skipped'), noton.paths-ignore/on.pathson the trigger — the latter would mean the workflow never runs at all for a docs-only PR, no check run gets created, and the required check sits "Expected" forever, permanently blocking merge. GitHub Actions' branch protection accepts a job-level'skipped'conclusion as satisfying a required check; it does not accept a check that was never created.Verified
python3 -c "import yaml; yaml.safe_load(open(f))") on both files.actionlintreports no issues on both files..github/workflows/**, which both filters explicitly include (so both jobs will actually run here, not skip). Worth watching the next genuinely docs-only PR to confirm the required checks clear as expected rather than sitting pending.🤖 Generated with Claude Code