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

make build:view and build:list use GraphQL instead of REST endpoints #286

Merged
merged 1 commit into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 198 additions & 17 deletions packages/eas-cli/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "experimentation",
"description": "Top-level query object for querying Experimentation configuration.",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "ExperimentationQuery",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "project",
"description": "",
Expand Down Expand Up @@ -2588,6 +2604,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "ownerAccount",
"description": "",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Account",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "privacy",
"description": "",
Expand Down Expand Up @@ -2782,7 +2814,7 @@
},
{
"name": "builds",
"description": "",
"description": "(EAS Build) Builds associated with this app",
"args": [
{
"name": "offset",
Expand Down Expand Up @@ -2821,6 +2853,16 @@
"ofType": null
},
"defaultValue": null
},
{
"name": "platform",
"description": null,
"type": {
"kind": "ENUM",
"name": "AppPlatform",
"ofType": null
},
"defaultValue": null
}
],
"type": {
Expand Down Expand Up @@ -9679,6 +9721,65 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "ExperimentationQuery",
"description": "",
"fields": [
{
"name": "userConfig",
"description": "Get user experimentation config",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "JSONObject",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "deviceConfig",
"description": "Get device experimentation config",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "JSONObject",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "deviceExperimentationUnit",
"description": "Get experimentation unit to use for device experiments. In this case, it is the IP address.",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "ProjectQuery",
Expand Down Expand Up @@ -10466,13 +10567,9 @@
"name": "buildId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"defaultValue": null
}
Expand Down Expand Up @@ -11275,6 +11372,51 @@
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "rename",
"description": "Rename this account",
"args": [
{
"name": "accountID",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "newName",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Account",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
Expand Down Expand Up @@ -13322,9 +13464,24 @@
"description": "",
"fields": [
{
"name": "cancel",
"description": "Cancel an EAS Build\"",
"args": [],
"name": "cancelBuild",
"description": "Cancel an EAS Build build",
"args": [
{
"name": "buildId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "NON_NULL",
"name": null,
Expand All @@ -13336,6 +13493,22 @@
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "cancel",
"description": "Cancel an EAS Build build",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Build",
"ofType": null
}
},
"isDeprecated": true,
"deprecationReason": "Use cancelBuild instead"
}
],
"inputFields": null,
Expand Down Expand Up @@ -16311,9 +16484,13 @@
"name": "environmentSecretData",
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "CreateEnvironmentSecretInput",
"ofType": null
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "CreateEnvironmentSecretInput",
"ofType": null
}
},
"defaultValue": null
},
Expand Down Expand Up @@ -16352,9 +16529,13 @@
"name": "environmentSecretData",
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "CreateEnvironmentSecretInput",
"ofType": null
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "CreateEnvironmentSecretInput",
"ofType": null
}
},
"defaultValue": null
},
Expand Down
8 changes: 5 additions & 3 deletions packages/eas-cli/src/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { promptAsync } from '../prompts';
import { UploadType, uploadAsync } from '../uploads';
import { formatBytes } from '../utils/files';
import { createProgressTracker } from '../utils/progress';
import { platformDisplayNames } from './constants';
import { requestedPlatformDisplayNames } from './constants';
import { BuildContext } from './context';
import { collectMetadata } from './metadata';
import { AnalyticsEvent, Platform, TrackingContext } from './types';
Expand Down Expand Up @@ -69,7 +69,9 @@ export async function prepareBuildRequestForPlatformAsync<
if (!(await isGitStatusCleanAsync())) {
Log.addNewLineIfNone();
await reviewAndCommitChangesAsync(
`[EAS Build] Run EAS Build for ${platformDisplayNames[builder.ctx.platform as Platform]}`,
`[EAS Build] Run EAS Build for ${
requestedPlatformDisplayNames[builder.ctx.platform as Platform]
}`,
{
nonInteractive: builder.ctx.commandCtx.nonInteractive,
}
Expand All @@ -92,7 +94,7 @@ export async function prepareBuildRequestForPlatformAsync<
return await withAnalyticsAsync(
async () => {
if (Log.isDebug) {
Log.log(`Starting ${platformDisplayNames[job.platform]} build`);
Log.log(`Starting ${requestedPlatformDisplayNames[job.platform]} build`);
}
const {
data: { buildId, deprecationInfo },
Expand Down
8 changes: 7 additions & 1 deletion packages/eas-cli/src/build/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { AppPlatform } from '../graphql/generated';
import { Platform, RequestedPlatform } from './types';

export const platformDisplayNames = {
export const requestedPlatformDisplayNames: Record<RequestedPlatform, string> = {
[RequestedPlatform.iOS]: 'iOS',
[RequestedPlatform.Android]: 'Android',
[RequestedPlatform.All]: 'Android and iOS',
};

export const appPlatformDisplayNames: Record<AppPlatform, string> = {
[AppPlatform.Android]: 'Android',
[AppPlatform.Ios]: 'iOS',
};

export const platformEmojis = {
[Platform.IOS]: '🍎',
[Platform.ANDROID]: '🤖',
Expand Down
6 changes: 3 additions & 3 deletions packages/eas-cli/src/build/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import chalk from 'chalk';
import { CredentialsProvider } from '../credentials/CredentialsProvider';
import Log from '../log';
import { confirmAsync, promptAsync } from '../prompts';
import { platformDisplayNames } from './constants';
import { requestedPlatformDisplayNames } from './constants';

function logCredentials(target: 'local' | 'remote', platform: Platform) {
let message = `Using ${target} ${platformDisplayNames[platform]} credentials`;
let message = `Using ${target} ${requestedPlatformDisplayNames[platform]} credentials`;
if (target === 'local') message += ` ${chalk.dim('(credentials.json)')}`;
if (target === 'remote') message += ` ${chalk.dim('(Expo server)')}`;
Log.succeed(message);
Expand All @@ -19,7 +19,7 @@ async function ensureCredentialsAutoAsync(
workflow: Workflow,
nonInteractive: boolean
): Promise<CredentialsSource.LOCAL | CredentialsSource.REMOTE> {
const platform = platformDisplayNames[provider.platform];
const platform = requestedPlatformDisplayNames[provider.platform];
switch (workflow) {
case Workflow.MANAGED:
if (await provider.hasLocalAsync()) {
Expand Down
Loading