Skip to content

Commit

Permalink
feat: Support Amplify Gen 2 outputs (#5073)
Browse files Browse the repository at this point in the history
* feat(core): add AmplifyOutputs types based on the CLI Gen2 client config schema (#4859)

* chore: map AmplifyConfig to AmplifyOutputs (#4935)

* chore: map AmplifyConfig to AmplifyOutputs

* chore: formatting, license headers

* chore: rename amplify_outputs_mapping_test.dart

* chore: update API config

* chore: support multiple graphql or rest APIs (#4982)

* chore: update gen2 version and config mapping tests (#5010)

chore: update gen2 version and tests

* chore: supporting missing auth config options (#5011)

* chore: map null passwordSettings to null passwordPolicy (#5024)

* chore(core): updated asyncConfig to use AmplifyOutputs (#4995)

* feat(core): add AmplifyOutputs types based on the CLI Gen2 client config schema (#4859)

* chore: map AmplifyConfig to AmplifyOutputs (#4935)

* chore: map AmplifyConfig to AmplifyOutputs

* chore: formatting, license headers

* chore: rename amplify_outputs_mapping_test.dart

* chore: update API config

* chore: support multiple graphql or rest APIs (#4982)

* chore(core): updated asyncConfig to use AmplifyOutputs

* feat(core): add AmplifyOutputs types based on the CLI Gen2 client config schema (#4859)

* chore: map AmplifyConfig to AmplifyOutputs (#4935)

* chore: map AmplifyConfig to AmplifyOutputs

* chore: formatting, license headers

* chore: rename amplify_outputs_mapping_test.dart

* chore: update API config

* chore: support multiple graphql or rest APIs (#4982)

* chore(core): updated exports to expose MFA/Password Policies/Identity Providers

* chore(auth): updated unit test to use AmplifyOutputs

* chore(authenticator): updated to use AmplifyOutputs type

* chore(test): updated test stub to use AmplifyOutputs

* chore: update gen2 version and config mapping tests (#5010)

chore: update gen2 version and tests

* chore: supporting missing auth config options (#5011)

* chore(core): updated unit tests AmplifyConfig Json to AmplifyOutputs Json

* chore(authenticator): updated unit tests AmplifyOutputs Json values

* chore(core): updated amplify_core.dart file format

* chore(core): re-internalized IdentityProvider, MFA, and PasswordPolicies

* chore(authenticator): renamed InheritedConfig.amplifyConfig to InheritedConfig.amplifyOutputs

* chore(authenticator): Renamed FormFieldValidator.validateNewPassword's AmplifyOutputs parameter

---------

Co-authored-by: NikaHsn <nika.hasani@gmail.com>
Co-authored-by: Jordan Nelson <Jordanryannelson@gmail.com>

* chore: fix oauth outputs (#5028)

* chore: fix oauth outputs

* fix naming typo

---------

Co-authored-by: Nika Hassani <nikaws@amazon.com>

* chore(infra-gen2): Gen 2 infra (#5026)

* chore(infra): gen 2 api rename (#5040)

* chore(infra): Add verbose flag to deploy step (#5042)

* chore: update configure apis to use AmplifyOutputs instead of AmplifyConfig (#5017)

* chore(core): add validation checks for AmplifyOutputs Json deserialization (#5077)

* Chore/authenticator password validation (#5078)

* chore(test): Removed linter ignore

* chore(authenticator): cleaned up extra import

* chore(authenticator): Updated password policy validator to use a type not affiliated with config

* chore(authenticator): updated AmplifyConfig references to AmplifyOutputs

---------

Co-authored-by: Jordan Nelson <Jordanryannelson@gmail.com>
Co-authored-by: Tyler-Larkin <tyllark@amazon.com>
Co-authored-by: Nika Hassani <nikaws@amazon.com>
Co-authored-by: Elijah Quartey <Equartey@users.noreply.github.com>
  • Loading branch information
5 people committed Jun 27, 2024
1 parent e1a5b48 commit 6488445
Show file tree
Hide file tree
Showing 178 changed files with 41,518 additions and 773 deletions.
11 changes: 11 additions & 0 deletions .github/composite_actions/fetch_backends/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
secret-identifier:
required: true
description: ARN of secret from AWS Secrets Manger which is a JSON object of app IDs / s3 bucket ARNs
needs-gen2-config:
required: true
description: Whether the E2E workflow needs amplify_outputs from AWS

runs:
using: "composite"
Expand Down Expand Up @@ -44,6 +47,14 @@ runs:
shell: bash
run: dart pub global run aft exec --include=${{ inputs.scope }} -- tool/pull_test_backend.sh

- name: Pull Amplify Outputs
shell: bash
run: |
if [[ "${{inputs.needs-gen2-config}}" == true ]]; then
dart pub global run aft exec --include=${{ inputs.scope }} -- tool/pull_test_gen2_backend.sh ...
fi
exit 0
- name: Undo any codegen changes from amplify pull
shell: bash
run: dart pub global run aft exec --include=${{ inputs.scope }} -- [ -d "lib/models" ] && git checkout '**/lib/models/*' || exit 0
Expand Down
35 changes: 35 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ updates:
- dependency-name: "*"
update-types:
- "version-update:semver-patch"
- package-ecosystem: "npm"
directory: "infra-gen2"
schedule:
interval: "weekly"
groups:
cdk:
patterns:
- "aws-amplify"
- "@aws-amplify/*"
- "aws-cdk"
- "aws-cdk-lib"
- "constructs"
aws-sdk-js:
patterns:
- "@aws-sdk/*"
- "@aws-crypto/*"
ignore:
# Ignore patch version bumps
- dependency-name: "*"
update-types:
- "version-update:semver-patch"
- package-ecosystem: "pub"
directory: "/"
schedule:
Expand Down Expand Up @@ -207,6 +228,20 @@ updates:
- dependency-name: "aws_common"
- dependency-name: "amplify_lints"
- dependency-name: "aws_signature_v4"
- package-ecosystem: "pub"
directory: "infra-gen2"
schedule:
interval: "daily"
ignore:
# Ignore patch version bumps
- dependency-name: "*"
update-types:
- "version-update:semver-patch"
# Ignore all repo packages
- dependency-name: "amplify_core"
- dependency-name: "aws_common"
- dependency-name: "amplify_lints"
- dependency-name: "aws_signature_v4"
- package-ecosystem: "pub"
directory: "packages/aft"
schedule:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/amplify_analytics_pinpoint_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ jobs:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
needs-gen2-config: false
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
Expand All @@ -174,6 +175,7 @@ jobs:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
needs-gen2-config: false
e2e_web_test:
needs: [test]
uses: ./.github/workflows/e2e_web.yaml
Expand All @@ -182,6 +184,7 @@ jobs:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
needs-gen2-config: false
e2e_linux_test:
needs: [test]
uses: ./.github/workflows/e2e_linux.yaml
Expand All @@ -190,6 +193,7 @@ jobs:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
needs-gen2-config: false
e2e_windows_test:
needs: [test]
uses: ./.github/workflows/e2e_windows.yaml
Expand All @@ -198,3 +202,4 @@ jobs:
package-name: amplify_analytics_pinpoint_example
working-directory: packages/analytics/amplify_analytics_pinpoint/example
needs-aws-config: true
needs-gen2-config: false
5 changes: 5 additions & 0 deletions .github/workflows/amplify_api_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ jobs:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
needs-gen2-config: false
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
Expand All @@ -178,6 +179,7 @@ jobs:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
needs-gen2-config: false
e2e_web_test:
needs: [test]
uses: ./.github/workflows/e2e_web.yaml
Expand All @@ -186,6 +188,7 @@ jobs:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
needs-gen2-config: false
e2e_linux_test:
needs: [test]
uses: ./.github/workflows/e2e_linux.yaml
Expand All @@ -194,6 +197,7 @@ jobs:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
needs-gen2-config: false
e2e_windows_test:
needs: [test]
uses: ./.github/workflows/e2e_windows.yaml
Expand All @@ -202,3 +206,4 @@ jobs:
package-name: amplify_api_example
working-directory: packages/api/amplify_api/example
needs-aws-config: true
needs-gen2-config: false
5 changes: 5 additions & 0 deletions .github/workflows/amplify_auth_cognito_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ jobs:
package-name: amplify_auth_cognito_example
working-directory: packages/auth/amplify_auth_cognito/example
needs-aws-config: true
needs-gen2-config: false
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
Expand All @@ -186,6 +187,7 @@ jobs:
package-name: amplify_auth_cognito_example
working-directory: packages/auth/amplify_auth_cognito/example
needs-aws-config: true
needs-gen2-config: false
e2e_web_test:
needs: [test]
uses: ./.github/workflows/e2e_web.yaml
Expand All @@ -194,6 +196,7 @@ jobs:
package-name: amplify_auth_cognito_example
working-directory: packages/auth/amplify_auth_cognito/example
needs-aws-config: true
needs-gen2-config: false
e2e_linux_test:
needs: [test]
uses: ./.github/workflows/e2e_linux.yaml
Expand All @@ -202,6 +205,7 @@ jobs:
package-name: amplify_auth_cognito_example
working-directory: packages/auth/amplify_auth_cognito/example
needs-aws-config: true
needs-gen2-config: false
e2e_windows_test:
needs: [test]
uses: ./.github/workflows/e2e_windows.yaml
Expand All @@ -210,3 +214,4 @@ jobs:
package-name: amplify_auth_cognito_example
working-directory: packages/auth/amplify_auth_cognito/example
needs-aws-config: true
needs-gen2-config: false
5 changes: 5 additions & 0 deletions .github/workflows/amplify_authenticator_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ jobs:
package-name: amplify_authenticator_example
working-directory: packages/authenticator/amplify_authenticator/example
needs-aws-config: true
needs-gen2-config: false
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
Expand All @@ -178,6 +179,7 @@ jobs:
package-name: amplify_authenticator_example
working-directory: packages/authenticator/amplify_authenticator/example
needs-aws-config: true
needs-gen2-config: false
e2e_web_test:
needs: [test]
uses: ./.github/workflows/e2e_web.yaml
Expand All @@ -186,6 +188,7 @@ jobs:
package-name: amplify_authenticator_example
working-directory: packages/authenticator/amplify_authenticator/example
needs-aws-config: true
needs-gen2-config: false
e2e_linux_test:
needs: [test]
uses: ./.github/workflows/e2e_linux.yaml
Expand All @@ -194,6 +197,7 @@ jobs:
package-name: amplify_authenticator_example
working-directory: packages/authenticator/amplify_authenticator/example
needs-aws-config: true
needs-gen2-config: false
e2e_windows_test:
needs: [test]
uses: ./.github/workflows/e2e_windows.yaml
Expand All @@ -202,3 +206,4 @@ jobs:
package-name: amplify_authenticator_example
working-directory: packages/authenticator/amplify_authenticator/example
needs-aws-config: true
needs-gen2-config: false
2 changes: 2 additions & 0 deletions .github/workflows/amplify_datastore_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ jobs:
package-name: amplify_datastore_example
working-directory: packages/amplify_datastore/example
needs-aws-config: true
needs-gen2-config: false
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
Expand All @@ -152,3 +153,4 @@ jobs:
package-name: amplify_datastore_example
working-directory: packages/amplify_datastore/example
needs-aws-config: true
needs-gen2-config: false
5 changes: 5 additions & 0 deletions .github/workflows/amplify_db_common_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
package-name: amplify_db_common_example
working-directory: packages/common/amplify_db_common/example
needs-aws-config: true
needs-gen2-config: false
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
Expand All @@ -106,6 +107,7 @@ jobs:
package-name: amplify_db_common_example
working-directory: packages/common/amplify_db_common/example
needs-aws-config: true
needs-gen2-config: false
e2e_web_test:
needs: [test]
uses: ./.github/workflows/e2e_web.yaml
Expand All @@ -114,6 +116,7 @@ jobs:
package-name: amplify_db_common_example
working-directory: packages/common/amplify_db_common/example
needs-aws-config: true
needs-gen2-config: false
e2e_linux_test:
needs: [test]
uses: ./.github/workflows/e2e_linux.yaml
Expand All @@ -122,6 +125,7 @@ jobs:
package-name: amplify_db_common_example
working-directory: packages/common/amplify_db_common/example
needs-aws-config: true
needs-gen2-config: false
e2e_windows_test:
needs: [test]
uses: ./.github/workflows/e2e_windows.yaml
Expand All @@ -130,3 +134,4 @@ jobs:
package-name: amplify_db_common_example
working-directory: packages/common/amplify_db_common/example
needs-aws-config: true
needs-gen2-config: false
5 changes: 5 additions & 0 deletions .github/workflows/amplify_secure_storage_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
package-name: amplify_secure_storage_example
working-directory: packages/secure_storage/amplify_secure_storage/example
needs-aws-config: false
needs-gen2-config: false
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
Expand All @@ -102,6 +103,7 @@ jobs:
package-name: amplify_secure_storage_example
working-directory: packages/secure_storage/amplify_secure_storage/example
needs-aws-config: false
needs-gen2-config: false
e2e_web_test:
needs: [test]
uses: ./.github/workflows/e2e_web.yaml
Expand All @@ -110,6 +112,7 @@ jobs:
package-name: amplify_secure_storage_example
working-directory: packages/secure_storage/amplify_secure_storage/example
needs-aws-config: false
needs-gen2-config: false
e2e_linux_test:
needs: [test]
uses: ./.github/workflows/e2e_linux.yaml
Expand All @@ -118,6 +121,7 @@ jobs:
package-name: amplify_secure_storage_example
working-directory: packages/secure_storage/amplify_secure_storage/example
needs-aws-config: false
needs-gen2-config: false
e2e_windows_test:
needs: [test]
uses: ./.github/workflows/e2e_windows.yaml
Expand All @@ -126,3 +130,4 @@ jobs:
package-name: amplify_secure_storage_example
working-directory: packages/secure_storage/amplify_secure_storage/example
needs-aws-config: false
needs-gen2-config: false
5 changes: 5 additions & 0 deletions .github/workflows/amplify_storage_s3_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ jobs:
package-name: amplify_storage_s3_example
working-directory: packages/storage/amplify_storage_s3/example
needs-aws-config: true
needs-gen2-config: false
e2e_ios_test:
needs: [test]
uses: ./.github/workflows/e2e_ios.yaml
Expand All @@ -178,6 +179,7 @@ jobs:
package-name: amplify_storage_s3_example
working-directory: packages/storage/amplify_storage_s3/example
needs-aws-config: true
needs-gen2-config: false
e2e_web_test:
needs: [test]
uses: ./.github/workflows/e2e_web.yaml
Expand All @@ -186,6 +188,7 @@ jobs:
package-name: amplify_storage_s3_example
working-directory: packages/storage/amplify_storage_s3/example
needs-aws-config: true
needs-gen2-config: false
e2e_linux_test:
needs: [test]
uses: ./.github/workflows/e2e_linux.yaml
Expand All @@ -194,6 +197,7 @@ jobs:
package-name: amplify_storage_s3_example
working-directory: packages/storage/amplify_storage_s3/example
needs-aws-config: true
needs-gen2-config: false
e2e_windows_test:
needs: [test]
uses: ./.github/workflows/e2e_windows.yaml
Expand All @@ -202,3 +206,4 @@ jobs:
package-name: amplify_storage_s3_example
working-directory: packages/storage/amplify_storage_s3/example
needs-aws-config: true
needs-gen2-config: false
5 changes: 5 additions & 0 deletions .github/workflows/e2e_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
description: Whether the E2E workflow needs configuration pulled from AWS
required: true
type: boolean
needs-gen2-config:
required: true
description: Whether the E2E workflow needs amplify_outputs from AWS
type: boolean

jobs:
e2e-test-android:
Expand Down Expand Up @@ -62,6 +66,7 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
scope: ${{ inputs.package-name }}
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
needs-gen2-config: ${{ inputs.needs-gen2-config }}

- name: Launch Android emulator
uses: ./.github/composite_actions/launch_android_emulator
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/e2e_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
description: Whether the E2E workflow needs configuration pulled from AWS
required: true
type: boolean
needs-gen2-config:
required: true
description: Whether the E2E workflow needs amplify_outputs from AWS
type: boolean

jobs:
e2e-test-ios:
Expand Down Expand Up @@ -60,6 +64,7 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
scope: ${{ inputs.package-name }}
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
needs-gen2-config: ${{ inputs.needs-gen2-config }}

- name: Run integration tests
timeout-minutes: 60
Expand Down
Loading

0 comments on commit 6488445

Please sign in to comment.