Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/graph ql transformer core added bracket mismatch detection #1138

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5036433
feat: 🎸 Added bracket mismatch error detection
ncarvajalc Nov 8, 2022
3f37100
feat: 🎸 Added extra validation for bracket syntax in schema
jcollinc Nov 9, 2022
60822fb
feat: 🎸 Added border case for additional bracket checking
ncarvajalc Nov 9, 2022
c8213d1
chore: 🤖 Fixed yarn.lock conflict
ncarvajalc Nov 9, 2022
add686d
Merge branch 'main' of https://github.com/ncarvajalc/amplify-category…
ncarvajalc Nov 15, 2022
5d4e79c
refactor: 💡 Added fallback to switch cases
ncarvajalc Nov 15, 2022
ca736f7
test: 💍 add test cases for mismatched brackets function
jcollinc Nov 15, 2022
312e264
feat: 🎸 Added line number detection in bracket mismatch
ncarvajalc Nov 16, 2022
797848b
feat: 🎸 Handle additional edge cases when validating brackets
jcollinc Nov 17, 2022
4359f27
feat: 🎸 Added border case for bracket detection in strings
ncarvajalc Nov 17, 2022
fa26cd7
refactor: 💡 Removed useless condition
ncarvajalc Nov 17, 2022
0937360
refactor: 💡 Refactored bracket mismatch cases
ncarvajalc Nov 17, 2022
d2b9ba9
Merge branch 'main' of https://github.com/ncarvajalc/amplify-category…
ncarvajalc Jan 4, 2023
c9a5c26
fix: 🐛 Fixed border case for bracket mismatch
ncarvajalc Jan 4, 2023
8151312
feat: 🎸 Added extra validation for bracket syntax in schema
jcollinc Nov 9, 2022
a5d4eef
feat: 🎸 Added border case for additional bracket checking
ncarvajalc Nov 9, 2022
76c370e
refactor: 💡 Added fallback to switch cases
ncarvajalc Jan 5, 2023
be4e999
feat: 🎸 Added line number detection in bracket mismatch
ncarvajalc Jan 5, 2023
a1f4cdd
feat: 🎸 Handle additional edge cases when validating brackets
ncarvajalc Jan 5, 2023
ca52d8a
fix: 🐛 Fixed border case for bracket mismatch
ncarvajalc Jan 4, 2023
fd57a36
Merge branch 'feat/graph-ql-transformer-core-added-bracket-mismatch-d…
ncarvajalc Jan 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 24 additions & 105 deletions .circleci/config.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ executors:
shell: bash.exe
working_directory: ~/repo
environment:
AMPLIFY_DIR: C:/home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin
AMPLIFY_PATH: C:/home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin/amplify
AMPLIFY_DIR: C:/home/circleci/repo/out
AMPLIFY_PATH: C:/home/circleci/repo/out/amplify.exe

l: &linux-e2e-executor
docker:
- image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:latest
working_directory: ~/repo
resource_class: large
environment:
AMPLIFY_DIR: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin/amplify
AMPLIFY_DIR: /home/circleci/repo/out
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64

defaults: &defaults
working_directory: ~/repo
Expand All @@ -35,7 +35,7 @@ defaults: &defaults

scan_e2e_test_artifacts: &scan_e2e_test_artifacts
name: Scan And Cleanup E2E Test Artifacts
no_output_timeout: 60m
no_output_timeout: 90m
command: |
if ! yarn ts-node .circleci/scan_artifacts.ts; then
echo "Cleaning the repository"
Expand Down Expand Up @@ -107,15 +107,6 @@ jobs:
key: amplify-category-api-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ arch }}
- run: chmod +x .circleci/lint_pr.sh && ./.circleci/lint_pr.sh

verify-api-extract:
<<: *linux-e2e-executor
steps:
- attach_workspace:
at: ./
- restore_cache:
key: amplify-category-api-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ arch }}
- run: yarn verify-api-extract

mock_e2e_tests:
<<: *linux-e2e-executor
steps:
Expand All @@ -129,7 +120,7 @@ jobs:
source .circleci/local_publish_helpers.sh
cd packages/amplify-util-mock/
yarn e2e
no_output_timeout: 60m
no_output_timeout: 90m
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
Expand Down Expand Up @@ -187,7 +178,7 @@ jobs:
retry yarn e2e --maxWorkers=3 $TEST_SUITE
environment:
AMPLIFY_CLI_DISABLE_LOGGING: "true"
no_output_timeout: 60m
no_output_timeout: 90m
- store_test_results:
path: packages/graphql-transformers-e2e-tests/

Expand Down Expand Up @@ -222,6 +213,8 @@ jobs:
path: packages/amplify-e2e-tests/amplify-e2e-reports

client_e2e_tests:
environment:
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin/amplify
parameters:
os:
type: executor
Expand Down Expand Up @@ -266,8 +259,6 @@ jobs:

amplify_migration_tests_v5:
<<: *defaults
environment:
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
steps:
- attach_workspace:
at: ./
Expand All @@ -281,7 +272,7 @@ jobs:
changeNpmGlobalPath
cd packages/amplify-migration-tests
retry yarn run migration_v5.2.0 --maxWorkers=3 $TEST_SUITE
no_output_timeout: 60m
no_output_timeout: 90m
- run: *scan_e2e_test_artifacts
- store_test_results:
path: packages/amplify-migration-tests/
Expand All @@ -290,9 +281,9 @@ jobs:
working_directory: ~/repo

amplify_migration_tests_v6:
<<: *defaults
environment:
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli-internal/bin/amplify
<<: *defaults
steps:
- attach_workspace:
at: ./
Expand All @@ -306,37 +297,10 @@ jobs:
changeNpmGlobalPath
cd packages/amplify-migration-tests
retry yarn run migration_v6.1.0 --maxWorkers=3 $TEST_SUITE
no_output_timeout: 60m
- run: *scan_e2e_test_artifacts
- store_test_results:
path: packages/amplify-migration-tests/
- store_artifacts:
path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
working_directory: ~/repo

amplify_migration_tests_v10:
<<: *defaults
environment:
AMPLIFY_PATH: /home/circleci/.amplify/bin/amplify
steps:
- attach_workspace:
at: ./
- restore_cache:
key: amplify-category-api-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ arch }}
- run:
name: Run tests migrating from CLI v10.5.1
command: |
yarn setup-dev
source .circleci/local_publish_helpers.sh
changeNpmGlobalPath
cd packages/amplify-migration-tests
unset IS_AMPLIFY_CI
echo $IS_AMPLIFY_CI
retry yarn run migration_v10.5.1 --maxWorkers=3 $TEST_SUITE
no_output_timeout: 90m
- run: *scan_e2e_test_artifacts
- store_test_results:
path: ~/repo/packages/amplify-migration-tests/
path: packages/amplify-migration-tests/
- store_artifacts:
path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
working_directory: ~/repo
Expand Down Expand Up @@ -370,7 +334,7 @@ jobs:
command: |
cd packages/amplify-e2e-tests
yarn clean-e2e-resources
no_output_timeout: 60m
no_output_timeout: 90m
- run:
name: "Cleanup Stale Buckets"
command: |
Expand All @@ -394,25 +358,12 @@ jobs:
command: |
cd packages/amplify-e2e-tests
yarn clean-e2e-resources workflow ${CIRCLE_WORKFLOW_ID}
no_output_timeout: 60m
no_output_timeout: 90m
- run: *scan_e2e_test_artifacts
- store_artifacts:
path: ~/repo/packages/amplify-e2e-tests/amplify-e2e-reports
working_directory: ~/repo

