From 115b1059e1c810496db4fef64feac56d93a45cdb Mon Sep 17 00:00:00 2001 From: Sachin Panemangalore <83682223+sachscode@users.noreply.github.com> Date: Sun, 7 Nov 2021 17:45:03 -0800 Subject: [PATCH] =?UTF-8?q?(fix)=20graphql-schema=20predictions=20migratio?= =?UTF-8?q?n=20failure=20because=20of=20missing=E2=80=A6=20(#8718)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * (fix) graphql-schema predictions migration failure because of missing storage * (fix/cleanup) changed default for storage trigger to N, removed extraneous keydown Co-authored-by: Sachin Panemangalore --- .../service-walkthroughs/s3-walkthrough.ts | 2 +- packages/amplify-e2e-core/src/categories/storage.ts | 6 +++++- .../src/transform-graphql-schema.ts | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/amplify-category-storage/src/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.ts b/packages/amplify-category-storage/src/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.ts index 1f1e1a39a4a..c97b9457bff 100644 --- a/packages/amplify-category-storage/src/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.ts +++ b/packages/amplify-category-storage/src/provider-utils/awscloudformation/service-walkthroughs/s3-walkthrough.ts @@ -253,7 +253,7 @@ async function startAddTriggerFunctionFlow( policyID: string, existingTriggerFunction: string | undefined, ): Promise { - const enableLambdaTriggerOnS3: boolean = await prompter.yesOrNo('Do you want to add a Lambda Trigger for your S3 Bucket?'); + const enableLambdaTriggerOnS3: boolean = await prompter.yesOrNo('Do you want to add a Lambda Trigger for your S3 Bucket?', false); let triggerFunction: string | undefined = undefined; if (enableLambdaTriggerOnS3) { try { diff --git a/packages/amplify-e2e-core/src/categories/storage.ts b/packages/amplify-e2e-core/src/categories/storage.ts index c08bb8e67e8..91347ec36c8 100644 --- a/packages/amplify-e2e-core/src/categories/storage.ts +++ b/packages/amplify-e2e-core/src/categories/storage.ts @@ -379,7 +379,11 @@ export function addS3AndAuthWithAuthOnlyAccess(cwd: string, settings: any): Prom .wait('Who should have access') .sendCarriageReturn() // Auth users only .wait('What kind of access do you want for') - .sendCtrlA() // Select all + .send(' ') + .sendKeyDown() + .send(' ') + .sendKeyDown() + .send(' ') .sendCarriageReturn() .wait('Do you want to add a Lambda Trigger for your S3 Bucket') .sendConfirmNo() diff --git a/packages/amplify-provider-awscloudformation/src/transform-graphql-schema.ts b/packages/amplify-provider-awscloudformation/src/transform-graphql-schema.ts index d2a3d1d4851..1c5efbea50d 100644 --- a/packages/amplify-provider-awscloudformation/src/transform-graphql-schema.ts +++ b/packages/amplify-provider-awscloudformation/src/transform-graphql-schema.ts @@ -455,7 +455,9 @@ export async function transformGraphQLSchema(context, options) { // for the predictions directive get storage config const s3ResourceName = await invokeS3GetResourceName(context); - const storageConfig = s3ResourceName ? await getBucketName(context, s3ResourceName ) : undefined; + const storageConfig = { + bucketName: s3ResourceName ? await getBucketName(context, s3ResourceName) : undefined, + }; const buildDir = path.normalize(path.join(resourceDir, 'build')); const schemaFilePath = path.normalize(path.join(resourceDir, schemaFileName));