fix(ci): zero-network fetch without --locked; fix host-leaking CLI config test - #51
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #50 (merged while still red on 2 checks). Fixes the two remaining CI failures:
Cargo.lockisn't versioned in this repo, so thecargo fetch --lockedstep 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.basemyai-cli'sno_db_path_uses_default_container_pathtest relied ondirs::home_dir()inpersisted_config.rs, which on Windows queries the OS profile API directly and ignores a process'sHOME/USERPROFILEoverride (unlikebasemyai-core's own env-var-basedhome_dir()). The test'sisolated()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. Mirroredbasemyai-core's env-var-basedhome_dir()and made the test write its owndb-pathviaconfig setinstead of relying on ambient state.Note: the
clippy + test (windows-latest)failure seen on the post-mergemaincommit (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 cigreen locallycargo test -p basemyai-cli --test cligreen with the personal~/.basemyaiconfig moved aside (proves real isolation, not accidental host-state pass)cargo test -p basemyai --features embed,test-util/basemyai-core --features embed,test-utilgreen (embed job parity)🤖 Generated with Claude Code