fabro/lib/crates
Bryan Helmkamp cf80fe567a
test(harness): scrub ambient creds from spawned fabro CLI
CLI integration tests spawned the real fabro binary while letting the
parent process's env pass through. The pr_view "no credentials" snapshot
failed in CI because the Nightly workflow's minted GITHUB_TOKEN was
inherited by the child and turned the expected "credentials required"
error into a real GitHub API call (404 / 401). On developer laptops the
same leak occurs whenever gh auth login is active.

Introduce apply_test_isolation(cmd, home) in fabro-test: env_clear() +
re-populate PATH, HOME, NO_COLOR, and the FABRO_* test overrides. Route
TestContext::command(), the internal server bootstrap, and the four
ad-hoc spawners in tests/it/cmd/{attach,render_graph,runner,server_start}
through the same helper so the isolation is systemic instead of
per-callsite. Tests that deliberately need a credential (OPENAI_API_KEY,
GITHUB_APP_PRIVATE_KEY, etc.) continue to set it explicitly on the
returned Command; those survive the clear.

Add a regression test that sets sentinel GITHUB_TOKEN and
ANTHROPIC_API_KEY in the parent, spawns /usr/bin/env through the helper,
and asserts the child sees neither credential while still seeing PATH
and the harness's FABRO_NO_UPGRADE_CHECK override.

Verified: the full workspace (4022 tests) passes with GITHUB_TOKEN and
ANTHROPIC_API_KEY set in the parent, which previously broke the
pr_view_reads_pull_request_from_store_without_pull_request_json
snapshot. cargo fmt and nightly clippy are clean.
2026-04-18 01:55:01 -04:00
..
fabro-agent ci: switch clippy to pinned nightly, clean up workspace lints 2026-04-16 18:59:11 -04:00
fabro-api refactor(http): centralize reqwest behind fabro-http 2026-04-12 11:48:54 -04:00
fabro-auth fix: resolve test failures and clippy warnings across workspace 2026-04-15 11:02:20 -04:00
fabro-checkpoint refactor(async): lint std::process::Command across all targets 2026-04-12 13:35:57 -04:00
fabro-cli test(harness): scrub ambient creds from spawned fabro CLI 2026-04-18 01:55:01 -04:00
fabro-config ci: switch clippy to pinned nightly, clean up workspace lints 2026-04-16 18:59:11 -04:00
fabro-core ci: switch clippy to pinned nightly, clean up workspace lints 2026-04-16 18:59:11 -04:00
fabro-devcontainer fix: wrap propagated io errors with anyhow context across prod code 2026-04-17 11:44:38 -04:00
fabro-github Merge remote-tracking branch 'origin/main' 2026-04-12 13:43:38 -04:00
fabro-graphviz ci: switch clippy to pinned nightly, clean up workspace lints 2026-04-16 18:59:11 -04:00
fabro-hooks fix: simplify fabro-http crate and fix correctness issues 2026-04-12 12:20:55 -04:00
fabro-http fix: simplify fabro-http crate and fix correctness issues 2026-04-12 12:20:55 -04:00
fabro-interview fix: wrap propagated io errors with anyhow context across prod code 2026-04-17 11:44:38 -04:00
fabro-llm fix: wrap propagated io errors with anyhow context across prod code 2026-04-17 11:44:38 -04:00
fabro-macros refactor(settings): stage 6.3b shrink server runtime types + delete Combine 2026-04-09 18:27:46 -04:00
fabro-mcp fix: simplify fabro-http crate and fix correctness issues 2026-04-12 12:20:55 -04:00
fabro-model wip 2026-04-16 13:13:09 -04:00
fabro-oauth Add typed provider credential auth flow 2026-04-12 22:10:11 -04:00
fabro-proc fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
fabro-retro ci: switch clippy to pinned nightly, clean up workspace lints 2026-04-16 18:59:11 -04:00
fabro-sandbox deps: bump rand 0.8 → 0.9 (#163) 2026-04-17 07:57:10 -04:00
fabro-server fix(api): convert OpenAPI spec to valid 3.1 syntax 2026-04-18 01:11:19 -04:00
fabro-slack refactor(http): centralize reqwest behind fabro-http 2026-04-12 11:48:54 -04:00
fabro-spa Update SPA 2026-04-16 17:35:37 -04:00
fabro-store ci: switch clippy to pinned nightly, clean up workspace lints 2026-04-16 18:59:11 -04:00
fabro-telemetry fix: wrap propagated io errors with anyhow context across prod code 2026-04-17 11:44:38 -04:00
fabro-template refactor(async): lint std::process::Command across all targets 2026-04-12 13:35:57 -04:00
fabro-test test(harness): scrub ambient creds from spawned fabro CLI 2026-04-18 01:55:01 -04:00
fabro-tracker refactor(http): centralize reqwest behind fabro-http 2026-04-12 11:48:54 -04:00
fabro-types ci: switch clippy to pinned nightly, clean up workspace lints 2026-04-16 18:59:11 -04:00
fabro-util fix: wrap propagated io errors with anyhow context across prod code 2026-04-17 11:44:38 -04:00
fabro-validate fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
fabro-vault fix: wrap propagated io errors with anyhow context across prod code 2026-04-17 11:44:38 -04:00
fabro-workflow fix: wrap propagated io errors with anyhow context across prod code 2026-04-17 11:44:38 -04:00