feat(simulator): add exec command and config persistence via dotenv#3777
Open
krystofwoldrich wants to merge 3 commits into
Open
feat(simulator): add exec command and config persistence via dotenv#3777krystofwoldrich wants to merge 3 commits into
krystofwoldrich wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3777 +/- ##
==========================================
+ Coverage 56.83% 57.50% +0.67%
==========================================
Files 904 907 +3
Lines 39129 39382 +253
Branches 8178 8255 +77
==========================================
+ Hits 22237 22642 +405
+ Misses 15420 15283 -137
+ Partials 1472 1457 -15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Subscribed to pull request
Generated by CodeMention |
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
When testing the
simulator:startI've noticed that agents correctly use the recommended agent-device envs, but because agents can't set envs for all child processes, they must include them in every agent-device call. This fogs up what is the agent doing, see the example below.This PR proposes an option to save simulator session config to
.env.eas-simulator, which can later be used by new exec command. This make working with the sim less verbose and also persist the config in case of agent cli crash, new sessions...This PR also adds
EAS_SIMULATOR_SESSION_IDenv which is saved to the dotenv file for later reference to the session. This let's user call allsimulator:*commands without specifying the--id.Before
Because of the truncation it's not clear what command was executed.
After
Now it's clearly visible.
Considered alternative solutions
.env.eas-simulatorcurrently implemented dedicated donenv file for the simulator session config. The benefit is isolation and easy of prune of the session, no parsing of the common.envfiles. It's used in the industry for example.env.sentry-sourcemaps..env.localalready established file for ephemeral envs, contains other user's/project's envs would require parsing to clean up.expo/.eas-simulator-confignew specialized config file for simulator session. Seems like the best next option, but makes less transparent if someone would not want to usesimulator:exec,.env.localis common for ephemeral vals.dotenv agent-device <command>only works out of the box with.envnot.env.local. Other eas command likeconvexuse.env.localwhich is better as typically not committed file for tmp session envs../agent-device.jsoncan have both url and token properties same as when using env, but it's unclear to me if this file is typically committed or not, there are no secrets, so my expectations are it's likely ment to be committed.Summary
eas simulator:execto run simulator commands with local .env files loadedsimulator:startwrite dotenv config by default, including agent-device envs and session id--out-config-type envfor print-only shell exportsTest plan
New TUI example
Start command output
Interactions without
--idWhy start with
--forceby default? This minimizes the number of fails runs where user/agent haven't stopped the prev session and the env file have not cleaned up. It's possible to use--no-forceif needed. We do only check the session id presence not the session state, to avoid extra network req on every start. This works well with the default force.