Skip to content

feat(build): separate dev app identity from releases#15

Merged
BlackHole1 merged 1 commit into
mainfrom
improve-dev
Jun 12, 2026
Merged

feat(build): separate dev app identity from releases#15
BlackHole1 merged 1 commit into
mainfrom
improve-dev

Conversation

@BlackHole1

Copy link
Copy Markdown
Member

Debug builds need their own bundle identity so local development does not collide with the installed release app in TCC, defaults, or app support storage. Release builds keep the existing production identity and log path to avoid disrupting published installs.

Debug builds need their own bundle identity so local development does
not collide with the installed release app in TCC, defaults, or app
support storage. Release builds keep the existing production identity
and log path to avoid disrupting published installs.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Summary by CodeRabbit

Release Notes

  • Infrastructure

    • Debug builds now create a separate "LockIME Dev" application that runs independently from release builds, with isolated settings and data storage.
  • Documentation

    • Updated release and testing documentation to reflect separate debug and release application configurations.
  • Tests

    • Added test coverage for application isolation between debug and release configurations.

Walkthrough

This PR introduces a configurable app variant system that generates separate LockIME Dev.app (Debug) and LockIME.app (Release) bundles with distinct bundle identifiers. The build configuration in project.yml and Makefile establishes the identity for each variant. The app bundle's Info.plist is updated to use dynamic substitution for display names. At runtime, LogStore selects storage directories based on the running app's bundle identifier to isolate dev and release data. The update-lab.sh test script is refactored to discover and use the correct app name and bundle ID from the app being tested, and documentation in RELEASING.md and update-lab README explains the separation rationale and behavior.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required format <type>(<scope>): <subject> with 'feat' as type, 'build' as scope, and a clear subject describing the main change of separating dev app identity from releases.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the rationale for separating debug builds into their own bundle identity to prevent collisions with release installs.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch improve-dev

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

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/update-lab/update-lab.sh (1)

65-70: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Stop command doesn't adapt to the variant being tested.

The stop command early-exits before the plist-derived values are set (lines 78-80), so it uses the default EXECUTABLE_NAME ("LockIME Dev") and BUNDLE_ID ("com.oomol.LockIME.dev") from lines 21-23. If you test a Release build with CONFIG=Release, then run make update-test-stop, the stop command will:

  1. Try to kill "LockIME Dev" instead of "LockIME" (no-op, wrong process)
  2. Clear defaults for "com.oomol.LockIME.dev" instead of "com.oomol.LockIME" (wrong bundle)
  3. Leave the Release app running with its defaults intact

Consider checking for $LAB_DIR/run/*.app and deriving values from the run copy's Info.plist when it exists, falling back to defaults only when no run copy is present.

🔧 Suggested fix to derive from run copy
 if [[ "$SCENARIO" == "stop" ]]; then
+    # Derive from run copy if it exists, otherwise use defaults
+    if compgen -G "$LAB_DIR/run/*.app" > /dev/null; then
+        local run_copy="$(echo "$LAB_DIR/run"/*.app | head -n1)"
+        APP_NAME="$(basename "$run_copy" .app)"
+        BUNDLE_ID="$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$run_copy/Contents/Info.plist" 2>/dev/null || echo "$BUNDLE_ID")"
+        EXECUTABLE_NAME="$(/usr/libexec/PlistBuddy -c "Print :CFBundleExecutable" "$run_copy/Contents/Info.plist" 2>/dev/null || echo "$EXECUTABLE_NAME")"
+    fi
     stop_lab
     rm -rf "$LAB_DIR/run" "$LAB_DIR/payload" "$SERVE_DIR"
     echo "[update-lab] stopped."
     exit 0
 fi
🤖 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 `@scripts/update-lab/update-lab.sh` around lines 65 - 70, The stop path
currently exits before plist-derived values are set, so update the stop logic
(stop_lab and the early-exit block in the SCENARIO == "stop" branch) to first
check for a run copy under $LAB_DIR/run/*.app; if a run bundle exists, read its
Info.plist to override EXECUTABLE_NAME and BUNDLE_ID (falling back to the
existing defaults only when no run copy is present), then proceed to kill the
correct process and clear defaults; ensure the code that reads
CFBundleExecutable/CFBundleIdentifier from the run copy’s Info.plist is used by
stop_lab and the rm/cleanup steps so Release builds are handled correctly.
🤖 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.

Outside diff comments:
In `@scripts/update-lab/update-lab.sh`:
- Around line 65-70: The stop path currently exits before plist-derived values
are set, so update the stop logic (stop_lab and the early-exit block in the
SCENARIO == "stop" branch) to first check for a run copy under
$LAB_DIR/run/*.app; if a run bundle exists, read its Info.plist to override
EXECUTABLE_NAME and BUNDLE_ID (falling back to the existing defaults only when
no run copy is present), then proceed to kill the correct process and clear
defaults; ensure the code that reads CFBundleExecutable/CFBundleIdentifier from
the run copy’s Info.plist is used by stop_lab and the rm/cleanup steps so
Release builds are handled correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ae591d2c-606e-4ad2-a761-505aab4109da

📥 Commits

Reviewing files that changed from the base of the PR and between 806ff28 and 84edf23.

📒 Files selected for processing (8)
  • Makefile
  • Sources/LockIME/Info.plist
  • Sources/LockIMEKit/Logging/LogStore.swift
  • Tests/LockIMEKitTests/LogStoreTests.swift
  • docs/RELEASING.md
  • project.yml
  • scripts/update-lab/README.md
  • scripts/update-lab/update-lab.sh

@BlackHole1 BlackHole1 merged commit 5cfed2b into main Jun 12, 2026
3 checks passed
@BlackHole1 BlackHole1 deleted the improve-dev branch June 12, 2026 16:49
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