-
Notifications
You must be signed in to change notification settings - Fork 96
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
[eas-cli] [ENG-9957] Don't overwrite distribution for simulator builds #2073
Changes from 12 commits
c48928b
7679dee
4b41ba2
de4712a
2dd7e3b
c9d25b7
35b99d7
f9b738a
4e1da63
cf09ead
9e25d60
dfa81f3
e19f1cb
9b442e2
7bc9744
c15b9dd
12895bd
935dcbc
24156cd
1fce06f
59e7978
dd45591
577edaa
049f177
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,10 +24,7 @@ export async function collectMetadataAsync<T extends Platform>( | |||||
ctx: BuildContext<T> | ||||||
): Promise<Metadata> { | ||||||
const channelOrReleaseChannel = await resolveChannelOrReleaseChannelAsync(ctx); | ||||||
const distribution = | ||||||
('simulator' in ctx.buildProfile && ctx.buildProfile.simulator | ||||||
? 'simulator' | ||||||
: ctx.buildProfile.distribution) ?? 'store'; | ||||||
const distribution = ctx.buildProfile.distribution ?? 'store'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
const metadata: Metadata = { | ||||||
trackingContext: ctx.analyticsEventProperties, | ||||||
...(await maybeResolveVersionsAsync(ctx)), | ||||||
|
@@ -64,6 +61,7 @@ export async function collectMetadataAsync<T extends Platform>( | |||||
requiredPackageManager: ctx.requiredPackageManager ?? undefined, | ||||||
selectedImage: ctx.buildProfile.image, | ||||||
customNodeVersion: ctx.buildProfile.node, | ||||||
simulator: 'simulator' in ctx.buildProfile && ctx.buildProfile.simulator, | ||||||
}; | ||||||
return sanitizeMetadata(metadata); | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -10,6 +10,7 @@ import { | |||||||||||||
getPaginatedQueryOptions, | ||||||||||||||
} from '../../commandUtils/pagination'; | ||||||||||||||
import { AppPlatform, BuildStatus as GraphQLBuildStatus } from '../../graphql/generated'; | ||||||||||||||
import Log from '../../log'; | ||||||||||||||
import { RequestedPlatform } from '../../platform'; | ||||||||||||||
import { getDisplayNameForProjectIdAsync } from '../../project/projectUtils'; | ||||||||||||||
import { buildDistributionTypeToGraphQLDistributionType } from '../../utils/buildDistribution'; | ||||||||||||||
|
@@ -51,6 +52,7 @@ export default class BuildList extends EasCommand { | |||||||||||||
...EasPaginatedQueryFlags, | ||||||||||||||
limit: getLimitFlagWithCustomValues({ defaultTo: 10, limit: BUILDS_LIMIT }), | ||||||||||||||
...EasNonInteractiveAndJsonFlags, | ||||||||||||||
simulator: Flags.boolean(), | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it would be good to add a description to this flag, putting emphasis on the fact that it will only filter the iOS simulator builds. People tend to confuse Android emulator with iOS simulator and one could think that this will also query for Android emulator builds. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should also enforce that this is only applicable when using the |
||||||||||||||
}; | ||||||||||||||
|
||||||||||||||
static override contextDefinition = { | ||||||||||||||
|
@@ -69,6 +71,11 @@ export default class BuildList extends EasCommand { | |||||||||||||
distribution: buildDistribution, | ||||||||||||||
'non-interactive': nonInteractive, | ||||||||||||||
} = flags; | ||||||||||||||
if (buildDistribution === BuildDistributionType.SIMULATOR) { | ||||||||||||||
Log.warn( | ||||||||||||||
`Using "distribution" flag with "simulator" value is deprecated - use "simulator" flag instead` | ||||||||||||||
); | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice 👏
Suggested change
|
||||||||||||||
} | ||||||||||||||
const { | ||||||||||||||
privateProjectConfig: { projectId }, | ||||||||||||||
loggedIn: { graphqlClient }, | ||||||||||||||
|
@@ -100,6 +107,7 @@ export default class BuildList extends EasCommand { | |||||||||||||
appIdentifier: flags.appIdentifier, | ||||||||||||||
buildProfile: flags.buildProfile, | ||||||||||||||
gitCommitHash: flags.gitCommitHash, | ||||||||||||||
simulator: flags.simulator, | ||||||||||||||
}, | ||||||||||||||
paginatedQueryOptions, | ||||||||||||||
}); | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will break stuff like
eas build:run
🤔I'm wondering if altering the
distributionType
behavior is necessary 🤔.Maybe we can add some new field to Metadata to keep the raw
buildProfile.distribution
value there? I mean it's probably not optimal but I feel that this change can introduce some regressions in some parts of the codebase.What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on why
eas build:run
would be broken by this?As for another field for "original distribution" or whatever we want to call it, I'm open for discussion but it feels to me like hacking around an existing hack (overwriting the distribution). I feel like we should remove the reliance on this hardcoded
simulator
value fordistribution
instead of building upon it, wdyt?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, it runs a simulator build and fetches it by filtering by distribution = simulator.
Maybe it should handle both options (distribution = simulator or simulator = true) for a while instead of introducing another field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I concur, we should list builds with both
simulator: true
anddistribution: simulator
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's handled in https://github.com/expo/universe/pull/13524