Skip to content

fix(ci): commit insta snapshots and fix Windows clippy errors (REF-172)#38

Merged
therecluse26 merged 3 commits into
mainfrom
feature/blocker-resolution
May 16, 2026
Merged

fix(ci): commit insta snapshots and fix Windows clippy errors (REF-172)#38
therecluse26 merged 3 commits into
mainfrom
feature/blocker-resolution

Conversation

@therecluse26
Copy link
Copy Markdown
Collaborator

@therecluse26 therecluse26 commented May 16, 2026

Summary

Restores green CI on main across all three platforms after PR #37 was merged red. Bundles two ticket scopes:

  • REF-172 — fix the regressions PR Feature/blocker resolution #37 introduced (4 snapshot tests + Windows build).
  • REF-173 — fix the 21 pre-existing Windows path-separator bugs that became visible once Windows could compile again.

Commits

SHA Scope
ac1e527 REF-172: commit insta snapshots; gate Windows clippy edges
9721504 REF-173: normalize path separators in 21 Windows-only test assertions
c71962c REF-173: make path/home overrides reach storage + dirs lookups

Root causes

REF-172 — PR #37 regressions

  1. *.snap was in .gitignore, which excluded insta's baseline snapshot files. CI saw "missing snapshot" failures for 4 pulse::site tests:

    • snapshot_zola_config_all_surfaces
    • snapshot_base_html_page_structure
    • snapshot_base_html_pagefind_integration
    • snapshot_home_page_navigation_links

    Insta's convention is the opposite: commit .snap (baseline) and ignore .snap.new / .pending-snap (pending updates). Replaced the blanket glob with that pair.

  2. Windows-only clippy errors under -D warnings in src/indexer.rs and src/cli/index.rs:

    • use crate::output; was only referenced inside a #[cfg(unix)] branch of check_disk_space → gated the import on #[cfg(unix)].
    • root: &Path parameter of check_disk_space was unused on Windows for the same reason → added #[cfg_attr(not(unix), allow(unused_variables))] on the function.
    • .arg(&path) in the Windows-specific spawn block triggered clippy::needless_borrows_for_generic_args → matched the Unix branch's .arg(path).

REF-173 — Pre-existing Windows path bugs (revealed once Windows compiled)

Windows used backslash separators (src\\models.rs) where tests asserted forward slashes (src/models.rs), and a handful of fixture walks picked up extra entries. Path overrides for storage/dirs lookups also weren't honored on Windows. See REF-173 for the full failing-test inventory.

Test plan

  • cargo clippy --all-targets -- -D warnings clean
  • cargo test — all tests pass locally
  • cargo build --release clean
  • CI green on Ubuntu (run 25970851209)
  • CI green on macOS (same run)
  • CI green on Windows (same run, 704 lib tests)

🤖 Generated with Claude Code

therecluse26 and others added 3 commits May 16, 2026 14:47
PR #37 was merged with broken CI on Ubuntu, macOS, and Windows runners.

Root causes:
1. `*.snap` in .gitignore excluded insta's baseline snapshot files, so
   CI saw "missing snapshot" failures for 4 pulse::site tests. Insta's
   convention is the opposite: commit `.snap` (baseline) and ignore
   `.snap.new` (pending). Replaced the blanket glob with that pair.
2. Windows-only clippy errors under `-D warnings`:
   - `use crate::output` was unused on Windows (only referenced inside a
     `#[cfg(unix)]` branch of `check_disk_space`) → gated import on unix.
   - `root: &Path` parameter of `check_disk_space` was unused on Windows
     for the same reason → added `cfg_attr(not(unix), allow(unused_variables))`.
   - `.arg(&path)` in the Windows-specific spawn block triggered
     `needless_borrows_for_generic_args` → matched the Unix branch's `.arg(path)`.

Verified:
- `cargo clippy --all-targets -- -D warnings` clean.
- `cargo test` — all 855 tests pass (lib 704 + integration 80 + symbol_test 59 +
  mcp_jsonrpc 6 + doctests 6; 10 perf tests intentionally ignored in debug).
- `cargo build --release` clean.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
…ailures (REF-173)

Normalize all resolved file paths to forward slashes and make
platform-specific helpers Windows-aware. With this change the same
21 tests that failed on `windows-latest` (path separator
mismatches, vendor/venv filters not matching `\vendor\`, missing
Windows asset for Pagefind/Zola, and `HOME` overrides ignored by
`dirs::home_dir()`) now behave identically on every OS.

Production normalizations:
- Indexer stores relative paths with `/` so the on-disk index is
  deterministic and downstream `path.contains("src/...")` filters
  work regardless of OS.
- `resolve_rust_import`, `resolve_rust_mod_declaration`,
  `resolve_c_include_to_path`, `resolve_cpp_include_to_path`, the
  TypeScript resolver and the Go/Python project-root strings all
  emit forward-slash paths.
- Go vendor/Python venv filters operate on a normalized string so
  the `.../vendor/...` check fires on Windows paths too.

Test-only adjustments:
- Pagefind/Zola `test_get_asset_name` now branches on supported
  platforms: assert `Ok` where a binary exists, assert the
  unsupported-platform error otherwise.
- Semantic config tests use `set_home`/`unset_home` helpers that
  also set `USERPROFILE` on Windows so `dirs::home_dir()` picks up
  the override.
- C/C++ resolver tests drop the `|| backslash` alternatives now
  that the resolver guarantees forward slashes.

Verified locally with `cargo test` (704 lib + 145 integration tests
all green) and `cargo build --release`.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
… (REF-173)

Second iteration of the Windows CI fix. The first push knocked the
21 failures down to 4; this addresses the remaining four:

- Indexer was still passing the original `PathBuf` (with backslashes
  on Windows) into the trigram index and content store, so the
  query layer saw `src\main.rs` even though the metadata DB had
  `src/main.rs`. Rebuild the `PathBuf` from the already-normalized
  `path_str` and drop the now-unused `path` field on the
  intermediate result struct.
- `dirs::home_dir()` queries `SHGetKnownFolderPath(FOLDERID_Profile)`
  on Windows and ignores `HOME` / `USERPROFILE`, so the semantic
  config tests could not redirect the lookup to a temp directory.
  Add `user_home_dir()` that checks `REFLEX_HOME`, `HOME`, then
  `USERPROFILE` before falling back to `dirs::home_dir()`, and
  route every `dirs::home_dir()` call inside `semantic/config.rs`
  through it. Tests on Unix and macOS keep using `HOME` as before.

Verified locally with `cargo test --lib` (704 passed) and
`cargo clippy --lib --all-targets -- -D warnings`.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@therecluse26 therecluse26 merged commit 93501ad into main May 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant