Skip to content

fix(ci): checkout repo before paths-filter in changes job - #517

Merged
libravault-xyz merged 2 commits into
devfrom
fix/paths-filter-missing-checkout
Aug 24, 2026
Merged

libravault-xyz merged 2 commits into
devfrom
fix/paths-filter-missing-checkout

Conversation

@libravault-pipeline-bot

Copy link
Copy Markdown
Contributor

Summary

Both jvm-tests.yml and ios-app-build.yml's changes job runs dorny/paths-filter@v3 with no actions/checkout step before it. paths-filter diffs via the GitHub API on pull_request events (no checkout needed), but falls back to local git history on push events — with no checkout, that failed immediately with fatal: not a git repository.

Since the changes job failed, the fail-closed behavior added for #416 correctly skipped the real test/build jobs — so this wasn't silently passing tests — but it did mean every push-triggered run to dev/main (i.e. every merge) reported a false red, and Unit & Integration Tests (JVM) / the iOS build job never actually executed on those runs.

Verified via gh run list --workflow=jvm-tests.yml --json event,conclusion: 100% of recent push-triggered runs were failure at "Detect Changed Paths", 100% of pull_request-triggered runs were success.

Fix

Add actions/checkout@v4 with fetch-depth: 0 as the first step of the changes job in both workflows. Full history (rather than a shallow depth) because paths-filter's default base for push events is the commit before the push (github.event.before), which can be more than one commit back for a multi-commit push — a shallow fetch-depth: 1 or 2 would only reliably cover a single-commit push.

Risk

