Skip to content
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

Implement GUI for selecting eas build configuration #932

Merged
merged 6 commits into from
Feb 12, 2025

Conversation

jwajgelt
Copy link
Contributor

@jwajgelt jwajgelt commented Feb 4, 2025

Adds options to the "Launch Configuration" GUI for enabling EAS Build, selecting build profiles and specifying build UUIDs.

How Has This Been Tested:

  • open expo-52-eas and open the "Launch Configuration" window
    • the settings for EAS Build should appear
    • changing the settings in GUI should update launch.config file appropriately
  • open an application without build config in eas.json (for example, react-native-77 or remove the build entry in eas.json in expo-52-eas) and open the "Launch Configuration" window
    • the settings for EAS Build shouldn't appear

@jwajgelt jwajgelt requested a review from filip131311 February 4, 2025 13:58
@jwajgelt jwajgelt self-assigned this Feb 4, 2025
Copy link

vercel bot commented Feb 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radon-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 11, 2025 7:55am

Copy link
Collaborator

@filip131311 filip131311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some inline comments

async getAvailableEasProfiles(): Promise<string[]> {
const appRootFolder = getAppRootFolder();
const easConfig = await readEasConfig(appRootFolder);
const easBuildConfig = easConfig?.build ?? {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "simulator": true
      }
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {
      "autoIncrement": true
    }

this is an example eas configuration (from eas.json) we should only show profiles that have distribution field set to "internal". And simulator set to true. It is not necessary true, that profiles with those flag will generate dev builds runnable on simulators, but expo asumes so and you would have to do a lot of manula configuration to "cheat" that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've thought about it. I'm not sure we should hide the "invalid" configs.

I feel like ideally we'd show all configs, but disable selecting the "invalid" ones with some information to the user why they are not selectable, but I'm not sure how much work it is to add that functionality to our components.
I'd leave this out of this PR.

return (
<div className="launch-configuration-container">
<div className="setting-description">{prettyPlatformName(platform)} Build Profile:</div>
<Select
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should allow additional manual input of a value that is not on the list for users with exotic configurations, the button that does it might be hidden as a last psoittion in the select list for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly.
I feel like if you have an "exotic configuration", you can be asked to edit the launch.json manually, and I fear that adding a "Custom" option may clutter the UI for the other users who, I think, are in vast majority here.

Copy link
Collaborator

@filip131311 filip131311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some additional comments please adres them before merging

return false;
}

return !("build" in obj) || obj.build === undefined || isEasBuildConfig(obj.build);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is elaborate would you mind commenting why this check is "correct"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just checking if the shape of the object matches what we expect it to be -- is it really that puzzling?
I suppose you might want a reference to some schema here for the eas.json file -- previously this was in the same place that read that file, so the context was there to see that's what it's doing, but I suppose now that it's an exported part of a module, some comment might be useful.

return false;
}

return Object.values(obj).every((v) => v === undefined || isEasBuildProfile(v));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again would you mind adding some comments linking to eas documentation or explaining this checks?

@jwajgelt jwajgelt merged commit 2d3a163 into main Feb 12, 2025
4 checks passed
@jwajgelt jwajgelt deleted the @jwajgelt/eas-build-gui-config branch February 12, 2025 08:43
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.

3 participants