Skip to content

Make the bootstrap catalog test hermetic (#684) - #711

Open
Finesssee wants to merge 2 commits into
mainfrom
fix/684-hermetic-bootstrap-test
Open

Finesssee wants to merge 2 commits into
mainfrom
fix/684-hermetic-bootstrap-test

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #684. bootstrap_payload_exposes_every_provider_variant called get_bootstrap_state(), which reads the real %APPDATA%\CodexBar\settings.json through Settings::load(). On a machine where a retired provider is still enabled, the catalog had 79 entries instead of 78 and the test failed.

This branch starts from origin/main and:

  • carries the Isolate bootstrap payload test from real settings #684 change (get_bootstrap_state delegates to bootstrap_state_for(Settings), same body, no behavior change; the existing test calls it with Settings::default()), cherry-picked from 0cc3a38b;
  • adds bootstrap_catalog_depends_only_on_supplied_settings, which pins the case that broke: with a deprecated provider (kimi-k2) enabled in the supplied settings, the catalog lists it exactly once (active count + 1), a deprecated provider that is not enabled (crossmodel) stays hidden, and building the payload twice from the same settings yields the same catalog.

Neither test reads %APPDATA%, the registry or the keyring, so the result no longer depends on the developer's installed state.

Refs #684 (this PR can replace it; #684 itself is left untouched).

Upstream reference

Not applicable (test-only isolation fix in Win-CodexBar).

Ported / Deferred

Nothing deferred. Production behavior is unchanged.

Validation

Run in an isolated worktree with CARGO_TARGET_DIR=W:\cargo-target\worker:

  • cargo +1.98.0 fmt --all --check: clean
  • cargo +1.98.0 clippy --workspace --all-targets -- -D warnings: pass
  • cargo +1.98.0 test -p codexbar-desktop-tauri bootstrap: 2 passed
  • cargo +1.98.0 test -p codexbar-desktop-tauri: 463 passed, 0 failed
  • cargo +1.98.0 test -p codexbar: 2160 passed, 0 failed, 1 ignored

Affected areas

apps/desktop-tauri/src-tauri/src/commands/bridge.rs (helper extraction) and commands/tests.rs.

UI proof

Not applicable (no UI change).

Summary by CodeRabbit

  • Improvements
    • Provider catalog availability follows the selected settings, including whether deprecated providers appear.
    • Bootstrap information remains consistent when generated from the same settings. No changes to the visible bootstrap content are noted.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f0b8e74b-3baf-4f0e-b704-4245326e7047

📥 Commits

Reviewing files that changed from the base of the PR and between b585d48 and 6178f00.

📒 Files selected for processing (2)
  • apps/desktop-tauri/src-tauri/src/commands/bridge.rs
  • apps/desktop-tauri/src-tauri/src/commands/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The bootstrap command now passes loaded settings to the state-building helper. Tests use explicit settings and check provider catalog IDs and deprecated-provider entries.

Changes

Bootstrap State Settings

Layer / File(s) Summary
Pass settings into bootstrap construction
apps/desktop-tauri/src-tauri/src/commands/bridge.rs, apps/desktop-tauri/src-tauri/src/commands/tests.rs
The command passes loaded settings to bootstrap_state_for. Tests construct payloads from explicit settings and check catalog IDs, KimiK2, and CrossModel entries.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: romeroej2

Merge Risk: ⚪ Minimal · up to 6178f

The extraction preserves production bootstrap behavior while removing machine settings from the catalog tests. This change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: making the bootstrap catalog test independent of machine settings.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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