Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into param-bound
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardfoyle committed May 10, 2021
2 parents 9ff685b + d28dd1c commit ccfd139
Show file tree
Hide file tree
Showing 70 changed files with 4,321 additions and 352 deletions.
8 changes: 6 additions & 2 deletions .circleci/config.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,9 @@ workflows:
jobs:
- build
- cleanup_resources:
context: cleanup-resources
context:
- cleanup-resources
- e2e-test-context
requires:
- build

Expand Down Expand Up @@ -762,7 +764,9 @@ workflows:
only:
- release
- cleanup_resources_after_e2e_runs:
context: cleanup-resources
context:
- cleanup-resources
- e2e-test-context
requires:
- done_with_pkg_linux_e2e_tests
- amplify_migration_tests_latest
Expand Down
66 changes: 50 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1135,22 +1135,30 @@ jobs:
environment:
TEST_SUITE: src/__tests__/function_5.test.ts
CLI_REGION: ap-northeast-1
defer-init-push-amplify_e2e_tests:
working_directory: ~/repo
docker: *ref_1
resource_class: large
steps: *ref_4
environment:
TEST_SUITE: src/__tests__/defer-init-push.test.ts
CLI_REGION: ap-southeast-1
configure-project-amplify_e2e_tests:
working_directory: ~/repo
docker: *ref_1
resource_class: large
steps: *ref_4
environment:
TEST_SUITE: src/__tests__/configure-project.test.ts
CLI_REGION: ap-southeast-1
CLI_REGION: ap-southeast-2
api_4-amplify_e2e_tests:
working_directory: ~/repo
docker: *ref_1
resource_class: large
steps: *ref_4
environment:
TEST_SUITE: src/__tests__/api_4.test.ts
CLI_REGION: ap-southeast-2
CLI_REGION: us-east-2
schema-iterative-update-4-amplify_e2e_tests_pkg_linux:
working_directory: ~/repo
docker: *ref_1
Expand Down Expand Up @@ -1831,6 +1839,16 @@ jobs:
TEST_SUITE: src/__tests__/function_5.test.ts
CLI_REGION: ap-northeast-1
steps: *ref_5
defer-init-push-amplify_e2e_tests_pkg_linux:
working_directory: ~/repo
docker: *ref_1
resource_class: large
environment:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux
TEST_SUITE: src/__tests__/defer-init-push.test.ts
CLI_REGION: ap-southeast-1
steps: *ref_5
configure-project-amplify_e2e_tests_pkg_linux:
working_directory: ~/repo
docker: *ref_1
Expand All @@ -1839,7 +1857,7 @@ jobs:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux
TEST_SUITE: src/__tests__/configure-project.test.ts
CLI_REGION: ap-southeast-1
CLI_REGION: ap-southeast-2
steps: *ref_5
api_4-amplify_e2e_tests_pkg_linux:
working_directory: ~/repo
Expand All @@ -1849,7 +1867,7 @@ jobs:
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux
TEST_SUITE: src/__tests__/api_4.test.ts
CLI_REGION: ap-southeast-2
CLI_REGION: us-east-2
steps: *ref_5
workflows:
version: 2
Expand Down Expand Up @@ -1886,7 +1904,9 @@ workflows:
jobs:
- build
- cleanup_resources:
context: cleanup-resources
context:
- cleanup-resources
- e2e-test-context
requires:
- build
build_test_deploy:
Expand Down Expand Up @@ -1947,10 +1967,10 @@ workflows:
- master
- done_with_node_e2e_tests:
requires:
- schema-key-amplify_e2e_tests
- analytics-amplify_e2e_tests
- notifications-amplify_e2e_tests
- schema-iterative-update-locking-amplify_e2e_tests
- api_4-amplify_e2e_tests
- schema-auth-10-amplify_e2e_tests
- hosting-amplify_e2e_tests
- tags-amplify_e2e_tests
Expand All @@ -1970,17 +1990,17 @@ workflows:
- schema-iterative-update-2-amplify_e2e_tests
- schema-data-access-patterns-amplify_e2e_tests
- init-special-case-amplify_e2e_tests
- configure-project-amplify_e2e_tests
- defer-init-push-amplify_e2e_tests
- feature-flags-amplify_e2e_tests
- schema-versioned-amplify_e2e_tests
- plugin-amplify_e2e_tests
- api_4-amplify_e2e_tests
- configure-project-amplify_e2e_tests
- done_with_pkg_linux_e2e_tests:
requires:
- schema-key-amplify_e2e_tests_pkg_linux
- analytics-amplify_e2e_tests_pkg_linux
- notifications-amplify_e2e_tests_pkg_linux
- schema-iterative-update-locking-amplify_e2e_tests_pkg_linux
- api_4-amplify_e2e_tests_pkg_linux
- schema-auth-10-amplify_e2e_tests_pkg_linux
- hosting-amplify_e2e_tests_pkg_linux
- tags-amplify_e2e_tests_pkg_linux
Expand All @@ -2000,11 +2020,11 @@ workflows:
- schema-iterative-update-2-amplify_e2e_tests_pkg_linux
- schema-data-access-patterns-amplify_e2e_tests_pkg_linux
- init-special-case-amplify_e2e_tests_pkg_linux
- configure-project-amplify_e2e_tests_pkg_linux
- defer-init-push-amplify_e2e_tests_pkg_linux
- feature-flags-amplify_e2e_tests_pkg_linux
- schema-versioned-amplify_e2e_tests_pkg_linux
- plugin-amplify_e2e_tests_pkg_linux
- api_4-amplify_e2e_tests_pkg_linux
- configure-project-amplify_e2e_tests_pkg_linux
- amplify_migration_tests_latest:
context:
- amplify-ecr-image-pull
Expand Down Expand Up @@ -2076,7 +2096,9 @@ workflows:
only:
- release
- cleanup_resources_after_e2e_runs:
context: cleanup-resources
context:
- cleanup-resources
- e2e-test-context
requires:
- done_with_pkg_linux_e2e_tests
- amplify_migration_tests_latest
Expand Down Expand Up @@ -2183,6 +2205,12 @@ workflows:
filters: *ref_9
requires:
- function_2-amplify_e2e_tests
- api_4-amplify_e2e_tests:
context: *ref_7
post-steps: *ref_8
filters: *ref_9
requires:
- schema-key-amplify_e2e_tests
- api_2-amplify_e2e_tests:
context: *ref_7
post-steps: *ref_8
Expand Down Expand Up @@ -2477,7 +2505,7 @@ workflows:
filters: *ref_9
requires:
- layer-amplify_e2e_tests
- configure-project-amplify_e2e_tests:
- defer-init-push-amplify_e2e_tests:
context: *ref_7
post-steps: *ref_8
filters: *ref_9
Expand Down Expand Up @@ -2537,7 +2565,7 @@ workflows:
filters: *ref_9
requires:
- auth_3-amplify_e2e_tests
- api_4-amplify_e2e_tests:
- configure-project-amplify_e2e_tests:
context: *ref_7
post-steps: *ref_8
filters: *ref_9
Expand Down Expand Up @@ -2615,6 +2643,12 @@ workflows:
filters: *ref_12
requires:
- function_2-amplify_e2e_tests_pkg_linux
- api_4-amplify_e2e_tests_pkg_linux:
context: *ref_10
post-steps: *ref_11
filters: *ref_12
requires:
- schema-key-amplify_e2e_tests_pkg_linux
- api_2-amplify_e2e_tests_pkg_linux:
context: *ref_10
post-steps: *ref_11
Expand Down Expand Up @@ -2929,7 +2963,7 @@ workflows:
filters: *ref_12
requires:
- layer-amplify_e2e_tests_pkg_linux
- configure-project-amplify_e2e_tests_pkg_linux:
- defer-init-push-amplify_e2e_tests_pkg_linux:
context: *ref_10
post-steps: *ref_11
filters: *ref_12
Expand Down Expand Up @@ -2993,7 +3027,7 @@ workflows:
filters: *ref_12
requires:
- auth_3-amplify_e2e_tests_pkg_linux
- api_4-amplify_e2e_tests_pkg_linux:
- configure-project-amplify_e2e_tests_pkg_linux:
context: *ref_10
post-steps: *ref_11
filters: *ref_12
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The AWS Amplify CLI is a toolchain which includes a robust feature set for simpl

## Install the CLI

- Requires Node.js® version 10 or later
- Requires Node.js® version 12 or later

Install and configure the Amplify CLI as follows:

Expand Down
6 changes: 0 additions & 6 deletions packages/amplify-app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ const run = async opts => {
if (!opts.skipInit) {
await createAmplifySkeletonProject(platform.frontend);
}
if (platform.frontend === 'ios' && !opts.internalOnlyIosCallback) {
// the ios frontend plugin handles the post init event to call back to ampfliy-app
// So we need to return here if this is the original invocation of amplify-app (aka not the callback)
// yes, this needs to be refactored
return;
}
updateFrameworkInProjectConfig(platform.framework);
await createAmplifyHelperFiles(platform.frontend);
console.log(`${emoji.get('white_check_mark')} Amplify setup completed successfully.`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ async function askPaths(context, answers, currentPath) {
await inquirer.prompt({
name: 'isOverlappingPathOK',
type: 'confirm',
message: `This path ${lowerOrderPath} is overlapping with ${higherOrderPath}. ${higherOrderPath} is going to catch all requests from ${lowerOrderPath}. Are you sure you want to continue?`,
message: `The path ${lowerOrderPath} overlaps with ${higherOrderPath}. Users authorized to access ${higherOrderPath} will also have access to ${lowerOrderPath}. Are you sure you want to continue?`,
default: false,
})
).isOverlappingPathOK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Resources:
Mutable: true
<% } %>
<% } %>
<%if (!props.breakCircularDependency && props.triggers !== '{}' && props.dependsOn) { %>
<%if (!props.breakCircularDependency && props.triggers && props.dependsOn) { %>
LambdaConfig:
<%if (props.dependsOn.find(i => i.resourceName.includes('CreateAuthChallenge'))) { %>
CreateAuthChallenge: !Ref function<%=props.resourceName%>CreateAuthChallengeArn
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`check CFN resources 1`] = `
Object {
"cfnResources": Array [
"apiattr1",
"apiattr2",
],
"permissionPolicies": "randomPermissionsforapi",
}
`;

exports[`check CFN resources for storage 1`] = `
Object {
"cfnResources": Array [
Object {
"_cfJoinComponentTableArn": Array [
"arn:aws:dynamodb:",
Object {
"Ref": "aws_region",
},
":",
Object {
"Ref": "aws_accountId",
},
":table/",
Object {
"Fn::ImportValue": Object {
"Fn::Sub": "\${apimock_apiGraphQLAPIIdOutput}:GetAtt:storage:Name",
},
},
],
"_cfJoinComponentTableName": Object {
"Fn::ImportValue": Object {
"Fn::Sub": "\${apimock_apiGraphQLAPIIdOutput}:GetAtt:storage:Name",
},
},
"_modelName": "storageattr1@model(appsync)",
"attributes": Array [
"GraphQLAPIIdOutput",
],
"category": "api",
"needsAdditionalDynamoDBResourceProps": true,
"resourceName": "mock_api",
},
Object {
"_cfJoinComponentTableArn": Array [
"arn:aws:dynamodb:",
Object {
"Ref": "aws_region",
},
":",
Object {
"Ref": "aws_accountId",
},
":table/",
Object {
"Fn::ImportValue": Object {
"Fn::Sub": "\${apimock_apiGraphQLAPIIdOutput}:GetAtt:storage:Name",
},
},
],
"_cfJoinComponentTableName": Object {
"Fn::ImportValue": Object {
"Fn::Sub": "\${apimock_apiGraphQLAPIIdOutput}:GetAtt:storage:Name",
},
},
"_modelName": "storageattr2@model(appsync)",
"attributes": Array [
"GraphQLAPIIdOutput",
],
"category": "api",
"needsAdditionalDynamoDBResourceProps": true,
"resourceName": "mock_api",
},
],
"permissionPolicies": "randomPermissionsforapiandstorage",
}
`;

exports[`env resources for CFN for DDB table and api 1`] = `
Object {
"dependsOn": Array [
Object {
"attributes": Array [
"GraphQLAPIIdOutput",
],
"category": "api",
"resourceName": "mock_api",
},
],
"envVarStringList": "API_MOCK_API_GRAPHQLAPIIDOUTPUT",
"environmentMap": Object {
"API_MOCK_API_GRAPHQLAPIIDOUTPUT": Object {
"Ref": "apimock_apiGraphQLAPIIdOutput",
},
},
}
`;

exports[`env resources for CFN for auth and storage for api 1`] = `
Object {
"dependsOn": Array [
Object {
"attributes": Array [
"randombucket",
],
"category": "storage",
"resourceName": "mock_api",
},
Object {
"attributes": Array [
"userPoolId",
],
"category": "auth",
"resourceName": "mock_api",
},
],
"envVarStringList": "AUTH_MOCK_API_USERPOOLID
STORAGE_MOCK_API_RANDOMBUCKET",
"environmentMap": Object {
"AUTH_MOCK_API_USERPOOLID": Object {
"Ref": "authmock_apiuserPoolId",
},
"STORAGE_MOCK_API_RANDOMBUCKET": Object {
"Ref": "storagemock_apirandombucket",
},
},
}
`;
Loading

0 comments on commit ccfd139

Please sign in to comment.