Skip to content

[PM-35680] chore: Convert ServerCommunicationConfigClientProtocol to AutoMockable#2853

Open
matt-livefront wants to merge 1 commit into
mainfrom
matt/PM-35680-sdk-mocks-server-communication-config-client
Open

[PM-35680] chore: Convert ServerCommunicationConfigClientProtocol to AutoMockable#2853
matt-livefront wants to merge 1 commit into
mainfrom
matt/PM-35680-sdk-mocks-server-communication-config-client

Conversation

@matt-livefront

@matt-livefront matt-livefront commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

🎟️ Tracking

PM-35680

📔 Objective

Updates ServerCommunicationConfigClientProtocol to use AutoMockable.

@matt-livefront matt-livefront requested a review from a team as a code owner July 2, 2026 22:08
@matt-livefront matt-livefront added ai-review Request a Claude code review t:tech-debt Change Type - Tech debt labels Jul 2, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context labels Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR converts the bespoke MockServerCommunicationConfigClient to a Sourcery AutoMockable-generated mock (MockServerCommunicationConfigClientProtocol), following the established pattern for BitwardenSdk types declared as empty extensions in BitwardenSdkMocks.swift. It adds a withDefaults() factory to supply the required non-optional return values and updates the three affected test files to the AutoMockable naming conventions (*ReturnValue, *ThrowableError, *ReceivedArguments, *Received<Param>). No production references to the deleted mock remain.

Code Review Details

No findings. The conversion is a clean, mechanical tech-debt change that:

  • Removes the hand-written mock and its 84 lines of boilerplate.
  • Registers ServerCommunicationConfigClientProtocol in BitwardenSdkMocks.swift consistently with sibling SDK types (e.g., ServerCommunicationConfigRepository).
  • Provides withDefaults() to set the four required non-optional return values (cookiesReturnValue, getConfigReturnValue, getCookiesReturnValue, needsBootstrapReturnValue), which the singleton default depends on to avoid force-unwrap crashes.
  • Updates all test assertions to the correct AutoMockable member names, matching conventions used elsewhere in the codebase.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.87%. Comparing base (9b721b3) to head (8e4950c).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2853      +/-   ##
==========================================
- Coverage   81.14%   78.87%   -2.28%     
==========================================
  Files        1026     1149     +123     
  Lines       65978    73282    +7304     
==========================================
+ Hits        53539    57801    +4262     
- Misses      12439    15481    +3042     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant