[eas-cli] Add eas update:embedded:upload command#3720
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
bbd2f9d to
71ba6bc
Compare
3fef5e4 to
427e5a9
Compare
427e5a9 to
4375d57
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3720 +/- ##
==========================================
+ Coverage 56.80% 56.91% +0.12%
==========================================
Files 904 908 +4
Lines 39112 39210 +98
Branches 8173 8187 +14
==========================================
+ Hits 22214 22314 +100
+ Misses 15428 15426 -2
Partials 1470 1470 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Subscribed to pull request
Generated by CodeMention |
|
✅ Thank you for adding the changelog entry! |
| enableJsonOutput(); | ||
| } | ||
|
|
||
| if (!fs.existsSync(bundlePath)) { |
There was a problem hiding this comment.
use fs-extra so you can await instead
| registerSpinner.fail('Failed to register embedded update'); | ||
| Log.warn( | ||
| 'This bundle may already be registered. To replace it, delete it manually and re-upload.' | ||
| ); | ||
| throw e; |
There was a problem hiding this comment.
This code will run on any error that is not an EmbeddedUpdateAssetNotAvailableError, so it wouldn't make sense to print this since we don't know if the issue is bundleregistration (ie) network error, etc.
Also I'm not sure i follow the use case here, if the bundle is already registered (the embedded asset) wouldn't the creation of the embedded update succeed? Or if you meant the EmbeddedUpdateEntity already exists, we can detect that from www and throw a special error to catch that specific case (so we aren't telling users to delete manually when we catch a generic error)
| export function readEmbeddedManifest(manifestPath: string): { id: string } { | ||
| let parsed: unknown; | ||
| try { | ||
| parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); |

Why
EAS Update bundle diffing can't generate patches against the JS bundle embedded in a native build, so the first OTA after install always downloads the full bundle. This command registers the embedded bundle with EAS Update so the diff worker can use it as a patch base.
Ref ENG-21033
How
eas update:embedded:uploadcommand with--platform,--bundle,--manifest,--channel, and optional--build-id/--jsonflagsuploadEmbeddedUpdate; two-phase spinner shows progress for each stepEMBEDDED_UPDATE_ASSET_NOT_AVAILABLE(GCS finalization race) with exponential backoff; hints on other failures that the bundle may already be registeredTest Plan
yarn jest src/commands/update/embedded/__tests__/upload.test.ts src/graphql/__tests__/client-test.ts— 24 tests passyarn tsc && yarn lintpass