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

[ENG-12115][eas-cli] add eas onboarding flow #2338

Merged
merged 9 commits into from
May 8, 2024

Conversation

szdziedzic
Copy link
Member

@szdziedzic szdziedzic commented Apr 23, 2024

Why

Add onboarding flow for EAS

https://linear.app/expo/issue/ENG-12115/add-eas-onboarding-command-to-automatically-execute-all-of-the

How

Add onboarding flow for EAS

Test Plan

Test manually

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 22.88557% with 155 lines in your changes are missing coverage. Please review.

Project coverage is 53.64%. Comparing base (de8956c) to head (59823b1).
Report is 1 commits behind head on main.

Files Patch % Lines
...ackages/eas-cli/src/commands/project/onboarding.ts 23.92% 61 Missing and 9 partials ⚠️
packages/eas-cli/src/onboarding/runCommand.ts 16.00% 21 Missing ⚠️
packages/eas-cli/src/vcs/clients/git.ts 0.00% 21 Missing ⚠️
packages/eas-cli/src/onboarding/git.ts 21.74% 17 Missing and 1 partial ⚠️
...ages/eas-cli/src/onboarding/installDependencies.ts 18.19% 9 Missing ⚠️
...i/src/graphql/mutations/UserPreferencesMutation.ts 36.37% 7 Missing ⚠️
packages/eas-cli/src/vcs/git.ts 28.58% 5 Missing ⚠️
...ials/manager/SetUpBuildCredentialsCommandAction.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2338      +/-   ##
==========================================
- Coverage   53.83%   53.64%   -0.19%     
==========================================
  Files         525      530       +5     
  Lines       19275    19479     +204     
  Branches     4074     4120      +46     
==========================================
+ Hits        10375    10447      +72     
- Misses       8180     8302     +122     
- Partials      720      730      +10     

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

@szdziedzic szdziedzic changed the title [eas-cli] add eas onboarding flow [ENG-12115][eas-cli] add eas onboarding flow Apr 24, 2024
@szdziedzic szdziedzic force-pushed the @szdziedzic/eas-onboarding-flow branch from e15b190 to 41b58b0 Compare April 30, 2024 11:50
Copy link

github-actions bot commented Apr 30, 2024

Size Change: +7.5 kB (0%)

Total Size: 51.3 MB

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

compressed-size-action

@szdziedzic szdziedzic force-pushed the @szdziedzic/eas-onboarding-flow branch from 41b58b0 to 5026f1e Compare May 8, 2024 12:38
@szdziedzic szdziedzic marked this pull request as ready for review May 8, 2024 12:39

if (!actor.preferences.onboarding) {
throw new Error(
'This command is a continuation of the onboarding process started on the Expo website. Start the onboarding process on the website before running this command. Visit https:/expo.new to create an account and start the onboarding process.'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: https:/expo.new -> https://expo.new

actor: Actor;
}): DynamicConfigContextFn {
return async (options?: ExpoConfigOptions) => {
const expBefore = getPrivateExpoConfig(projectDir, options);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not reuse getPrivateExpoConfigWithProjectIdAsync here?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, sure

@szdziedzic szdziedzic added the no changelog PR that doesn't require a changelog entry label May 8, 2024
@@ -17,6 +17,10 @@ import {
import { Client } from '../vcs';

export default class GitClient extends Client {
constructor(private maybeCwdOverride?: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to instead have this.cwd = findWorkspaceRoot(cwd) ?? cwd?

Copy link
Member Author

@szdziedzic szdziedzic May 8, 2024

Choose a reason for hiding this comment

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

I think we are not always running it workspace root (for example when git adding something), this can be risky and can break something

packages/eas-cli/src/onboarding/runCommand.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/onboarding/runCommand.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/onboarding/git.ts Outdated Show resolved Hide resolved
Comment on lines +34 to +35
appId
isCLIDone
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting — can a single user only have a single preferences entry for a single app?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe so, cc: @tchayen

Copy link
Member

Choose a reason for hiding this comment

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

Yup! This is an interactive wizard on the website. We don't allow people to run more than one at the same time. If they have such a need they probably don't need an interactive wizard in the first place.

And everything we do here can be automated as well by the user if they ever need that.

packages/eas-cli/src/commands/project/onboarding.ts Outdated Show resolved Hide resolved
Comment on lines +84 to +89
const githubUsername = app.githubRepository
? app.githubRepository.metadata.githubRepoOwnerName
: 'expo';
const githubRepositoryName = app.githubRepository
? app.githubRepository.metadata.githubRepoName
: 'expo-default-template';
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: if one is defined, but not the other we'd try to clone sjchmiela/expo-default-template? Seems like we shouldn't

Copy link
Member Author

Choose a reason for hiding this comment

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

both githubRepoOwnerName and githubRepoName are reguired on metadata object

Copy link
Member Author

Choose a reason for hiding this comment

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

so I believe there should never be a case when one exists and other not

packages/eas-cli/src/commands/project/onboarding.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/commands/project/onboarding.ts Outdated Show resolved Hide resolved
Copy link

github-actions bot commented May 8, 2024

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@szdziedzic szdziedzic merged commit a740aa1 into main May 8, 2024
9 checks passed
@szdziedzic szdziedzic deleted the @szdziedzic/eas-onboarding-flow branch May 8, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog PR that doesn't require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants