Skip to content

RR-T43 Fixing build issue#113

Merged
ucswift merged 2 commits intomasterfrom
develop
Apr 19, 2026
Merged

RR-T43 Fixing build issue#113
ucswift merged 2 commits intomasterfrom
develop

Conversation

@ucswift
Copy link
Copy Markdown
Member

@ucswift ucswift commented Apr 18, 2026

Summary by CodeRabbit

  • Chores

    • Live Activities integration now accepts and applies a configurable App Group identifier and propagates signing/team and build settings to the widget target.
    • Build-time environment now includes an iOS App Group value and an optional Apple Team ID for iOS builds.
  • Documentation

    • CI guidance added to ensure Apple Team ID is provided for correct widget signing.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

📝 Walkthrough

Walkthrough

The PR computes and exports an IOS_APP_GROUP and optional IOS_APPLE_TEAM_ID from build-time env, passes IOS_APP_GROUP into the Live Activities Expo plugin via app.config.ts, and updates the plugin to accept/use that app-group and to propagate signing/team values into the widget target entitlements and Xcode settings.

Changes

Cohort / File(s) Summary
App config
app.config.ts
Passes Live Activities plugin as a tuple with options: ['./plugins/withLiveActivities.js', { appGroupId: Env.IOS_APP_GROUP }] and conditionally sets ios.appleTeamId from Env.IOS_APPLE_TEAM_ID.
Environment setup
env.js
Adds IOS_APP_GROUP computation via getIosAppGroup(), extends build-time Zod schema to require IOS_APP_GROUP and optionally include IOS_APPLE_TEAM_ID, and exposes both on exported Env (populating IOS_APPLE_TEAM_ID from multiple fallback env vars).
Live Activities plugin
plugins/withLiveActivities.js
Changes export signature to (config, { appGroupId } = {}), adds resolveAppGroupId(cfg, appGroupId) helper, threads resolved app-group into file/entitlements writers, mirrors main app build settings into the widget target, and applies DEVELOPMENT_TEAM/CODE_SIGN_STYLE and target attributes when discovered.
Docs / README
README.md
Documents that iOS CI prebuilds generating the widget target must set IOS_APPLE_TEAM_ID (or EXPO_APPLE_TEAM_ID/APPLE_TEAM_ID) and fixes newline at EOF.

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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped through env vars, tail a-fluff,
Passing group IDs so widgets aren’t rough,
I nudged the plugin, set the team in place,
Now activities hum — a tidy, signed embrace. ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'RR-T43 Fixing build issue' is vague and generic, using the non-descriptive term 'build issue' without specifying what was actually fixed or which build system/platform is affected. Consider a more specific title like 'Configure iOS app group and team ID for widget signing' or 'Add iOS Live Activities widget build configuration' to clearly describe the actual changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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 (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) to IOS_APP_GROUP validation (also mentioned in the existing comment at line 73)
  • Validate IOS_APPLE_TEAM_ID with a regex pattern matching the 10-character Team ID format
Proposed 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

📥 Commits

Reviewing files that changed from the base of the PR and between d2ff8eb and 03ab681.

📒 Files selected for processing (4)
  • README.md
  • app.config.ts
  • env.js
  • plugins/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

@ucswift
Copy link
Copy Markdown
Member Author

ucswift commented Apr 19, 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 082e2ca into master Apr 19, 2026
13 of 14 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 20, 2026
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