Skip to content

Fix dev app and test identity isolation - #391

Merged
nathanialhenniges merged 7 commits into
mainfrom
codex/fix-dev-test-identity
Aug 6, 2026
Merged

Fix dev app and test identity isolation#391
nathanialhenniges merged 7 commits into
mainfrom
codex/fix-dev-test-identity

Conversation

@nathanialhenniges

@nathanialhenniges nathanialhenniges commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

  • keep Debug scheme, display name, bundle ID, and product distinct from Release
  • isolate unsigned test products from the signed Debug app
  • default test hosts to process-local Keychain storage
  • move Widget HTTP test ports below the macOS ephemeral range

Verification

  • make build
  • make test: 2810 tests, 0 failures
  • make lint-crash-safety
  • make lint-headers

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

    • Debug builds now display as “WolfWave Dev,” clearly distinguishing them from Release builds.
    • Tests use an isolated, process-local credential store instead of the system Keychain.
  • Bug Fixes

    • Improved test reliability by standardizing build data locations and integration-test ports.
  • Documentation

    • Updated build, branding, testing, and configuration guidance for Debug and Release environments.

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.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c3c7b124-a777-430f-908e-85e1d946f295

📥 Commits

Reviewing files that changed from the base of the PR and between 486a741 and 94b075d.

📒 Files selected for processing (5)
  • CLAUDE.md
  • Makefile
  • apps/native/WolfWaveTests/AppConstantsTests.swift
  • apps/native/WolfWaveTests/KeychainServiceTests.swift
  • apps/native/WolfWaveTests/WidgetHTTPServiceTests.swift
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/native/WolfWaveTests/AppConstantsTests.swift
  • apps/native/WolfWaveTests/WidgetHTTPServiceTests.swift
  • Makefile
  • apps/native/WolfWaveTests/KeychainServiceTests.swift

Walkthrough

The PR gives Debug builds a distinct WolfWave Dev identity, isolates test DerivedData, routes test keychain operations to process-local storage, and updates widget integration-test ports.

Changes

Native build and test isolation

Layer / File(s) Summary
App identity and test build isolation
CLAUDE.md, Makefile, apps/native/WolfWave.xcodeproj/*, apps/native/WolfWave/Config.xcconfig.example, apps/native/WolfWaveTests/AppConstantsTests.swift
Debug builds use WolfWave Dev. Test targets use a shared DerivedData path. Guidance and tests reflect the separate Debug and Release identities.
Test keychain backend routing
CLAUDE.md, apps/native/WolfWave/Core/KeychainBackend.swift, apps/native/WolfWave/Core/KeychainService.swift, apps/native/WolfWave/WolfWaveApp.swift, apps/native/WolfWaveTests/KeychainServiceTests.swift
Test hosts use a thread-safe process-local InMemoryKeychainBackend. Other execution uses SystemKeychainBackend. Tests verify the selection.
Widget integration-test port updates
apps/native/WolfWaveTests/WidgetHTTPServiceTests.swift
Widget HTTP tests now use ports in the 389xx range.

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
Loading

Possibly related PRs

Poem

A rabbit hops through tests so bright,
No real Keychain comes in sight.
Dev apps wear a newer name,
Ports shift lanes to keep tests tame.
Locked-up memory guards each byte—
Hop, WolfWave, and build it right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes to development app identity and test identity isolation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-dev-test-identity

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
apps/native/WolfWaveTests/KeychainServiceTests.swift (1)

35-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the installed default backend.

KeychainServiceTests.init() saves the static backend in previousBackend before replacing it. The new test checks only the factory with an explicit true argument. It can pass even if KeychainService.backend initializes with SystemKeychainBackend. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ee2fcc and 486a741.

📒 Files selected for processing (12)
  • CLAUDE.md
  • Makefile
  • apps/native/WolfWave.xcodeproj/project.pbxproj
  • apps/native/WolfWave.xcodeproj/xcshareddata/xcschemes/WolfWave.xcscheme
  • apps/native/WolfWave/Config.xcconfig.example
  • apps/native/WolfWave/Core/KeychainBackend.swift
  • apps/native/WolfWave/Core/KeychainService.swift
  • apps/native/WolfWave/WolfWaveApp.swift
  • apps/native/WolfWaveTests/AppConstantsTests.swift
  • apps/native/WolfWaveTests/InMemoryKeychainBackend.swift
  • apps/native/WolfWaveTests/KeychainServiceTests.swift
  • apps/native/WolfWaveTests/WidgetHTTPServiceTests.swift
💤 Files with no reviewable changes (1)
  • apps/native/WolfWaveTests/InMemoryKeychainBackend.swift

Comment thread apps/native/WolfWaveTests/AppConstantsTests.swift
Comment thread CLAUDE.md
# Conflicts:
#	apps/native/WolfWaveTests/WidgetHTTPServiceTests.swift
@nathanialhenniges
nathanialhenniges merged commit e74e621 into main Aug 6, 2026
8 checks passed
@nathanialhenniges
nathanialhenniges deleted the codex/fix-dev-test-identity branch August 6, 2026 19:46
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.

1 participant