wait_for_all:
<<: *linux-e2e-executor
steps:
- run:
name: 'Wait for all required jobs to finish'
command: |
while [[ $(curl --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job" --header "Circle-Token: $CIRCLECI_TOKEN"| jq -r '.items[]|select(.name != "wait_for_all")|.status' | grep -c "running") -gt 0 ]]
do
sleep 60
done
no_output_timeout: 180m
working_directory: ~/repo

workflows:
version: 2
e2e_resource_cleanup:
Expand Down Expand Up @@ -462,9 +413,6 @@ workflows:
- lint:
requires:
- build
- verify-api-extract:
requires:
- build
- test:
requires:
- build
Expand Down Expand Up @@ -532,19 +480,6 @@ workflows:
- /run-e2e\/.*/
requires:
- publish_to_local_registry
- amplify_migration_tests_v10:
context:
- e2e-auth-credentials
- api-cleanup-resources
- api-e2e-test-context
filters:
branches:
only:
- main
- /tagged-release\/.*/
- /run-e2e\/.*/
requires:
- publish_to_local_registry
- amplify_migration_tests_v5:
context:
- e2e-auth-credentials
Expand All @@ -558,31 +493,16 @@ workflows:
- /run-e2e\/.*/
requires:
- publish_to_local_registry
- wait_for_all:
context:
- api-cleanup-resources
- api-e2e-test-context
requires:
- build
filters:
branches:
only:
- main
- /tagged-release\/.*/
- /run-e2e\/.*/

- cleanup_resources_after_e2e_runs:
context:
- api-cleanup-resources
- api-e2e-test-context
requires:
- wait_for_all
filters:
branches:
only:
- main
- /tagged-release\/.*/
- /run-e2e\/.*/
- amplify_e2e_tests
- client_e2e_tests
- graphql_e2e_tests
- amplify_migration_tests_v6
- amplify_migration_tests_v5
- deploy:
context:
- e2e-auth-credentials
Expand All @@ -594,7 +514,6 @@ workflows:
- graphql_e2e_tests
- amplify_e2e_tests
- client_e2e_tests
- amplify_migration_tests_v10
- amplify_migration_tests_v6
- amplify_migration_tests_v5
filters:
Expand Down Expand Up @@ -653,7 +572,7 @@ commands:
source .circleci/local_publish_helpers.sh
cd packages/amplify-e2e-tests
retry yarn run e2e --detectOpenHandles --maxWorkers=3 $TEST_SUITE
no_output_timeout: 60m
no_output_timeout: 90m
- when:
condition:
equal: [*linux-e2e-executor, << parameters.os >>]
Expand All @@ -676,7 +595,7 @@ commands:
steps:
- run:
name: Scan E2E artifacts
no_output_timeout: 60m
no_output_timeout: 90m
command: |
if ! yarn ts-node .circleci/scan_artifacts.ts; then
echo "Cleaning the repository"
Expand Down Expand Up @@ -704,7 +623,7 @@ commands:
cd client-test-apps/js/api-model-relationship-app
npm install
retry npm run test:ci
no_output_timeout: 60m
no_output_timeout: 90m
- when:
condition:
equal: [*linux-e2e-executor, << parameters.os >>]
Expand All @@ -719,4 +638,4 @@ commands:
cd client-test-apps/js/api-model-relationship-app
npm install
retry npm run test:ci
no_output_timeout: 60m
no_output_timeout: 90m
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ commands:
cd client-test-apps/js/api-model-relationship-app
npm install
retry npm run test:ci
no_output_timeout: 60m
no_output_timeout: 90m
2 changes: 0 additions & 2 deletions .github/codeql/codeql-config.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/codeql.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .lgtm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#########################################################################################
# Use the extraction block to define changes to the default code extraction process #
# for one or more languages. The settings for each language are defined in a child #
# block, with one or more steps. #
#########################################################################################

extraction:
# Define settings for JavaScript analysis
##########################################
javascript:
# The `index` step extracts information from the files in the codebase.
index:
# Specify a list of glob patterns to include/exclude files from extraction; this
# is applied on top of the include/exclude paths from above; patterns are
# processed in the same way as for path classifiers above.
# Default: include all files with known extensions (such as .js, .ts and .html),
# but exclude files ending in `-min.js` or `.min.js` and folders named `node_modules`
# or `bower_components`
filters:
# exclude any *.ts files anywhere.
- exclude: "packages/amplify-category-api/resources/awscloudformation/container-templates/**/*.js"
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ const chain = (context: Context): ExecutionContext => {
sendCtrlA: function (): ExecutionContext {
var _send: ExecutionStep = {
fn: () => {
context.process.write(`${CONTROL_A}`);
context.process.write(`${CONTROL_A}${EOL}`);
return true;
},
name: '_send',
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@
"hoist-cli-win": "rimraf node_modules/amplify-cli-internal && mkdir node_modules\\amplify-cli-internal && xcopy /e /q node_modules\\@aws-amplify\\cli-internal node_modules\\amplify-cli-internal\\",
"publish:main": "lerna publish --canary --force-publish --preid=alpha --exact --include-merged-tags --conventional-prerelease --no-verify-access --yes",
"refresh-lockfile": "rimraf yarn.lock && yarn",
"update-cli-packages": "./scripts/update-cli-dependencies.sh && yarn",
"extract-api": "lerna run extract-api",
"verify-api-extract": "yarn extract-api && ./scripts/verify-extract-api.sh"
"update-cli-packages": "./scripts/update-cli-dependencies.sh && yarn"
},
"bugs": {
"url": "https://github.com/aws-amplify/amplify-category-api/issues"
Expand Down Expand Up @@ -90,7 +88,6 @@
"@commitlint/config-lerna-scopes": "^16.2.2",
"@commitlint/cz-commitlint": "^16.2.3",
"@commitlint/prompt": "^16.2.3",
"@microsoft/api-extractor": "^7.33.5",
"@types/glob": "^7.1.1",
"@types/jest": "^26.0.20",
"@types/js-yaml": "^4.0.0",
Expand Down
Loading