Skip to content

fix(ci): skip iOS/Android/JVM builds for docs-only PR diffs - #415

Merged
libravault-xyz merged 2 commits into
devfrom
fix/ci-path-filters
Aug 22, 2026
Merged

libravault-xyz merged 2 commits into
devfrom
fix/ci-path-filters

Conversation

@libravault-xyz

Copy link
Copy Markdown
Collaborator

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), plus jvm-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:

$ grep -n "paths" .github/workflows/*.yml
(nothing)

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 changes job (dorny/paths-filter) to both ios-app-build.yml and jvm-tests.yml that 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 from settings.gradle.kts and 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

  1. ios-app-build.yml's report-status job 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-status itself 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' while report-status still 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.
  2. jvm-tests.yml's job has no such wrapper — it is the required check directly — so it only needed the needs/if gate.

jvm-tests.yml's filter additionally includes scripts/**, since that workflow directly runs scripts/coverage-summary.py and scripts/check-test-plan-modules.py, which ios-app-build.yml doesn't.

Why this doesn't just break branch protection

dev's required status checks are Unit & Integration Tests (JVM), Build & Test iOS (Simulator), Build Android App — one per job, not per-workflow-run. The skip here is a job-level if (the job still runs, just does nothing and reports 'skipped'), not on.paths-ignore/on.paths on 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

  • YAML parses clean (python3 -c "import yaml; yaml.safe_load(open(f))") on both files.
  • actionlint reports no issues on both files.
  • Not yet verified live — this is the first real PR to exercise the skip path itself, since this PR touches only .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

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>
@github-actions github-actions Bot added the risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge label Aug 22, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was opened outside the automated pipeline (author isn't libravault-pipeline-bot[bot]) and doesn't link an issue (no Closes #N-style line in its body), so there's no acceptance criteria for qa-agent.yml to verify against — it would otherwise sit with no risk/status label and nothing downstream would pick it up (see issue #223's actual history, and issue #343 for this issue-less case specifically). This deterministic backstop (pr-intake.yml) classified its risk and applied status:needs-review to route it straight to principal review.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.12 on both files: no issues — confirms the PR description's claim.
  • Live CI on this PR itself: Detect Changed Paths passed on both workflows, Build Android App and Unit & 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.md conventions — 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.yml sensitive paths — only .github/workflows/** is touched, correctly reflected by risk:high. No other sensitive path touched.
  • New dependency: dorny/paths-filter@v3 is 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 via pr-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's report-status "Fail if either build failed" step ignores 'skipped' regardless of why the upstream job skipped.
  • jvm-tests.yml's test job is the required check directly, with no wrapper at all — if changes fails, test reports '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.

@github-actions github-actions Bot added status:needs-human-merge Principal review done, requires human merge decision and removed status:needs-review QA passed, awaiting principal-review-agent labels Aug 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@github-actions

Copy link
Copy Markdown
Contributor

Not merging via the sweep: this PR touches .github/workflows/ios-app-build.yml and .github/workflows/jvm-tests.yml, both on agent-policy.yml's sensitive-path list. Per this sweep's hard rule (.claude/agents/human-merge-sweep-agent.md, Part 1/Hard limits), PRs touching .github/workflows/** are never merged by this automation regardless of how clean the diff or CI looks — routing to a human for the merge decision. CI is green and the branch is mergeable against dev; the only reason this isn't auto-merged is the sensitive path.

@libravault-xyz

Copy link
Copy Markdown
Collaborator Author

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 changes/paths-filter job itself errors, its outputs read empty, the needs.changes.outputs.* == 'true' guards evaluate false, the build jobs skip, and 'skipped' is already treated as passing by the fail-condition here. Net effect: a paths-filter failure would make a required check silently report green with no build having run at all — the exact class of gap CI required-checks exist to prevent. Recommend folding a 'changes job itself failed → treat as not-skipped/fail-closed' guard into this PR (or landing #416's fix first) before merge. Leaving status:needs-human-merge; not merging as-is.

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>
@libravault-xyz

Copy link
Copy Markdown
Collaborator Author

Pushed a fix for #416 directly onto this branch: build-ios-simulator/build-android-app (ios-app-build.yml) and test (jvm-tests.yml) are each themselves the required branch-protection status check (verified against the repo's actual branch protection config, not just the job names) — so the fix has to live on those jobs directly, not on report-status (which isn't a required check at all). Each now runs (instead of skipping) when changes.result != 'success', and fails explicitly in that case via a new first step, instead of landing on 'skipped' and reading as a pass. Also rebased onto current dev. Waiting on real CI now before I merge.

@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@libravault-xyz
libravault-xyz merged commit 7bfc827 into dev Aug 22, 2026
8 checks passed
@libravault-xyz
libravault-xyz deleted the fix/ci-path-filters branch August 22, 2026 18:27
libravault-xyz added a commit that referenced this pull request Aug 25, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge status:needs-human-merge Principal review done, requires human merge decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant