[eas-cli] Require --environment flag for eas update when SDK >= 55#3418
Conversation
Ensures that server-side environment variables are always explicitly specified for projects using Expo SDK 55 or greater. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Subscribed to pull request
Generated by CodeMention |
|
✅ Thank you for adding the changelog entry! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3418 +/- ##
==========================================
+ Coverage 52.54% 52.56% +0.02%
==========================================
Files 806 806
Lines 33621 33633 +12
Branches 6986 6988 +2
==========================================
+ Hits 17664 17675 +11
- Misses 14571 14573 +2
+ Partials 1386 1385 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kadikraman
left a comment
There was a problem hiding this comment.
This is definitely a good change for helping people avoid common pitfalls.
We can't know if there are users currently relying on this flow (reading the values from the local env file). Adding this check would make it impossible. We might need to add an option like --local-environment which would use the local env file as before. But it's ok to add it later if there are actually users who need it.

Why
Problems can occur if an update intended for a development build is published with the environment defaulting to or set to production, and vice versa.
To prevent such problems in the future, this PR makes the
--environmentflag a required flag for projects using SDK 55 and greater.How
Add a new utility function to throw an error if sdkVersion does not meet the requirement, and use that function in
eas update:configureandeas update.Skip the check if EAS_BUILD env is set.
Test Plan
Unit tests added.
Testing locally with different projects.