Skip to content

RU-T51 Build fixes#238

Merged
ucswift merged 1 commit into
masterfrom
develop
May 10, 2026
Merged

RU-T51 Build fixes#238
ucswift merged 1 commit into
masterfrom
develop

Conversation

@ucswift
Copy link
Copy Markdown
Member

@ucswift ucswift commented May 10, 2026

Summary by CodeRabbit

  • Chores
    • Improved iOS Live Activity widget configuration and entitlement management.
    • Enhanced app signing setup for widget extensions with better environment-specific handling and fallback logic.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

📝 Walkthrough

Walkthrough

The PR configures iOS Live Activity entitlements and widget signing to be conditional and parameterizable. The plugin now accepts configuration options to control entitlement registration and team ID, app config conditionally enables this feature based on build environment, and the plugin generates widget-specific entitlements files with proper signing team resolution.

Changes

Live Activity Entitlements Configuration

Layer / File(s) Summary
Plugin Configuration Contract
plugins/withCheckInLiveActivity.js
withCheckInLiveActivity function accepts optional props parameter with teamId and enableLiveActivityEntitlement options; entitlements are written conditionally based on the flag.
Widget Entitlements File Generation
plugins/withCheckInLiveActivity.js
Plugin generates and writes CheckInTimerWidget.entitlements plist file to the widget extension directory during the iOS build phase.
Team ID Resolution Fallback Chain
plugins/withCheckInLiveActivity.js
Widget target DEVELOPMENT_TEAM resolution prioritizes plugin teamId prop, then falls back to host target's build setting, then to EXPO_APPLE_TEAM_ID environment variable.
Code Signing Entitlements Path
plugins/withCheckInLiveActivity.js
Widget target's CODE_SIGN_ENTITLEMENTS build setting is set to the newly generated widget entitlements file.
Conditional Plugin Registration
app.config.ts
Plugin is registered with teamId: QKQVAJMTCN and enableLiveActivityEntitlement conditionally set to true only when Env.APP_ENV is 'production' or 'internal'.
Ignore Pattern Update
.gitignore
Added ignore pattern for opencode.json file.

Possibly related PRs

  • Resgrid/Unit#237: Both PRs modify the same plugins/withCheckInLiveActivity.js logic for propagating DEVELOPMENT_TEAM to the widget target; this PR extends that with plugin props, conditional entitlements writing, and dedicated entitlements file handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A widget now signs with grace and care,
Its entitlements dance through the air,
Conditional flags in prod and internal bloom,
While team IDs find their rightful room,
Fallbacks nested like warren tunnels deep,
The config now secrets safely keeps! 🍃

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'RU-T51 Build fixes' is vague and generic, using non-descriptive terms that do not convey meaningful information about the specific changes. Consider a more descriptive title that reflects the actual changes, such as 'Configure Live Activity entitlements and widget signing' or 'Add Live Activity entitlement configuration and widget target setup'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
app.config.ts (1)

227-233: ⚡ Quick win

Consider sourcing teamId from env instead of hardcoding.

Apple Team IDs aren't secret (they're embedded in every signed build), so this isn't a security issue, but everything else in this file reads configuration from Env / env vars (Env.BUNDLE_ID, Env.PACKAGE, Env.EAS_PROJECT_ID, …). Hardcoding 'QKQVAJMTCN' here breaks that pattern and makes it harder to ship the project under a different Apple team without a code change. The plugin already falls back to process.env.EXPO_APPLE_TEAM_ID, so either route works.

♻️ Suggested change
     [
       './plugins/withCheckInLiveActivity.js',
       {
-        teamId: 'QKQVAJMTCN',
+        teamId: Env.APPLE_TEAM_ID ?? process.env.EXPO_APPLE_TEAM_ID,
         enableLiveActivityEntitlement: Env.APP_ENV === 'production' || Env.APP_ENV === 'internal',
       },
     ],

(add APPLE_TEAM_ID to env.js / env.ts alongside the other iOS settings).

🤖 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 `@app.config.ts` around lines 227 - 233, Replace the hardcoded Apple teamId
used in the withCheckInLiveActivity plugin entry with a value sourced from
environment configuration: change the teamId ('QKQVAJMTCN') to read from Env
(e.g., Env.APPLE_TEAM_ID or existing Env variable pattern) and fall back to
process.env.EXPO_APPLE_TEAM_ID if Env is not set; update env.js/env.ts to expose
APPLE_TEAM_ID alongside other iOS settings so the plugin entry (the array
containing './plugins/withCheckInLiveActivity.js' and the teamId property) uses
the Env-provided value instead of a literal string.
plugins/withCheckInLiveActivity.js (1)

462-483: 💤 Low value

Team-ID resolution chain is sound; minor DRY opportunity.

Priority props.teamId → host build setting → EXPO_APPLE_TEAM_ID is the right ordering, and the inline comment about EAS applying credentials after prebuild is exactly the gotcha that justifies the new prop.

Optional nit: lines 469–480 re-walk targetSection[hostTarget.uuid].buildConfigurationList and the first build configuration that you already resolved at lines 441–452 for MARKETING_VERSION / CURRENT_PROJECT_VERSION. You could read DEVELOPMENT_TEAM from the same firstHostConfig.buildSettings in that earlier block and drop this duplicated traversal.

♻️ Sketch: fold team-id lookup into the existing host-config read
     if (hostConfigList) {
       const firstHostConfigUuid = hostConfigList.buildConfigurations[0]?.value;
       if (firstHostConfigUuid) {
         const firstHostConfig = project.pbxXCBuildConfigurationSection()[firstHostConfigUuid];
         if (firstHostConfig?.buildSettings) {
           hostMarketingVersion = firstHostConfig.buildSettings.MARKETING_VERSION || null;
           hostCurrentProjectVersion = firstHostConfig.buildSettings.CURRENT_PROJECT_VERSION || null;
+          if (!teamId) {
+            hostDevelopmentTeamFromProject = firstHostConfig.buildSettings.DEVELOPMENT_TEAM || null;
+          }
         }
       }
     }
@@
-    let hostDevelopmentTeam = teamId || null;
-    if (!hostDevelopmentTeam) {
-      const hostBuildConfigListId = targetSection[hostTarget.uuid].buildConfigurationList;
-      const hostBuildConfigList = project.pbxXCConfigurationList()[hostBuildConfigListId];
-      if (hostBuildConfigList) {
-        const firstHostConfigUuid = hostBuildConfigList.buildConfigurations[0]?.value;
-        if (firstHostConfigUuid) {
-          const firstHostConfig = project.pbxXCBuildConfigurationSection()[firstHostConfigUuid];
-          if (firstHostConfig?.buildSettings) {
-            hostDevelopmentTeam = firstHostConfig.buildSettings.DEVELOPMENT_TEAM || null;
-          }
-        }
-      }
-    }
-    if (!hostDevelopmentTeam) {
-      hostDevelopmentTeam = process.env.EXPO_APPLE_TEAM_ID || null;
-    }
+    const hostDevelopmentTeam =
+      teamId || hostDevelopmentTeamFromProject || process.env.EXPO_APPLE_TEAM_ID || null;

(declare hostDevelopmentTeamFromProject next to hostMarketingVersion).

🤖 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 `@plugins/withCheckInLiveActivity.js` around lines 462 - 483, The host
DEVELOPMENT_TEAM lookup is duplicated; instead of re-traversing
targetSection[hostTarget.uuid].buildConfigurationList, read DEVELOPMENT_TEAM
from the same firstHostConfig.buildSettings you already obtained for
hostMarketingVersion/currentProjectVersion (the variable names to look for:
hostMarketingVersion, firstHostConfig, hostDevelopmentTeam), assign
hostDevelopmentTeam = firstHostConfig.buildSettings.DEVELOPMENT_TEAM || null
there, and then fall back to process.env.EXPO_APPLE_TEAM_ID only if
hostDevelopmentTeam is still falsy; remove the later block that re-reads
project.pbxXCConfigurationList()/pbxXCBuildConfigurationSection() to avoid the
duplicate traversal.
🤖 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.

Nitpick comments:
In `@app.config.ts`:
- Around line 227-233: Replace the hardcoded Apple teamId used in the
withCheckInLiveActivity plugin entry with a value sourced from environment
configuration: change the teamId ('QKQVAJMTCN') to read from Env (e.g.,
Env.APPLE_TEAM_ID or existing Env variable pattern) and fall back to
process.env.EXPO_APPLE_TEAM_ID if Env is not set; update env.js/env.ts to expose
APPLE_TEAM_ID alongside other iOS settings so the plugin entry (the array
containing './plugins/withCheckInLiveActivity.js' and the teamId property) uses
the Env-provided value instead of a literal string.

In `@plugins/withCheckInLiveActivity.js`:
- Around line 462-483: The host DEVELOPMENT_TEAM lookup is duplicated; instead
of re-traversing targetSection[hostTarget.uuid].buildConfigurationList, read
DEVELOPMENT_TEAM from the same firstHostConfig.buildSettings you already
obtained for hostMarketingVersion/currentProjectVersion (the variable names to
look for: hostMarketingVersion, firstHostConfig, hostDevelopmentTeam), assign
hostDevelopmentTeam = firstHostConfig.buildSettings.DEVELOPMENT_TEAM || null
there, and then fall back to process.env.EXPO_APPLE_TEAM_ID only if
hostDevelopmentTeam is still falsy; remove the later block that re-reads
project.pbxXCConfigurationList()/pbxXCBuildConfigurationSection() to avoid the
duplicate traversal.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: feceef2c-d15b-4dbc-9b1d-efeae87b1ffe

📥 Commits

Reviewing files that changed from the base of the PR and between e97104c and e57fa7e.

📒 Files selected for processing (3)
  • .gitignore
  • app.config.ts
  • plugins/withCheckInLiveActivity.js

@ucswift
Copy link
Copy Markdown
Member Author

ucswift commented May 10, 2026

Approve

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

This PR is approved.

@ucswift ucswift merged commit 5e89b6e into master May 10, 2026
19 of 20 checks passed
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