Skip to content

Commit 48d324b

Browse files
sunderscakshbhuawslujaDoesnt Matteraws-eddy
authored
chore(api): trigger rds tagged release (#12844)
* fix: fetch deployment key from current-cloud-backend (#12687) * fix: fetch deployment key from current-cloud-backend * fix: fix e2e * fix: added Prepush after init and before deploy (#12674) * fix: added Prepush after init and before deploy * chore: remove comments * chore: excluded test on win * fix: revert projectMeta changes * chore: lint issues * ci: E2E/PR pipelines (#12708) * ci: build graph skeleton (#12278) * chore: cache sample * chore: update sample cache * chore: test * chore: test artifacts * chore: rename file * ci: testing s3 bucket * chore: fix build issue * ci: implement caching solution * ci: test * ci: fix config * ci: try another way to run buildlinux * ci: fix path * ci: fix source * ci: fix sh file header * ci: switch source to dot * ci: remove use of local * ci: update s3 pathing * ci: remove function * ci: try again * ci: specify bash * ci: bash test * ci: remove parenthesis * ci: updated the cache to load * ci: fix * ci: mute cache * ci: fix * ci: update cache * ci: cleanup * ci: add cache file method, graph updates * ci: graph updates * ci: rune2e sample * ci: yml fix * ci: fix * ci: fix * ci: fix * ci: add validate * ci: fix * ci: fix file names * ci: fix publish * ci: test * ci: fix pwd * ci: fix * ci: fix --------- Co-authored-by: Doesnt Matter <[email protected]> * ci: updates to fix build/package & produce binaries (#12284) * chore: cache sample * chore: update sample cache * chore: test * chore: test artifacts * chore: rename file * ci: testing s3 bucket * chore: fix build issue * ci: implement caching solution * ci: test * ci: fix config * ci: try another way to run buildlinux * ci: fix path * ci: fix source * ci: fix sh file header * ci: switch source to dot * ci: remove use of local * ci: update s3 pathing * ci: remove function * ci: try again * ci: specify bash * ci: bash test * ci: remove parenthesis * ci: updated the cache to load * ci: fix * ci: mute cache * ci: fix * ci: update cache * ci: cleanup * ci: add cache file method, graph updates * ci: graph updates * ci: rune2e sample * ci: yml fix * ci: fix * ci: fix * ci: fix * ci: add validate * ci: fix * ci: fix file names * ci: fix publish * ci: test * ci: fix pwd * ci: fix * ci: fix * ci: test branch name * ci: test branch * ci: test branch env var * ci: test with updated vars * ci: test env var * ci: test env var * ci: re-enable and test * ci: try something else for publish * ci: test * ci: try without caching verdaccio * ci: try new path to verdaccio cache * ci: disable sourcing invalid bash_env * ci: move env vars into correct file --------- Co-authored-by: Doesnt Matter <[email protected]> Co-authored-by: Eddy Varela <[email protected]> * ci: amplify cli install support (#12341) * ci: increase memory * ci: cleanup * ci: add binaries for arm,macos,win and add more jobs * ci: try reusing old cache, cleanup * ci: try to fix export * ci: interpolation fix * ci: fix location after installing cli * ci: uncomment and do a full run * ci: e2e test setup for assume role in test account org (#12392) * ci: test assume role * ci: retry * ci: test again * ci: cleanup * ci: reduce duration to 1h max for role chaining * ci: full e2e run * ci: run with breakpoint * ci: run with debug * ci: add CI flag * ci: re-enable test * ci: fix ci * ci: add circleci env var * ci: prepare for pr * ci: add artifact scanning, windows test and check in e2e support changes (#12403) * ci: test with mock values * ci: test with mock values * ci: fix typo * ci: cleanup apple mock key * ci: cleanup and add artifact scanning * ci: add artifact scanning using codebuild src dir * ci: rerun * ci: do a full run * ci: test artifacts and multi-core * ci: test artifacts * ci: add windows and cleanup * ci: rename codebuild specific files * ci: fix build issue * ci: try without image declaration * ci: update image pull role for windows * ci: retry without specifying image * ci: try without depends on linux job * ci: specify codebuild role in buildspec files * ci: try without specifying role * ci: try with windows 19 latest * ci: try just windows build * ci: fix version * ci: try again after updates to cb project * ci: remove invalid flag, cleanup * ci: extract node and npm versions * ci: install node 18 and yarn * ci: install yarn * ci: cleanup * chore: add two new workflows (#12420) * chore: add two new workflows * chore: clean up PR workflow * ci: add windows test support (#12499) * ci: try custom windows container * ci: try again with windows container * ci: try again with windows 2019 image * ci: use 2019 server base * ci: try again with node gyp * ci: try with updated image * ci: try bash * ci: bash * ci: use sh * ci: run windows only * ci: try dot * ci: try provisioning with medium windows * ci: try again * ci: try again * ci: try again * ci: try again * ci: try again * ci: try bash * ci: try again * ci: try again * ci: try with sh file * ci: try again * ci: try again * ci: enable linux too * ci: enable linux too * ci: try new image * ci: split linux and windows scripts * ci: try again * ci: try again with quotes * ci: try again * ci: try again * ci: try again * ci: try again with build * ci: try again * ci: try mixing pwsh with bash * ci: try bash with compound statement * ci: try bash source on separate lines * ci: try using bash as shell root * ci: try again with image6 * ci: try powershell with bash session * ci: try compound command * ci: build and save cache * ci: try again fix file name * ci: try compound statement again * ci: cleanup and move files around * ci: try bash * ci: add msys flags * ci: try fixing pathing * ci: remove yarn install * ci: use full pathing * ci: reset source after build * ci: test reading secrets * ci: try again * ci: try again * ci: refactor and run windows test * ci: try less parallelism * ci: try again * ci: try e2e run * ci: try again * ci: try without setting shell * ci: fix tar unzip * ci: use cache * ci: try with bash to export * ci: try with export in bash file * ci: try changin pathing * ci: try again with bash * ci: print out directories * ci: fix pathing * ci: try with forward slash * ci: move to scripts * ci: test amplify command * ci: try again * ci: try again * ci: get yarn cache location * ci: remove bashenv sourcing * ci: load from cache * ci: cleanup and full run * ci: load cache ignore exiting files * ci: try again * ci: try flipped flags * ci: try again with stdin * ci: print help command * ci: extract without overwriting * ci: tar without printing help * ci: try adding amplify to path * ci: print env homedrive * ci: try again * ci: try again * ci: try again * ci: try again * ci: try without choco * ci: working build & test run starts * ci: cleanup * ci: cleanup * ci: remove unused filed * ci: run test * ci: undo * test: add codebuild integration tests (#12545) * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * chore: noop trigger debug session build * test: integration tests working * test: uncommenting things and renaming delete_auth script to delete * test: refactoring * test: refactoring * chore: remove installs included in image * chore: remove load verdaccio cache * chore: fix name of delete script * chore: remove aws-cli install * chore: clean up * chore: clean up * chore: fix artifact path * Merge dev into CB (#12595) * fix: generate model introspection regardless of studio and datastore (#12258) * fix: generate model introspection regardless of studio * fix: remove data store condition as well * fix: remove unused mocks from unit tests * fix: test coverage * fix: modelgen failure on windows (#12263) * fix: modelgen on windows * fix: run solo * fix: close stream * fix: unit test * fix: try this * fix(api): add null placeholder for nested stack during api rebuild (#11460) * fix(api): add null placeholder for nested stack during api rebuild * chore: re-enable tests on windows (#12272) * chore: re-enable tests on windows * chore: fix the exclusion list * chore: use small executor at wait step (#12275) * chore: increase parallelization in e2e tests (#12276) * chore: increase parallelization of tests * chore: run searchable migration solo * fix: source temp aws creds and ec2 instance credentials using general level config (#12181) * fix: added a test for general profile * fix: added config change * fix: exp1 * fix: running only single test * fix: added aplify error for missing creds * fix: fixes e2e * fix: cci config file * chore: fixes lint * chore: fixes ci config again * chore: running test in specific branches * fix: running test after verification * fix: address comments * fix: e2e tests config * chore: removes extra comments * fix: fixes codeql warnings * fix: config file --------- Co-authored-by: Akshay Upadhyay <[email protected]> * chore: use nodejs 14.x compatible with CDK (#12280) * chore: use nodejs 14.x compatible with CDK * chore: use nodejs 14.x compatible with CDK * chore: use nodejs 14.x compatible with CDK * fix: skip backend sync on force push (#12262) * fix: skip backend sync on force push * chore: use pkg-fetch fork (#12259) * chore: fetch binaries from s3 * chore: fetch binaries from s3 (fix profile) * chore: fetch binaries from s3 (make context single item not list) * chore: fetch binaries from s3 (dummy commit) * chore: use image with binaries * chore: use image with binaries * chore: change tag to latest * chore: change hash * fix: all floating promises (#12293) * fix: all floating promises * fix: make arrow functions async that have awaits * chore: migrate from deprecated CDK api (#12297) * chore: convert generic errors that are user errors to AmplifyErrors (#12296) * chore: convert generic errors that are user errors to AmplifyErrors * fix: run extract-api * fix: unit test * chore: use npm registry (#12300) * chore: re-generate yarn.lock with NPM registry * chore: replace urls * chore: validate * fix: set registry in build steps (#12303) * fix: standalone test build * fix: standalone test build * fix: throws a warning for detector (#12307) * fix: throws a warning for detector * fix: address comments * chore: fix unit test header * chore: don't show deprecation warnings in binary (#12309) * fix: enable help for category statuses (#12216) * fix: enable help for category statuses * test: add e2e test for status with help * fix: handle bucket exists check for s3 buckets in opt in regions (#12298) * fix: handle bucket exists check for s3 buckets in opt in regions * test: add e2e tests for push, init, pull, env with help flag (#12310) * test: add e2e tests for push, init, pull, env * test: add e2e tests for push, init, pull, env (commit to restart build) * test: fix help tests on windows with regex (#12314) * chore: update pkg to 5.8.1 (#12322) * chore: upgrade yarn (#12323) * fix: fail `init --forcePush` fast if environment parameters or secrets are missing in the environment (#12279) * chore: revise net6 baseline (#12327) * fix: sso login (#12325) * chore: undo custom resource exclusions on windows (#12329) * chore: remove custom resource tests from windows exclusion list * chore: undo these todos too * chore: stick to us west * fix:removing auth from local state if imported userpool is deleted (#12286) * fix: cleanup auth resource when userpool not found * fix: lint fixes * fix: added e2e test for the scenario * chore: address comments * fix: added some refractoring * fix: unit tests * fix: lint fixes * fix: fixing lint in auth files * chore: removed unused imports * chore: adjust warning --------- Co-authored-by: Akshay Upadhyay <[email protected]> * chore: reclassify file permissions errors as AmplifyError (#12336) * chore: reclassify file permissions errors as AmplifyError * fix: run extract-api * chore(api): update api dependencies post 5.2.0 release (#12345) * chore(api): update api dependencies post 5.2.0 release * fix unit test * lint fix * change compile to implementation (#12313) * chore: exclude auth test run on windows (#12355) Co-authored-by: Akshay Upadhyay <[email protected]> * fix: multi select race conditions (#12356) * fix: null check for custom IAM policies Action array (#12346) * chore: bump codegen deps (#12358) * fix: reset readline terminal property on close (#12347) * fix: reset readline terminal property on close * test: ensure closeReadline is called on admin flow * fix: codegen version in snapshots (#12362) * fix: yarn failures (#12368) * chore: run e2e tests on windows on node18 (#12370) * chore: run e2e tests on windows on node18 * chore: fix build * chore: import from clodform-types instead of cloudform (#12371) * fix: env param fail-fast checks don't fatal on missing appId or envName (#12373) * chore(release): Publish rc [ci skip] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - [email protected] - [email protected] - [email protected] - [email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] * build(deps): bump vm2 from 3.9.11 to 3.9.15 (#12410) Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.11 to 3.9.15. - [Release notes](https://github.com/patriksimek/vm2/releases) - [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md) - [Commits](patriksimek/vm2@3.9.11...3.9.15) --- updated-dependencies: - dependency-name: vm2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: api hotfix for ownerfield as pk (#12422) * chore: update vm2 to ^3.9.16 (#12458) * build(deps): bump vm2 from 3.9.15 to 3.9.16 (#12457) Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.15 to 3.9.16. - [Release notes](https://github.com/patriksimek/vm2/releases) - [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md) - [Commits](patriksimek/vm2@3.9.15...3.9.16) --- updated-dependencies: - dependency-name: vm2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat(amplify-util-uibuilder): formFeatureFlags metadata (#12369) * feat: pass formFeatureFlags metadata to generateUiBuilderForms * chore: update tests to include formFeatureFlags * chore: format syncAmplifyUIBuilderComponents with prettier --------- Co-authored-by: Joe Buono <[email protected]> Co-authored-by: Eddy Varela <[email protected]> * feat(amplify-util-uibuilder): support StorageField (#12386) * feat((amplify-util-uibuilder): support StorageField * chore: update all aws-sdk versions to ^2.1350.0 * fix: revert changes to package.json.ejs * chore: add **/aws-sdk to package.json under resolutions * fix: revert white space changes in package.json.ejs * fix: bump codegen-ui to 2.12.1 * chore: bump lint memory --------- Co-authored-by: Hein Jeong <[email protected]> Co-authored-by: Kamil Sobol <[email protected]> * fix: fixes merge conflicts * feat: minor version bump * fix: fixes unit test and pin gql transformer v1 version * fix: modelgen regression * fix: updated snapshot * fix(amplify-util-uibuilder): fix icon regression (#12498) * fix: double hooks invocation (fixes #9996) * chore: move smoketest script into the e2e suite (#12414) * chore: moved smoke test to e2e test; added nx task * fix: promisify npm install * fix: remove environment variable * fix: remove yargs * fix: out of sync yarn lock * fix: corrected rest api waits * chore: add rc and latest scripts for smoketest * fix: add defaults for env vars * chore(release): Publish latest [ci skip] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - [email protected] - [email protected] - [email protected] - [email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - [email protected] - [email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] * test: ensure single execution of push hooks * fix: codeql findings * style: run prettier * Dev main merge b009319 (#12522) * fix: graceful fallback if us-east-1 AppState unavailable (#12435) * chore: fix failing e2e tests (#12526) Co-authored-by: Amplifiyer <[email protected]> * fix(amplify-console-hosting): handle undefined errors (#12505) * fix(amplify-console-hosting): handle undefined errors * fix: typo in previous commit * chore: update api category and codegen dependencies (#12527) * chore: update api category dependencies * chore: add codegen, and reintroduce pkg uid field * fix: snapshot test embeds codegen version * fix(mock)-handle stack trace & produce meaningful error, resolution messages for mocking API & Func category * address comments * make getAppSyncAPI public * address comments * remove unwanted ? * fix: remove use of object ACLs #10283 * chore: remove the ability to add hosting with S3 and Cloudfront * removing dev option * chore: remove console.log * chore: add a new error for not supporting publish command * chore: allow users to publish on first launch * chore: fix failing unit test * chore: add a comment to document change * try to remove update install step * chore: address feedback * chore: address codeql comments * chore: fix failing e2e tests * chore: removing unused import * chore: change let to const * chore: remove extra steps that no longer exist * chore: add prod hosting to an e2e test * Update packages/amplify-category-hosting/index.js Co-authored-by: John Hockett <[email protected]> * chore: removing some defaults that are repetitive * build(deps): bump yaml from 2.2.1 to 2.2.2 (#12521) Bumps [yaml](https://github.com/eemeli/yaml) from 2.2.1 to 2.2.2. - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](eemeli/yaml@v2.2.1...v2.2.2) --- updated-dependencies: - dependency-name: yaml dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix lint errors * use AmplifyError as exception * chore: convert gql tansformer v1 core syntax errors errors to amplify exceptions (#12535) * chore: convert gql tansformer errors to amplify exceptions * chore: update API file * chore: modify failing e2e test * chore: remove test altogether * chore(release): Publish latest [ci skip] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - @aws-amplify/[email protected] - [email protected] - @aws-amplify/[email protected] * chore: remove old version of cli-core * chore: add uid * fix: add min delay to exp backoff (#12488) * fix: remove smoketest from normal e2e flow (#12555) * fix: remove smoketest from normal e2e flow * fix: configure auth for smoketest * Revert "fix: configure auth for smoketest" This reverts commit 2d103c0. * fix: don't throw for missing backend in prepush function handler (#12531) * test: fix bad import in pull-2 e2e test (#12559) * fix: generate OAuth keys from cognito for amplify pull workflow (#12518) * fix: creates oauthKeys from userpool for pull use cases * fix: creates oauthKeys from userpool for pull use cases * fix: exclude pull test from windows * chore: revert test file changes * chore: fixes codeql warnings * chore: fixes lint * test: add hooks-c e2e to windows exclusion list (#12562) * Run smoketests with e2e (#12558) * feat(amplify-util-uibuilder): update codegen-ui to 2.13.1 (#12565) * fix(amplify-util-uibuilder): update codegen-ui to 2.13.1 * feat(amplify-util-uibuilder): make conditional ui-react-storage dep warning * fix(amplify-util-uibuilder): fixing unit test * fix(amplify-util-uibuilder): added guard functions for better readability * fix: exclude smoketests on windows; remove extraneous dependency (#12572) * chore: enable deprecation warnings in non-prod CLI (#12585) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Kamil Sobol <[email protected]> Co-authored-by: Zeyu Li <[email protected]> Co-authored-by: akshbhu <[email protected]> Co-authored-by: Akshay Upadhyay <[email protected]> Co-authored-by: Pavel Lazar <[email protected]> Co-authored-by: Zachary Goldberg <[email protected]> Co-authored-by: Amplifiyer <[email protected]> Co-authored-by: Edward Foyle <[email protected]> Co-authored-by: Christopher Sundersingh <[email protected]> Co-authored-by: Robert J. Lemmens <[email protected]> Co-authored-by: Eddy Varela <[email protected]> Co-authored-by: aws-amplify-bot <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: John Hockett <[email protected]> Co-authored-by: Joe Buono <[email protected]> Co-authored-by: Joe Buono <[email protected]> Co-authored-by: Hein Jeong <[email protected]> Co-authored-by: Hein Jeong <[email protected]> Co-authored-by: akshay <[email protected]> Co-authored-by: Charles Shin <[email protected]> Co-authored-by: John Hockett <[email protected]> Co-authored-by: Al Harris <[email protected]> Co-authored-by: Manaswi Manthena <[email protected]> Co-authored-by: Stu Tomlinson <[email protected]> Co-authored-by: Charles Shin <[email protected]> * ci: e2e test splitting (#12525) * ci: migration tests and test splitting * ci: try again * ci: try just one batch * ci: remove hyphens * ci: try again * ci: cleanup * ci: instance size updates * ci: switch to single batch * ci: trigger full e2e run * ci: try again * ci: try again * ci: fix bug with migration test splitting * ci: full e2e run * ci: fix structure * ci: re-add original file * ci: cleanup * ci: cleanup * cb: enable basic e2e test coverage (#12601) This adds several items to the CodeBuild setup including CodeCov updates and V8 supported coverage for e2e tests. The CodeBuild updates include the function _uploadCoverageLinux in the shared-scripts.sh file. This setup utilizes the CodeCov Token secret, managed by SecretsManager and injected by the build. It then gets the latest CodeCov uploader executable and verifies it via SHA. Once the verification is complete, the uploader API is called, automatically searching for coverage artifacts to upload. This update also includes an update to the codecov.yml file to conform to CodeCov validation. Lastly, in this update we take advantage of the embedded ability of NodeJS to report coverage metrics: https://blog.npmjs.org/post/178487845610/rethinking-javascript-test-coverage.html. We then run the c8 tool to convert that coverage into something that both CodeCov and CodeBuild can consume. It also integrates these reports in CodeBuild directly. * ci: fix migration tests (#12619) * ci: Setup e2e scripts (#12629) * ci: remove dependance on webhooks * ci: try again * ci: migrate to manual cb triggers for e2e * ci: set region if not defined * ci: cleanup * ci: refactor * ci: Add local cloud e2e script (#12643) * ci: remove dependance on webhooks * ci: try again * ci: migrate to manual cb triggers for e2e * ci: set region if not defined * ci: cleanup * ci: refactor * ci: add local cloud-e2e support * ci: cleanup missed file (#12651) * ci: fix e2e (#12652) * chore: add test reporting and aggregate reporting (#12641) * noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore commit * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: noop commit trigger cb * chore: clean up * chore: clean up * chore: clean up * chore: clean up * chore: clean up * chore: clean up * chore: clean up * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: change tabs to spaces * chore: change tabs to spaces * chore: change tabs to spaces * chore: change tabs to spaces * chore: make test package variable * chore: make test package variable (remove from download) * chore: increase memory size for tests, run amplify-provider-awscloudformation separately (#12685) * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: enable test reporting for full e2e run in cb (#12675) * chore: put wait for ids in file * chore: put wait for ids in file * chore: put wait for ids in file * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: noop trigger cb * chore: remove type assertions * chore: remove type assertions * chore: remove yarn install * chore: remove yarn install * chore: reduce size of generated e2e buildspec (#12686) * chore: noop trigger cb * chore: move compute type for migration tests to specific buildspec files * chore: shoreten upload_pkg_binaries identifier to reduce buildspec size * ci: add e2e coverage clover reports and cast artifacts (#12692) * fix: use and operatpr instead of semicolon to run unit tests (#12712) * chore: enable report aggregation for migration and windows tests (#12731) * chore: encable report aggregation for migration and windows tests * chore: encable report aggregation for migration and windows tests * chore: encable report aggregation for migration and windows tests * chore: encable report aggregation for migration and windows tests * ci: rename e2e branch to avoid triggering circleci job (#12721) * ci: rename e2e branch to avoid triggering circleci job * ci: update docs * fix: local test reporting wait ids variable in buildspec (#12741) * chore: fix local reports ids variable * chore: fix local reports ids variable * chore: fix local reports ids variable * chore: fix windows buildspec (#12743) * chore: fix_windows_buildspec * chore: fix_windows_buildspec * ci: fix lint error * ci: format * ci: fix publish * ci: add integration test to generated workflow * ci: separate codebuild & cci differences (#12751) * ci: update windows build for yarn2 (#12759) * ci: update scripts to match latest yarn2 windows build * ci: try again * ci: try again * ci: dont set global npm path * ci: cleanup var names & scripts * chore: cleanup --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Doesnt Matter <[email protected]> Co-authored-by: Eddy Varela <[email protected]> Co-authored-by: Zachary Goldberg <[email protected]> Co-authored-by: Spencer Stolworthy <[email protected]> Co-authored-by: Kamil Sobol <[email protected]> Co-authored-by: Zeyu Li <[email protected]> Co-authored-by: akshbhu <[email protected]> Co-authored-by: Akshay Upadhyay <[email protected]> Co-authored-by: Pavel Lazar <[email protected]> Co-authored-by: Amplifiyer <[email protected]> Co-authored-by: Edward Foyle <[email protected]> Co-authored-by: Christopher Sundersingh <[email protected]> Co-authored-by: Robert J. Lemmens <[email protected]> Co-authored-by: aws-amplify-bot <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: John Hockett <[email protected]> Co-authored-by: Joe Buono <[email protected]> Co-authored-by: Joe Buono <[email protected]> Co-authored-by: Hein Jeong <[email protected]> Co-authored-by: Hein Jeong <[email protected]> Co-authored-by: akshay <[email protected]> Co-authored-by: Charles Shin <[email protected]> Co-authored-by: John Hockett <[email protected]> Co-authored-by: Al Harris <[email protected]> Co-authored-by: Manaswi Manthena <[email protected]> Co-authored-by: Stu Tomlinson <[email protected]> Co-authored-by: Charles Shin <[email protected]> Co-authored-by: kuhlmanp <[email protected]> * fix: smoke test flakynes (#12760) * chore: verdaccio wait performance (#12761) * chore: verdaccio wait performance * chore: verdaccio wait performance * chore: validate binary presence before npm publish in release (#12765) * fix: remove redundant step * fix: validate that binaries has been uploaded before publishing to NPM * fix: adjust path finding for schemas in codebuild (#12771) * fix: adjust path finding for schemas in codebuild * fix: adjust path finding for schemas in codebuild. adding windows condition * fix: adjust path finding for schemas in codebuild. adding windows condition * fix: adjust path finding for schemas in codebuild. copying windows function * fix: adjust path finding for schemas in codebuild. copying windows function * fix: adjust path finding for schemas in codebuild. copying windows function * fix: fix yarn path (#12769) * fix: fix yarn path * fix: update yarn path for e2e test and console integration tests * chore: split deployment step (#12775) * chore: separate versioning * chore: separate versioning * chore: separate local publish * chore: separate git actions * chore: separate git actions * chore: fixes * chore: fixes * chore: add rollback job * chore: fix finish release script (#12785) * fix: github release script (#12789) * chore: add reports for windows (#12792) * chore: add reports for windows tests * chore: add reports for windows tests * chore: add reports for windows tests * chore: add reports for windows tests * chore: add reports for windows tests * chore: add reports for windows tests * chore: add reports for windows tests * chore: add reports for windows tests * chore: add reports for windows tests * chore: add reports for windows tests * fix: update notification channel name lookup (#12763) * fix: notification update * chore: add ability to run single test cb (#12802) * chore: run single test cb * chore: run single test cb * chore: run single test cb * Update scripts/generate_single_test_buildspec_codebuild.ts Co-authored-by: John Hockett <[email protected]> --------- Co-authored-by: John Hockett <[email protected]> * chore: fix unallowed characters in single test split script (#12807) * chore: fix_unallowed_characters_in_single_split_script * chore: fix_unallowed_characters_in_single_split_script * fix: beta reporter endpoints urls (#12806) * test: fix pull-2 when multiple userpools present (#12808) * chore: update ci-info to use new CI detection logic (#12803) * fix: avoid empty and string rejects (#12818) * feat(amplify-category-storage): add CRUD PartiQL permissions for DynamoDB (#11002) * feat(amplify-util-mock): import custom port from mock.json (#10978) chore: fix lint Co-authored-by: Takahiro Suzuki <[email protected]> * chore: remove lambda python test from windows suite * fix: update lambda-auth mock event.json with the correct request authorization event payload (#11428) * Update lambda-auth event with the correct request authorization event payload per https://aws.amazon.com/blogs/mobile/appsync-lambda-auth/ * chore: fix format --------- Co-authored-by: Kamil Sobol <[email protected]> * test: make test teardown resilient to failures (#12799) * test: add try/finally to make test teardown resilient to failures * test: address PR feedback * test: use jest events instead of try/catch * chore: run prettier * Revert "test: make test teardown resilient to failures (#12799)" (#12823) This reverts commit ab04abf. * fix: warn about multiple schema files in admin modelgen task (#12673) * fix: warn about multiple schema files in admin modelgen task * chore: lint fix * fix: add check for studio enabled projects * chore: update snapshot * fix: fix Property ‘handleRunQuery’ does not exist on type ‘GraphiQL’ * chore: update CONTRIBUTING * Revert "fix: fix Property ‘handleRunQuery’ does not exist on type ‘GraphiQL’" This reverts commit 273871d. * chore: Refine Dart config parsing (#11181) * chore: Refine Dart config parsing We are experimenting with some new config layouts and the current parsing behavior prevents changing the config structure. This expands on the current behavior to allow more flexibility in the config file contents. * Add tests * test(amplify-frontend-flutter): clean up tests * chore: bump data dependency version (#12834) * chore: bump data dependency version * fix: feature flag in mock package * fix mock test * fix unit test * fix: usage data should not throw errors (#12839) * fix: usage data should not throw errors * update api dependencies --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: akshbhu <[email protected]> Co-authored-by: awsluja <[email protected]> Co-authored-by: Doesnt Matter <[email protected]> Co-authored-by: Eddy Varela <[email protected]> Co-authored-by: Zachary Goldberg <[email protected]> Co-authored-by: Spencer Stolworthy <[email protected]> Co-authored-by: Kamil Sobol <[email protected]> Co-authored-by: Zeyu Li <[email protected]> Co-authored-by: Akshay Upadhyay <[email protected]> Co-authored-by: Pavel Lazar <[email protected]> Co-authored-by: Amplifiyer <[email protected]> Co-authored-by: Edward Foyle <[email protected]> Co-authored-by: Robert J. Lemmens <[email protected]> Co-authored-by: aws-amplify-bot <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: John Hockett <[email protected]> Co-authored-by: Joe Buono <[email protected]> Co-authored-by: Joe Buono <[email protected]> Co-authored-by: Hein Jeong <[email protected]> Co-authored-by: Hein Jeong <[email protected]> Co-authored-by: akshay <[email protected]> Co-authored-by: Charles Shin <[email protected]> Co-authored-by: John Hockett <[email protected]> Co-authored-by: Al Harris <[email protected]> Co-authored-by: Manaswi Manthena <[email protected]> Co-authored-by: Stu Tomlinson <[email protected]> Co-authored-by: Charles Shin <[email protected]> Co-authored-by: kuhlmanp <[email protected]> Co-authored-by: Danielle Adams <[email protected]> Co-authored-by: Pavel Lazar <[email protected]> Co-authored-by: John Ferlito <[email protected]> Co-authored-by: Takahiro Suzuki <[email protected]> Co-authored-by: Takahiro Suzuki <[email protected]> Co-authored-by: Kevin Old <[email protected]> Co-authored-by: Phani Srikar Edupuganti <[email protected]> Co-authored-by: MJ☔ <[email protected]> Co-authored-by: Dillon Nys <[email protected]> Co-authored-by: MJ Zhang <[email protected]>
1 parent 1801a8e commit 48d324b

File tree

120 files changed

+5229
-346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+5229
-346
lines changed

.circleci/config.base.yml

Lines changed: 57 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ jobs:
112112
- run:
113113
name: Build tests
114114
command: yarn build-tests
115+
- run:
116+
# setting versions in build step so that commit and git tags are cached and available for all steps in pipeline
117+
name: Set versions
118+
command: ./.circleci/publish-step-1-set-versions.sh
115119
- save_cache:
116120
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
117121
paths:
@@ -276,8 +280,7 @@ jobs:
276280
source .circleci/local_publish_helpers.sh
277281
startLocalRegistry "$(pwd)/.circleci/verdaccio.yaml"
278282
setNpmRegistryUrlToLocal
279-
export LOCAL_PUBLISH_TO_LATEST=true
280-
./.circleci/publish.sh
283+
./.circleci/publish-step-2-verdaccio.sh
281284
unsetNpmRegistryUrl
282285
- run:
283286
name: Generate unified changelog
@@ -563,36 +566,6 @@ jobs:
563566
path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
564567
working_directory: ~/repo
565568

566-
amplify_migration_tests_v6:
567-
parameters:
568-
os:
569-
type: executor
570-
default: l_large
571-
executor: << parameters.os >>
572-
environment:
573-
AMPLIFY_PATH: /home/circleci/.npm-global/lib/node_modules/@aws-amplify/cli/bin/amplify
574-
steps:
575-
- restore_cache:
576-
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
577-
- restore_cache:
578-
key: amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
579-
- restore_cache:
580-
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
581-
- run:
582-
name: Run tests migrating from CLI v6.1.0
583-
command: |
584-
source .circleci/local_publish_helpers.sh
585-
changeNpmGlobalPath
586-
cd packages/amplify-migration-tests
587-
retry yarn run migration_v6.1.0 --no-cache --maxWorkers=4 --forceExit $TEST_SUITE
588-
no_output_timeout: 65m
589-
- run: *scan_e2e_test_artifacts
590-
- store_test_results:
591-
path: ~/repo/packages/amplify-migration-tests/
592-
- store_artifacts:
593-
path: ~/repo/packages/amplify-migration-tests/amplify-migration-reports
594-
working_directory: ~/repo
595-
596569
amplify_migration_tests_v10:
597570
parameters:
598571
os:
@@ -850,7 +823,7 @@ jobs:
850823
- store_artifacts:
851824
path: ~/aws-amplify-cypress-api/cypress/screenshots
852825

853-
deploy:
826+
publish_to_npm:
854827
<<: *linux-e2e-executor-large
855828
steps:
856829
- restore_cache:
@@ -860,20 +833,27 @@ jobs:
860833
- amplify-cli-ssh-deps-{{ .Branch }}
861834
- restore_cache:
862835
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
863-
- run:
864-
name: Upload Pkg Binary
865-
command: |
866-
source .circleci/local_publish_helpers.sh
867-
uploadPkgCli
868-
./out/amplify-pkg-linux-x64 --version
869836
- run:
870837
name: Authenticate with npm
871838
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
872839
- run:
873840
name: Publish Amplify CLI
874841
command: |
875-
bash ./.circleci/publish.sh
876-
- run: *scan_e2e_test_artifacts
842+
bash ./.circleci/publish-step-3-npm.sh
843+
post_publish_push_to_git:
844+
<<: *linux-e2e-executor-large
845+
steps:
846+
- restore_cache:
847+
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
848+
- restore_cache:
849+
keys:
850+
- amplify-cli-ssh-deps-{{ .Branch }}
851+
- restore_cache:
852+
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
853+
- run:
854+
name: Push release commit and tags
855+
command: |
856+
bash ./.circleci/publish-step-4-push-to-git.sh
877857
github_prerelease:
878858
<<: *linux-e2e-executor-large
879859
steps:
@@ -934,6 +914,19 @@ jobs:
934914
commit=$(git rev-parse HEAD)
935915
version=$(cat .amplify-pkg-version)
936916
yarn ts-node scripts/github-release.ts $version $commit
917+
npm_rollback_access:
918+
<<: *linux-e2e-executor-large
919+
steps:
920+
- restore_cache:
921+
key: amplify-cli-repo-{{ .Branch }}-{{ .Revision }}
922+
- restore_cache:
923+
keys:
924+
- amplify-cli-ssh-deps-{{ .Branch }}
925+
- restore_cache:
926+
key: amplify-pkg-binaries-{{ .Branch }}-{{ .Revision }}
927+
- run:
928+
name: Authenticate with npm
929+
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
937930
cleanup_resources:
938931
<<: *linux-e2e-executor-large
939932
steps:
@@ -1285,11 +1278,8 @@ workflows:
12851278
- /tagged-release\/.*/
12861279
- /run-e2e\/.*/
12871280

1288-
- deploy:
1281+
- publish_to_npm:
12891282
context:
1290-
- e2e-auth-credentials
1291-
- e2e-test-context
1292-
- amplify-s3-upload
12931283
- npm-publish
12941284
requires:
12951285
- test
@@ -1314,10 +1304,31 @@ workflows:
13141304
- /run-e2e-with-rc\/.*/
13151305
- /tagged-release\/.*/
13161306
- /tagged-release-without-e2e-tests\/.*/
1307+
- npm_rollback_access:
1308+
context:
1309+
- npm-publish
1310+
requires:
1311+
- upload_pkg_binaries
1312+
- verify-versions-match
1313+
filters:
1314+
branches:
1315+
only:
1316+
- release
1317+
- post_publish_push_to_git:
1318+
requires:
1319+
- publish_to_npm
1320+
filters:
1321+
branches:
1322+
only:
1323+
- release
1324+
- /release_rc\/.*/
1325+
- /run-e2e-with-rc\/.*/
1326+
- /tagged-release\/.*/
1327+
- /tagged-release-without-e2e-tests\/.*/
13171328
- github_release:
13181329
context: github-publish
13191330
requires:
1320-
- deploy
1331+
- post_publish_push_to_git
13211332
filters:
13221333
branches:
13231334
only:

.circleci/local_publish_helpers.sh

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@ [email protected]
55

66
function startLocalRegistry {
77
# Start local registry
8-
tmp_registry_log=$(mktemp)
8+
tmp_registry_log="$(mktemp)"
99
echo "Registry output file: $tmp_registry_log"
1010
(cd && nohup npx ${VERDACCIO_PACKAGE:-$default_verdaccio_package} -c $1 &>$tmp_registry_log &)
1111
# Wait for Verdaccio to boot
12-
grep -q 'http address' <(tail -f $tmp_registry_log)
12+
attempts=0
13+
until grep -q 'http address' $tmp_registry_log
14+
do
15+
attempts=$((attempts+1))
16+
echo "Waiting for Verdaccio, attempt $attempts"
17+
sleep 1
18+
19+
if (( attempts > 60 )); then
20+
echo "Verdaccio didn't start";
21+
exit 1
22+
fi
23+
done
1324
}
1425

1526
function uploadPkgCli {
@@ -152,7 +163,7 @@ function unsetSudoNpmRegistryUrl {
152163
}
153164

154165
function changeNpmGlobalPath {
155-
mkdir -p ~/.npm-global
166+
mkdir -p ~/.npm-global/{bin,lib}
156167
npm config set prefix '~/.npm-global'
157168
export PATH=~/.npm-global/bin:$PATH
158169
}
@@ -266,7 +277,6 @@ function setAwsAccountCredentials {
266277
useChildAccountCredentials
267278
fi
268279
}
269-
270280
function runE2eTest {
271281
FAILED_TEST_REGEX_FILE="./amplify-e2e-reports/amplify-e2e-failed-test.txt"
272282

@@ -279,6 +289,36 @@ function runE2eTest {
279289
fi
280290
}
281291

292+
function runE2eTestCb {
293+
_setupCoverage
294+
FAILED_TEST_REGEX_FILE="./amplify-e2e-reports/amplify-e2e-failed-test.txt"
295+
296+
if [ -f $FAILED_TEST_REGEX_FILE ]; then
297+
# read the content of failed tests
298+
failedTests=$(<$FAILED_TEST_REGEX_FILE)
299+
NODE_V8_COVERAGE=$E2E_TEST_COVERAGE_DIR yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE -t "$failedTests"
300+
else
301+
NODE_V8_COVERAGE=$E2E_TEST_COVERAGE_DIR yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE
302+
fi
303+
}
304+
305+
function _setupCoverage {
306+
_teardownCoverage
307+
echo "Setup Coverage ($E2E_TEST_COVERAGE_DIR)"
308+
if [ ! -d $E2E_TEST_COVERAGE_DIR ]
309+
then
310+
mkdir -p $E2E_TEST_COVERAGE_DIR
311+
fi
312+
}
313+
314+
function _teardownCoverage {
315+
if [ -d $E2E_TEST_COVERAGE_DIR ]
316+
then
317+
echo "Teardown Coverage ($E2E_TEST_COVERAGE_DIR)"
318+
rm -r $E2E_TEST_COVERAGE_DIR
319+
fi
320+
}
321+
282322
function checkPackageVersionsInLocalNpmRegistry {
283323
cli_internal_version=$(npm view @aws-amplify/cli-internal version)
284324
cli_version=$(npm view @aws-amplify/cli version)

.circleci/publish.sh renamed to .circleci/publish-codebuild.sh

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,46 @@
11
#!/bin/bash -e
2+
export BRANCH_NAME="$(git symbolic-ref HEAD --short 2>/dev/null)"
3+
if [ "$BRANCH_NAME" = "" ] ; then
4+
BRANCH_NAME="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g')";
5+
fi
6+
git checkout $BRANCH_NAME
7+
echo "fetching tags"
8+
git fetch --tags https://github.com/aws-amplify/amplify-cli
29

310
# lerna has a bug (https://github.com/lerna/lerna/issues/1066) where failed publishes do not set the exit code properly
411
# this causes the script to keep running even after failed publishes
512
# this function forces failed publishes to exit on failure
613
function lernaPublishExitOnFailure {
714
# exit on failure
815
set -e
9-
# run lerna publish with the args that were passed to this function
10-
# duplicate stdout to a temp file
11-
# grep the temp file for the lerna err token and return exit 1 if found (-v option inverts grep exit code)
12-
1316
if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
1417
# registy URL update changes .yarnrc.yml file
1518
git update-index --assume-unchanged .yarnrc.yml
1619
fi
1720

21+
# run lerna publish with the args that were passed to this function
22+
# duplicate stdout to a temp file
23+
# grep the temp file for the lerna err token and return exit 1 if found (-v option inverts grep exit code)
1824
npx lerna publish "$@" | tee /tmp/publish-results && grep -qvz "lerna ERR!" < /tmp/publish-results
1925
}
2026

27+
# verifies that binaries are uploaded and available before publishing to NPM
28+
function verifyPkgIsAvailable {
29+
# exit on failure
30+
set -e
31+
32+
# read version of @aws-amplify/cli
33+
desiredPkgVersion=$(npx lerna list --scope @aws-amplify/cli --json | jq -r '.[0].version')
34+
35+
# check binaries
36+
# send HEAD requests to check for binary presence
37+
# curl --fail exits with non-zero code and makes this script fail
38+
curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-linux-x64.tgz
39+
curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-linux-arm64.tgz
40+
curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-macos-x64.tgz
41+
curl -I --fail https://package.cli.amplify.aws/$desiredPkgVersion/amplify-pkg-win-x64.tgz
42+
}
43+
2144
if [ -z "$GITHUB_EMAIL" ]; then
2245
if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
2346
git config --global user.email [email protected]
@@ -40,13 +63,13 @@ else
4063
git config --global user.name $GITHUB_USER
4164
fi
4265

43-
if [[ "$CIRCLE_BRANCH" =~ ^tagged-release ]]; then
44-
if [[ "$CIRCLE_BRANCH" =~ ^tagged-release-without-e2e-tests\/.* ]]; then
66+
if [[ "$BRANCH_NAME" =~ ^tagged-release ]]; then
67+
if [[ "$BRANCH_NAME" =~ ^tagged-release-without-e2e-tests\/.* ]]; then
4568
# Remove tagged-release-without-e2e-tests/
46-
export NPM_TAG="${CIRCLE_BRANCH/tagged-release-without-e2e-tests\//}"
47-
elif [[ "$CIRCLE_BRANCH" =~ ^tagged-release\/.* ]]; then
69+
export NPM_TAG="${BRANCH_NAME/tagged-release-without-e2e-tests\//}"
70+
elif [[ "$BRANCH_NAME" =~ ^tagged-release\/.* ]]; then
4871
# Remove tagged-release/
49-
export NPM_TAG="${CIRCLE_BRANCH/tagged-release\//}"
72+
export NPM_TAG="${BRANCH_NAME/tagged-release\//}"
5073
fi
5174
if [ -z "$NPM_TAG" ]; then
5275
echo "Tag name is missing. Name your branch with either tagged-release/<tag-name> or tagged-release-without-e2e-tests/<tag-name>"
@@ -62,10 +85,15 @@ if [[ "$CIRCLE_BRANCH" =~ ^tagged-release ]]; then
6285
fi
6386

6487
# @latest release
65-
elif [[ "$CIRCLE_BRANCH" == "release" ]]; then
88+
elif [[ "$BRANCH_NAME" == "release" ]]; then
6689
# create release commit and release tags
6790
npx lerna version --exact --conventional-commits --conventional-graduate --yes --no-push --include-merged-tags --message "chore(release): Publish latest [ci skip]"
6891

92+
if [[ "$LOCAL_PUBLISH_TO_LATEST" != "true" ]]; then
93+
# verify that binary has been uploaded
94+
verifyPkgIsAvailable
95+
fi
96+
6997
# publish versions that were just computed
7098
lernaPublishExitOnFailure from-git --yes --no-push
7199

@@ -76,7 +104,7 @@ elif [[ "$CIRCLE_BRANCH" == "release" ]]; then
76104
fi
77105

78106
# push release commit
79-
git push origin "$CIRCLE_BRANCH"
107+
git push origin "$BRANCH_NAME"
80108

81109
# push release tags
82110
git tag --points-at HEAD | xargs git push origin
@@ -94,7 +122,7 @@ elif [[ "$CIRCLE_BRANCH" == "release" ]]; then
94122
git push origin hotfix
95123

96124
# release candidate or local publish for testing / building binary
97-
elif [[ "$CIRCLE_BRANCH" =~ ^run-e2e-with-rc\/.* ]] || [[ "$CIRCLE_BRANCH" =~ ^release_rc\/.* ]] || [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
125+
elif [[ "$BRANCH_NAME" =~ ^run-e2e-with-rc\/.* ]] || [[ "$BRANCH_NAME" =~ ^release_rc\/.* ]] || [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
98126

99127
# force @aws-amplify/cli-internal to be versioned in case this pipeline run does not have any commits that modify the CLI packages
100128
if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
@@ -103,6 +131,7 @@ elif [[ "$CIRCLE_BRANCH" =~ ^run-e2e-with-rc\/.* ]] || [[ "$CIRCLE_BRANCH" =~ ^r
103131
# create release commit and release tags
104132
npx lerna version --preid=rc.$(git rev-parse --short HEAD) --exact --conventional-prerelease --conventional-commits --yes --no-push --include-merged-tags --message "chore(release): Publish rc [ci skip]" $(echo $force_publish_local_args) --no-commit-hooks
105133

134+
106135
# if publishing locally to verdaccio
107136
if [[ "$LOCAL_PUBLISH_TO_LATEST" == "true" ]]; then
108137
# publish to verdaccio with no dist tag (default to latest)
@@ -112,14 +141,17 @@ elif [[ "$CIRCLE_BRANCH" =~ ^run-e2e-with-rc\/.* ]] || [[ "$CIRCLE_BRANCH" =~ ^r
112141
exit 0
113142
fi
114143

144+
# verify that binary has been uploaded
145+
verifyPkgIsAvailable
146+
115147
# publish versions that were just computed
116148
lernaPublishExitOnFailure from-git --yes --no-push --dist-tag rc
117149

118150
# push release commit
119-
git push origin "$CIRCLE_BRANCH"
151+
git push origin "$BRANCH_NAME"
120152

121153
# push release tags
122154
git tag --points-at HEAD | xargs git push origin
123155
else
124-
echo "branch name" "$CIRCLE_BRANCH" "did not match any branch publish rules. Skipping publish"
156+
echo "branch name" "$BRANCH_NAME" "did not match any branch publish rules. Skipping publish"
125157
fi

0 commit comments

Comments
 (0)