-
Notifications
You must be signed in to change notification settings - Fork 86
[PM-28540] Add BitwardenSharedMocks target #2183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Claude finished @matt-livefront's task —— View job Code Review CompleteSummaryThis PR successfully creates a Architecture & Design ✅Strengths:
Key Changes:
Code Quality ✅Positive Findings:
Fixture Organization: Testing ✅
Documentation ✅
Security ✅
Potential ConcernsMinor:
RecommendationsOptional Improvements (not blockers):
Verdict: ✅ APPROVEDThis is a well-executed refactoring that improves code organization and sets the foundation for Xcodegen templates. The changes are:
The CI failure in Authenticator tests is unrelated (infrastructure issue with Ruby download timeout from GitHub's servers). |
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2183 +/- ##
==========================================
- Coverage 85.50% 84.23% -1.27%
==========================================
Files 1740 1978 +238
Lines 147301 162364 +15063
==========================================
+ Hits 125943 136767 +10824
- Misses 21358 25597 +4239 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fedemkr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one small question.
| - path: BitwardenShared/Sourcery/Generated | ||
| optional: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I see that BitwardenShared/Sourcery/Generated/AutoMockable.generated.swift has been moved to the new BitwardenSharedMocks. However, this one BitwardenShared/Sourcery/Generated hasn't, is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if there's any reason we need to explicitly include BitwardenShared/Sourcery/Generated? I think if there were any files in it, they would be picked up by the existing BitwardenShared path. We only need to let Xcode know that the BitwardenShared/Sourcery/Generated/AutoMockable.generated.swift file is optional, since it might not exist when the Xcode project is built by Xcodgen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the AutoMockable.generated.swift file doesn't exist, you run Xcodegen then I assume the Generated path is not created on the Xcode project. In that situation does Sourcery works as expected when building the target? Does it create the files under the Xcode project tree? or do you need to regenerate the project with Xcodegen?
That's the only caveat I can remember that may have happened and could need that line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the AutoMockable.generated.swift file doesn't exist, you run Xcodegen then I assume the Generated path is not created on the Xcode project.
Since the AutoMockable.generated.swift file is marked as optional, Xcode will include the full path to the file in the Xcode project. I double checked by removing the generated file, running bootstrap, and performing a build and noticed no issues.
The file shows up in Xcode even if it doesn't yet exist after bootstrapping (and without explicitly including the Generated directory):


🎟️ Tracking
PM-28540
📔 Objective
Adds a
BitwardenSharedMockstarget containing the mocks and fixtures used within BitwardenShared.This adds consistency with how we've used
BitwardenKitMocksandAuthenticatorBridgeKitMocksand will make it easier to implement Xcodegen templates (#2153).BitwardenSharedMockscontains a lot of fixtures and mocks forinternaltypes within BitwardenShared. Rather than make these typespublic, I've used testable imports of the newBitwardenSharedMockstarget in tests.⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes