Skip to content

[eas-cli] fix CapabilityModel creation and syncing #3088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

vonovak
Copy link
Contributor

@vonovak vonovak commented Jul 3, 2025

Why

The current implementation of capabilities syncing can lead to provisioning profiles becoming invalid. This PR refactors the syncing process to avoid this issue by making the following improvements:

  1. Preventing unnecessary creation of capability identifiers that already exist
  2. Only updating bundle capabilities when necessary

closes #1069
closes #1445

How

I refactored the capability syncing logic to:

  • Add test coverage for faulty behaviors. More tests are up the stack.
  • Only create capability identifiers that don't already exist on the server
  • Skip updating bundle capabilities when no changes are needed

Test Plan

easd command below is from https://github.com/expo/eas-cli/blob/main/CONTRIBUTING.md#development.

To best test this locally, have an iOS app with

(1) no capabilities enabled. Enable some capabilities in app.json and run prebuild. iCloud, Apple Sign In, app groups, or "com.apple.developer.default-data-protection": "NSFileProtectionComplete / ..." are of special interest, but any will do.

OR

(2) a buch of capabilities already enabled

using this app, run easd build -p ios TWO times. Confirm that the first build creates new capabilities on your app bundle (https://developer.apple.com/account/resources/identifiers/list) and provisioning profiles (if any). Confirm the second build passes and doesn't require any provisioning profile changes.

Finally, change the capabilities, and again run easd build -p ios twice to confirm no capabilities / provisioning profiles are changed on the second run (that's what should happen on the first run).

  • green CI
  • local tests

Copy link
Contributor Author

vonovak commented Jul 3, 2025

Copy link

github-actions bot commented Jul 3, 2025

Size Change: -2.34 kB (0%)

Total Size: 53.5 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 53.5 MB -2.34 kB (0%)

compressed-size-action

@vonovak vonovak force-pushed the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch 2 times, most recently from de26105 to b4d65ea Compare July 3, 2025 15:00
@vonovak vonovak force-pushed the vonovak/_eas-cli_refactor_capability_syncing branch 2 times, most recently from 9e67180 to 9dab486 Compare July 3, 2025 15:48
@vonovak vonovak force-pushed the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch from b4d65ea to 6210218 Compare July 3, 2025 15:48
@vonovak vonovak force-pushed the vonovak/_eas-cli_refactor_capability_syncing branch from 9dab486 to 73ecbb2 Compare July 3, 2025 17:45
@vonovak vonovak force-pushed the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch from 6210218 to 4426121 Compare July 3, 2025 17:45
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 51.77%. Comparing base (a88897b) to head (90fa44c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../credentials/ios/appstore/capabilityIdentifiers.ts 80.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3088      +/-   ##
==========================================
+ Coverage   51.77%   51.77%   +0.01%     
==========================================
  Files         607      607              
  Lines       24385    24385              
  Branches     5120     5119       -1     
==========================================
+ Hits        12622    12624       +2     
+ Misses      10713    10712       -1     
+ Partials     1050     1049       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vonovak vonovak force-pushed the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch from 4426121 to 045b03d Compare July 4, 2025 08:01
@vonovak vonovak requested review from alanjhughes and EvanBacon July 4, 2025 08:01
@vonovak vonovak marked this pull request as ready for review July 4, 2025 08:01
Copy link

github-actions bot commented Jul 4, 2025

Subscribed to pull request

File Patterns Mentions
**/* @sjchmiela

Generated by CodeMention

@vonovak vonovak force-pushed the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch from 47f6f53 to 3893477 Compare July 14, 2025 17:04
@vonovak vonovak force-pushed the vonovak/_eas-cli_refactor_capability_syncing branch 2 times, most recently from a8be45c to a92141d Compare July 14, 2025 19:42
@vonovak vonovak force-pushed the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch from 3893477 to 081170b Compare July 14, 2025 19:42
@vonovak vonovak force-pushed the vonovak/_eas-cli_refactor_capability_syncing branch 2 times, most recently from 1588bfc to 65de17f Compare July 14, 2025 20:10
@vonovak vonovak force-pushed the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch from 081170b to da14035 Compare July 14, 2025 20:10
@vonovak vonovak changed the base branch from vonovak/_eas-cli_refactor_capability_syncing to graphite-base/3088 July 14, 2025 20:29
@vonovak vonovak force-pushed the graphite-base/3088 branch from 65de17f to a88897b Compare July 14, 2025 20:29
@vonovak vonovak force-pushed the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch from da14035 to 8f8244a Compare July 14, 2025 20:29
@graphite-app graphite-app bot changed the base branch from graphite-base/3088 to main July 14, 2025 20:29
@vonovak vonovak force-pushed the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch from 8f8244a to 90fa44c Compare July 14, 2025 20:29
Copy link

✅ Thank you for adding the changelog entry!

Copy link
Contributor Author

vonovak commented Jul 14, 2025

Merge activity

  • Jul 14, 8:34 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 14, 8:34 PM UTC: @vonovak merged this pull request with Graphite.

@vonovak vonovak merged commit 356d626 into main Jul 14, 2025
12 checks passed
@vonovak vonovak deleted the vonovak/_eas-cli_fix_capabilitymodel_creation_and_syncing branch July 14, 2025 20:34
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.

EAS internal distribution build invalidates provisioning profiles Building iOS app invalidates provisioning profile when using document picker
2 participants