Skip to content

Conversation

@neiii
Copy link
Owner

@neiii neiii commented Jan 9, 2026

Summary

Testing

  • cargo fmt -- --check
  • cargo clippy -- -D warnings
  • cargo test

Notes

After merge, tag 0.2.6 off master.

@neiii
Copy link
Owner Author

neiii commented Jan 9, 2026

@greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This is a clean release preparation PR that bumps the version to 0.2.6 and addresses test infrastructure improvements.

Key Changes:

  • Version bumped from 0.2.5 to 0.2.6 across Cargo.toml and Cargo.lock
  • CHANGELOG updated with references to PRs #24 and #25 (TUI performance and resource isolation fixes)
  • Test determinism fix: replaced reliance on --test-threads=1 with proper mutex-based synchronization for BRIDLE_CONFIG_DIR env var in parallel tests
  • Issue tracker updated with 3 closed Crush harness-related issues

Test Infrastructure Improvement:
The config manager tests now use a TestEnvGuard RAII pattern with a static mutex lock to serialize environment variable setup/teardown. This ensures safe parallel test execution without relying on external flags. The implementation properly restores previous env var state on drop, preventing test isolation issues.

Confidence Score: 5/5

  • This PR is safe to merge - it's a standard release preparation with proper test infrastructure improvements
  • All changes are straightforward: version bump, changelog update, and a well-implemented test synchronization fix. The test fix replaces unsafe reliance on single-threaded test execution with proper mutex-based synchronization. No production code changes, only test infrastructure improvements.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
Cargo.toml 5/5 Version bumped from 0.2.5 to 0.2.6 - standard semantic version increment
CHANGELOG.md 5/5 Added 0.2.6 release entry documenting TUI performance and resource isolation fixes
src/config/manager/mod.rs 5/5 Implemented thread-safe test environment with mutex-guarded env var setup/teardown for parallel testing

Sequence Diagram

sequenceDiagram
    participant Test as Test Function
    participant Guard as TestEnvGuard
    participant Lock as TEST_ENV_LOCK (Mutex)
    participant Env as Environment Variables
    
    Test->>Guard: setup_test_env(temp_dir)
    Guard->>Lock: lock().unwrap()
    Lock-->>Guard: MutexGuard acquired
    Guard->>Env: var_os("BRIDLE_CONFIG_DIR")
    Env-->>Guard: prev (current value or None)
    Guard->>Env: set_var("BRIDLE_CONFIG_DIR", test_path)
    Guard-->>Test: TestEnvGuard { _lock, prev }
    
    Note over Test: Test executes with<br/>isolated env var
    
    Test->>Guard: (drop at end of scope)
    Guard->>Env: restore previous value or remove_var
    Guard->>Lock: (MutexGuard dropped)
    Lock-->>Lock: mutex released for next test
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This release PR bumps the version to 0.2.6 and implements a critical fix for test determinism under parallel execution.

Key Changes:

  • Version bumped from 0.2.5 to 0.2.6 across Cargo.toml, Cargo.lock
  • Changelog updated with references to PRs #24 (profile resource isolation) and #25 (TUI/profile switching performance)
  • Test synchronization implemented using a global mutex (TEST_ENV_LOCK) to serialize BRIDLE_CONFIG_DIR environment variable access across 16 parallel tests
  • RAII guard pattern (TestEnvGuard) ensures proper cleanup and restoration of environment variables even on test failure/panic

Technical Implementation:
The test fix uses OnceLock<Mutex<()>> to ensure only one test at a time can modify the BRIDLE_CONFIG_DIR environment variable. The TestEnvGuard struct holds the mutex guard and the previous environment value, automatically restoring it via the Drop trait. This prevents race conditions that could cause non-deterministic test failures when tests run in parallel.

The solution properly handles three cases: (1) env var previously set, (2) env var not set, and (3) panic during test execution. All 16 affected tests now use the let _env = setup_test_env(&temp) pattern to ensure proper serialization.

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • This is a well-executed release PR with appropriate version bumping, changelog updates, and a focused test reliability fix. The test synchronization implementation uses established Rust patterns (OnceLock, Mutex, RAII guards) correctly. All changes are low-risk: version metadata updates and test infrastructure improvements that don't affect runtime code.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
CHANGELOG.md 5/5 Added version 0.2.6 entry with references to PRs #24 and #25 - changelog follows Keep a Changelog format
Cargo.toml 5/5 Version bumped from 0.2.5 to 0.2.6 - standard semantic versioning update
src/config/manager/mod.rs 5/5 Implemented test synchronization using mutex-guarded env var setup/teardown via RAII guard pattern - makes parallel tests deterministic

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant CI as CI Pipeline
    participant Cargo as Cargo Build
    participant Tests as Test Suite
    
    Dev->>Dev: Update version to 0.2.6
    Dev->>Dev: Update CHANGELOG.md
    Dev->>Dev: Add test synchronization
    Dev->>CI: Push changes
    CI->>Cargo: cargo fmt --check
    Cargo-->>CI: ✓ Format OK
    CI->>Cargo: cargo clippy -D warnings
    Cargo-->>CI: ✓ No warnings
    CI->>Tests: cargo test (parallel)
    Note over Tests: TEST_ENV_LOCK serializes<br/>BRIDLE_CONFIG_DIR access
    Tests->>Tests: Test 1 acquires mutex
    Tests->>Tests: Test 1 sets env var
    Tests->>Tests: Test 1 executes
    Tests->>Tests: Test 1 restores env (Drop)
    Tests->>Tests: Test 2 acquires mutex
    Tests->>Tests: Test 2 sets env var
    Tests-->>CI: ✓ All tests pass
    Dev->>Dev: Tag 0.2.6 after merge
Loading

@neiii neiii merged commit 951844a into master Jan 9, 2026
10 checks passed
@neiii neiii deleted the release-0.2.6 branch January 9, 2026 05:03
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.

2 participants