Conversation
📝 WalkthroughWalkthroughThe PR computes and exports an Changes
Sequence Diagram(s)sequenceDiagram
participant CI/Env
participant app.config.ts
participant Env (build-time)
participant withLiveActivities.js
participant XcodeProj
participant Entitlements
CI/Env->>Env (build-time): provide BUNDLE_ID, APP_ENV, IOS_APPLE_TEAM_ID, etc.
Env (build-time)->>app.config.ts: export Env.IOS_APP_GROUP, IOS_APPLE_TEAM_ID
app.config.ts->>withLiveActivities.js: invoke plugin with { appGroupId: Env.IOS_APP_GROUP }
withLiveActivities.js->>withLiveActivities.js: resolve appGroupId (param or group.<bundleId>)
withLiveActivities.js->>XcodeProj: read main target build settings
XcodeProj->>withLiveActivities.js: return DEVELOPMENT_TEAM, build settings
withLiveActivities.js->>XcodeProj: apply widget target build settings (team, code sign style, mirrored settings)
withLiveActivities.js->>Entitlements: write widget/app entitlements using resolved appGroupId
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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.
🧹 Nitpick comments (1)
env.js (1)
108-109: Add Team ID trimming and format validation to catch environment typos early.A whitespace-padded or malformed Team ID is truthy and will pass through to Expo's
ios.appleTeamId, causing silent failure at signing time. Trim and validate the format here so Zod catches misconfigurations immediately during build setup.The expected format is a 10-character uppercase alphanumeric string (e.g.,
ABC1D2E334), which is the standard Apple Developer Team ID format. The proposed changes:
- Extract Team ID into a
getIosAppleTeamId()helper that trims whitespace before using it- Add
.min(1)toIOS_APP_GROUPvalidation (also mentioned in the existing comment at line 73)- Validate
IOS_APPLE_TEAM_IDwith a regex pattern matching the 10-character Team ID formatProposed validation tightening
const getIosAppGroup = () => { return APP_ENV === 'production' || APP_ENV === 'internal' ? IOS_APP_GROUP_SHARED : `group.${withEnvSuffix(BUNDLE_ID)}`; }; +const getIosAppleTeamId = () => { + return [process.env.IOS_APPLE_TEAM_ID, process.env.EXPO_APPLE_TEAM_ID, process.env.APPLE_TEAM_ID] + .map((value) => value?.trim()) + .find(Boolean); +}; + const buildTime = z.object({ EXPO_ACCOUNT_OWNER: z.string(), EAS_PROJECT_ID: z.string(), - IOS_APP_GROUP: z.string(), - IOS_APPLE_TEAM_ID: z.string().optional(), + IOS_APP_GROUP: z.string().min(1), + IOS_APPLE_TEAM_ID: z + .string() + .regex(/^[A-Z0-9]{10}$/, 'IOS_APPLE_TEAM_ID must be a 10-character Apple Developer Team ID') + .optional(), // ADD YOUR BUILD TIME ENV VARS HERE }); @@ const _buildTimeEnv = { EXPO_ACCOUNT_OWNER, EAS_PROJECT_ID, IOS_APP_GROUP: getIosAppGroup(), - IOS_APPLE_TEAM_ID: process.env.IOS_APPLE_TEAM_ID || process.env.EXPO_APPLE_TEAM_ID || process.env.APPLE_TEAM_ID, + IOS_APPLE_TEAM_ID: getIosAppleTeamId(), // ADD YOUR ENV VARS HERE TOO };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@env.js` around lines 108 - 109, Add stricter Zod validation and trimming for the iOS Team ID and enforce non-empty app group: update the IOS_APP_GROUP schema to include .min(1) and replace the current IOS_APPLE_TEAM_ID z.string().optional() with a validation that trims whitespace and enforces a 10-character uppercase alphanumeric pattern; implement a small helper getIosAppleTeamId() that reads the raw env value, runs .trim(), returns undefined for empty strings, and validates against the regex /^[A-Z0-9]{10}$/ before exposing it to expo config so malformed or whitespace-padded Team IDs are caught early.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@env.js`:
- Around line 108-109: Add stricter Zod validation and trimming for the iOS Team
ID and enforce non-empty app group: update the IOS_APP_GROUP schema to include
.min(1) and replace the current IOS_APPLE_TEAM_ID z.string().optional() with a
validation that trims whitespace and enforces a 10-character uppercase
alphanumeric pattern; implement a small helper getIosAppleTeamId() that reads
the raw env value, runs .trim(), returns undefined for empty strings, and
validates against the regex /^[A-Z0-9]{10}$/ before exposing it to expo config
so malformed or whitespace-padded Team IDs are caught early.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e8aa797d-e385-41df-a9f2-5df0c9f0561d
📒 Files selected for processing (4)
README.mdapp.config.tsenv.jsplugins/withLiveActivities.js
✅ Files skipped from review due to trivial changes (1)
- README.md
🚧 Files skipped from review as they are similar to previous changes (1)
- plugins/withLiveActivities.js
|
Approve |
Summary by CodeRabbit
Chores
Documentation