Skip to content

Commit

Permalink
Merge pull request #770 from aws-amplify/main
Browse files Browse the repository at this point in the history
chore: Release Codegen Plugin
  • Loading branch information
phani-srikar authored Dec 11, 2023
2 parents f84e1c6 + c9284bd commit 400aaac
Show file tree
Hide file tree
Showing 58 changed files with 24,474 additions and 1,809 deletions.
147 changes: 138 additions & 9 deletions .codebuild/e2e_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ batch:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: verify_dependency_licenses_extract
buildspec: .codebuild/verify_dependency_licenses_extract.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: publish_to_local_registry
buildspec: .codebuild/publish_to_local_registry.yml
env:
Expand All @@ -62,8 +68,18 @@ batch:
debug-session: true
depend-on:
- publish_to_local_registry
- identifier: codegen_matrix
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: src/__tests__/codegen-matrix.test.ts
CLI_REGION: ap-southeast-2
debug-session: true
depend-on:
- publish_to_local_registry
- identifier: >-
add_codegen_ios_configure_codegen_android_configure_codegen_js_graphql_codegen_android
l_add_codegen_ios_configure_codegen_android_configure_codegen_js_graphql_codegen_android
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
Expand All @@ -74,7 +90,7 @@ batch:
depend-on:
- publish_to_local_registry
- identifier: >-
graphql_codegen_js_remove_codegen_android_remove_codegen_ios_add_codegen_android
l_graphql_codegen_js_remove_codegen_android_remove_codegen_ios_add_codegen_android
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
Expand All @@ -85,7 +101,7 @@ batch:
depend-on:
- publish_to_local_registry
- identifier: >-
configure_codegen_ios_datastore_modelgen_android_datastore_modelgen_js_feature_flags
l_configure_codegen_ios_datastore_modelgen_android_datastore_modelgen_js_feature_flags
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
Expand All @@ -96,7 +112,7 @@ batch:
depend-on:
- publish_to_local_registry
- identifier: >-
graphql_codegen_ios_add_codegen_js_datastore_modelgen_ios_remove_codegen_js
l_graphql_codegen_ios_add_codegen_js_datastore_modelgen_ios_remove_codegen_js
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
Expand All @@ -107,7 +123,7 @@ batch:
depend-on:
- publish_to_local_registry
- identifier: >-
datastore_modelgen_flutter_env_codegen_model_introspection_codegen_pull_codegen
l_datastore_modelgen_flutter_env_codegen_model_introspection_codegen_pull_codegen
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
Expand All @@ -118,7 +134,7 @@ batch:
depend-on:
- publish_to_local_registry
- identifier: >-
push_codegen_ios_push_codegen_android_graphql_documents_generator_push_codegen_js
l_push_codegen_ios_push_codegen_android_graphql_documents_generator_push_codegen_js
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
Expand All @@ -129,17 +145,18 @@ batch:
depend-on:
- publish_to_local_registry
- identifier: >-
build_app_ts_uninitialized_project_codegen_js_uninitialized_project_modelgen_android_uninitialized_project_modelgen_flutter
l_build_app_ts_uninitialized_project_codegen_js_uninitialized_project_modelgen_android_uninitialized_project_modelgen_flutter
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: >-
src/__tests__/build-app-ts.test.ts|src/__tests__/uninitialized-project-codegen-js.test.ts|src/__tests__/uninitialized-project-modelgen-android.test.ts|src/__tests__/uninitialized-project-modelgen-flutter.test.ts
CLI_REGION: ap-southeast-1
DISABLE_ESLINT_PLUGIN: true
depend-on:
- publish_to_local_registry
- identifier: uninitialized_project_modelgen_ios_uninitialized_project_modelgen_js
- identifier: l_uninitialized_project_modelgen_ios_uninitialized_project_modelgen_js
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
Expand All @@ -149,10 +166,122 @@ batch:
CLI_REGION: ap-southeast-2
depend-on:
- publish_to_local_registry
- identifier: >-
w_add_codegen_ios_configure_codegen_android_configure_codegen_js_graphql_codegen_android
buildspec: .codebuild/run_e2e_tests_windows.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: $WINDOWS_IMAGE_2019
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: >-
src/__tests__/add-codegen-ios.test.ts|src/__tests__/configure-codegen-android.test.ts|src/__tests__/configure-codegen-js.test.ts|src/__tests__/graphql-codegen-android.test.ts
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- build_windows
- identifier: >-
w_graphql_codegen_js_remove_codegen_android_remove_codegen_ios_add_codegen_android
buildspec: .codebuild/run_e2e_tests_windows.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: $WINDOWS_IMAGE_2019
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: >-
src/__tests__/graphql-codegen-js.test.ts|src/__tests__/remove-codegen-android.test.ts|src/__tests__/remove-codegen-ios.test.ts|src/__tests__/add-codegen-android.test.ts
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- build_windows
- identifier: >-
w_configure_codegen_ios_datastore_modelgen_android_datastore_modelgen_js_feature_flags
buildspec: .codebuild/run_e2e_tests_windows.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: $WINDOWS_IMAGE_2019
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: >-
src/__tests__/configure-codegen-ios.test.ts|src/__tests__/datastore-modelgen-android.test.ts|src/__tests__/datastore-modelgen-js.test.ts|src/__tests__/feature-flags.test.ts
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- build_windows
- identifier: >-
w_graphql_codegen_ios_add_codegen_js_datastore_modelgen_ios_remove_codegen_js
buildspec: .codebuild/run_e2e_tests_windows.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: $WINDOWS_IMAGE_2019
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: >-
src/__tests__/graphql-codegen-ios.test.ts|src/__tests__/add-codegen-js.test.ts|src/__tests__/datastore-modelgen-ios.test.ts|src/__tests__/remove-codegen-js.test.ts
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- build_windows
- identifier: >-
w_datastore_modelgen_flutter_env_codegen_model_introspection_codegen_pull_codegen
buildspec: .codebuild/run_e2e_tests_windows.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: $WINDOWS_IMAGE_2019
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: >-
src/__tests__/datastore-modelgen-flutter.test.ts|src/__tests__/env-codegen.test.ts|src/__tests__/model-introspection-codegen.test.ts|src/__tests__/pull-codegen.test.ts
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- build_windows
- identifier: >-
w_push_codegen_ios_push_codegen_android_graphql_documents_generator_push_codegen_js
buildspec: .codebuild/run_e2e_tests_windows.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: $WINDOWS_IMAGE_2019
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: >-
src/__tests__/push-codegen-ios.test.ts|src/__tests__/push-codegen-android.test.ts|src/__tests__/graphql-documents-generator.test.ts|src/__tests__/push-codegen-js.test.ts
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- build_windows
- identifier: >-
w_build_app_ts_uninitialized_project_codegen_js_uninitialized_project_modelgen_android_uninitialized_project_modelgen_flutter
buildspec: .codebuild/run_e2e_tests_windows.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: $WINDOWS_IMAGE_2019
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: >-
src/__tests__/build-app-ts.test.ts|src/__tests__/uninitialized-project-codegen-js.test.ts|src/__tests__/uninitialized-project-modelgen-android.test.ts|src/__tests__/uninitialized-project-modelgen-flutter.test.ts
CLI_REGION: us-east-1
DISABLE_ESLINT_PLUGIN: true
depend-on:
- publish_to_local_registry
- build_windows
- identifier: w_uninitialized_project_modelgen_ios_uninitialized_project_modelgen_js
buildspec: .codebuild/run_e2e_tests_windows.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: $WINDOWS_IMAGE_2019
type: WINDOWS_SERVER_2019_CONTAINER
variables:
TEST_SUITE: >-
src/__tests__/uninitialized-project-modelgen-ios.test.ts|src/__tests__/uninitialized-project-modelgen-js.test.ts
CLI_REGION: us-east-1
depend-on:
- publish_to_local_registry
- build_windows
- identifier: cleanup_e2e_resources
buildspec: .codebuild/cleanup_e2e_resources.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- >-
add_codegen_ios_configure_codegen_android_configure_codegen_js_graphql_codegen_android
l_add_codegen_ios_configure_codegen_android_configure_codegen_js_graphql_codegen_android
16 changes: 16 additions & 0 deletions .codebuild/e2e_workflow_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ batch:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: verify_dependency_licenses_extract
buildspec: .codebuild/verify_dependency_licenses_extract.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: publish_to_local_registry
buildspec: .codebuild/publish_to_local_registry.yml
env:
Expand All @@ -62,3 +68,13 @@ batch:
debug-session: true
depend-on:
- publish_to_local_registry
- identifier: codegen_matrix
buildspec: .codebuild/run_e2e_tests.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
TEST_SUITE: src/__tests__/codegen-matrix.test.ts
CLI_REGION: ap-southeast-2
debug-session: true
depend-on:
- publish_to_local_registry
6 changes: 6 additions & 0 deletions .codebuild/pr_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ batch:
buildspec: .codebuild/verify_api_extract.yml
depend-on:
- build_linux
- identifier: verify_dependency_licenses_extract
buildspec: .codebuild/verify_dependency_licenses_extract.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
6 changes: 6 additions & 0 deletions .codebuild/release_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ batch:
buildspec: .codebuild/verify_api_extract.yml
depend-on:
- build_linux
- identifier: verify_dependency_licenses_extract
buildspec: .codebuild/verify_dependency_licenses_extract.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
depend-on:
- build_linux
- identifier: deploy
buildspec: .codebuild/deploy.yml
depend-on:
Expand Down
24 changes: 24 additions & 0 deletions .codebuild/run_e2e_tests_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 0.2
env:
shell: powershell.exe
variables:
AMPLIFY_DIR: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin
AMPLIFY_PATH: /root/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin/amplify
CI: true
CODEBUILD: true
NODE_OPTIONS: --max-old-space-size=8096
SKIP_SET_NPM_PREFIX: true
phases:
build:
commands:
# commands need to be run in stand-alone bash scripts so that bash can be used on windows
- bash ./.codebuild/scripts/e2e_test_windows.sh
post_build:
commands:
# commands need to be run in stand-alone bash scripts so that bash can be used on windows
- bash ./.codebuild/scripts/post_e2e_test.sh

artifacts:
files:
- '**/*'
base-directory: $Env:CODEBUILD_SRC_DIR\packages\amplify-codegen-e2e-tests\amplify-e2e-reports
8 changes: 8 additions & 0 deletions .codebuild/scripts/e2e_test_windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# set exit on error to true
set -e

source ./shared-scripts.sh && _setupE2ETestsWindows
codebuild-breakpoint
source ./shared-scripts.sh && _runE2ETestsWindows
2 changes: 1 addition & 1 deletion .codebuild/scripts/local_publish_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function startLocalRegistry {
# Start local registry
tmp_registry_log="$(mktemp)"
echo "Registry output file: $tmp_registry_log"
(cd && nohup npx ${VERDACCIO_PACKAGE:-$default_verdaccio_package} -c $1 &>$tmp_registry_log &)
nohup npx ${VERDACCIO_PACKAGE:-$default_verdaccio_package} -c $1 &>$tmp_registry_log &
# Wait for Verdaccio to boot
grep -q 'http address' <(tail -f $tmp_registry_log)
}
Expand Down
8 changes: 8 additions & 0 deletions .codebuild/scripts/post_e2e_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# set exit on error to true
set -e

source ./shared-scripts.sh && _unassumeTestAccountCredentials
aws sts get-caller-identity
source ./shared-scripts.sh && _scanArtifacts
5 changes: 5 additions & 0 deletions .codebuild/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ phases:
artifacts:
files:
- 'shared-scripts.sh'
reports:
coverage-report:
files:
- 'packages/*/coverage/clover.xml'
file-format: 'CLOVERXML'
7 changes: 7 additions & 0 deletions .codebuild/verify_dependency_licenses_extract.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 0.2
env:
shell: bash
phases:
build:
commands:
- source ./shared-scripts.sh && _verifyDependencyLicensesExtract
28 changes: 25 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,35 @@ module.exports = {
'operator-assignment': 'off',
'import/no-named-default': 'off',
},
overrides: [
{
// edit rules here to modify test linting
files: ['__tests__/**', '*.test.ts', '*.test.js'],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
rules: {
// jest describe/test can be very long
'max-lines-per-function': 'off',

// to be fixed and enabled later
'jest/no-conditional-expect': 'warn',
'jest/valid-title': 'warn',
'jest/no-export': 'warn',
'no-trailing-spaces': 'warn',
'jest/no-standalone-expect': 'warn',
'jest/no-conditional-expect': 'warn',
'jest/valid-expect': 'warn',
'jest/no-identical-title': 'warn',
'no-useless-computed-key': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'guard-for-in': 'warn',
},
},
],
'ignorePatterns': [
'node_modules',
'dist',
'build',
'tests',
'__test__',
'__tests__',
'__mocks__',
'__e2e__',
'coverage',
Expand Down
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
# API approval - public surface and dependencies.
**/API.md @aws-amplify/amplify-data-admins

# Changes to CI/CD scripts/buildspecs need admin approval
# Dependency Licensing approval
dependency_licenses.txt @aws-amplify/amplify-data-admins

# Changes to CI/CD scripts/buildspecs need admin approval
/scripts/ @aws-amplify/amplify-data-admins
/shared-scripts.sh @aws-amplify/amplify-data-admins
/.codebuild/ @aws-amplify/amplify-data-admins
Expand Down
Loading

0 comments on commit 400aaac

Please sign in to comment.