Skip to content

fix(ci): zero-network fetch without --locked; fix host-leaking CLI config test - #51

Merged
MikeRoss27 merged 1 commit into
mainfrom
dev
Jul 9, 2026
Merged

fix(ci): zero-network fetch without --locked; fix host-leaking CLI config test#51
MikeRoss27 merged 1 commit into
mainfrom
dev

Conversation

@MikeRoss27

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #50 (merged while still red on 2 checks). Fixes the two remaining CI failures:

  • zero-network-after-setup: Cargo.lock isn't versioned in this repo, so the cargo fetch --locked step added to warm dependencies before blocking the proxy errored on a fresh checkout ("cannot create the lock file ... --locked was passed"). Fetch without --locked, run the tests --offline.
  • clippy + test (ubuntu-latest): basemyai-cli's no_db_path_uses_default_container_path test relied on dirs::home_dir() in persisted_config.rs, which on Windows queries the OS profile API directly and ignores a process's HOME/USERPROFILE override (unlike basemyai-core's own env-var-based home_dir()). The test's isolated() helper assumes overrides are honored — so on any Windows dev machine with an ambient ~/.basemyai/config.toml, the test silently read that instead of its own isolated tempdir, passing by accident while failing on a clean Linux CI runner (NOT_CONFIGURED), and separately hardcoded a Windows-only backslash path literal. Mirrored basemyai-core's env-var-based home_dir() and made the test write its own db-path via config set instead of relying on ambient state.

Note: the clippy + test (windows-latest) failure seen on the post-merge main commit (consolidation_runs_through_worker_background_loop) looks like an unrelated pre-existing timing flake (40ms interval / 200ms budget for a background consolidation loop) — not touched here.

Test plan

  • cargo xtask ci green locally
  • cargo test -p basemyai-cli --test cli green with the personal ~/.basemyai config moved aside (proves real isolation, not accidental host-state pass)
  • cargo test -p basemyai --features embed,test-util / basemyai-core --features embed,test-util green (embed job parity)

🤖 Generated with Claude Code

…nfig test

Cargo.lock isn't versioned in this repo, so `cargo fetch --locked` in the
zero-network job errored on a fresh checkout ("cannot create the lock file
... --locked was passed"). Fetch without --locked, keep --offline on the
subsequent test runs.

persisted_config.rs::file_path() used `dirs::home_dir()`, which on Windows
queries the OS profile API directly and ignores a process's HOME/USERPROFILE
override — unlike basemyai-core's own `key::home_dir()`. The CLI test suite's
`isolated()` helper assumes HOME/USERPROFILE overrides are honored (as they
are for the encryption-key file), so `no_db_path_uses_default_container_path`
was silently reading a real, ambient ~/.basemyai/config.toml on any Windows
dev machine that had one instead of the test's own isolated tempdir — passing
by accident locally while failing on a clean CI runner (NOT_CONFIGURED), and
separately asserting a Windows-only backslash path literal. Mirror
basemyai-core's env-var-based home_dir() and make the test actually write
its own db-path via `config set` instead of relying on ambient state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@MikeRoss27 MikeRoss27 self-assigned this Jul 9, 2026
@MikeRoss27
MikeRoss27 merged commit 76d3cfb into main Jul 9, 2026
10 checks passed
@MikeRoss27
MikeRoss27 deleted the dev branch July 9, 2026 21:17
@MikeRoss27
MikeRoss27 restored the dev branch July 9, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant