diff --git a/.circleci/config.yml b/.circleci/config.yml index c83f57f69dc..1cb8db55e9c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2975,6 +2975,58 @@ jobs: AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/storage-4.test.ts CLI_REGION: ap-northeast-1 + version-gating-amplify_e2e_tests: + working_directory: ~/repo + parameters: + os: + type: executor + default: linux + executor: << parameters.os >> + steps: + - attach_workspace: + at: ./ + - restore_cache: + key: >- + amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ + arch }} + - restore_cache: + key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }} + - restore_cache: + key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }} + - run: + name: Start verdaccio, install node CLI and amplify-app + command: | + source .circleci/local_publish_helpers.sh + startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml" + setNpmRegistryUrlToLocal + changeNpmGlobalPath + npm install -g @aws-amplify/cli + npm install -g amplify-app + unsetNpmRegistryUrl + - run: + name: Run E2e Tests + command: | + source .circleci/local_publish_helpers.sh + retry runE2eTest + no_output_timeout: 90m + - run: + name: Scan And Cleanup E2E Test Artifacts + command: | + if ! yarn ts-node .circleci/scan_artifacts.ts; then + echo "Cleaning the repository" + git clean -fdx + exit 1 + fi + when: always + - store_test_results: + path: packages/amplify-e2e-tests/ + - store_artifacts: + path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports + environment: + AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin + AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify + TEST_SUITE: src/__tests__/version-gating.test.ts + CLI_REGION: ap-southeast-1 plugin-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3026,7 +3078,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/plugin.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 init-special-case-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3078,7 +3130,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/init-special-case.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 datastore-modelgen-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3130,7 +3182,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/datastore-modelgen.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 amplify-configure-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3182,7 +3234,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/amplify-configure.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 init-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3234,7 +3286,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/init.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 tags-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3286,7 +3338,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/tags.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 notifications-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3338,7 +3390,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/notifications.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 schema-versioned-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3390,7 +3442,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-versioned.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-data-access-patterns-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3442,7 +3494,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-data-access-patterns.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 interactions-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3546,7 +3598,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-predictions.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 amplify-app-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3598,7 +3650,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/amplify-app.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 hosting-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3650,7 +3702,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/hosting.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 analytics-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3702,7 +3754,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/analytics.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 feature-flags-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3754,7 +3806,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/feature-flags.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-iterative-update-2-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3806,7 +3858,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-iterative-update-2.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 containers-api-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3858,7 +3910,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/containers-api.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 predictions-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3910,7 +3962,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/predictions.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 hostingPROD-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -3962,7 +4014,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/hostingPROD.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 geo-add-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4014,7 +4066,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/geo-add.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 geo-update-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4066,7 +4118,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/geo-update.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 geo-remove-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4118,7 +4170,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/geo-remove.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-auth-10-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4170,7 +4222,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-10.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-key-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4222,7 +4274,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-key.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 auth_1-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4274,7 +4326,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/auth_1.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 auth_5-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4326,7 +4378,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/auth_5.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 function_3-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4378,7 +4430,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/function_3.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 schema-iterative-update-1-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4430,7 +4482,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-iterative-update-1.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 schema-auth-3-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4482,7 +4534,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-3.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 delete-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4534,7 +4586,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/delete.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 function_2-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4586,7 +4638,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/function_2.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 auth_3-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4638,7 +4690,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/auth_3.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 migration-api-key-migration1-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4690,7 +4742,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/migration/api.key.migration1.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 auth_4-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4742,7 +4794,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/auth_4.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 schema-auth-7-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4794,7 +4846,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-7.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 schema-auth-8-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4846,7 +4898,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-8.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-searchable-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4898,7 +4950,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-searchable.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-auth-4-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -4950,7 +5002,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-4.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 api_3-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5002,7 +5054,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/api_3.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 import_auth_1-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5054,7 +5106,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/import_auth_1.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 import_auth_2-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5106,7 +5158,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/import_auth_2.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 import_s3_1-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5158,7 +5210,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/import_s3_1.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 USE_PARENT_ACCOUNT: 1 import_dynamodb_1-amplify_e2e_tests: working_directory: ~/repo @@ -5211,7 +5263,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/import_dynamodb_1.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 USE_PARENT_ACCOUNT: 1 schema-iterative-rollback-1-amplify_e2e_tests: working_directory: ~/repo @@ -5264,7 +5316,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-iterative-rollback-1.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-iterative-rollback-2-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5316,7 +5368,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-iterative-rollback-2.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 env-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5368,7 +5420,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/env.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 auth_2-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5420,7 +5472,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/auth_2.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 USE_PARENT_ACCOUNT: 1 schema-auth-9-amplify_e2e_tests: working_directory: ~/repo @@ -5473,7 +5525,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-9.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 schema-auth-11-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5525,7 +5577,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-11.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 migration-api-key-migration2-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5577,7 +5629,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/migration/api.key.migration2.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 USE_PARENT_ACCOUNT: 1 migration-api-key-migration3-amplify_e2e_tests: working_directory: ~/repo @@ -5630,7 +5682,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/migration/api.key.migration3.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 USE_PARENT_ACCOUNT: 1 function_1-amplify_e2e_tests: working_directory: ~/repo @@ -5683,7 +5735,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/function_1.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 schema-auth-1-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5735,7 +5787,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-1.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 function_4-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5787,7 +5839,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/function_4.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 schema-model-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5839,7 +5891,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-model.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 migration-api-connection-migration-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5891,7 +5943,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/migration/api.connection.migration.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 schema-connection-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5943,7 +5995,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-connection.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-auth-6-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -5995,7 +6047,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-6.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-iterative-update-3-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -6047,7 +6099,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-iterative-update-3.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 schema-auth-2-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -6099,7 +6151,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-2.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 api_1-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -6151,7 +6203,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 USE_PARENT_ACCOUNT: 1 schema-auth-5-amplify_e2e_tests: working_directory: ~/repo @@ -6204,7 +6256,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-auth-5.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 api_2-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -6256,7 +6308,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/api_2.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 USE_PARENT_ACCOUNT: 1 api_5-amplify_e2e_tests: working_directory: ~/repo @@ -6309,7 +6361,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/api_5.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 api_6-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -6361,7 +6413,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/api_6.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-iterative-update-4-amplify_e2e_tests: working_directory: ~/repo parameters: @@ -6413,7 +6465,7 @@ jobs: AMPLIFY_DIR: /home/circleci/repo/packages/amplify-cli/bin AMPLIFY_PATH: /home/circleci/repo/packages/amplify-cli/bin/amplify TEST_SUITE: src/__tests__/schema-iterative-update-4.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 api_4-amplify_e2e_tests_pkg: parameters: os: @@ -7816,6 +7868,41 @@ jobs: environment: TEST_SUITE: src/__tests__/storage-4.test.ts CLI_REGION: ap-northeast-1 + version-gating-amplify_e2e_tests_pkg: + parameters: + os: + type: executor + default: os.linux + executor: << parameters.os >> + working_directory: ~/repo + steps: + - attach_workspace: + at: ./ + - restore_cache: + key: >- + amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ + arch }} + - restore_cache: + key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }} + - restore_cache: + key: amplify-build-artifact-{{ .Revision }}-{{ arch }} + - restore_cache: + key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }} + - install_yarn: + os: << parameters.os >> + - install_packaged_cli: + os: << parameters.os >> + - run_e2e_tests: + os: << parameters.os >> + - scan_e2e_test_artifacts: + os: << parameters.os >> + - store_test_results: + path: packages/amplify-e2e-tests/ + - store_artifacts: + path: packages/amplify-e2e-tests/amplify-e2e-reports + environment: + TEST_SUITE: src/__tests__/version-gating.test.ts + CLI_REGION: ap-southeast-1 plugin-amplify_e2e_tests_pkg: parameters: os: @@ -7850,7 +7937,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/plugin.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 init-special-case-amplify_e2e_tests_pkg: parameters: os: @@ -7885,7 +7972,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/init-special-case.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 datastore-modelgen-amplify_e2e_tests_pkg: parameters: os: @@ -7920,7 +8007,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/datastore-modelgen.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 amplify-configure-amplify_e2e_tests_pkg: parameters: os: @@ -7955,7 +8042,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/amplify-configure.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 init-amplify_e2e_tests_pkg: parameters: os: @@ -7990,7 +8077,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/init.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 tags-amplify_e2e_tests_pkg: parameters: os: @@ -8025,7 +8112,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/tags.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 notifications-amplify_e2e_tests_pkg: parameters: os: @@ -8060,7 +8147,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/notifications.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 schema-versioned-amplify_e2e_tests_pkg: parameters: os: @@ -8095,7 +8182,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-versioned.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-data-access-patterns-amplify_e2e_tests_pkg: parameters: os: @@ -8130,7 +8217,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-data-access-patterns.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 interactions-amplify_e2e_tests_pkg: parameters: os: @@ -8200,7 +8287,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-predictions.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 amplify-app-amplify_e2e_tests_pkg: parameters: os: @@ -8235,7 +8322,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/amplify-app.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 hosting-amplify_e2e_tests_pkg: parameters: os: @@ -8270,7 +8357,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/hosting.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 analytics-amplify_e2e_tests_pkg: parameters: os: @@ -8305,7 +8392,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/analytics.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 feature-flags-amplify_e2e_tests_pkg: parameters: os: @@ -8340,7 +8427,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/feature-flags.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-iterative-update-2-amplify_e2e_tests_pkg: parameters: os: @@ -8375,7 +8462,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-iterative-update-2.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 containers-api-amplify_e2e_tests_pkg: parameters: os: @@ -8410,7 +8497,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/containers-api.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 predictions-amplify_e2e_tests_pkg: parameters: os: @@ -8445,7 +8532,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/predictions.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 hostingPROD-amplify_e2e_tests_pkg: parameters: os: @@ -8480,7 +8567,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/hostingPROD.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 geo-add-amplify_e2e_tests_pkg: parameters: os: @@ -8515,7 +8602,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/geo-add.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 geo-update-amplify_e2e_tests_pkg: parameters: os: @@ -8550,7 +8637,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/geo-update.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 geo-remove-amplify_e2e_tests_pkg: parameters: os: @@ -8585,7 +8672,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/geo-remove.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-auth-10-amplify_e2e_tests_pkg: parameters: os: @@ -8620,7 +8707,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-10.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-key-amplify_e2e_tests_pkg: parameters: os: @@ -8655,7 +8742,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-key.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 auth_1-amplify_e2e_tests_pkg: parameters: os: @@ -8690,7 +8777,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/auth_1.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 auth_5-amplify_e2e_tests_pkg: parameters: os: @@ -8725,7 +8812,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/auth_5.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 function_3-amplify_e2e_tests_pkg: parameters: os: @@ -8760,7 +8847,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/function_3.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 schema-iterative-update-1-amplify_e2e_tests_pkg: parameters: os: @@ -8795,7 +8882,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-iterative-update-1.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 schema-auth-3-amplify_e2e_tests_pkg: parameters: os: @@ -8830,7 +8917,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-3.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 delete-amplify_e2e_tests_pkg: parameters: os: @@ -8865,7 +8952,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/delete.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 function_2-amplify_e2e_tests_pkg: parameters: os: @@ -8900,7 +8987,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/function_2.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 auth_3-amplify_e2e_tests_pkg: parameters: os: @@ -8935,7 +9022,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/auth_3.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 migration-api-key-migration1-amplify_e2e_tests_pkg: parameters: os: @@ -8970,7 +9057,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/migration/api.key.migration1.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 auth_4-amplify_e2e_tests_pkg: parameters: os: @@ -9005,7 +9092,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/auth_4.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 schema-auth-7-amplify_e2e_tests_pkg: parameters: os: @@ -9040,7 +9127,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-7.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 schema-auth-8-amplify_e2e_tests_pkg: parameters: os: @@ -9075,7 +9162,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-8.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-searchable-amplify_e2e_tests_pkg: parameters: os: @@ -9110,7 +9197,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-searchable.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-auth-4-amplify_e2e_tests_pkg: parameters: os: @@ -9145,7 +9232,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-4.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 api_3-amplify_e2e_tests_pkg: parameters: os: @@ -9180,7 +9267,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/api_3.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 import_auth_1-amplify_e2e_tests_pkg: parameters: os: @@ -9215,7 +9302,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/import_auth_1.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 import_auth_2-amplify_e2e_tests_pkg: parameters: os: @@ -9250,7 +9337,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/import_auth_2.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 import_s3_1-amplify_e2e_tests_pkg: parameters: os: @@ -9285,7 +9372,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/import_s3_1.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 USE_PARENT_ACCOUNT: 1 import_dynamodb_1-amplify_e2e_tests_pkg: parameters: @@ -9321,7 +9408,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/import_dynamodb_1.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 USE_PARENT_ACCOUNT: 1 schema-iterative-rollback-1-amplify_e2e_tests_pkg: parameters: @@ -9357,7 +9444,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-iterative-rollback-1.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-iterative-rollback-2-amplify_e2e_tests_pkg: parameters: os: @@ -9392,7 +9479,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-iterative-rollback-2.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 env-amplify_e2e_tests_pkg: parameters: os: @@ -9427,7 +9514,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/env.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 auth_2-amplify_e2e_tests_pkg: parameters: os: @@ -9462,7 +9549,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/auth_2.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 USE_PARENT_ACCOUNT: 1 schema-auth-9-amplify_e2e_tests_pkg: parameters: @@ -9498,7 +9585,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-9.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 schema-auth-11-amplify_e2e_tests_pkg: parameters: os: @@ -9533,7 +9620,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-11.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 migration-api-key-migration2-amplify_e2e_tests_pkg: parameters: os: @@ -9568,7 +9655,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/migration/api.key.migration2.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 USE_PARENT_ACCOUNT: 1 migration-api-key-migration3-amplify_e2e_tests_pkg: parameters: @@ -9604,7 +9691,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/migration/api.key.migration3.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 USE_PARENT_ACCOUNT: 1 function_1-amplify_e2e_tests_pkg: parameters: @@ -9640,7 +9727,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/function_1.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 schema-auth-1-amplify_e2e_tests_pkg: parameters: os: @@ -9675,7 +9762,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-1.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 function_4-amplify_e2e_tests_pkg: parameters: os: @@ -9710,7 +9797,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/function_4.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 schema-model-amplify_e2e_tests_pkg: parameters: os: @@ -9745,7 +9832,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-model.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 migration-api-connection-migration-amplify_e2e_tests_pkg: parameters: os: @@ -9780,7 +9867,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/migration/api.connection.migration.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 schema-connection-amplify_e2e_tests_pkg: parameters: os: @@ -9815,7 +9902,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-connection.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 schema-auth-6-amplify_e2e_tests_pkg: parameters: os: @@ -9850,7 +9937,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-6.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-iterative-update-3-amplify_e2e_tests_pkg: parameters: os: @@ -9885,7 +9972,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-iterative-update-3.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 schema-auth-2-amplify_e2e_tests_pkg: parameters: os: @@ -9920,7 +10007,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-2.test.ts - CLI_REGION: us-west-2 + CLI_REGION: eu-west-2 api_1-amplify_e2e_tests_pkg: parameters: os: @@ -9955,7 +10042,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/api_1.test.ts - CLI_REGION: eu-west-2 + CLI_REGION: eu-central-1 USE_PARENT_ACCOUNT: 1 schema-auth-5-amplify_e2e_tests_pkg: parameters: @@ -9991,7 +10078,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-auth-5.test.ts - CLI_REGION: eu-central-1 + CLI_REGION: ap-northeast-1 api_2-amplify_e2e_tests_pkg: parameters: os: @@ -10026,7 +10113,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/api_2.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-1 USE_PARENT_ACCOUNT: 1 api_5-amplify_e2e_tests_pkg: parameters: @@ -10062,7 +10149,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/api_5.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-southeast-2 api_6-amplify_e2e_tests_pkg: parameters: os: @@ -10097,7 +10184,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/api_6.test.ts - CLI_REGION: ap-southeast-2 + CLI_REGION: us-east-2 schema-iterative-update-4-amplify_e2e_tests_pkg: parameters: os: @@ -10132,7 +10219,7 @@ jobs: path: packages/amplify-e2e-tests/amplify-e2e-reports environment: TEST_SUITE: src/__tests__/schema-iterative-update-4.test.ts - CLI_REGION: us-east-2 + CLI_REGION: us-west-2 AuthV2Transformer-e2e-graphql_e2e_tests: working_directory: ~/repo parameters: @@ -12273,7 +12360,24 @@ workflows: - layer-2-amplify_e2e_tests - pull-amplify_e2e_tests - schema-iterative-update-locking-amplify_e2e_tests + - init-special-case-amplify_e2e_tests + - schema-data-access-patterns-amplify_e2e_tests + - schema-iterative-update-2-amplify_e2e_tests + - schema-auth-10-amplify_e2e_tests + - delete-amplify_e2e_tests + - schema-searchable-amplify_e2e_tests + - schema-iterative-rollback-1-amplify_e2e_tests + - migration-api-key-migration3-amplify_e2e_tests + - schema-auth-6-amplify_e2e_tests + - api_6-amplify_e2e_tests + - auth_6-amplify_e2e_tests + - frontend_config_drift-amplify_e2e_tests + - iam-permissions-boundary-amplify_e2e_tests + - layer-3-amplify_e2e_tests + - resolvers-amplify_e2e_tests + - storage-1-amplify_e2e_tests - datastore-modelgen-amplify_e2e_tests + - interactions-amplify_e2e_tests - containers-api-amplify_e2e_tests - schema-key-amplify_e2e_tests - function_2-amplify_e2e_tests @@ -12282,14 +12386,13 @@ workflows: - function_1-amplify_e2e_tests - schema-iterative-update-3-amplify_e2e_tests - schema-iterative-update-4-amplify_e2e_tests - - auth_6-amplify_e2e_tests - - frontend_config_drift-amplify_e2e_tests - - iam-permissions-boundary-amplify_e2e_tests - - layer-3-amplify_e2e_tests - - resolvers-amplify_e2e_tests - - storage-1-amplify_e2e_tests + - auth_7-amplify_e2e_tests + - function_5-amplify_e2e_tests + - import_auth_3-amplify_e2e_tests + - layer-4-amplify_e2e_tests + - s3-sse-amplify_e2e_tests + - storage-2-amplify_e2e_tests - amplify-configure-amplify_e2e_tests - - interactions-amplify_e2e_tests - schema-predictions-amplify_e2e_tests - predictions-amplify_e2e_tests - auth_1-amplify_e2e_tests @@ -12298,12 +12401,12 @@ workflows: - env-amplify_e2e_tests - schema-auth-1-amplify_e2e_tests - schema-auth-2-amplify_e2e_tests - - auth_7-amplify_e2e_tests - - function_5-amplify_e2e_tests - - import_auth_3-amplify_e2e_tests - - layer-4-amplify_e2e_tests - - s3-sse-amplify_e2e_tests - - storage-2-amplify_e2e_tests + - auth_8-amplify_e2e_tests + - function_6-amplify_e2e_tests + - import_dynamodb_2-amplify_e2e_tests + - migration-api-connection-migration2-amplify_e2e_tests + - schema-auth-12-amplify_e2e_tests + - storage-3-amplify_e2e_tests - init-amplify_e2e_tests - amplify-app-amplify_e2e_tests - hostingPROD-amplify_e2e_tests @@ -12313,12 +12416,12 @@ workflows: - auth_2-amplify_e2e_tests - function_4-amplify_e2e_tests - api_1-amplify_e2e_tests - - auth_8-amplify_e2e_tests - - function_6-amplify_e2e_tests - - import_dynamodb_2-amplify_e2e_tests - - migration-api-connection-migration2-amplify_e2e_tests - - schema-auth-12-amplify_e2e_tests - - storage-3-amplify_e2e_tests + - configure-project-amplify_e2e_tests + - function_7-amplify_e2e_tests + - import_s3_2-amplify_e2e_tests + - migration-api-key-migration4-amplify_e2e_tests + - schema-auth-13-amplify_e2e_tests + - storage-4-amplify_e2e_tests - tags-amplify_e2e_tests - hosting-amplify_e2e_tests - geo-add-amplify_e2e_tests @@ -12328,12 +12431,12 @@ workflows: - schema-auth-9-amplify_e2e_tests - schema-model-amplify_e2e_tests - schema-auth-5-amplify_e2e_tests - - configure-project-amplify_e2e_tests - - function_7-amplify_e2e_tests - - import_s3_2-amplify_e2e_tests - - migration-api-key-migration4-amplify_e2e_tests - - schema-auth-13-amplify_e2e_tests - - storage-4-amplify_e2e_tests + - container-hosting-amplify_e2e_tests + - function_8-amplify_e2e_tests + - import_s3_3-amplify_e2e_tests + - migration-api-key-migration5-amplify_e2e_tests + - schema-function-1-amplify_e2e_tests + - version-gating-amplify_e2e_tests - notifications-amplify_e2e_tests - analytics-amplify_e2e_tests - geo-update-amplify_e2e_tests @@ -12343,11 +12446,11 @@ workflows: - schema-auth-11-amplify_e2e_tests - migration-api-connection-migration-amplify_e2e_tests - api_2-amplify_e2e_tests - - container-hosting-amplify_e2e_tests - - function_8-amplify_e2e_tests - - import_s3_3-amplify_e2e_tests - - migration-api-key-migration5-amplify_e2e_tests - - schema-function-1-amplify_e2e_tests + - custom_policies_container-amplify_e2e_tests + - function_9-amplify_e2e_tests + - layer-1-amplify_e2e_tests + - migration-node-function-amplify_e2e_tests + - schema-function-2-amplify_e2e_tests - plugin-amplify_e2e_tests - schema-versioned-amplify_e2e_tests - feature-flags-amplify_e2e_tests @@ -12358,28 +12461,30 @@ workflows: - migration-api-key-migration2-amplify_e2e_tests - schema-connection-amplify_e2e_tests - api_5-amplify_e2e_tests - - custom_policies_container-amplify_e2e_tests - - function_9-amplify_e2e_tests - - layer-1-amplify_e2e_tests - - migration-node-function-amplify_e2e_tests - - schema-function-2-amplify_e2e_tests - - init-special-case-amplify_e2e_tests - - schema-data-access-patterns-amplify_e2e_tests - - schema-iterative-update-2-amplify_e2e_tests - - schema-auth-10-amplify_e2e_tests - - delete-amplify_e2e_tests - - schema-searchable-amplify_e2e_tests - - schema-iterative-rollback-1-amplify_e2e_tests - - migration-api-key-migration3-amplify_e2e_tests - - schema-auth-6-amplify_e2e_tests - - api_6-amplify_e2e_tests - api_4-amplify_e2e_tests_pkg - custom_policies_function-amplify_e2e_tests_pkg - hooks-amplify_e2e_tests_pkg - layer-2-amplify_e2e_tests_pkg - pull-amplify_e2e_tests_pkg - schema-iterative-update-locking-amplify_e2e_tests_pkg + - init-special-case-amplify_e2e_tests_pkg + - schema-data-access-patterns-amplify_e2e_tests_pkg + - schema-iterative-update-2-amplify_e2e_tests_pkg + - schema-auth-10-amplify_e2e_tests_pkg + - delete-amplify_e2e_tests_pkg + - schema-searchable-amplify_e2e_tests_pkg + - schema-iterative-rollback-1-amplify_e2e_tests_pkg + - migration-api-key-migration3-amplify_e2e_tests_pkg + - schema-auth-6-amplify_e2e_tests_pkg + - api_6-amplify_e2e_tests_pkg + - auth_6-amplify_e2e_tests_pkg + - frontend_config_drift-amplify_e2e_tests_pkg + - iam-permissions-boundary-amplify_e2e_tests_pkg + - layer-3-amplify_e2e_tests_pkg + - resolvers-amplify_e2e_tests_pkg + - storage-1-amplify_e2e_tests_pkg - datastore-modelgen-amplify_e2e_tests_pkg + - interactions-amplify_e2e_tests_pkg - containers-api-amplify_e2e_tests_pkg - schema-key-amplify_e2e_tests_pkg - function_2-amplify_e2e_tests_pkg @@ -12388,14 +12493,13 @@ workflows: - function_1-amplify_e2e_tests_pkg - schema-iterative-update-3-amplify_e2e_tests_pkg - schema-iterative-update-4-amplify_e2e_tests_pkg - - auth_6-amplify_e2e_tests_pkg - - frontend_config_drift-amplify_e2e_tests_pkg - - iam-permissions-boundary-amplify_e2e_tests_pkg - - layer-3-amplify_e2e_tests_pkg - - resolvers-amplify_e2e_tests_pkg - - storage-1-amplify_e2e_tests_pkg + - auth_7-amplify_e2e_tests_pkg + - function_5-amplify_e2e_tests_pkg + - import_auth_3-amplify_e2e_tests_pkg + - layer-4-amplify_e2e_tests_pkg + - s3-sse-amplify_e2e_tests_pkg + - storage-2-amplify_e2e_tests_pkg - amplify-configure-amplify_e2e_tests_pkg - - interactions-amplify_e2e_tests_pkg - schema-predictions-amplify_e2e_tests_pkg - predictions-amplify_e2e_tests_pkg - auth_1-amplify_e2e_tests_pkg @@ -12404,12 +12508,12 @@ workflows: - env-amplify_e2e_tests_pkg - schema-auth-1-amplify_e2e_tests_pkg - schema-auth-2-amplify_e2e_tests_pkg - - auth_7-amplify_e2e_tests_pkg - - function_5-amplify_e2e_tests_pkg - - import_auth_3-amplify_e2e_tests_pkg - - layer-4-amplify_e2e_tests_pkg - - s3-sse-amplify_e2e_tests_pkg - - storage-2-amplify_e2e_tests_pkg + - auth_8-amplify_e2e_tests_pkg + - function_6-amplify_e2e_tests_pkg + - import_dynamodb_2-amplify_e2e_tests_pkg + - migration-api-connection-migration2-amplify_e2e_tests_pkg + - schema-auth-12-amplify_e2e_tests_pkg + - storage-3-amplify_e2e_tests_pkg - init-amplify_e2e_tests_pkg - amplify-app-amplify_e2e_tests_pkg - hostingPROD-amplify_e2e_tests_pkg @@ -12419,12 +12523,12 @@ workflows: - auth_2-amplify_e2e_tests_pkg - function_4-amplify_e2e_tests_pkg - api_1-amplify_e2e_tests_pkg - - auth_8-amplify_e2e_tests_pkg - - function_6-amplify_e2e_tests_pkg - - import_dynamodb_2-amplify_e2e_tests_pkg - - migration-api-connection-migration2-amplify_e2e_tests_pkg - - schema-auth-12-amplify_e2e_tests_pkg - - storage-3-amplify_e2e_tests_pkg + - configure-project-amplify_e2e_tests_pkg + - function_7-amplify_e2e_tests_pkg + - import_s3_2-amplify_e2e_tests_pkg + - migration-api-key-migration4-amplify_e2e_tests_pkg + - schema-auth-13-amplify_e2e_tests_pkg + - storage-4-amplify_e2e_tests_pkg - tags-amplify_e2e_tests_pkg - hosting-amplify_e2e_tests_pkg - geo-add-amplify_e2e_tests_pkg @@ -12434,12 +12538,12 @@ workflows: - schema-auth-9-amplify_e2e_tests_pkg - schema-model-amplify_e2e_tests_pkg - schema-auth-5-amplify_e2e_tests_pkg - - configure-project-amplify_e2e_tests_pkg - - function_7-amplify_e2e_tests_pkg - - import_s3_2-amplify_e2e_tests_pkg - - migration-api-key-migration4-amplify_e2e_tests_pkg - - schema-auth-13-amplify_e2e_tests_pkg - - storage-4-amplify_e2e_tests_pkg + - container-hosting-amplify_e2e_tests_pkg + - function_8-amplify_e2e_tests_pkg + - import_s3_3-amplify_e2e_tests_pkg + - migration-api-key-migration5-amplify_e2e_tests_pkg + - schema-function-1-amplify_e2e_tests_pkg + - version-gating-amplify_e2e_tests_pkg - notifications-amplify_e2e_tests_pkg - analytics-amplify_e2e_tests_pkg - geo-update-amplify_e2e_tests_pkg @@ -12449,11 +12553,11 @@ workflows: - schema-auth-11-amplify_e2e_tests_pkg - migration-api-connection-migration-amplify_e2e_tests_pkg - api_2-amplify_e2e_tests_pkg - - container-hosting-amplify_e2e_tests_pkg - - function_8-amplify_e2e_tests_pkg - - import_s3_3-amplify_e2e_tests_pkg - - migration-api-key-migration5-amplify_e2e_tests_pkg - - schema-function-1-amplify_e2e_tests_pkg + - custom_policies_container-amplify_e2e_tests_pkg + - function_9-amplify_e2e_tests_pkg + - layer-1-amplify_e2e_tests_pkg + - migration-node-function-amplify_e2e_tests_pkg + - schema-function-2-amplify_e2e_tests_pkg - plugin-amplify_e2e_tests_pkg - schema-versioned-amplify_e2e_tests_pkg - feature-flags-amplify_e2e_tests_pkg @@ -12464,21 +12568,6 @@ workflows: - migration-api-key-migration2-amplify_e2e_tests_pkg - schema-connection-amplify_e2e_tests_pkg - api_5-amplify_e2e_tests_pkg - - custom_policies_container-amplify_e2e_tests_pkg - - function_9-amplify_e2e_tests_pkg - - layer-1-amplify_e2e_tests_pkg - - migration-node-function-amplify_e2e_tests_pkg - - schema-function-2-amplify_e2e_tests_pkg - - init-special-case-amplify_e2e_tests_pkg - - schema-data-access-patterns-amplify_e2e_tests_pkg - - schema-iterative-update-2-amplify_e2e_tests_pkg - - schema-auth-10-amplify_e2e_tests_pkg - - delete-amplify_e2e_tests_pkg - - schema-searchable-amplify_e2e_tests_pkg - - schema-iterative-rollback-1-amplify_e2e_tests_pkg - - migration-api-key-migration3-amplify_e2e_tests_pkg - - schema-auth-6-amplify_e2e_tests_pkg - - api_6-amplify_e2e_tests_pkg - >- migration_tests-auth-deployment-migration-auth-deployment-secrets-amplify_migration_tests_v4 - update_tests-function_migration_update-amplify_migration_tests_v4 @@ -12529,7 +12618,24 @@ workflows: - layer-2-amplify_e2e_tests - pull-amplify_e2e_tests - schema-iterative-update-locking-amplify_e2e_tests + - init-special-case-amplify_e2e_tests + - schema-data-access-patterns-amplify_e2e_tests + - schema-iterative-update-2-amplify_e2e_tests + - schema-auth-10-amplify_e2e_tests + - delete-amplify_e2e_tests + - schema-searchable-amplify_e2e_tests + - schema-iterative-rollback-1-amplify_e2e_tests + - migration-api-key-migration3-amplify_e2e_tests + - schema-auth-6-amplify_e2e_tests + - api_6-amplify_e2e_tests + - auth_6-amplify_e2e_tests + - frontend_config_drift-amplify_e2e_tests + - iam-permissions-boundary-amplify_e2e_tests + - layer-3-amplify_e2e_tests + - resolvers-amplify_e2e_tests + - storage-1-amplify_e2e_tests - datastore-modelgen-amplify_e2e_tests + - interactions-amplify_e2e_tests - containers-api-amplify_e2e_tests - schema-key-amplify_e2e_tests - function_2-amplify_e2e_tests @@ -12538,14 +12644,13 @@ workflows: - function_1-amplify_e2e_tests - schema-iterative-update-3-amplify_e2e_tests - schema-iterative-update-4-amplify_e2e_tests - - auth_6-amplify_e2e_tests - - frontend_config_drift-amplify_e2e_tests - - iam-permissions-boundary-amplify_e2e_tests - - layer-3-amplify_e2e_tests - - resolvers-amplify_e2e_tests - - storage-1-amplify_e2e_tests + - auth_7-amplify_e2e_tests + - function_5-amplify_e2e_tests + - import_auth_3-amplify_e2e_tests + - layer-4-amplify_e2e_tests + - s3-sse-amplify_e2e_tests + - storage-2-amplify_e2e_tests - amplify-configure-amplify_e2e_tests - - interactions-amplify_e2e_tests - schema-predictions-amplify_e2e_tests - predictions-amplify_e2e_tests - auth_1-amplify_e2e_tests @@ -12554,12 +12659,12 @@ workflows: - env-amplify_e2e_tests - schema-auth-1-amplify_e2e_tests - schema-auth-2-amplify_e2e_tests - - auth_7-amplify_e2e_tests - - function_5-amplify_e2e_tests - - import_auth_3-amplify_e2e_tests - - layer-4-amplify_e2e_tests - - s3-sse-amplify_e2e_tests - - storage-2-amplify_e2e_tests + - auth_8-amplify_e2e_tests + - function_6-amplify_e2e_tests + - import_dynamodb_2-amplify_e2e_tests + - migration-api-connection-migration2-amplify_e2e_tests + - schema-auth-12-amplify_e2e_tests + - storage-3-amplify_e2e_tests - init-amplify_e2e_tests - amplify-app-amplify_e2e_tests - hostingPROD-amplify_e2e_tests @@ -12569,12 +12674,12 @@ workflows: - auth_2-amplify_e2e_tests - function_4-amplify_e2e_tests - api_1-amplify_e2e_tests - - auth_8-amplify_e2e_tests - - function_6-amplify_e2e_tests - - import_dynamodb_2-amplify_e2e_tests - - migration-api-connection-migration2-amplify_e2e_tests - - schema-auth-12-amplify_e2e_tests - - storage-3-amplify_e2e_tests + - configure-project-amplify_e2e_tests + - function_7-amplify_e2e_tests + - import_s3_2-amplify_e2e_tests + - migration-api-key-migration4-amplify_e2e_tests + - schema-auth-13-amplify_e2e_tests + - storage-4-amplify_e2e_tests - tags-amplify_e2e_tests - hosting-amplify_e2e_tests - geo-add-amplify_e2e_tests @@ -12584,12 +12689,12 @@ workflows: - schema-auth-9-amplify_e2e_tests - schema-model-amplify_e2e_tests - schema-auth-5-amplify_e2e_tests - - configure-project-amplify_e2e_tests - - function_7-amplify_e2e_tests - - import_s3_2-amplify_e2e_tests - - migration-api-key-migration4-amplify_e2e_tests - - schema-auth-13-amplify_e2e_tests - - storage-4-amplify_e2e_tests + - container-hosting-amplify_e2e_tests + - function_8-amplify_e2e_tests + - import_s3_3-amplify_e2e_tests + - migration-api-key-migration5-amplify_e2e_tests + - schema-function-1-amplify_e2e_tests + - version-gating-amplify_e2e_tests - notifications-amplify_e2e_tests - analytics-amplify_e2e_tests - geo-update-amplify_e2e_tests @@ -12599,11 +12704,11 @@ workflows: - schema-auth-11-amplify_e2e_tests - migration-api-connection-migration-amplify_e2e_tests - api_2-amplify_e2e_tests - - container-hosting-amplify_e2e_tests - - function_8-amplify_e2e_tests - - import_s3_3-amplify_e2e_tests - - migration-api-key-migration5-amplify_e2e_tests - - schema-function-1-amplify_e2e_tests + - custom_policies_container-amplify_e2e_tests + - function_9-amplify_e2e_tests + - layer-1-amplify_e2e_tests + - migration-node-function-amplify_e2e_tests + - schema-function-2-amplify_e2e_tests - plugin-amplify_e2e_tests - schema-versioned-amplify_e2e_tests - feature-flags-amplify_e2e_tests @@ -12614,28 +12719,30 @@ workflows: - migration-api-key-migration2-amplify_e2e_tests - schema-connection-amplify_e2e_tests - api_5-amplify_e2e_tests - - custom_policies_container-amplify_e2e_tests - - function_9-amplify_e2e_tests - - layer-1-amplify_e2e_tests - - migration-node-function-amplify_e2e_tests - - schema-function-2-amplify_e2e_tests - - init-special-case-amplify_e2e_tests - - schema-data-access-patterns-amplify_e2e_tests - - schema-iterative-update-2-amplify_e2e_tests - - schema-auth-10-amplify_e2e_tests - - delete-amplify_e2e_tests - - schema-searchable-amplify_e2e_tests - - schema-iterative-rollback-1-amplify_e2e_tests - - migration-api-key-migration3-amplify_e2e_tests - - schema-auth-6-amplify_e2e_tests - - api_6-amplify_e2e_tests - api_4-amplify_e2e_tests_pkg - custom_policies_function-amplify_e2e_tests_pkg - hooks-amplify_e2e_tests_pkg - layer-2-amplify_e2e_tests_pkg - pull-amplify_e2e_tests_pkg - schema-iterative-update-locking-amplify_e2e_tests_pkg + - init-special-case-amplify_e2e_tests_pkg + - schema-data-access-patterns-amplify_e2e_tests_pkg + - schema-iterative-update-2-amplify_e2e_tests_pkg + - schema-auth-10-amplify_e2e_tests_pkg + - delete-amplify_e2e_tests_pkg + - schema-searchable-amplify_e2e_tests_pkg + - schema-iterative-rollback-1-amplify_e2e_tests_pkg + - migration-api-key-migration3-amplify_e2e_tests_pkg + - schema-auth-6-amplify_e2e_tests_pkg + - api_6-amplify_e2e_tests_pkg + - auth_6-amplify_e2e_tests_pkg + - frontend_config_drift-amplify_e2e_tests_pkg + - iam-permissions-boundary-amplify_e2e_tests_pkg + - layer-3-amplify_e2e_tests_pkg + - resolvers-amplify_e2e_tests_pkg + - storage-1-amplify_e2e_tests_pkg - datastore-modelgen-amplify_e2e_tests_pkg + - interactions-amplify_e2e_tests_pkg - containers-api-amplify_e2e_tests_pkg - schema-key-amplify_e2e_tests_pkg - function_2-amplify_e2e_tests_pkg @@ -12644,14 +12751,13 @@ workflows: - function_1-amplify_e2e_tests_pkg - schema-iterative-update-3-amplify_e2e_tests_pkg - schema-iterative-update-4-amplify_e2e_tests_pkg - - auth_6-amplify_e2e_tests_pkg - - frontend_config_drift-amplify_e2e_tests_pkg - - iam-permissions-boundary-amplify_e2e_tests_pkg - - layer-3-amplify_e2e_tests_pkg - - resolvers-amplify_e2e_tests_pkg - - storage-1-amplify_e2e_tests_pkg + - auth_7-amplify_e2e_tests_pkg + - function_5-amplify_e2e_tests_pkg + - import_auth_3-amplify_e2e_tests_pkg + - layer-4-amplify_e2e_tests_pkg + - s3-sse-amplify_e2e_tests_pkg + - storage-2-amplify_e2e_tests_pkg - amplify-configure-amplify_e2e_tests_pkg - - interactions-amplify_e2e_tests_pkg - schema-predictions-amplify_e2e_tests_pkg - predictions-amplify_e2e_tests_pkg - auth_1-amplify_e2e_tests_pkg @@ -12660,12 +12766,12 @@ workflows: - env-amplify_e2e_tests_pkg - schema-auth-1-amplify_e2e_tests_pkg - schema-auth-2-amplify_e2e_tests_pkg - - auth_7-amplify_e2e_tests_pkg - - function_5-amplify_e2e_tests_pkg - - import_auth_3-amplify_e2e_tests_pkg - - layer-4-amplify_e2e_tests_pkg - - s3-sse-amplify_e2e_tests_pkg - - storage-2-amplify_e2e_tests_pkg + - auth_8-amplify_e2e_tests_pkg + - function_6-amplify_e2e_tests_pkg + - import_dynamodb_2-amplify_e2e_tests_pkg + - migration-api-connection-migration2-amplify_e2e_tests_pkg + - schema-auth-12-amplify_e2e_tests_pkg + - storage-3-amplify_e2e_tests_pkg - init-amplify_e2e_tests_pkg - amplify-app-amplify_e2e_tests_pkg - hostingPROD-amplify_e2e_tests_pkg @@ -12675,12 +12781,12 @@ workflows: - auth_2-amplify_e2e_tests_pkg - function_4-amplify_e2e_tests_pkg - api_1-amplify_e2e_tests_pkg - - auth_8-amplify_e2e_tests_pkg - - function_6-amplify_e2e_tests_pkg - - import_dynamodb_2-amplify_e2e_tests_pkg - - migration-api-connection-migration2-amplify_e2e_tests_pkg - - schema-auth-12-amplify_e2e_tests_pkg - - storage-3-amplify_e2e_tests_pkg + - configure-project-amplify_e2e_tests_pkg + - function_7-amplify_e2e_tests_pkg + - import_s3_2-amplify_e2e_tests_pkg + - migration-api-key-migration4-amplify_e2e_tests_pkg + - schema-auth-13-amplify_e2e_tests_pkg + - storage-4-amplify_e2e_tests_pkg - tags-amplify_e2e_tests_pkg - hosting-amplify_e2e_tests_pkg - geo-add-amplify_e2e_tests_pkg @@ -12690,12 +12796,12 @@ workflows: - schema-auth-9-amplify_e2e_tests_pkg - schema-model-amplify_e2e_tests_pkg - schema-auth-5-amplify_e2e_tests_pkg - - configure-project-amplify_e2e_tests_pkg - - function_7-amplify_e2e_tests_pkg - - import_s3_2-amplify_e2e_tests_pkg - - migration-api-key-migration4-amplify_e2e_tests_pkg - - schema-auth-13-amplify_e2e_tests_pkg - - storage-4-amplify_e2e_tests_pkg + - container-hosting-amplify_e2e_tests_pkg + - function_8-amplify_e2e_tests_pkg + - import_s3_3-amplify_e2e_tests_pkg + - migration-api-key-migration5-amplify_e2e_tests_pkg + - schema-function-1-amplify_e2e_tests_pkg + - version-gating-amplify_e2e_tests_pkg - notifications-amplify_e2e_tests_pkg - analytics-amplify_e2e_tests_pkg - geo-update-amplify_e2e_tests_pkg @@ -12705,11 +12811,11 @@ workflows: - schema-auth-11-amplify_e2e_tests_pkg - migration-api-connection-migration-amplify_e2e_tests_pkg - api_2-amplify_e2e_tests_pkg - - container-hosting-amplify_e2e_tests_pkg - - function_8-amplify_e2e_tests_pkg - - import_s3_3-amplify_e2e_tests_pkg - - migration-api-key-migration5-amplify_e2e_tests_pkg - - schema-function-1-amplify_e2e_tests_pkg + - custom_policies_container-amplify_e2e_tests_pkg + - function_9-amplify_e2e_tests_pkg + - layer-1-amplify_e2e_tests_pkg + - migration-node-function-amplify_e2e_tests_pkg + - schema-function-2-amplify_e2e_tests_pkg - plugin-amplify_e2e_tests_pkg - schema-versioned-amplify_e2e_tests_pkg - feature-flags-amplify_e2e_tests_pkg @@ -12720,21 +12826,6 @@ workflows: - migration-api-key-migration2-amplify_e2e_tests_pkg - schema-connection-amplify_e2e_tests_pkg - api_5-amplify_e2e_tests_pkg - - custom_policies_container-amplify_e2e_tests_pkg - - function_9-amplify_e2e_tests_pkg - - layer-1-amplify_e2e_tests_pkg - - migration-node-function-amplify_e2e_tests_pkg - - schema-function-2-amplify_e2e_tests_pkg - - init-special-case-amplify_e2e_tests_pkg - - schema-data-access-patterns-amplify_e2e_tests_pkg - - schema-iterative-update-2-amplify_e2e_tests_pkg - - schema-auth-10-amplify_e2e_tests_pkg - - delete-amplify_e2e_tests_pkg - - schema-searchable-amplify_e2e_tests_pkg - - schema-iterative-rollback-1-amplify_e2e_tests_pkg - - migration-api-key-migration3-amplify_e2e_tests_pkg - - schema-auth-6-amplify_e2e_tests_pkg - - api_6-amplify_e2e_tests_pkg - AuthV2Transformer-e2e-graphql_e2e_tests - HttpTransformerV2-e2e-graphql_e2e_tests - ModelConnectionTransformer-e2e-graphql_e2e_tests @@ -12929,7 +13020,7 @@ workflows: parameters: os: - linux - - datastore-modelgen-amplify_e2e_tests: + - init-special-case-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -12947,7 +13038,7 @@ workflows: parameters: os: - linux - - containers-api-amplify_e2e_tests: + - schema-data-access-patterns-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -12965,7 +13056,7 @@ workflows: parameters: os: - linux - - schema-key-amplify_e2e_tests: + - schema-iterative-update-2-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -12983,7 +13074,7 @@ workflows: parameters: os: - linux - - function_2-amplify_e2e_tests: + - schema-auth-10-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13001,7 +13092,7 @@ workflows: parameters: os: - linux - - schema-auth-4-amplify_e2e_tests: + - delete-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13019,7 +13110,7 @@ workflows: parameters: os: - linux - - schema-iterative-rollback-2-amplify_e2e_tests: + - schema-searchable-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13037,7 +13128,7 @@ workflows: parameters: os: - linux - - function_1-amplify_e2e_tests: + - schema-iterative-rollback-1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13055,7 +13146,7 @@ workflows: parameters: os: - linux - - schema-iterative-update-3-amplify_e2e_tests: + - migration-api-key-migration3-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13073,7 +13164,25 @@ workflows: parameters: os: - linux - - schema-iterative-update-4-amplify_e2e_tests: + - schema-auth-6-amplify_e2e_tests: + context: + - amplify-ecr-image-pull + - cleanup-resources + - e2e-auth-credentials + - e2e-test-context + filters: + branches: + only: + - master + - /tagged-release\/.*/ + - /run-e2e\/.*/ + requires: + - publish_to_local_registry + matrix: + parameters: + os: + - linux + - api_6-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13199,7 +13308,7 @@ workflows: parameters: os: - linux - - amplify-configure-amplify_e2e_tests: + - datastore-modelgen-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13235,7 +13344,7 @@ workflows: parameters: os: - linux - - schema-predictions-amplify_e2e_tests: + - containers-api-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13253,7 +13362,7 @@ workflows: parameters: os: - linux - - predictions-amplify_e2e_tests: + - schema-key-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13271,7 +13380,7 @@ workflows: parameters: os: - linux - - auth_1-amplify_e2e_tests: + - function_2-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13289,7 +13398,7 @@ workflows: parameters: os: - linux - - auth_3-amplify_e2e_tests: + - schema-auth-4-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13307,7 +13416,7 @@ workflows: parameters: os: - linux - - api_3-amplify_e2e_tests: + - schema-iterative-rollback-2-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13325,7 +13434,7 @@ workflows: parameters: os: - linux - - env-amplify_e2e_tests: + - function_1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13343,7 +13452,7 @@ workflows: parameters: os: - linux - - schema-auth-1-amplify_e2e_tests: + - schema-iterative-update-3-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13361,7 +13470,7 @@ workflows: parameters: os: - linux - - schema-auth-2-amplify_e2e_tests: + - schema-iterative-update-4-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13487,7 +13596,7 @@ workflows: parameters: os: - linux - - init-amplify_e2e_tests: + - amplify-configure-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13505,7 +13614,7 @@ workflows: parameters: os: - linux - - amplify-app-amplify_e2e_tests: + - schema-predictions-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13523,7 +13632,7 @@ workflows: parameters: os: - linux - - hostingPROD-amplify_e2e_tests: + - predictions-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13541,7 +13650,7 @@ workflows: parameters: os: - linux - - auth_5-amplify_e2e_tests: + - auth_1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13559,7 +13668,7 @@ workflows: parameters: os: - linux - - migration-api-key-migration1-amplify_e2e_tests: + - auth_3-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13577,7 +13686,7 @@ workflows: parameters: os: - linux - - import_auth_1-amplify_e2e_tests: + - api_3-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13595,7 +13704,7 @@ workflows: parameters: os: - linux - - auth_2-amplify_e2e_tests: + - env-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13613,7 +13722,7 @@ workflows: parameters: os: - linux - - function_4-amplify_e2e_tests: + - schema-auth-1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13631,7 +13740,7 @@ workflows: parameters: os: - linux - - api_1-amplify_e2e_tests: + - schema-auth-2-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13757,7 +13866,7 @@ workflows: parameters: os: - linux - - tags-amplify_e2e_tests: + - init-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13775,7 +13884,7 @@ workflows: parameters: os: - linux - - hosting-amplify_e2e_tests: + - amplify-app-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13793,7 +13902,7 @@ workflows: parameters: os: - linux - - geo-add-amplify_e2e_tests: + - hostingPROD-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13811,7 +13920,7 @@ workflows: parameters: os: - linux - - function_3-amplify_e2e_tests: + - auth_5-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13829,7 +13938,7 @@ workflows: parameters: os: - linux - - auth_4-amplify_e2e_tests: + - migration-api-key-migration1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13847,7 +13956,7 @@ workflows: parameters: os: - linux - - import_auth_2-amplify_e2e_tests: + - import_auth_1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13865,7 +13974,7 @@ workflows: parameters: os: - linux - - schema-auth-9-amplify_e2e_tests: + - auth_2-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13883,7 +13992,7 @@ workflows: parameters: os: - linux - - schema-model-amplify_e2e_tests: + - function_4-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -13901,7 +14010,7 @@ workflows: parameters: os: - linux - - schema-auth-5-amplify_e2e_tests: + - api_1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14027,7 +14136,7 @@ workflows: parameters: os: - linux - - notifications-amplify_e2e_tests: + - tags-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14045,7 +14154,7 @@ workflows: parameters: os: - linux - - analytics-amplify_e2e_tests: + - hosting-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14063,7 +14172,7 @@ workflows: parameters: os: - linux - - geo-update-amplify_e2e_tests: + - geo-add-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14081,7 +14190,7 @@ workflows: parameters: os: - linux - - schema-iterative-update-1-amplify_e2e_tests: + - function_3-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14099,7 +14208,7 @@ workflows: parameters: os: - linux - - schema-auth-7-amplify_e2e_tests: + - auth_4-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14117,7 +14226,7 @@ workflows: parameters: os: - linux - - import_s3_1-amplify_e2e_tests: + - import_auth_2-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14135,7 +14244,7 @@ workflows: parameters: os: - linux - - schema-auth-11-amplify_e2e_tests: + - schema-auth-9-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14153,7 +14262,7 @@ workflows: parameters: os: - linux - - migration-api-connection-migration-amplify_e2e_tests: + - schema-model-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14171,7 +14280,7 @@ workflows: parameters: os: - linux - - api_2-amplify_e2e_tests: + - schema-auth-5-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14279,7 +14388,7 @@ workflows: parameters: os: - linux - - plugin-amplify_e2e_tests: + - version-gating-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14297,7 +14406,7 @@ workflows: parameters: os: - linux - - schema-versioned-amplify_e2e_tests: + - notifications-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14315,7 +14424,7 @@ workflows: parameters: os: - linux - - feature-flags-amplify_e2e_tests: + - analytics-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14333,7 +14442,7 @@ workflows: parameters: os: - linux - - geo-remove-amplify_e2e_tests: + - geo-update-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14351,7 +14460,7 @@ workflows: parameters: os: - linux - - schema-auth-3-amplify_e2e_tests: + - schema-iterative-update-1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14369,7 +14478,7 @@ workflows: parameters: os: - linux - - schema-auth-8-amplify_e2e_tests: + - schema-auth-7-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14387,7 +14496,7 @@ workflows: parameters: os: - linux - - import_dynamodb_1-amplify_e2e_tests: + - import_s3_1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14405,7 +14514,7 @@ workflows: parameters: os: - linux - - migration-api-key-migration2-amplify_e2e_tests: + - schema-auth-11-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14423,7 +14532,7 @@ workflows: parameters: os: - linux - - schema-connection-amplify_e2e_tests: + - migration-api-connection-migration-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14441,7 +14550,7 @@ workflows: parameters: os: - linux - - api_5-amplify_e2e_tests: + - api_2-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14549,7 +14658,7 @@ workflows: parameters: os: - linux - - init-special-case-amplify_e2e_tests: + - plugin-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14567,7 +14676,7 @@ workflows: parameters: os: - linux - - schema-data-access-patterns-amplify_e2e_tests: + - schema-versioned-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14585,7 +14694,7 @@ workflows: parameters: os: - linux - - schema-iterative-update-2-amplify_e2e_tests: + - feature-flags-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14603,7 +14712,7 @@ workflows: parameters: os: - linux - - schema-auth-10-amplify_e2e_tests: + - geo-remove-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14621,7 +14730,7 @@ workflows: parameters: os: - linux - - delete-amplify_e2e_tests: + - schema-auth-3-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14639,7 +14748,7 @@ workflows: parameters: os: - linux - - schema-searchable-amplify_e2e_tests: + - schema-auth-8-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14657,7 +14766,7 @@ workflows: parameters: os: - linux - - schema-iterative-rollback-1-amplify_e2e_tests: + - import_dynamodb_1-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14675,7 +14784,7 @@ workflows: parameters: os: - linux - - migration-api-key-migration3-amplify_e2e_tests: + - migration-api-key-migration2-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14693,7 +14802,7 @@ workflows: parameters: os: - linux - - schema-auth-6-amplify_e2e_tests: + - schema-connection-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14711,7 +14820,7 @@ workflows: parameters: os: - linux - - api_6-amplify_e2e_tests: + - api_5-amplify_e2e_tests: context: - amplify-ecr-image-pull - cleanup-resources @@ -14838,7 +14947,7 @@ workflows: parameters: os: - linux - - datastore-modelgen-amplify_e2e_tests_pkg: + - init-special-case-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -14856,7 +14965,8 @@ workflows: parameters: os: - linux - - containers-api-amplify_e2e_tests_pkg: + - windows + - schema-data-access-patterns-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -14875,7 +14985,7 @@ workflows: os: - linux - windows - - schema-key-amplify_e2e_tests_pkg: + - schema-iterative-update-2-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -14893,7 +15003,7 @@ workflows: parameters: os: - linux - - function_2-amplify_e2e_tests_pkg: + - schema-auth-10-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -14911,7 +15021,26 @@ workflows: parameters: os: - linux - - schema-auth-4-amplify_e2e_tests_pkg: + - windows + - delete-amplify_e2e_tests_pkg: + context: + - amplify-ecr-image-pull + - cleanup-resources + - e2e-auth-credentials + - e2e-test-context + filters: + branches: + only: + - master + - /tagged-release\/.*/ + - /run-e2e\/.*/ + requires: + - build_pkg_binaries + matrix: + parameters: + os: + - linux + - schema-searchable-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -14930,7 +15059,7 @@ workflows: os: - linux - windows - - schema-iterative-rollback-2-amplify_e2e_tests_pkg: + - schema-iterative-rollback-1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -14948,7 +15077,7 @@ workflows: parameters: os: - linux - - function_1-amplify_e2e_tests_pkg: + - migration-api-key-migration3-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -14966,7 +15095,7 @@ workflows: parameters: os: - linux - - schema-iterative-update-3-amplify_e2e_tests_pkg: + - schema-auth-6-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -14984,7 +15113,8 @@ workflows: parameters: os: - linux - - schema-iterative-update-4-amplify_e2e_tests_pkg: + - windows + - api_6-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15114,7 +15244,7 @@ workflows: os: - linux - windows - - amplify-configure-amplify_e2e_tests_pkg: + - datastore-modelgen-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15132,7 +15262,6 @@ workflows: parameters: os: - linux - - windows - interactions-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull @@ -15152,7 +15281,7 @@ workflows: os: - linux - windows - - schema-predictions-amplify_e2e_tests_pkg: + - containers-api-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15171,7 +15300,7 @@ workflows: os: - linux - windows - - predictions-amplify_e2e_tests_pkg: + - schema-key-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15189,8 +15318,7 @@ workflows: parameters: os: - linux - - windows - - auth_1-amplify_e2e_tests_pkg: + - function_2-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15208,8 +15336,7 @@ workflows: parameters: os: - linux - - windows - - auth_3-amplify_e2e_tests_pkg: + - schema-auth-4-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15227,7 +15354,8 @@ workflows: parameters: os: - linux - - api_3-amplify_e2e_tests_pkg: + - windows + - schema-iterative-rollback-2-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15245,7 +15373,7 @@ workflows: parameters: os: - linux - - env-amplify_e2e_tests_pkg: + - function_1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15263,7 +15391,7 @@ workflows: parameters: os: - linux - - schema-auth-1-amplify_e2e_tests_pkg: + - schema-iterative-update-3-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15281,8 +15409,7 @@ workflows: parameters: os: - linux - - windows - - schema-auth-2-amplify_e2e_tests_pkg: + - schema-iterative-update-4-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15300,7 +15427,6 @@ workflows: parameters: os: - linux - - windows - auth_7-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull @@ -15412,7 +15538,7 @@ workflows: os: - linux - windows - - init-amplify_e2e_tests_pkg: + - amplify-configure-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15431,7 +15557,7 @@ workflows: os: - linux - windows - - amplify-app-amplify_e2e_tests_pkg: + - schema-predictions-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15449,7 +15575,8 @@ workflows: parameters: os: - linux - - hostingPROD-amplify_e2e_tests_pkg: + - windows + - predictions-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15468,7 +15595,7 @@ workflows: os: - linux - windows - - auth_5-amplify_e2e_tests_pkg: + - auth_1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15487,7 +15614,7 @@ workflows: os: - linux - windows - - migration-api-key-migration1-amplify_e2e_tests_pkg: + - auth_3-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15505,7 +15632,7 @@ workflows: parameters: os: - linux - - import_auth_1-amplify_e2e_tests_pkg: + - api_3-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15523,7 +15650,7 @@ workflows: parameters: os: - linux - - auth_2-amplify_e2e_tests_pkg: + - env-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15541,8 +15668,7 @@ workflows: parameters: os: - linux - - windows - - function_4-amplify_e2e_tests_pkg: + - schema-auth-1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15560,7 +15686,8 @@ workflows: parameters: os: - linux - - api_1-amplify_e2e_tests_pkg: + - windows + - schema-auth-2-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15578,6 +15705,7 @@ workflows: parameters: os: - linux + - windows - auth_8-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull @@ -15689,7 +15817,7 @@ workflows: os: - linux - windows - - tags-amplify_e2e_tests_pkg: + - init-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15708,7 +15836,7 @@ workflows: os: - linux - windows - - hosting-amplify_e2e_tests_pkg: + - amplify-app-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15726,8 +15854,7 @@ workflows: parameters: os: - linux - - windows - - geo-add-amplify_e2e_tests_pkg: + - hostingPROD-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15745,7 +15872,8 @@ workflows: parameters: os: - linux - - function_3-amplify_e2e_tests_pkg: + - windows + - auth_5-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15763,7 +15891,8 @@ workflows: parameters: os: - linux - - auth_4-amplify_e2e_tests_pkg: + - windows + - migration-api-key-migration1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15781,7 +15910,7 @@ workflows: parameters: os: - linux - - import_auth_2-amplify_e2e_tests_pkg: + - import_auth_1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15799,7 +15928,7 @@ workflows: parameters: os: - linux - - schema-auth-9-amplify_e2e_tests_pkg: + - auth_2-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15818,7 +15947,7 @@ workflows: os: - linux - windows - - schema-model-amplify_e2e_tests_pkg: + - function_4-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15836,8 +15965,7 @@ workflows: parameters: os: - linux - - windows - - schema-auth-5-amplify_e2e_tests_pkg: + - api_1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15855,7 +15983,6 @@ workflows: parameters: os: - linux - - windows - configure-project-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull @@ -15966,7 +16093,7 @@ workflows: parameters: os: - linux - - notifications-amplify_e2e_tests_pkg: + - tags-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -15985,7 +16112,7 @@ workflows: os: - linux - windows - - analytics-amplify_e2e_tests_pkg: + - hosting-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16004,7 +16131,7 @@ workflows: os: - linux - windows - - geo-update-amplify_e2e_tests_pkg: + - geo-add-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16022,7 +16149,7 @@ workflows: parameters: os: - linux - - schema-iterative-update-1-amplify_e2e_tests_pkg: + - function_3-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16040,7 +16167,7 @@ workflows: parameters: os: - linux - - schema-auth-7-amplify_e2e_tests_pkg: + - auth_4-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16058,8 +16185,7 @@ workflows: parameters: os: - linux - - windows - - import_s3_1-amplify_e2e_tests_pkg: + - import_auth_2-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16077,7 +16203,7 @@ workflows: parameters: os: - linux - - schema-auth-11-amplify_e2e_tests_pkg: + - schema-auth-9-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16096,7 +16222,7 @@ workflows: os: - linux - windows - - migration-api-connection-migration-amplify_e2e_tests_pkg: + - schema-model-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16114,7 +16240,8 @@ workflows: parameters: os: - linux - - api_2-amplify_e2e_tests_pkg: + - windows + - schema-auth-5-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16132,6 +16259,7 @@ workflows: parameters: os: - linux + - windows - container-hosting-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull @@ -16224,7 +16352,7 @@ workflows: os: - linux - windows - - plugin-amplify_e2e_tests_pkg: + - version-gating-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16243,7 +16371,7 @@ workflows: os: - linux - windows - - schema-versioned-amplify_e2e_tests_pkg: + - notifications-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16262,7 +16390,7 @@ workflows: os: - linux - windows - - feature-flags-amplify_e2e_tests_pkg: + - analytics-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16280,7 +16408,8 @@ workflows: parameters: os: - linux - - geo-remove-amplify_e2e_tests_pkg: + - windows + - geo-update-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16298,7 +16427,7 @@ workflows: parameters: os: - linux - - schema-auth-3-amplify_e2e_tests_pkg: + - schema-iterative-update-1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16316,8 +16445,7 @@ workflows: parameters: os: - linux - - windows - - schema-auth-8-amplify_e2e_tests_pkg: + - schema-auth-7-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16336,7 +16464,7 @@ workflows: os: - linux - windows - - import_dynamodb_1-amplify_e2e_tests_pkg: + - import_s3_1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16354,8 +16482,7 @@ workflows: parameters: os: - linux - - windows - - migration-api-key-migration2-amplify_e2e_tests_pkg: + - schema-auth-11-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16373,7 +16500,8 @@ workflows: parameters: os: - linux - - schema-connection-amplify_e2e_tests_pkg: + - windows + - migration-api-connection-migration-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16391,8 +16519,7 @@ workflows: parameters: os: - linux - - windows - - api_5-amplify_e2e_tests_pkg: + - api_2-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16410,7 +16537,6 @@ workflows: parameters: os: - linux - - windows - custom_policies_container-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull @@ -16503,7 +16629,7 @@ workflows: os: - linux - windows - - init-special-case-amplify_e2e_tests_pkg: + - plugin-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16522,7 +16648,7 @@ workflows: os: - linux - windows - - schema-data-access-patterns-amplify_e2e_tests_pkg: + - schema-versioned-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16541,7 +16667,7 @@ workflows: os: - linux - windows - - schema-iterative-update-2-amplify_e2e_tests_pkg: + - feature-flags-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16559,7 +16685,7 @@ workflows: parameters: os: - linux - - schema-auth-10-amplify_e2e_tests_pkg: + - geo-remove-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16577,8 +16703,7 @@ workflows: parameters: os: - linux - - windows - - delete-amplify_e2e_tests_pkg: + - schema-auth-3-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16596,7 +16721,8 @@ workflows: parameters: os: - linux - - schema-searchable-amplify_e2e_tests_pkg: + - windows + - schema-auth-8-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16615,7 +16741,7 @@ workflows: os: - linux - windows - - schema-iterative-rollback-1-amplify_e2e_tests_pkg: + - import_dynamodb_1-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16633,7 +16759,8 @@ workflows: parameters: os: - linux - - migration-api-key-migration3-amplify_e2e_tests_pkg: + - windows + - migration-api-key-migration2-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16651,7 +16778,7 @@ workflows: parameters: os: - linux - - schema-auth-6-amplify_e2e_tests_pkg: + - schema-connection-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16670,7 +16797,7 @@ workflows: os: - linux - windows - - api_6-amplify_e2e_tests_pkg: + - api_5-amplify_e2e_tests_pkg: context: - amplify-ecr-image-pull - cleanup-resources @@ -16688,6 +16815,7 @@ workflows: parameters: os: - linux + - windows - AuthV2Transformer-e2e-graphql_e2e_tests: context: - amplify-ecr-image-pull diff --git a/packages/amplify-cli-core/src/errors/index.ts b/packages/amplify-cli-core/src/errors/index.ts index aa418fdcd48..a83df8d6139 100644 --- a/packages/amplify-cli-core/src/errors/index.ts +++ b/packages/amplify-cli-core/src/errors/index.ts @@ -24,11 +24,10 @@ export class NotInitializedError extends Error { public constructor() { super(); this.name = 'NotInitializedError'; - this.message = ` - No Amplify backend project files detected within this folder. Either initialize a new Amplify project or pull an existing project. - - "amplify init" to initialize a new Amplify project - - "amplify pull " to pull your existing Amplify project. Find the in the AWS Console or Amplify Admin UI. - `; + this.message = `No Amplify backend project files detected within this folder. Either initialize a new Amplify project or pull an existing project. +- "amplify init" to initialize a new Amplify project +- "amplify pull " to pull your existing Amplify project. Find the in the AWS Console or Amplify Admin UI.`; + this.stack = undefined; } } diff --git a/packages/amplify-cli-core/src/index.ts b/packages/amplify-cli-core/src/index.ts index a820ab40bbb..80254de11aa 100644 --- a/packages/amplify-cli-core/src/index.ts +++ b/packages/amplify-cli-core/src/index.ts @@ -25,7 +25,7 @@ export * from './cliRemoveResourcePrompt'; export * from './cliViewAPI'; export * from './hooks'; export * from './cliViewAPI'; -export * from './customPoliciesUtils' +export * from './customPoliciesUtils'; // Temporary types until we can finish full type definition across the whole CLI @@ -51,6 +51,7 @@ export type $TSContext = { newUserInfo?: $TSAny; filesystem: IContextFilesystem; template: IContextTemplate; + versionInfo: CLIVersionInfo; }; export type CategoryName = string; @@ -145,6 +146,11 @@ export type DeploymentSecrets = { }>; }; +export type CLIVersionInfo = { + currentCLIVersion: string; + minimumCompatibleCLIVersion: string; +}; + /** * Plugins or other packages bundled with the CLI that pass a file to a system command or execute a binary file must export a function named * "getPackageAssetPaths" of this type. diff --git a/packages/amplify-cli/package.json b/packages/amplify-cli/package.json index 6f021a367ed..28dfec91a26 100644 --- a/packages/amplify-cli/package.json +++ b/packages/amplify-cli/package.json @@ -32,6 +32,11 @@ "engines": { "node": ">=12.0.0" }, + "amplify-cli": { + "configuration": { + "minimumCompatibleCLIVersion": "6.4.0" + } + }, "dependencies": { "@aws-cdk/cloudformation-diff": "~1.124.0", "amplify-app": "3.0.16", diff --git a/packages/amplify-cli/src/__tests__/context-manager.test.ts b/packages/amplify-cli/src/__tests__/context-manager.test.ts index 2191b0b07d1..5f7a555aa16 100644 --- a/packages/amplify-cli/src/__tests__/context-manager.test.ts +++ b/packages/amplify-cli/src/__tests__/context-manager.test.ts @@ -23,8 +23,13 @@ jest.mock('../domain/amplify-usageData/', () => { }); jest.mock('../app-config'); +jest.mock('../version-gating', () => ({ + getCurrentCLIVersion: jest.fn().mockReturnValue(() => '5.2.0'), + getMinimumCompatibleCLIVersion: jest.fn().mockReturnValue(() => '5.0.0'), +})); + describe('test attachUsageData', () => { - const version = 'latestversion'; + const version = '5.2.0'; const mockContext = jest.genMockFromModule('../domain/context'); mockContext.input = new Input([ @@ -32,6 +37,10 @@ describe('test attachUsageData', () => { '/Users/userName/.nvm/versions/node/v8.11.4/bin/amplify', 'status', ]); + mockContext.versionInfo = { + currentCLIVersion: '5.2.0', + minimumCompatibleCLIVersion: '5.0.0', + }; mockContext.pluginPlatform = new PluginPlatform(); mockContext.pluginPlatform.plugins['core'] = [new PluginInfo('', version, '', new PluginManifest('', ''))]; diff --git a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-all-category-pluginInfos.test.ts b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-all-category-pluginInfos.test.ts index 4a1c47467df..0b0672080cd 100644 --- a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-all-category-pluginInfos.test.ts +++ b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-all-category-pluginInfos.test.ts @@ -6,6 +6,8 @@ import { constructMockPluginPlatform } from './mock-plugin-platform'; import { getAllCategoryPluginInfo } from '../../../extensions/amplify-helpers/get-all-category-pluginInfos'; +jest.mock('../../../version-gating'); + test('getAllCategoryPluginInfo', () => { const mockPluginPlatform = constructMockPluginPlatform(); const mockProcessArgv = [ @@ -17,7 +19,7 @@ test('getAllCategoryPluginInfo', () => { const mockInput = new Input(mockProcessArgv); const mockContext = constructContext(mockPluginPlatform, mockInput); - const categoryPluginInfoList = (getAllCategoryPluginInfo(mockContext) as unknown) as PluginCollection; + const categoryPluginInfoList = getAllCategoryPluginInfo(mockContext) as unknown as PluginCollection; expect(categoryPluginInfoList.hosting).toBeDefined(); expect(Object.keys(categoryPluginInfoList.hosting).length).toEqual(2); }); diff --git a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-category-pluginInfo.test.ts b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-category-pluginInfo.test.ts index 50760e7780f..51dc87b7585 100644 --- a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-category-pluginInfo.test.ts +++ b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-category-pluginInfo.test.ts @@ -3,6 +3,8 @@ import { constructMockPluginPlatform } from './mock-plugin-platform'; import { constructContext } from '../../../context-manager'; import { getCategoryPluginInfo } from '../../../extensions/amplify-helpers/get-category-pluginInfo'; +jest.mock('../../../version-gating'); + test('getCategoryPluginInfo returns the first pluginInfo to match category', () => { const mockPluginPlatform = constructMockPluginPlatform(); const mockProcessArgv = [ diff --git a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-project-meta.test.ts b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-project-meta.test.ts index 0025b102646..e572921d01b 100644 --- a/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-project-meta.test.ts +++ b/packages/amplify-cli/src/__tests__/extensions/amplify-helpers/get-project-meta.test.ts @@ -30,10 +30,10 @@ describe('getProjectMeta', () => { }); it('should throw NotInitializedError when metaFile does not exists', () => { stateManager_mock.metaFileExists.mockImplementation(() => false); - expect(() => getProjectMeta()).toThrow(` - No Amplify backend project files detected within this folder. Either initialize a new Amplify project or pull an existing project. - - "amplify init" to initialize a new Amplify project - - "amplify pull " to pull your existing Amplify project. Find the in the AWS Console or Amplify Admin UI. - `); + expect(() => getProjectMeta()).toThrow( + `No Amplify backend project files detected within this folder. Either initialize a new Amplify project or pull an existing project. +- "amplify init" to initialize a new Amplify project +- "amplify pull " to pull your existing Amplify project. Find the in the AWS Console or Amplify Admin UI.`, + ); }); }); diff --git a/packages/amplify-cli/src/__tests__/version-gating.test.ts b/packages/amplify-cli/src/__tests__/version-gating.test.ts new file mode 100644 index 00000000000..db4d302901e --- /dev/null +++ b/packages/amplify-cli/src/__tests__/version-gating.test.ts @@ -0,0 +1,266 @@ +import { $TSContext } from 'amplify-cli-core'; + +describe('command blocking', () => { + test('validate which commands will be blocked or not', async () => { + const { isCommandInMatches, versionGatingBlockedCommands } = await import('../version-gating'); + + expect(isCommandInMatches({ plugin: 'api', command: 'add' }, versionGatingBlockedCommands)).toBe(true); + expect(isCommandInMatches({ plugin: 'function', command: 'add' }, versionGatingBlockedCommands)).toBe(true); + + expect(isCommandInMatches({ plugin: 'api', command: 'update' }, versionGatingBlockedCommands)).toBe(true); + expect(isCommandInMatches({ plugin: 'function', command: 'update' }, versionGatingBlockedCommands)).toBe(true); + + expect(isCommandInMatches({ plugin: 'api', command: 'remove' }, versionGatingBlockedCommands)).toBe(true); + expect(isCommandInMatches({ plugin: 'function', command: 'remove' }, versionGatingBlockedCommands)).toBe(true); + + expect(isCommandInMatches({ plugin: 'core', command: 'push' }, versionGatingBlockedCommands)).toBe(true); + expect(isCommandInMatches({ plugin: 'api', command: 'push' }, versionGatingBlockedCommands)).toBe(true); + expect(isCommandInMatches({ plugin: 'function', command: 'push' }, versionGatingBlockedCommands)).toBe(true); + + expect(isCommandInMatches({ plugin: 'hosting', command: 'publish' }, versionGatingBlockedCommands)).toBe(true); + + expect(isCommandInMatches({ plugin: 'api', command: 'gql-compile' }, versionGatingBlockedCommands)).toBe(true); + + expect(isCommandInMatches({ plugin: undefined, command: 'help' }, versionGatingBlockedCommands)).toBe(false); + expect(isCommandInMatches({ plugin: undefined, command: 'version' }, versionGatingBlockedCommands)).toBe(false); + expect(isCommandInMatches({ plugin: undefined, command: 'configure' }, versionGatingBlockedCommands)).toBe(false); + expect(isCommandInMatches({ plugin: undefined, command: 'console' }, versionGatingBlockedCommands)).toBe(false); + expect(isCommandInMatches({ plugin: undefined, command: 'init' }, versionGatingBlockedCommands)).toBe(false); + expect(isCommandInMatches({ plugin: undefined, command: 'logout' }, versionGatingBlockedCommands)).toBe(false); + expect(isCommandInMatches({ plugin: undefined, command: 'status' }, versionGatingBlockedCommands)).toBe(false); + expect(isCommandInMatches({ plugin: undefined, command: 'pull' }, versionGatingBlockedCommands)).toBe(false); + + expect(isCommandInMatches({ plugin: 'env', command: 'list' }, versionGatingBlockedCommands)).toBe(false); + }); +}); + +describe('version gating', () => { + const originalProcessEnv = process.env; + + let stackMetadata: any = undefined; + + class CfnClientMock { + public getTemplateSummary = () => { + return { + promise: () => + new Promise((resolve, _) => { + resolve({ Metadata: stackMetadata }); + }), + }; + }; + } + + const cfnClientMockInstance = new CfnClientMock(); + + class CloudFormation { + cfn: CfnClientMock; + + constructor() { + this.cfn = cfnClientMockInstance; + } + } + + const cloudFormationClient_stub = new CloudFormation(); + + const meta_stub = { + providers: { + awscloudformation: { + StackName: 'mockstack', + }, + }, + }; + + const stackMetadata_stub_520_500 = { + AmplifyCLI: { + DeployedByCLIVersion: '5.2.0', + MinimumCompatibleCLIVersion: '5.0.0', + }, + }; + + const stackMetadata_stub_520_530 = { + AmplifyCLI: { + DeployedByCLIVersion: '5.2.0', + MinimumCompatibleCLIVersion: '5.3.0', + }, + }; + + const stackMetadata_stub_530_531 = { + AmplifyCLI: { + DeployedByCLIVersion: '5.3.0', + MinimumCompatibleCLIVersion: '5.3.1', + }, + }; + + const versionInfo_520_500 = { + currentCLIVersion: '5.2.0', + minimumCompatibleCLIVersion: '5.0.0', + }; + + const versionInfo_520_510 = { + currentCLIVersion: '5.2.0', + minimumCompatibleCLIVersion: '5.1.0', + }; + + const versionInfo_520_540 = { + currentCLIVersion: '5.2.0', + minimumCompatibleCLIVersion: '5.4.0', + }; + + const versionInfo_532_530 = { + currentCLIVersion: '5.3.2', + minimumCompatibleCLIVersion: '5.3.0', + }; + + const context_stub = { + print: { + info: jest.fn(), + warning: jest.fn(), + success: jest.fn(), + }, + input: { + plugin: 'api', + command: 'add', + }, + versionInfo: versionInfo_520_500, + amplify: { + invokePluginMethod: jest.fn().mockReturnValue(cloudFormationClient_stub), + }, + } as unknown as jest.Mocked<$TSContext>; + + beforeEach(() => { + jest.clearAllMocks(); + jest.resetModules(); + + // reset mutated state + context_stub.input.plugin = 'api'; + context_stub.input.command = 'add'; + context_stub.versionInfo = versionInfo_520_500; + + stackMetadata = undefined; + + process.env = { ...originalProcessEnv }; + }); + + afterEach(() => { + jest.clearAllMocks(); + jest.resetModules(); + + // reset mutated state + context_stub.input.plugin = 'api'; + context_stub.input.command = 'add'; + + stackMetadata = undefined; + + process.env = { ...originalProcessEnv }; + }); + + test('version gating should pass when env override set', async () => { + process.env.AMPLIFY_CLI_DISABLE_VERSION_CHECK = '1'; + + const versionGating = await import('../version-gating'); + + const isCommandInMatchesMock = jest.spyOn(versionGating, 'isCommandInMatches'); + + await expect(versionGating.isMinimumVersionSatisfied(context_stub)).resolves.toBe(true); + + expect(isCommandInMatchesMock).toHaveBeenCalledTimes(0); + }); + + test('version gating should pass when command is non-blocking', async () => { + context_stub.input.plugin = 'core'; + context_stub.input.command = 'version'; + + const versionGating = await import('../version-gating'); + const { stateManager } = await import('amplify-cli-core'); + + const isCommandInMatchesMock = jest.spyOn(versionGating, 'isCommandInMatches'); + const stateManagerMock = jest.spyOn(stateManager, 'getMeta').mockImplementation(() => undefined); + + await expect(versionGating.isMinimumVersionSatisfied(context_stub)).resolves.toBe(true); + + expect(isCommandInMatchesMock).toHaveBeenCalledTimes(1); + expect(stateManagerMock).toHaveBeenCalledTimes(0); + }); + + test('version gating should pass when stack is not deployed', async () => { + const versionGating = await import('../version-gating'); + const { stateManager } = await import('amplify-cli-core'); + + const stateManagerMock = jest.spyOn(stateManager, 'getMeta').mockImplementation(() => undefined); + + await expect(versionGating.isMinimumVersionSatisfied(context_stub)).resolves.toBe(true); + + expect(stateManagerMock).toHaveBeenCalledTimes(1); + expect(context_stub.amplify.invokePluginMethod).toHaveBeenCalledTimes(0); + }); + + test('version gating should pass when stack has no metadata', async () => { + const versionGating = await import('../version-gating'); + const { stateManager } = await import('amplify-cli-core'); + + const stateManagerMock = jest.spyOn(stateManager, 'getMeta').mockImplementation(() => meta_stub); + + await expect(versionGating.isMinimumVersionSatisfied(context_stub)).resolves.toBe(true); + + expect(stateManagerMock).toHaveBeenCalledTimes(1); + expect(context_stub.amplify.invokePluginMethod).toHaveBeenCalledTimes(1); + }); + + test('version gating should pass, meta: 5.2.0, metamin: 5.0.0, current: 5.2.0, min: 5.0.0', async () => { + const versionGating = await import('../version-gating'); + const { stateManager } = await import('amplify-cli-core'); + + stackMetadata = stackMetadata_stub_520_500; + + const stateManagerMock = jest.spyOn(stateManager, 'getMeta').mockImplementation(() => meta_stub); + + await expect(versionGating.isMinimumVersionSatisfied(context_stub)).resolves.toBe(true); + }); + + test('version gating should pass, meta: 5.2.0, metamin: 5.0.0, current: 5.2.0, min: 5.1.0', async () => { + const versionGating = await import('../version-gating'); + const { stateManager } = await import('amplify-cli-core'); + + stackMetadata = stackMetadata_stub_520_500; + context_stub.versionInfo = versionInfo_520_510; + + const stateManagerMock = jest.spyOn(stateManager, 'getMeta').mockImplementation(() => meta_stub); + + await expect(versionGating.isMinimumVersionSatisfied(context_stub)).resolves.toBe(true); + }); + + test('version gating should pass, meta: 5.3.0, metamin: 5.3.1, current: 5.3.2, min: 5.3.0', async () => { + const versionGating = await import('../version-gating'); + const { stateManager } = await import('amplify-cli-core'); + + stackMetadata = stackMetadata_stub_530_531; + context_stub.versionInfo = versionInfo_532_530; + + const stateManagerMock = jest.spyOn(stateManager, 'getMeta').mockImplementation(() => meta_stub); + + await expect(versionGating.isMinimumVersionSatisfied(context_stub)).resolves.toBe(true); + }); + + test('version gating should fail, meta: 5.2.0, metamin: 5.3.0, current: 5.2.0, min: 5.0.0', async () => { + const versionGating = await import('../version-gating'); + const { stateManager } = await import('amplify-cli-core'); + + stackMetadata = stackMetadata_stub_520_530; + + const stateManagerMock = jest.spyOn(stateManager, 'getMeta').mockImplementation(() => meta_stub); + + expect(versionGating.isMinimumVersionSatisfied(context_stub)).resolves.toEqual(false); + }); + + test('version gating should fail, meta: 5.2.0, metamin: 5.3.0, current: 5.2.0, min: 5.4.0', async () => { + const versionGating = await import('../version-gating'); + const { stateManager } = await import('amplify-cli-core'); + + stackMetadata = stackMetadata_stub_520_530; + context_stub.versionInfo = versionInfo_520_540; + + const stateManagerMock = jest.spyOn(stateManager, 'getMeta').mockImplementation(() => meta_stub); + + expect(versionGating.isMinimumVersionSatisfied(context_stub)).resolves.toEqual(false); + }); +}); diff --git a/packages/amplify-cli/src/commands/version.ts b/packages/amplify-cli/src/commands/version.ts index 3611d9ea176..d4e7f1e0864 100644 --- a/packages/amplify-cli/src/commands/version.ts +++ b/packages/amplify-cli/src/commands/version.ts @@ -1,7 +1,6 @@ -import { Context } from '../domain/context'; import { printer } from 'amplify-prompts'; -import { getAmplifyVersion } from '../extensions/amplify-helpers/get-amplify-version'; +import { Context } from '../domain/context'; export const run = (context: Context) => { - printer.info(getAmplifyVersion()); + printer.info(context.versionInfo.currentCLIVersion); }; diff --git a/packages/amplify-cli/src/context-manager.ts b/packages/amplify-cli/src/context-manager.ts index cd81af5b829..69f4a55ca43 100644 --- a/packages/amplify-cli/src/context-manager.ts +++ b/packages/amplify-cli/src/context-manager.ts @@ -24,11 +24,15 @@ export async function attachUsageData(context: Context) { } else { context.usageData = NoUsageData.Instance; } - context.usageData.init(config.usageDataConfig.installationUuid, getVersion(context), context.input, '', getProjectSettings()); + context.usageData.init( + config.usageDataConfig.installationUuid, + context.versionInfo.currentCLIVersion, + context.input, + '', + getProjectSettings(), + ); } -const getVersion = (context: Context) => context.pluginPlatform.plugins.core[0].packageVersion; - const getProjectSettings = (): ProjectSettings => { const projectSettings: ProjectSettings = {}; if (stateManager.projectConfigExists()) { diff --git a/packages/amplify-cli/src/domain/context.ts b/packages/amplify-cli/src/domain/context.ts index 7d834643531..da6fc24564b 100644 --- a/packages/amplify-cli/src/domain/context.ts +++ b/packages/amplify-cli/src/domain/context.ts @@ -2,12 +2,21 @@ import { Input } from './input'; import { AmplifyToolkit } from './amplify-toolkit'; import { PluginPlatform } from './plugin-platform'; import { IUsageData } from './amplify-usageData'; +import { CLIVersionInfo } from 'amplify-cli-core'; +import { getCurrentCLIVersion, getMinimumCompatibleCLIVersion } from '../version-gating'; export class Context { amplify: AmplifyToolkit; usageData!: IUsageData; + versionInfo: CLIVersionInfo; + constructor(public pluginPlatform: PluginPlatform, public input: Input) { this.amplify = new AmplifyToolkit(); + + this.versionInfo = { + currentCLIVersion: getCurrentCLIVersion(), + minimumCompatibleCLIVersion: getMinimumCompatibleCLIVersion(), + }; } // ToDo: this is to attach gluegun extensions and other attached properties diff --git a/packages/amplify-cli/src/index.ts b/packages/amplify-cli/src/index.ts index e7ac6a0cdd2..a3ed03aafd8 100644 --- a/packages/amplify-cli/src/index.ts +++ b/packages/amplify-cli/src/index.ts @@ -5,7 +5,6 @@ import { CLIContextEnvironmentProvider, exitOnNextTick, FeatureFlags, - JSONUtilities, JSONValidationError, pathManager, stateManager, @@ -32,6 +31,7 @@ import { rewireDeprecatedCommands } from './rewireDeprecatedCommands'; import { ensureMobileHubCommandCompatibility } from './utils/mobilehub-support'; import { migrateTeamProviderInfo } from './utils/team-provider-migrate'; import { deleteOldVersion } from './utils/win-utils'; +import { getCurrentCLIVersion, isMinimumVersionSatisfied } from './version-gating'; import { notify } from './version-notifier'; import { getAmplifyVersion } from './extensions/amplify-helpers/get-amplify-version'; @@ -131,8 +131,7 @@ export async function run() { } // Initialize Banner messages. These messages are set on the server side - const pkg = JSONUtilities.readJson<$TSAny>(path.join(__dirname, '..', 'package.json')); - BannerMessage.initialize(pkg.version); + BannerMessage.initialize(getCurrentCLIVersion()); ensureFilePermissions(pathManager.getAWSCredentialsFilePath()); ensureFilePermissions(pathManager.getAWSConfigFilePath()); @@ -185,6 +184,12 @@ export async function run() { process.on('SIGINT', sigIntHandler.bind(context)); + if ((await isMinimumVersionSatisfied(context as unknown as $TSContext)) === false) { + context.usageData.emitError(new Error('Version gating requirements were not passed.')); + + return 1; + } + // Skip NodeJS version check and migrations if Amplify CLI is executed in CI/CD or // the command is not push if (!isCI && context.input.command === 'push') { @@ -194,7 +199,7 @@ export async function run() { context.usageData.emitInvoke(); // For mobile hub migrated project validate project and command to be executed - if (!ensureMobileHubCommandCompatibility((context as unknown) as $TSContext)) { + if (!ensureMobileHubCommandCompatibility(context as unknown as $TSContext)) { // Double casting until we have properly typed context return 1; } diff --git a/packages/amplify-cli/src/version-gating/index.ts b/packages/amplify-cli/src/version-gating/index.ts new file mode 100644 index 00000000000..f1068aa1b57 --- /dev/null +++ b/packages/amplify-cli/src/version-gating/index.ts @@ -0,0 +1,202 @@ +import * as path from 'path'; +import _ from 'lodash'; +import semver from 'semver'; +import { $TSContext, JSONUtilities, stateManager } from 'amplify-cli-core'; +import * as CloudFormation from 'aws-sdk/clients/cloudformation'; + +const packageJsonFileName = 'package.json'; +const disableVersionGatingEnvVarName = 'AMPLIFY_CLI_DISABLE_VERSION_CHECK'; + +// Allowed Commands: 'configure', 'console', 'env list', 'help', 'init', 'logout', 'version', 'status', 'pull' + +// Type used internally for object matching +type CommandMatch = { + plugins: string[]; + command: string; +}; + +type Command = { + plugin?: string; + command: string; +}; + +type VersionGatingMetadata = { + DeployedByCLIVersion?: string; + MinimumCompatibleCLIVersion?: string; +}; + +export const versionGatingBlockedCommands: CommandMatch[] = [ + { + plugins: ['*'], + command: 'add', + }, + { + plugins: ['*'], + command: 'update', + }, + { + plugins: ['*'], + command: 'remove', + }, + { + plugins: ['*'], + command: 'push', + }, + { + plugins: ['*'], + command: 'publish', + }, + { + plugins: ['api'], + command: 'gql-compile', + }, +]; + +export const readCLIPackageJson = (): T => { + const packageJsonPath = path.join(__dirname, '..', '..', packageJsonFileName); + + const packageJsonContent = JSONUtilities.readJson(packageJsonPath); + + return packageJsonContent! as T; +}; + +export const getCurrentCLIVersion = (): string => { + const { version } = readCLIPackageJson<{ version: string }>(); + + // This data always exists in package.json + return version; +}; + +export const getMinimumCompatibleCLIVersion = (): string => { + const { 'amplify-cli': amplifyCLI } = readCLIPackageJson<{ 'amplify-cli': { configuration: { minimumCompatibleCLIVersion: string } } }>(); + + // This data always exists in package.json + return amplifyCLI.configuration.minimumCompatibleCLIVersion; +}; + +/* + +Summary for the version gating logic: + +Inputs: +- M: Metadata in root stack +- CV: Currently running CLI verison +- CMin: Minimum version value defined in currently running CLI's package.json +- DV: Version of the CLI the root stack was deployed with last time +- DMin: Minimum required CLI version for deployment + +Checks: +- M == null or no version info present => pass (Current CLI is newer always) +- CV >= DMin => pass (CV >= CMin always so no need to check) +- In all other cases => fail (for example: DMin > CV) + +Notes: +- DV: It is possible that this information will change from 5.1.0 to 5.0.2 and 5.1.3 with pushes as long as DMin is 5.0.0. +- DV: is not used for any checks, just persisted for diagnostic purposes. + +Cases we cannot handle: +- If a CLI version is used which does not have version gating, will always can run against a newer stack, which will nuke out + the metadata we added. + +*/ + +export const isMinimumVersionSatisfied = async (context: $TSContext): Promise => { + // Check if version gating is disabled via the environment variable + if (!!process.env[disableVersionGatingEnvVarName]) { + return true; + } + + const currentCommand: Command = { + plugin: context.input.plugin, + command: context.input.command, + }; + + const isBlockedCommand = isCommandInMatches(currentCommand, versionGatingBlockedCommands); + + if (isBlockedCommand === false) { + return true; + } + + // At this point the command is blocking so version check must be performed against current CLI version + // and the minimum CLI version vs. the deployed version from the root stack metadata (if any) + + const meta = stateManager.getMeta(undefined, { + throwIfNotExist: false, + }); + + const rootStackName = _.get(meta, ['providers', 'awscloudformation', 'StackName']); + + if (rootStackName === undefined) { + // No meta or root stack name is not present, which means that version gating cannot be enforced on an uninitialized project + // so assume version check passed as the rest of the CLI will validate the command in question for execution. + return true; + } + + const cloudFormation: { cfn: CloudFormation } = await context.amplify.invokePluginMethod( + context, + 'awscloudformation', + undefined, + 'getCloudFormationSdk', + [context], + ); + + const cfnClient: CloudFormation = cloudFormation.cfn as CloudFormation; + + const templateSummary = await cfnClient + .getTemplateSummary({ + StackName: rootStackName, + }) + .promise(); + + const metadataValue = _.get(templateSummary, ['Metadata']) || '{}'; + const metadata = JSONUtilities.parse(metadataValue); + const versionGatingMetadata: VersionGatingMetadata = _.get(metadata, ['AmplifyCLI']); + + // If no metadata or version info in metadata was found in the root stack template, then + // assume version check passed as current CLI is newer than the stack was deployed with. + if ( + versionGatingMetadata === undefined || + versionGatingMetadata.MinimumCompatibleCLIVersion === undefined || + versionGatingMetadata.DeployedByCLIVersion === undefined + ) { + return true; + } + + // These are always valid version numbers as CLI creating them. + const stackMinimumCompatibleCLIVersion = semver.coerce(versionGatingMetadata.MinimumCompatibleCLIVersion)!; + + // Pick the greater minimum version + const minimumCompatibleCLIVersion = semver.gt(stackMinimumCompatibleCLIVersion, context.versionInfo.minimumCompatibleCLIVersion) + ? stackMinimumCompatibleCLIVersion + : semver.coerce(context.versionInfo.minimumCompatibleCLIVersion)!; + + // If current version is greater than + if (semver.gte(context.versionInfo.currentCLIVersion, minimumCompatibleCLIVersion)) { + return true; + } + + const deployedCLIVersion = semver.coerce(versionGatingMetadata.DeployedByCLIVersion)!; + + context.print.warning( + `This project was previously deployed with Amplify CLI version ${deployedCLIVersion}. The currently running Amplify CLI version is ${context.versionInfo.currentCLIVersion}.`, + ); + + context.print.info(''); + context.print.info(`Some features in this project require Amplify CLI version >=${minimumCompatibleCLIVersion} to function correctly.`); + context.print.info('Upgrade to the latest version of Amplify CLI, run: "amplify upgrade" or "npm install -g @aws-amplify/cli"'); + + return false; +}; + +export const isCommandInMatches = (command: Command, commandsToMatch: CommandMatch[]): boolean => { + for (const commandToMatch of commandsToMatch) { + if ( + ((commandToMatch.plugins.length === 1 && commandToMatch.plugins[0] === '*') || _.includes(commandToMatch.plugins, command.plugin)) && + commandToMatch.command === command.command + ) { + return true; + } + } + + return false; +}; diff --git a/packages/amplify-cli/src/version-notifier.ts b/packages/amplify-cli/src/version-notifier.ts index ef736c92d5f..f5c6ff214f0 100644 --- a/packages/amplify-cli/src/version-notifier.ts +++ b/packages/amplify-cli/src/version-notifier.ts @@ -1,15 +1,17 @@ -import { JSONUtilities, $TSAny, isPackaged } from 'amplify-cli-core'; +import { $TSAny, isPackaged } from 'amplify-cli-core'; import { default as updateNotifier } from 'update-notifier'; -import path from 'path'; import chalk from 'chalk'; +import { readCLIPackageJson } from './version-gating'; -const pkg = JSONUtilities.readJson<$TSAny>(path.join(__dirname, '..', 'package.json')); +const pkg = readCLIPackageJson<$TSAny>(); const notifier = updateNotifier({ pkg }); // defaults to 1 day interval const defaultOpts: updateNotifier.NotifyOptions = { message: isPackaged ? `Update available:\nRun ${chalk.blueBright('amplify upgrade')} for the latest features and fixes!` : undefined, }; + export function notify(notifyOpts?: updateNotifier.NotifyOptions): void { notifyOpts = { ...defaultOpts, ...notifyOpts }; + notifier.notify(notifyOpts); } diff --git a/packages/amplify-e2e-core/src/index.ts b/packages/amplify-e2e-core/src/index.ts index a0a8b486dc4..fedfbba1c72 100644 --- a/packages/amplify-e2e-core/src/index.ts +++ b/packages/amplify-e2e-core/src/index.ts @@ -38,14 +38,12 @@ export function getCLIPath(testingWithLatestCodebase = false) { } export function isTestingWithLatestCodebase(scriptRunnerPath) { - return scriptRunnerPath === process.execPath + return scriptRunnerPath === process.execPath; } export function getScriptRunnerPath(testingWithLatestCodebase = false) { if (!testingWithLatestCodebase) { - return process.platform === 'win32' - ? 'node.exe' - : 'exec'; + return process.platform === 'win32' ? 'node.exe' : 'exec'; } // nodejs executable @@ -81,9 +79,10 @@ export async function installAmplifyCLI(version: string = 'latest') { env: process.env, stdio: 'inherit', }); - process.env.AMPLIFY_PATH = process.platform === 'win32' - ? path.join(os.homedir(), '..', '..', 'Program` Files', 'nodejs', 'node_modules', '@aws-amplify', 'cli', 'bin', 'amplify') - : path.join(os.homedir(), '.npm-global', 'bin', 'amplify'); + process.env.AMPLIFY_PATH = + process.platform === 'win32' + ? path.join(os.homedir(), '..', '..', 'Program` Files', 'nodejs', 'node_modules', '@aws-amplify', 'cli', 'bin', 'amplify') + : path.join(os.homedir(), '.npm-global', 'bin', 'amplify'); } export async function createNewProjectDir( @@ -98,7 +97,7 @@ export async function createNewProjectDir( } while (fs.existsSync(projectDir)); fs.ensureDirSync(projectDir); - console.log(projectDir); + return projectDir; } diff --git a/packages/amplify-e2e-tests/package.json b/packages/amplify-e2e-tests/package.json index 98e6a2e73e8..378ef0e7d51 100644 --- a/packages/amplify-e2e-tests/package.json +++ b/packages/amplify-e2e-tests/package.json @@ -41,6 +41,7 @@ "promise-sequential": "^1.1.1", "rimraf": "^3.0.0", "uuid": "^3.4.0", + "which": "^2.0.2", "yargs": "^15.1.0" }, "devDependencies": { diff --git a/packages/amplify-e2e-tests/src/__tests__/version-gating.test.ts b/packages/amplify-e2e-tests/src/__tests__/version-gating.test.ts new file mode 100644 index 00000000000..a3391a3a713 --- /dev/null +++ b/packages/amplify-e2e-tests/src/__tests__/version-gating.test.ts @@ -0,0 +1,238 @@ +import * as aws from 'aws-sdk'; +import * as fs from 'fs-extra'; +import * as path from 'path'; +import * as which from 'which'; +import CloudFormation from 'aws-sdk/clients/cloudformation'; +import _ from 'lodash'; +import { JSONUtilities, stateManager } from 'amplify-cli-core'; +import { + createNewProjectDir, + deleteProject, + deleteProjectDir, + getCLIPath, + initJSProjectWithProfile, + nspawn as spawn, + isCI, +} from 'amplify-e2e-core'; + +type VersionGatingMetadata = { + DeployedByCLIVersion?: string; + MinimumCompatibleCLIVersion?: string; +}; + +describe('version gating', () => { + let projRoot: string; + let projectInitialized = false; + const projName = 'versiongating'; + + // Extreme version numbers for testing purposes + const baseCLIVersion = '100.0.0'; + const baseMinimumCLIVersion = '100.0.0'; + + let cliPath: string; + let packageJsonPath: string; + let originalPackageJsonContent: string; + let packageJson: { version: string; 'amplify-cli': { configuration: { minimumCompatibleCLIVersion: string } } }; + + const profileName = isCI() ? 'amplify-integ-test-user' : 'default'; + + const creds = new aws.SharedIniFileCredentials({ profile: profileName }); + aws.config.credentials = creds; + + let region: string; + let rootStackName: string; + let cfnClient: CloudFormation; + + beforeEach(async () => { + projRoot = await createNewProjectDir(projName); + + if (!isPackagedAmplifyInPath()) { + cliPath = resolveRealCLIPath(); + packageJsonPath = path.resolve(cliPath, '..', '..', '..', 'amplify-cli', 'package.json'); + originalPackageJsonContent = fs.readFileSync(packageJsonPath, 'utf8').toString(); + packageJson = + JSONUtilities.parse<{ version: string; 'amplify-cli': { configuration: { minimumCompatibleCLIVersion: string } } }>( + originalPackageJsonContent, + ); + } + }); + + afterEach(async () => { + if (projectInitialized) { + await deleteProject(projRoot); + } + + deleteProjectDir(projRoot); + }); + + it('test version gating on projects', async () => { + // We cannot execute this test for packaged CLI as we are modifying the package.json file to + // simulate multiple versions + if (isPackagedAmplifyInPath()) { + return; + } + + try { + // Reset version information to make sure tests will pass with future CLI versionsas well + updateVersionInPackageJson(baseCLIVersion, baseMinimumCLIVersion); + + await initJSProjectWithProfile(projRoot, { name: projName }); + projectInitialized = true; + + const meta = stateManager.getMeta(projRoot); + + region = _.get(meta, ['providers', 'awscloudformation', 'Region']); + rootStackName = _.get(meta, ['providers', 'awscloudformation', 'StackName']); + + cfnClient = new CloudFormation({ region }); + + await expectStackMetadata(baseCLIVersion, baseMinimumCLIVersion); + + // Set CLI version to 100.1.0, verify push succeeds with newer version of CLI + updateVersionInPackageJson('100.1.0', undefined); + + await push(); + + await expectStackMetadata('100.1.0', baseMinimumCLIVersion); + + // Set Minimum CLI version to 100.2.0, verify push succeeds with newer version of CLI + updateVersionInPackageJson(undefined, '100.2.0'); + + await pushFail(); + + // Set CLI version to 100.2.0, Minimum CLI version to 100.2.0, verify push succeeds + updateVersionInPackageJson('100.2.0', '100.2.0'); + + await push(); + + await expectStackMetadata('100.2.0', '100.2.0'); + + // Set CLI version to 100.3.0, Minimum CLI version to 100.2.0, verify push succeeds + updateVersionInPackageJson('100.3.0', '100.2.0'); + + await push(); + + await expectStackMetadata('100.3.0', '100.2.0'); + + // Set CLI version back to 100.2.0, Minimum CLI version to 100.2.0, verify push succeeds as + // minimum deploy version requirement has met + updateVersionInPackageJson('100.2.0', '100.2.0'); + + await push(); + + await expectStackMetadata('100.2.0', '100.2.0'); + } finally { + // restore original package.json + fs.writeFileSync(packageJsonPath, originalPackageJsonContent); + } + }); + + // Test helper functions + const push = async () => { + await amplifyPushForceWithYes(projRoot); + }; + + const pushFail = async () => { + await amplifyPushForceWithVersionGatingOutput(projRoot); + }; + + const updateVersionInPackageJson = (cliVersion: string | undefined, minimumCompatibleCLIVersion: string | undefined) => { + if (cliVersion) { + packageJson.version = cliVersion; + } else { + packageJson.version = baseCLIVersion; + } + + if (minimumCompatibleCLIVersion) { + packageJson['amplify-cli'].configuration.minimumCompatibleCLIVersion = minimumCompatibleCLIVersion; + } else { + packageJson['amplify-cli'].configuration.minimumCompatibleCLIVersion = baseMinimumCLIVersion; + } + + fs.writeFileSync(packageJsonPath, JSONUtilities.stringify(packageJson)); + }; + + const expectStackMetadata = async (deployedByCLIVersion: string, minimumCompatibleCLIVersion: string) => { + const templateSummary = await cfnClient + .getTemplateSummary({ + StackName: rootStackName, + }) + .promise(); + + const metadataValue = _.get(templateSummary, ['Metadata']) || '{}'; + const metadata = JSONUtilities.parse(metadataValue); + const versionGatingMetadata: VersionGatingMetadata = _.get(metadata, ['AmplifyCLI']); + + expect(versionGatingMetadata.DeployedByCLIVersion).toBe(deployedByCLIVersion); + expect(versionGatingMetadata.MinimumCompatibleCLIVersion).toBe(minimumCompatibleCLIVersion); + }; +}); + +const resolveRealCLIPath = (): string => { + const cliPath = getCLIPath(false); + const cliResolvedPath = which.sync(cliPath); + + return fs.realpathSync(cliResolvedPath); +}; + +const isPackagedAmplifyInPath = (): boolean => { + const shebang = '#!/usr/bin/env node'; + const isWin = process.platform.startsWith('win'); + + const cliRealPath = resolveRealCLIPath(); + + if (isWin) { + if (cliRealPath.endsWith('.cmd')) { + return false; + } else if (cliRealPath.endsWith('.exe')) { + return true; + } + } + + // As *nix have no file extensions, read into the file and look for the shebang + let fileDescriptor: number | undefined; + + try { + fileDescriptor = fs.openSync(cliRealPath, 'r'); + + const buffer = Buffer.alloc(19); + + fs.readSync(fileDescriptor, buffer, 0, 19, 0); + + const preamble = String(buffer); + + return preamble !== shebang; + } finally { + if (fileDescriptor) { + fs.closeSync(fileDescriptor); + } + } +}; + +const amplifyPushForceWithVersionGatingOutput = (cwd: string, testingWithLatestCodebase: boolean = false): Promise => { + return new Promise((resolve, reject) => { + spawn(getCLIPath(testingWithLatestCodebase), ['push', '--forcePush', '--force', '--yes'], { cwd, stripColors: true }) + .wait('Upgrade to the latest version of Amplify CLI, run: "amplify upgrade" or "npm install -g @aws-amplify/cli') + .run((err: Error) => { + if (!err) { + resolve(); + } else { + reject(err); + } + }); + }); +}; + +const amplifyPushForceWithYes = (cwd: string, testingWithLatestCodebase: boolean = false): Promise => { + return new Promise((resolve, reject) => { + spawn(getCLIPath(testingWithLatestCodebase), ['push', '--forcePush', '--force', '--yes'], { cwd, stripColors: true }) + .wait('All resources are updated in the cloud') + .run((err: Error) => { + if (!err) { + resolve(); + } else { + reject(err); + } + }); + }); +}; diff --git a/packages/amplify-provider-awscloudformation/src/__tests__/initializer.test.ts b/packages/amplify-provider-awscloudformation/src/__tests__/initializer.test.ts index 3d69f1af4ee..feec4802cd7 100644 --- a/packages/amplify-provider-awscloudformation/src/__tests__/initializer.test.ts +++ b/packages/amplify-provider-awscloudformation/src/__tests__/initializer.test.ts @@ -31,13 +31,17 @@ describe('run', () => { }, teamProviderInfo: {}, }, + versionInfo: { + currentCLIVersion: '5.2.0', + minimumCompatibleCLIVersion: '5.0.0', + }, amplify: { - getTags: jest.fn(), + getTags: jest.fn().mockImplementation(() => []), }, }; CloudFormation_mock.mockImplementation( () => - (({ + ({ createResourceStack: jest.fn().mockResolvedValue({ Stacks: [ { @@ -45,7 +49,7 @@ describe('run', () => { }, ], }), - } as unknown) as CloudFormation), + } as unknown as CloudFormation), ); amplifyServiceManager_mock.init.mockResolvedValueOnce({} as any); JSONUtilities_mock.readJson.mockReturnValueOnce({}); diff --git a/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js b/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js index 571683df4b3..b1c1e90ef59 100644 --- a/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js +++ b/packages/amplify-provider-awscloudformation/src/aws-utils/aws-cfn.js @@ -219,7 +219,7 @@ class CloudFormation { }); } - updateResourceStack(filePath) { + updateResourceStack(context, filePath) { const cfnFile = path.parse(filePath).base; const projectDetails = this.context.amplify.getProjectDetails(); const stackName = projectDetails.amplifyMeta.providers ? projectDetails.amplifyMeta.providers[providerName].StackName : ''; @@ -231,6 +231,11 @@ class CloudFormation { const Tags = this.context.amplify.getTags(this.context); + Tags.push({ + Key: 'amplify:DeployedByCLIVersion', + Value: context.versionInfo.currentCLIVersion, + }); + if (!stackName) { throw new Error('Project stack has not been created yet. Use amplify init to initialize the project.'); } diff --git a/packages/amplify-provider-awscloudformation/src/initializer.ts b/packages/amplify-provider-awscloudformation/src/initializer.ts index d6c735b02fe..8600a7436b1 100644 --- a/packages/amplify-provider-awscloudformation/src/initializer.ts +++ b/packages/amplify-provider-awscloudformation/src/initializer.ts @@ -56,6 +56,18 @@ export async function run(context) { rootStack.Description = 'Root Stack for AWS Amplify Console'; } + rootStack.Metadata = { + AmplifyCLI: { + DeployedByCLIVersion: context.versionInfo.currentCLIVersion, + MinimumCompatibleCLIVersion: context.versionInfo.minimumCompatibleCLIVersion, + }, + }; + + Tags.push({ + Key: 'amplify:DeployedByCLIVersion', + Value: context.versionInfo.currentCLIVersion, + }); + const params = { StackName: stackName, Capabilities: ['CAPABILITY_NAMED_IAM', 'CAPABILITY_AUTO_EXPAND'], diff --git a/packages/amplify-provider-awscloudformation/src/push-resources.ts b/packages/amplify-provider-awscloudformation/src/push-resources.ts index 165776d8be3..dc8bbc3b0cc 100644 --- a/packages/amplify-provider-awscloudformation/src/push-resources.ts +++ b/packages/amplify-provider-awscloudformation/src/push-resources.ts @@ -700,7 +700,7 @@ async function updateCloudFormationNestedStack( const log = logger('updateCloudFormationNestedStack', [providerDirectory, transformedStackPath]); try { log(); - await cfnItem.updateResourceStack(transformedStackPath); + await cfnItem.updateResourceStack(context, transformedStackPath); } catch (error) { log(error); throw error; @@ -860,6 +860,18 @@ async function formNestedStack( const { amplifyMeta } = projectDetails; let authResourceName: string; + // Add CLI versioning information to the root stack's metadata + const metadata = nestedStack.Metadata || {}; + + Object.assign(metadata, { + AmplifyCLI: { + DeployedByCLIVersion: context.versionInfo.currentCLIVersion, + MinimumCompatibleCLIVersion: context.versionInfo.minimumCompatibleCLIVersion, + }, + }); + + nestedStack.Metadata = metadata; + const { APIGatewayAuthURL, NetworkStackS3Url, AuthTriggerTemplateURL } = amplifyMeta.providers[constants.ProviderName]; if (APIGatewayAuthURL) {