This touches .github/workflows/**, which is a sensitive_paths entry in agent-policy.yml — flagging explicitly per the dev-agent persona. The change only adds a checkout step ahead of an existing filter step; it doesn't change trigger conditions, permissions, or secrets handling. classify_pr_risk.py will force risk:high on this PR regardless, so it will land on status:needs-human-merge rather than auto-merge.

Testing

  • python3 -c "import yaml; yaml.safe_load(open(...))" — both workflow files parse cleanly.
  • No actionlint available in this environment to lint further; the real verification is CI's own run of these two workflows once this PR is opened (pull_request event — same code path as before, so this diff shouldn't be able to break the already-passing PR case) and, more importantly, the next push to dev after merge.
  • Not unit-testable (CI config, not application logic) — this falls under AGENTS.md's "build-script bumps" trivial-change exemption from the unit-test requirement.

Closes #514

dorny/paths-filter falls back to local git history on push events (no
checkout needed on pull_request, which uses the GitHub API instead),
so every push to dev/main failed at "Detect Changed Paths" with "not a
git repository". The fail-closed behavior from #416 correctly skipped
the real test/build jobs in response, so no tests were silently
passing — but every merge to dev/main has been reporting a false red,
and the JVM tests / iOS build never actually ran on those runs.

fetch-depth: 0 rather than a shallow depth, since paths-filter's
default base for push is the commit before the push
(github.event.before), which can be more than one commit back.

Closes #514
@libravault-pipeline-bot
libravault-pipeline-bot Bot marked this pull request as ready for review August 24, 2026 09:50
@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

The previous push opened the PR as draft and immediately marked it
ready, firing two near-simultaneous pull_request events into the same
jvm-tests.yml concurrency group. The surviving run's steps all
genuinely succeeded (checkout, tests, lint, coverage), but the job's
overall conclusion was reported as "cancelled" by a race with the
superseded run's cancellation signal. Empty commit to get one clean,
unraced run.
@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 github-actions Bot added the risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge label Aug 24, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-qa PR open, awaiting qa-agent verification label Aug 24, 2026
libravault-xyz added a commit that referenced this pull request Aug 24, 2026
… PR #517 is canonical

Filing issue #514 for the paths-filter bug (found during the 08-24 test
coverage review) triggered the dev-agent pipeline to pick it up
concurrently and ship a minimal, standalone fix (PR #517, already green)
faster than this session could land its own bundled version of the same
change. Reverting jvm-tests.yml/ios-app-build.yml back to origin/dev here to
avoid two competing fixes for the same two lines; #517 is now the PR that
closes #514. docs/TEST_COVERAGE_PRD.md's write-up of the bug stays (real,
useful analysis) but now points at #517 instead of claiming this branch
fixed it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@claude

claude Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

QA verification — PR #517 vs issue #514

Issue type: bug report, no acceptance checklist — criteria is "repro no longer reproduces + a regression test/verification proves it."

Root cause match

Issue #514: dorny/paths-filter@v3 diffs via the GitHub API on pull_request events (no checkout needed) but falls back to local git history on push events; with no checkout at all in the changes job, that fails with fatal: not a git repository. Confirmed via gh run list --workflow=jvm-tests.yml --json event,conclusion (last 20 runs): 100% of push-triggered runs → failure, 100% of pull_request-triggered runs → success — matches the issue's own evidence exactly. Independently confirmed via web search that dorny/paths-filter requires a prior checkout and recommends fetch-depth: 0 for accurate push-event diffing.

Fix review

git diff origin/dev...HEAD on both .github/workflows/jvm-tests.yml and .github/workflows/ios-app-build.yml: adds actions/checkout@v4 with fetch-depth: 0 as the first step of the changes job, ahead of the dorny/paths-filter@v3 step, in both files. This directly targets the failing line. fetch-depth: 0 (not shallow) is correct — paths-filter's push-event base is github.event.before, which can be more than one commit back for a multi-commit push; a shallow depth would only cover single-commit pushes. YAML parses cleanly (yaml.safe_load on both files).

CI verification (PR's own pull_request-triggered runs, commit 985e1fa)

  • jvm-tests.yml: Detect Changed Paths job → checkout + paths-filter steps both succeed → test job runs for real and passes.
  • ios-app-build.yml: all 5 jobs (Detect Changed Paths, Build & Test iOS (Simulator), iOS UI Tests, Build Android App, Report Build Status) succeed.

Note: since push only fires on an actual merge to dev/main, the fixed code path can't be exercised by a genuine push-triggered run before merge — this is an inherent limitation of this bug class, not a gap in the PR (the PR's own "Testing" section is upfront about this). Confidence instead comes from the root-cause match above, the direct fix, and successful pull_request-path runs, which exercise checkout+paths-filter identically apart from the diff-source (API vs. local history) — the part that was actually broken is now present in both cases.

Regression run

Ran the full suite locally on the PR branch, mirroring CI's Run JVM tests step:

./gradlew testDebugUnitTest :feature:settings:testFdroidDebugUnitTest :feature:settings:testPlayDebugUnitTest \
  :app:testFdroidDebugUnitTest :app:testPlayDebugUnitTest :core:billing:testFdroidDebugUnitTest \
  :core:billing:testPlayDebugUnitTest :core:cloudtts:testFdroidDebugUnitTest :core:cloudtts:testPlayDebugUnitTest --continue

BUILD SUCCESSFUL in 11m 20s, 692 actionable tasks (528 executed, 164 from cache) — no regressions. (Expected: this PR touches no JVM/iOS source, only workflow YAML.)

AGENTS.md conventions

  • Branch name fix/paths-filter-missing-checkout — matches fix/<short-slug>. ✓
  • Commit subjects (fix(ci): …, chore: …) — Conventional Commits. ✓
  • Unit-test requirement: PR claims the "build-script bumps" trivial-change exemption. That's a slight stretch of the literal wording (this adds a step, not a version bump), but matches actual repo precedent — PR fix(ci): skip iOS/Android/JVM builds for docs-only PR diffs #415, which introduced these same changes/paths-filter jobs, also shipped with no application-level unit tests, i.e. CI-workflow-only diffs are treated as exempt in practice here. Not a blocker.

Verdict per criterion

Criterion Result
Checkout added before paths-filter in both workflows ✅
fetch-depth: 0 used (handles multi-commit pushes) ✅
Fix doesn't break the already-working pull_request path ✅ (all jobs green on PR's own runs)
YAML valid ✅
No regressions in JVM test suite ✅ (BUILD SUCCESSFUL)
AGENTS.md conventions (branch, commits) ✅

QA verdict: PASS

@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 24, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Principal review — verdict: human-merge

Risk classification: risk:high — correct and current. Independently re-ran classify_pr_risk.py origin/dev HEAD myself: it hits .github/workflows/ios-app-build.yml against the .github/workflows/** sensitive-path pattern, same result as the label already on the PR. The label was applied at 10:27:12Z, after both commits on this branch (09:49:43Z, 10:07:09Z) — not stale. This forces human-merge regardless of review outcome, per agent-policy.yml.

Correctness review: the fix is small and sound. Both jvm-tests.yml and ios-app-build.yml's changes job get an identical actions/checkout@v4 with fetch-depth: 0 ahead of the existing dorny/paths-filter@v3 step.

  • fetch-depth: 0 (not a shallow depth) is the right call — paths-filter's default base for push events is github.event.before, which can be more than one commit back for a multi-commit push; a shallow fetch would silently under-cover that case.
  • Confirmed this doesn't change pull_request-event behavior: paths-filter auto-uses the GitHub API for pull_request events (no base: override is set in either filter step), so the new checkout is inert there — and this PR's own "Detect Changed Paths" checks are green on both workflows, consistent with that.
  • The actual bug (push-event failure) is inherently untestable from within this PR's own pull_request-triggered CI — verification only happens on the next push to dev after merge. The PR description is upfront about this limitation rather than overclaiming coverage, and the existing fail-closed behavior from changes/paths-filter job failure silently passes required CI checks (ios-app-build.yml, jvm-tests.yml) #416 means a still-broken fix would degrade to a loud red "changes" job again, not a silent pass.
  • Both files parse cleanly under yaml.safe_load (re-verified myself, not just taking the PR's word for it).

Policy checks:

No CONFIRMED findings — nothing to file as a follow-up issue. Routing to human-merge purely on the risk:high label; the change itself looks correct to merge as-is.

@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 24, 2026
@libravault-xyz
libravault-xyz merged commit 0d4c806 into dev Aug 24, 2026
20 checks passed
@libravault-xyz
libravault-xyz deleted the fix/paths-filter-missing-checkout branch August 24, 2026 10:48
libravault-xyz added a commit that referenced this pull request Aug 24, 2026
…(Settings + partial Reader) (#512)

* fix(ci): checkout before paths-filter; gate core:cloudtts; refresh coverage docs

- jvm-tests.yml and ios-app-build.yml's `changes` job ran dorny/paths-filter
  with no actions/checkout step. paths-filter diffs via the GitHub API on
  pull_request events (no checkout needed) but needs local git history on
  push, so every push-triggered run to dev/main has been failing at
  'Detect Changed Paths' with 'fatal: not a git repository', skipping the
  test job entirely. Verified against the last 15 jvm-tests.yml runs:
  100% of push runs failed, 100% of pull_request runs passed. Fixed by
  adding actions/checkout@v4 to both jobs.
- Re-ran koverXmlReportDebug across all 18 modules (was last measured
  2026-08-17 against 16). Android overall 40.1% -> 46.9%. core:cloudtts
  and core:billing (both new since the last audit) are now measured;
  core:cloudtts holds user API keys/vendor credentials so it's added to
  GATED_PREFIXES alongside the three vault modules, and
  coverage-baseline.json is regenerated via --write-baseline.
- docs/TEST_COVERAGE_PRD.md gets a dated status-update section (does not
  rewrite the original 08-16 audit) covering the above plus: PR #265
  merged so Phase 7's feature:library sequencing blocker is cleared;
  #253/#256 already closed; #273 stays status:blocked pending a human
  decision on iOS snapshot approval, deliberately not implemented blind.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* refactor(settings): split SettingsScreen into thin wrapper + pure SettingsContent (Phase 7)

Per docs/TEST_COVERAGE_PRD.md Phase 7's PlayerScreen template: SettingsScreen
was 0% covered because it takes viewModel = hiltViewModel() directly and reads
its StateFlows/callbacks inline, so it can't render without a Hilt graph.

- SettingsScreen(viewModel) is now a thin wrapper: it collects the ViewModel's
  state flows, resolves the Activity/Context-dependent bits (SAF folder
  picker, external browser intent, billing purchase calls), and hands
  everything else to a new pure SettingsContent(state, actions) with no
  Hilt/Context dependency.
- SettingsContentState / SettingsActions bundle the collaborators, mirroring
  PlayerScreen's PlayerActions pattern. cloudVoicesActuallySending moved onto
  SettingsContentState as a computed property (was an inline call-site
  expression) so it's independently testable.
- SettingsContentTest.kt (10 tests): the vaults empty/non-empty states, the
  three-way Support Development branch (F-Droid external link / Play
  no-products / Play subscribe), the remove-vault confirmation dialog, and
  cloudVoicesActuallySending's three-way AND. Existing 67 tests pass
  unchanged (evidence of preservation per the Phase 7 recipe). Two of the new
  assertions (cloudVoicesActuallySending's AND, the remove-vault callback
  wiring) were mutation-checked by hand: flipping AND to OR and dropping the
  callback each turned exactly the expected tests red.
- SettingsScreenshotTest.kt (3 tests, Dark/Light/Sepia) — first per-screen
  Roborazzi baseline in the repo (previously only core:ui's generic theme
  sampler existed). Needed adding the roborazzi plugin/deps to
  feature/settings/build.gradle.kts, which had never had them.
- Recording the first baseline caught a real, pre-existing bug: the reading
  theme filter-chip Row has no wrap or scroll, so with AppReadingTheme's 5th
  entry (System, #349) the System chip was squeezed to chip width and broke
  mid-word into 'Syst'/'em' in every theme. Fixed with horizontalScroll;
  re-recorded baselines confirm the fix, and the pre-fix baseline caught the
  regression when I ran the suite before fixing it (3 verify failures, all
  and only the screenshot tests).

feature:settings coverage was 58.4% before this file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(reader): cover ReaderMiniPlayerBar/ReaderReadAloudMiniBar display states (Phase 7, partial)

ReaderScreen.kt is a Phase 7 target (246 missed lines, 0%) but does NOT fit
the PlayerScreen/SettingsScreen thin-wrapper-plus-pure-content template:
epubViewModel/markdownViewModel are obtained via sibling hiltViewModel()
calls specifically so their instances are shared with the ViewModelStoreOwner
EpubReaderScreen/MarkdownReaderScreen use downstream (see the code comment
this file already had). Pulling that into a pure content composable risks
silently breaking that sharing -- exactly the a-real-behaviour-change-
slipping-in-unnoticed risk Phase 7 already calls out. This needs a
deliberate design pass, not a mechanical extraction, so it is left alone here.

selectReaderBottomBar/readAloudSupported (the file's other pure top-level
functions) already have dedicated tests. ReaderMiniPlayerBar and
ReaderReadAloudMiniBar were the remaining genuinely pure, untested pieces --
widened from private to internal and covered here for their state-dependent
icon/text display (Play vs Pause, Resume vs Pause reading).

Click/callback-wiring assertions were attempted but dropped: an extended
isolation investigation found performClick() silently invokes nothing on
either bar specifically when rendered with its real, distinct Material icon
set together (SkipPrevious/FastRewind/Pause/PlayArrow/SkipNext/Stop/
Headphones) -- every icon works fine individually, and a same-icon-repeated
reconstruction of the identical layout also clicks fine, so this isn't
believed to be a production bug (the component is unchanged, shipped code),
but a genuine, unexplained Robolectric/Compose test-harness interaction not
worth further time right now. Recorded here rather than shipped as a flaky
or silently-weakened assertion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs: record Phase 7 partial execution and final coverage numbers

Android overall 46.9% -> 50.4% after SettingsScreenKt (done) and
ReaderScreenKt (re-scoped, partial). See PRD Sec 1b for the per-target
writeup, including why ReaderScreenKt needs a design pass rather than the
mechanical wrapper/content split, and a heads-up to check
EpubReaderScreenKt/PdfReaderScreenKt for the same sibling-hiltViewModel
sharing shape before assuming the template applies to them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* revert(ci): drop this branch's paths-filter checkout fix, dev-agent's PR #517 is canonical

Filing issue #514 for the paths-filter bug (found during the 08-24 test
coverage review) triggered the dev-agent pipeline to pick it up
concurrently and ship a minimal, standalone fix (PR #517, already green)
faster than this session could land its own bundled version of the same
change. Reverting jvm-tests.yml/ios-app-build.yml back to origin/dev here to
avoid two competing fixes for the same two lines; #517 is now the PR that
closes #514. docs/TEST_COVERAGE_PRD.md's write-up of the bug stays (real,
useful analysis) but now points at #517 instead of claiming this branch
fixed it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
libravault-xyz added a commit that referenced this pull request Aug 24, 2026
)

Small, real addition riding along with a throwaway PR whose actual purpose
is triggering the circleci-job label against current dev, to confirm #517
+ #519 actually fixed the dispatch path (not just that the two diffs looked
right in review).

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.

CI: jvm-tests.yml/ios-app-build.yml 'changes' job fails on every push to dev/main (missing checkout before paths-filter)

1 participant