refactor(resilience): make IBreakerRegistry injectable (WS4.2 PR0)#373
Merged
RicherTunes merged 9 commits intomainfrom Jan 17, 2026
Merged
refactor(resilience): make IBreakerRegistry injectable (WS4.2 PR0)#373RicherTunes merged 9 commits intomainfrom
RicherTunes merged 9 commits intomainfrom
Conversation
Create DI seam for IBreakerRegistry to enable WS4.2 Common migration: - Add optional IBreakerRegistry ctor param to BrainarrOrchestrator (defaults to new BreakerRegistry() for backwards compatibility) - Register IBreakerRegistry in BrainarrOrchestratorFactory DI - Pass registry to orchestrator via DI instead of static Lazy<> - Add BreakerRegistryInjectionTests proving DI wiring works This is a no-behavior-change refactor. WS4.1 characterization tests pass unchanged, confirming the seam is safe. WS4.2 PR sequence: - PR0 (this): seam - PR1: AdvancedCircuitBreaker in Common - PR2: CommonBreakerRegistry adapter in Brainarr - PR3: Delete old breaker implementation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract PassThroughCircuitBreaker into shared helper to consolidate duplicate implementations across test files. Fix IBreakerRegistry injection in BrainarrOrchestratorEndToEndLiteTests which was missing the breakerRegistry parameter (causing Release build test failures). - Add Brainarr.Tests/Helpers/PassThroughBreakerRegistry.cs with: - PassThroughCircuitBreaker: no-op circuit breaker for tests - PassThroughBreakerRegistry.CreateMock(): factory for mock registry - Update 4 test files to use the shared helper - Remove ~160 lines of duplicate PassThroughCircuitBreaker code Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Complete the debt payoff by ensuring all 19 BrainarrOrchestrator direct-constructor call sites pass breakerRegistry:. This prevents Release mode CI failures where the #if DEBUG fallback doesn't apply. Updated 12 test files to: - Add `using Brainarr.Tests.Helpers;` where missing - Pass `breakerRegistry: PassThroughBreakerRegistry.CreateMock().Object` Verified: grep finds 19 `breakerRegistry:` matches across 16 files, matching all 19 `new BrainarrOrchestrator(` call sites. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Root cause: Pre-test cleanup was deleting bin/obj directories, forcing dotnet test to rebuild. This caused parallel MSBuild file locking on Common submodule's .deps.json files. Fix: - Remove `rm -rf Brainarr.Tests/bin Brainarr.Tests/obj` from pre-test cleanup - Add `--no-build` to all dotnet test commands (Linux unit, Linux provider-contract, Windows unit) This ensures tests use pre-built binaries from the Build step, eliminating rebuild-induced file contention. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The backslash followed by trailing spaces on line 136 caused bash to pass extra arguments to MSBuild, triggering MSB1008 "Only one project can be specified" error. Also cleaned up excessive spacing in other test commands. Co-Authored-By: Claude Opus 4.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.
Rebased PR0 seam onto main after merging characterization tests. Introduces injectable \IBreakerRegistry\ wiring; no behavior changes, WS4.1 characterization suite remains unchanged.