Fix dev app and test identity isolation - #391
Conversation
Unsigned test hosts have unstable identities that can prompt for or alter the signed development app keychain ACL. Default test processes to process-local storage before suite setup.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughThe PR gives Debug builds a distinct ChangesNative build and test isolation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant WolfWaveApp
participant KeychainService
participant InMemoryKeychainBackend
WolfWaveApp->>KeychainService: report test-host execution
KeychainService->>InMemoryKeychainBackend: create the default test backend
InMemoryKeychainBackend->>InMemoryKeychainBackend: lock and access process-local credentials
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/native/WolfWaveTests/KeychainServiceTests.swift (1)
35-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the installed default backend.
KeychainServiceTests.init()saves the static backend inpreviousBackendbefore replacing it. The new test checks only the factory with an explicittrueargument. It can pass even ifKeychainService.backendinitializes withSystemKeychainBackend. Add#expect(previousBackend is InMemoryKeychainBackend)or an equivalent assertion before injection.Proposed test assertion
func testHostUsesInMemoryBackend() { `#expect`(WolfWaveApp.isRunningTests) + `#expect`(previousBackend is InMemoryKeychainBackend) `#expect`(KeychainService.makeDefaultBackend(isRunningTests: true) is InMemoryKeychainBackend) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/native/WolfWaveTests/KeychainServiceTests.swift` around lines 35 - 40, Update testHostUsesInMemoryBackend to assert the installed backend captured by KeychainServiceTests.init() in previousBackend is an InMemoryKeychainBackend before checking the factory result, ensuring the test validates the default static backend rather than only an explicit factory argument.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/native/WolfWaveTests/AppConstantsTests.swift`:
- Around line 25-30: Update the bundle-identifier assertion in the AppInfo test
to use the Debug-specific identifier when compiled under DEBUG and the existing
release identifier otherwise. Keep this assertion alongside the conditional
displayName checks so both AppConstants.AppInfo values match the active build
configuration.
In `@CLAUDE.md`:
- Around line 71-73: Update the hosted-test identity documentation at the
remaining TEST_HOST reference so it distinguishes Debug using WolfWave Dev.app
from Release using WolfWave.app, matching the Xcode scheme and build
configuration identities already documented. Synchronize any affected
user-facing or structural documentation and repeated values in the same change
without collapsing the two configurations.
---
Nitpick comments:
In `@apps/native/WolfWaveTests/KeychainServiceTests.swift`:
- Around line 35-40: Update testHostUsesInMemoryBackend to assert the installed
backend captured by KeychainServiceTests.init() in previousBackend is an
InMemoryKeychainBackend before checking the factory result, ensuring the test
validates the default static backend rather than only an explicit factory
argument.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7deb7e1b-bc75-4374-bb61-448eeec5ca70
📒 Files selected for processing (12)
CLAUDE.mdMakefileapps/native/WolfWave.xcodeproj/project.pbxprojapps/native/WolfWave.xcodeproj/xcshareddata/xcschemes/WolfWave.xcschemeapps/native/WolfWave/Config.xcconfig.exampleapps/native/WolfWave/Core/KeychainBackend.swiftapps/native/WolfWave/Core/KeychainService.swiftapps/native/WolfWave/WolfWaveApp.swiftapps/native/WolfWaveTests/AppConstantsTests.swiftapps/native/WolfWaveTests/InMemoryKeychainBackend.swiftapps/native/WolfWaveTests/KeychainServiceTests.swiftapps/native/WolfWaveTests/WidgetHTTPServiceTests.swift
💤 Files with no reviewable changes (1)
- apps/native/WolfWaveTests/InMemoryKeychainBackend.swift
# Conflicts: # apps/native/WolfWaveTests/WidgetHTTPServiceTests.swift
Summary
Verification
Note
Existing dev-only Keychain ACL state may require a one-time manual reset. The production Keychain namespace is unchanged.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation