Skip to content

Fix #173 followup: address CodeRabbit review items#175

Merged
pablopunk merged 1 commit into
mainfrom
fix/173-review-followup
Jun 20, 2026
Merged

Fix #173 followup: address CodeRabbit review items#175
pablopunk merged 1 commit into
mainfrom
fix/173-review-followup

Conversation

@pablopunk

@pablopunk pablopunk commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Addresses review comments from #174 merge:

  • BlueprintIdentifier mismatch: scheme referenced stale target ID D76A70D7 instead of actual 4F0E6636
  • Deployment target: lowered from 14.0 → 13.0 to match app target
  • Foundation.framework path: replaced hardcoded SDK version path with SDKROOT-relative
  • Test hardening: use DEFAULT_IGNORED_APP_BUNDLE_ID constant instead of hardcoded bundle ID

All 49 tests pass after changes.

Summary by CodeRabbit

  • Chores

    • Enhanced CI/CD workflow security with explicit permissions and pinned action versions.
    • Lowered minimum macOS deployment target, extending app compatibility to older systems.
  • Tests

    • Improved test suite assertions for more robust validation coverage.

@codesandbox

codesandbox Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
swiftshift-app Ready Ready Preview, Comment Jun 20, 2026 9:26pm

@coderabbitai

coderabbitai Bot commented Jun 20, 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

Run ID: 62ff3d6a-cc11-4a46-8ef3-8209e7570852

📥 Commits

Reviewing files that changed from the base of the PR and between 8f9d607 and ebf0a45.

📒 Files selected for processing (5)
  • .github/workflows/build.yml
  • .github/workflows/www.yml
  • Swift Shift.xcodeproj/project.pbxproj
  • Swift Shift.xcodeproj/xcshareddata/xcschemes/Swift Shift.xcscheme
  • SwiftShiftTests/PreferencesManagerTests.swift
✅ Files skipped from review due to trivial changes (1)
  • Swift Shift.xcodeproj/project.pbxproj
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/www.yml
  • .github/workflows/build.yml
  • SwiftShiftTests/PreferencesManagerTests.swift

Walkthrough

The Xcode project file is updated to fix the Foundation.framework file reference to use sourceTree = SDKROOT instead of a hardcoded SDK path, and the SwiftShiftTests deployment target is lowered from 14.0 to 13.0 for both Release and Debug configurations. The Xcode scheme's BlueprintIdentifier for the SwiftShiftTests.xctest target is updated in both BuildActionEntries and TestAction. A test assertion in testIsAppIgnored_checksBothLists is generalized to check any entry in DEFAULT_IGNORED_APP_BUNDLE_ID rather than a single hardcoded bundle ID. Both GitHub Actions workflows gain SHA-pinned action references, persist-credentials: false on checkout, and contents: read permissions. The build workflow is split into separate build and test jobs.

Possibly related PRs

  • pablopunk/SwiftShift#112: Modifies .github/workflows/build.yml for CI make build and xcodebuild invocations with code signing disabled, directly overlapping with this PR's CI job changes.
  • pablopunk/SwiftShift#174: Sets up the SwiftShiftTests XCTest infrastructure including PreferencesManagerTests.swift and the Xcode scheme/workflow configuration that this PR's assertion update and scheme fixes build upon.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.29% 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 references a followup to PR #173 addressing CodeRabbit review items, which directly matches the PR's objectives of fixing four specific issues identified in code review.
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.


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 and usage tips.

… target, Foundation path, hardcoded test value

- Fix BlueprintIdentifier in scheme to match actual test target ID (4F0E6636...)
- Lower test target MACOSX_DEPLOYMENT_TARGET 14.0 → 13.0 to match app
- Replace hardcoded SDK path for Foundation.framework with SDKROOT-relative
- Use DEFAULT_IGNORED_APP_BUNDLE_ID constant instead of hardcoded bundle ID in test

@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: 1

🧹 Nitpick comments (3)
Swift Shift.xcodeproj/project.pbxproj (2)

181-183: ⚡ Quick win

Fix SwiftShiftTests group contents to include test files.

The SwiftShiftTests group currently contains app source manager/constants files, while actual test files are attached elsewhere. Repoint this group to KeyboardShortcutTests.swift, PreferencesManagerTests.swift, and WindowManagerTests.swift for consistent project structure.

Also applies to: 235-243

🤖 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 `@Swift` Shift.xcodeproj/project.pbxproj around lines 181 - 183, The
SwiftShiftTests group in the Xcode project file is incorrectly configured to
include app source manager and constants files instead of test files. Update the
group definition to properly reference the three test files:
KeyboardShortcutTests.swift, PreferencesManagerTests.swift, and
WindowManagerTests.swift by ensuring these file references are correctly placed
within the SwiftShiftTests group children array. Remove any non-test files from
this group and apply the same correction to all other occurrences of the
SwiftShiftTests group configuration throughout the project file.

76-86: ⚡ Quick win

Consolidate duplicate PBXFileReference entries and product entries.

There are duplicate logical references (including two SwiftShiftTests.xctest file refs and both listed under Products). This increases pbxproj churn and merge-conflict risk. Keep a single canonical file reference per logical file and remove stale duplicates from groups/products.

Also applies to: 191-193

🤖 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 `@Swift` Shift.xcodeproj/project.pbxproj around lines 76 - 86, Remove the
duplicate PBXFileReference entries in the project file. Specifically, eliminate
one of the two SwiftShiftTests.xctest file references (keeping either
2F7068A35E872B916122F622 or B4FAEC4EF8BA9AFD9FABBA1F), remove one of the
duplicate WindowManager.swift references (keeping either
3C0E83B215533AA53B9BD58A or C9075C2AB4A5BD52358038BF), and apply the same
consolidation approach to the duplicate entries noted at the referenced lines.
Maintain only a single canonical PBXFileReference per logical file and ensure
all product and group references point to the same canonical entry to minimize
project file churn and reduce merge-conflict risk.
SwiftShiftTests/PreferencesManagerTests.swift (1)

51-55: ⚡ Quick win

Replace hardcoded system bundle IDs with the system constant.

At Line 54 and related locations, the string "com.apple.notificationcenterui" is repeated directly in tests. Using SYSTEM_IGNORED_APP_BUNDLE_ID keeps tests aligned with the production source of truth and avoids drift when defaults change.

Also applies to: 66-67, 118-125, 136-145, 147-155

🤖 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 `@SwiftShiftTests/PreferencesManagerTests.swift` around lines 51 - 55, Replace
all hardcoded system bundle ID strings like "com.apple.notificationcenterui"
with the SYSTEM_IGNORED_APP_BUNDLE_ID constant throughout the test file. This
includes the testGetIgnoredApps_includesSystemApps function and all other test
methods that reference system bundle IDs (at the locations mentioned: 66-67,
118-125, 136-145, 147-155). Using the constant instead of hardcoded strings
ensures the tests remain synchronized with the production source of truth and
prevents test failures if the constant values change.
🤖 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 `@SwiftShiftTests/PreferencesManagerTests.swift`:
- Around line 194-208: The test testMigration_addsDefaultAppsWhenMissing does
not actually verify that default apps were merged into the ignored apps list
during migration. Currently it only checks that the custom app is retained and
the migration flag is set, but a regression in the default app merging logic
would not be caught. Add assertions after the getUserIgnoredApps() call to
verify that the returned apps list contains the expected default apps in
addition to the custom app that was set. This ensures the test validates the
core behavior described by its name.

---

Nitpick comments:
In `@Swift` Shift.xcodeproj/project.pbxproj:
- Around line 181-183: The SwiftShiftTests group in the Xcode project file is
incorrectly configured to include app source manager and constants files instead
of test files. Update the group definition to properly reference the three test
files: KeyboardShortcutTests.swift, PreferencesManagerTests.swift, and
WindowManagerTests.swift by ensuring these file references are correctly placed
within the SwiftShiftTests group children array. Remove any non-test files from
this group and apply the same correction to all other occurrences of the
SwiftShiftTests group configuration throughout the project file.
- Around line 76-86: Remove the duplicate PBXFileReference entries in the
project file. Specifically, eliminate one of the two SwiftShiftTests.xctest file
references (keeping either 2F7068A35E872B916122F622 or
B4FAEC4EF8BA9AFD9FABBA1F), remove one of the duplicate WindowManager.swift
references (keeping either 3C0E83B215533AA53B9BD58A or
C9075C2AB4A5BD52358038BF), and apply the same consolidation approach to the
duplicate entries noted at the referenced lines. Maintain only a single
canonical PBXFileReference per logical file and ensure all product and group
references point to the same canonical entry to minimize project file churn and
reduce merge-conflict risk.

In `@SwiftShiftTests/PreferencesManagerTests.swift`:
- Around line 51-55: Replace all hardcoded system bundle ID strings like
"com.apple.notificationcenterui" with the SYSTEM_IGNORED_APP_BUNDLE_ID constant
throughout the test file. This includes the
testGetIgnoredApps_includesSystemApps function and all other test methods that
reference system bundle IDs (at the locations mentioned: 66-67, 118-125,
136-145, 147-155). Using the constant instead of hardcoded strings ensures the
tests remain synchronized with the production source of truth and prevents test
failures if the constant values change.
🪄 Autofix (Beta)

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

Run ID: af3e0bd0-ad7f-4b16-b04e-b88b705908fe

📥 Commits

Reviewing files that changed from the base of the PR and between c33fb5a and 8f9d607.

📒 Files selected for processing (8)
  • .github/workflows/build.yml
  • .github/workflows/www.yml
  • Makefile
  • Swift Shift.xcodeproj/project.pbxproj
  • Swift Shift.xcodeproj/xcshareddata/xcschemes/Swift Shift.xcscheme
  • SwiftShiftTests/KeyboardShortcutTests.swift
  • SwiftShiftTests/PreferencesManagerTests.swift
  • SwiftShiftTests/WindowManagerTests.swift

@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

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🧹 Nitpick comments (3)
Swift Shift.xcodeproj/project.pbxproj (2)

181-183: ⚡ Quick win

Fix SwiftShiftTests group contents to include test files.

The SwiftShiftTests group currently contains app source manager/constants files, while actual test files are attached elsewhere. Repoint this group to KeyboardShortcutTests.swift, PreferencesManagerTests.swift, and WindowManagerTests.swift for consistent project structure.

Also applies to: 235-243

🤖 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 `@Swift` Shift.xcodeproj/project.pbxproj around lines 181 - 183, The
SwiftShiftTests group in the Xcode project file is incorrectly configured to
include app source manager and constants files instead of test files. Update the
group definition to properly reference the three test files:
KeyboardShortcutTests.swift, PreferencesManagerTests.swift, and
WindowManagerTests.swift by ensuring these file references are correctly placed
within the SwiftShiftTests group children array. Remove any non-test files from
this group and apply the same correction to all other occurrences of the
SwiftShiftTests group configuration throughout the project file.

76-86: ⚡ Quick win

Consolidate duplicate PBXFileReference entries and product entries.

There are duplicate logical references (including two SwiftShiftTests.xctest file refs and both listed under Products). This increases pbxproj churn and merge-conflict risk. Keep a single canonical file reference per logical file and remove stale duplicates from groups/products.

Also applies to: 191-193

🤖 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 `@Swift` Shift.xcodeproj/project.pbxproj around lines 76 - 86, Remove the
duplicate PBXFileReference entries in the project file. Specifically, eliminate
one of the two SwiftShiftTests.xctest file references (keeping either
2F7068A35E872B916122F622 or B4FAEC4EF8BA9AFD9FABBA1F), remove one of the
duplicate WindowManager.swift references (keeping either
3C0E83B215533AA53B9BD58A or C9075C2AB4A5BD52358038BF), and apply the same
consolidation approach to the duplicate entries noted at the referenced lines.
Maintain only a single canonical PBXFileReference per logical file and ensure
all product and group references point to the same canonical entry to minimize
project file churn and reduce merge-conflict risk.
SwiftShiftTests/PreferencesManagerTests.swift (1)

51-55: ⚡ Quick win

Replace hardcoded system bundle IDs with the system constant.

At Line 54 and related locations, the string "com.apple.notificationcenterui" is repeated directly in tests. Using SYSTEM_IGNORED_APP_BUNDLE_ID keeps tests aligned with the production source of truth and avoids drift when defaults change.

Also applies to: 66-67, 118-125, 136-145, 147-155

🤖 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 `@SwiftShiftTests/PreferencesManagerTests.swift` around lines 51 - 55, Replace
all hardcoded system bundle ID strings like "com.apple.notificationcenterui"
with the SYSTEM_IGNORED_APP_BUNDLE_ID constant throughout the test file. This
includes the testGetIgnoredApps_includesSystemApps function and all other test
methods that reference system bundle IDs (at the locations mentioned: 66-67,
118-125, 136-145, 147-155). Using the constant instead of hardcoded strings
ensures the tests remain synchronized with the production source of truth and
prevents test failures if the constant values change.
🤖 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 `@SwiftShiftTests/PreferencesManagerTests.swift`:
- Around line 194-208: The test testMigration_addsDefaultAppsWhenMissing does
not actually verify that default apps were merged into the ignored apps list
during migration. Currently it only checks that the custom app is retained and
the migration flag is set, but a regression in the default app merging logic
would not be caught. Add assertions after the getUserIgnoredApps() call to
verify that the returned apps list contains the expected default apps in
addition to the custom app that was set. This ensures the test validates the
core behavior described by its name.

---

Nitpick comments:
In `@Swift` Shift.xcodeproj/project.pbxproj:
- Around line 181-183: The SwiftShiftTests group in the Xcode project file is
incorrectly configured to include app source manager and constants files instead
of test files. Update the group definition to properly reference the three test
files: KeyboardShortcutTests.swift, PreferencesManagerTests.swift, and
WindowManagerTests.swift by ensuring these file references are correctly placed
within the SwiftShiftTests group children array. Remove any non-test files from
this group and apply the same correction to all other occurrences of the
SwiftShiftTests group configuration throughout the project file.
- Around line 76-86: Remove the duplicate PBXFileReference entries in the
project file. Specifically, eliminate one of the two SwiftShiftTests.xctest file
references (keeping either 2F7068A35E872B916122F622 or
B4FAEC4EF8BA9AFD9FABBA1F), remove one of the duplicate WindowManager.swift
references (keeping either 3C0E83B215533AA53B9BD58A or
C9075C2AB4A5BD52358038BF), and apply the same consolidation approach to the
duplicate entries noted at the referenced lines. Maintain only a single
canonical PBXFileReference per logical file and ensure all product and group
references point to the same canonical entry to minimize project file churn and
reduce merge-conflict risk.

In `@SwiftShiftTests/PreferencesManagerTests.swift`:
- Around line 51-55: Replace all hardcoded system bundle ID strings like
"com.apple.notificationcenterui" with the SYSTEM_IGNORED_APP_BUNDLE_ID constant
throughout the test file. This includes the
testGetIgnoredApps_includesSystemApps function and all other test methods that
reference system bundle IDs (at the locations mentioned: 66-67, 118-125,
136-145, 147-155). Using the constant instead of hardcoded strings ensures the
tests remain synchronized with the production source of truth and prevents test
failures if the constant values change.
🪄 Autofix (Beta)

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

Run ID: af3e0bd0-ad7f-4b16-b04e-b88b705908fe

📥 Commits

Reviewing files that changed from the base of the PR and between c33fb5a and 8f9d607.

📒 Files selected for processing (8)
  • .github/workflows/build.yml
  • .github/workflows/www.yml
  • Makefile
  • Swift Shift.xcodeproj/project.pbxproj
  • Swift Shift.xcodeproj/xcshareddata/xcschemes/Swift Shift.xcscheme
  • SwiftShiftTests/KeyboardShortcutTests.swift
  • SwiftShiftTests/PreferencesManagerTests.swift
  • SwiftShiftTests/WindowManagerTests.swift
🛑 Comments failed to post (1)
SwiftShiftTests/PreferencesManagerTests.swift (1)

194-208: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Migration test does not verify the behavior named by the test.

At Line 194, testMigration_addsDefaultAppsWhenMissing only checks custom-app retention and migration flag state; it never checks that defaults were actually merged. A regression in default-app merging would still pass this test.

Suggested assertion tightening
     let apps = PreferencesManager.getUserIgnoredApps()
     XCTAssertTrue(apps.contains("com.example.only"))
+    for bundleId in DEFAULT_IGNORED_APP_BUNDLE_ID {
+        XCTAssertTrue(apps.contains(bundleId), "Missing migrated default bundle ID: \(bundleId)")
+    }
 
     // After migration, the migration flag should be set
     XCTAssertTrue(UserDefaults.standard.bool(forKey: PreferenceKey.didMigrateDefaultIgnoredApps.rawValue))
🤖 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 `@SwiftShiftTests/PreferencesManagerTests.swift` around lines 194 - 208, The
test testMigration_addsDefaultAppsWhenMissing does not actually verify that
default apps were merged into the ignored apps list during migration. Currently
it only checks that the custom app is retained and the migration flag is set,
but a regression in the default app merging logic would not be caught. Add
assertions after the getUserIgnoredApps() call to verify that the returned apps
list contains the expected default apps in addition to the custom app that was
set. This ensures the test validates the core behavior described by its name.

@pablopunk pablopunk merged commit ae3f32d into main Jun 20, 2026
8 checks passed
@pablopunk pablopunk deleted the fix/173-review-followup branch June 20, 2026 21:31
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