From dd9c177bee867c7333e96582eca7f1d74be99858 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 15:27:55 -0300 Subject: [PATCH 01/14] chore: update CircleCI configuration to skip Nx cache during builds and remove 'since master' flag from test commands --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 978534296b..7e05a1683e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,7 +78,7 @@ jobs: - ~/.cache/yarn - run: name: Build all packages with lerna - command: 'yarn build --since master' + command: 'yarn build --skip-nx-cache' - persist_to_workspace: root: *working_directory paths: @@ -108,7 +108,6 @@ jobs: name: 'Test unit' command: | yarn test \ - --since master \ --ignore @requestnetwork/request-client.js \ --ignore @requestnetwork/smart-contracts \ --ignore @requestnetwork/payment-detection \ @@ -165,7 +164,6 @@ jobs: name: 'Test request-client.js, smart-contracts, payment-detection and payment-processor' command: | yarn test \ - --since master \ --scope @requestnetwork/request-client.js \ --scope @requestnetwork/smart-contracts \ --scope @requestnetwork/payment-detection \ @@ -203,7 +201,6 @@ jobs: name: 'Test integration-test' command: | yarn test \ - --since master \ --scope @requestnetwork/integration-test - store_test_results: path: packages/integration-test/reports/ From acf11c078700109885c57fe55fa44ec0342033a9 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 15:58:46 -0300 Subject: [PATCH 02/14] chore: update CircleCI configuration to build and test packages with 'since master' flag and add smart-contracts build step --- .circleci/config.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e05a1683e..8c5c5eee12 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,7 +78,7 @@ jobs: - ~/.cache/yarn - run: name: Build all packages with lerna - command: 'yarn build --skip-nx-cache' + command: 'yarn build --since master' - persist_to_workspace: root: *working_directory paths: @@ -108,6 +108,7 @@ jobs: name: 'Test unit' command: | yarn test \ + --since master \ --ignore @requestnetwork/request-client.js \ --ignore @requestnetwork/smart-contracts \ --ignore @requestnetwork/payment-detection \ @@ -156,6 +157,9 @@ jobs: steps: - attach_workspace: at: *working_directory + - run: + name: 'Build smart-contracts' + command: 'yarn build --scope @requestnetwork/smart-contracts' - run: name: 'Deploy test contract from smart-contracts' command: 'yarn deploy:contracts' @@ -164,6 +168,7 @@ jobs: name: 'Test request-client.js, smart-contracts, payment-detection and payment-processor' command: | yarn test \ + --since master \ --scope @requestnetwork/request-client.js \ --scope @requestnetwork/smart-contracts \ --scope @requestnetwork/payment-detection \ @@ -188,6 +193,9 @@ jobs: steps: - attach_workspace: at: *working_directory + - run: + name: 'Build smart-contracts' + command: 'yarn build --scope @requestnetwork/smart-contracts' - run: name: 'Deploy test contract from smart-contracts' command: 'yarn deploy:contracts' @@ -201,6 +209,7 @@ jobs: name: 'Test integration-test' command: | yarn test \ + --since master \ --scope @requestnetwork/integration-test - store_test_results: path: packages/integration-test/reports/ @@ -271,6 +280,9 @@ jobs: - run: name: 'Authenticate with registry' command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc + - run: + name: 'Build all packages with lerna' + command: 'yarn build --skip-nx-cache' - run: name: 'Publish' command: | From c15bc6bb61146ff14ef57afb757d93915e9c5db7 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 16:07:20 -0300 Subject: [PATCH 03/14] revert: attempt to avoid doing a clean build --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c5c5eee12..765cdbb666 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,7 +78,7 @@ jobs: - ~/.cache/yarn - run: name: Build all packages with lerna - command: 'yarn build --since master' + command: 'yarn build --skip-nx-cache' - persist_to_workspace: root: *working_directory paths: @@ -108,7 +108,6 @@ jobs: name: 'Test unit' command: | yarn test \ - --since master \ --ignore @requestnetwork/request-client.js \ --ignore @requestnetwork/smart-contracts \ --ignore @requestnetwork/payment-detection \ @@ -168,7 +167,6 @@ jobs: name: 'Test request-client.js, smart-contracts, payment-detection and payment-processor' command: | yarn test \ - --since master \ --scope @requestnetwork/request-client.js \ --scope @requestnetwork/smart-contracts \ --scope @requestnetwork/payment-detection \ @@ -209,7 +207,6 @@ jobs: name: 'Test integration-test' command: | yarn test \ - --since master \ --scope @requestnetwork/integration-test - store_test_results: path: packages/integration-test/reports/ From 37c1c353f667c796dea24029f311d9c861c5c2fb Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 16:20:19 -0300 Subject: [PATCH 04/14] fix: build by increasing resources --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 765cdbb666..fa59abc337 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,7 +60,7 @@ jobs: build: docker: - *node_image - resource_class: large + resource_class: xlarge working_directory: *working_directory steps: - checkout From f110bec6a8eafa3a80b3fb40d570ce9e080fd76d Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 16:47:00 -0300 Subject: [PATCH 05/14] test: increasing tests runner resources --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa59abc337..cd812290b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,7 +99,7 @@ jobs: test-unit: docker: - *node_image - resource_class: large + resource_class: xlarge working_directory: *working_directory steps: - attach_workspace: @@ -151,7 +151,7 @@ jobs: - *ganache_image - *postgres_image - *graph_image - resource_class: large + resource_class: xlarge working_directory: *working_directory steps: - attach_workspace: From 16c64337f6c6cdbd032c5d8cacab63859efea1fc Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 17:10:47 -0300 Subject: [PATCH 06/14] fix: test order --- .circleci/config.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd812290b7..02f746afff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,7 +99,7 @@ jobs: test-unit: docker: - *node_image - resource_class: xlarge + resource_class: large working_directory: *working_directory steps: - attach_workspace: @@ -108,6 +108,8 @@ jobs: name: 'Test unit' command: | yarn test \ + --ignore @requestnetwork/request-node \ + --ignore @requestnetwork/ethereum-storage \ --ignore @requestnetwork/request-client.js \ --ignore @requestnetwork/smart-contracts \ --ignore @requestnetwork/payment-detection \ @@ -125,16 +127,12 @@ jobs: path: packages/epk-cipher/reports/ - store_test_results: path: packages/epk-decryption/reports/ - - store_test_results: - path: packages/ethereum-storage/reports/ - store_test_results: path: packages/lit-protocol-cipher/reports/ - store_test_results: path: packages/multi-format/reports/ - store_test_results: path: packages/request-logic/reports/ - - store_test_results: - path: packages/request-node/reports/ - store_test_results: path: packages/thegraph-data-access/reports/ - store_test_results: @@ -151,7 +149,7 @@ jobs: - *ganache_image - *postgres_image - *graph_image - resource_class: xlarge + resource_class: large working_directory: *working_directory steps: - attach_workspace: @@ -167,10 +165,14 @@ jobs: name: 'Test request-client.js, smart-contracts, payment-detection and payment-processor' command: | yarn test \ + --scope @requestnetwork/request-node \ + --scope @requestnetwork/ethereum-storage \ --scope @requestnetwork/request-client.js \ --scope @requestnetwork/smart-contracts \ --scope @requestnetwork/payment-detection \ --scope @requestnetwork/payment-processor + - store_test_results: + path: packages/request-node/reports/ - store_test_results: path: packages/request-client.js/reports/ - store_test_results: @@ -179,6 +181,8 @@ jobs: path: packages/payment-detection/reports/ - store_test_results: path: packages/payment-processor/reports/ + - store_test_results: + path: packages/ethereum-storage/reports/ test-integration-with-request-node: docker: - *node_image From e543b1c2c70ff37d98abc5eb9831eefe9b424c4a Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 17:45:59 -0300 Subject: [PATCH 07/14] fix: build with cache --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02f746afff..d5b8ea1c80 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,7 +78,7 @@ jobs: - ~/.cache/yarn - run: name: Build all packages with lerna - command: 'yarn build --skip-nx-cache' + command: 'yarn build' - persist_to_workspace: root: *working_directory paths: From ec0efd4e95581242259ebc627c7567c63a8ffe79 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 17:51:06 -0300 Subject: [PATCH 08/14] fix: remove unecessary build smart contract --- .circleci/config.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d5b8ea1c80..38016c7dd3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -154,9 +154,6 @@ jobs: steps: - attach_workspace: at: *working_directory - - run: - name: 'Build smart-contracts' - command: 'yarn build --scope @requestnetwork/smart-contracts' - run: name: 'Deploy test contract from smart-contracts' command: 'yarn deploy:contracts' @@ -195,9 +192,6 @@ jobs: steps: - attach_workspace: at: *working_directory - - run: - name: 'Build smart-contracts' - command: 'yarn build --scope @requestnetwork/smart-contracts' - run: name: 'Deploy test contract from smart-contracts' command: 'yarn deploy:contracts' From 819c1d2917c7a703840d114aab04296edbab9d99 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 18:24:03 -0300 Subject: [PATCH 09/14] test: increasing resources --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 38016c7dd3..37000ab44d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,7 +99,7 @@ jobs: test-unit: docker: - *node_image - resource_class: large + resource_class: xlarge working_directory: *working_directory steps: - attach_workspace: @@ -149,7 +149,7 @@ jobs: - *ganache_image - *postgres_image - *graph_image - resource_class: large + resource_class: xlarge working_directory: *working_directory steps: - attach_workspace: From 56fd7a10b563d98e05b9be94d352654e23d6f274 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 21:49:18 -0300 Subject: [PATCH 10/14] fix: lerna caching --- .circleci/config.yml | 7 +++++-- .gitignore | 4 +++- nx.json | 5 ++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37000ab44d..e569969af9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,6 +83,9 @@ jobs: root: *working_directory paths: - ./ + - ./.nx-cache + - packages/*/dist + - packages/*/*.tsbuildinfo lint: docker: - *node_image @@ -99,7 +102,7 @@ jobs: test-unit: docker: - *node_image - resource_class: xlarge + resource_class: large working_directory: *working_directory steps: - attach_workspace: @@ -149,7 +152,7 @@ jobs: - *ganache_image - *postgres_image - *graph_image - resource_class: xlarge + resource_class: large working_directory: *working_directory steps: - attach_workspace: diff --git a/.gitignore b/.gitignore index 2f749745d3..4e85d3d789 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,6 @@ tsconfig.build.tsbuildinfo /packages/smart-contracts/types/ /packages/smart-contracts/src/types/ /packages/smart-contracts/build-zk/ -/packages/smart-contracts/cache-zk/ \ No newline at end of file +/packages/smart-contracts/cache-zk/ + +.nx-cache/ \ No newline at end of file diff --git a/nx.json b/nx.json index 20cba77dda..10c52ed172 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,10 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": ["build", "test", "lint:check"] + "cacheableOperations": ["build", "test", "lint:check"], + "cacheDirectory": ".nx-cache", + "parallel": 3, + "fileHashVersion": 2 } } }, From 894dedc7226bdea91e67146c0b562fc4fae6fe82 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 22:09:54 -0300 Subject: [PATCH 11/14] test: increase resourse again --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e569969af9..f75a885be2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,7 +102,7 @@ jobs: test-unit: docker: - *node_image - resource_class: large + resource_class: xlarge working_directory: *working_directory steps: - attach_workspace: @@ -152,7 +152,7 @@ jobs: - *ganache_image - *postgres_image - *graph_image - resource_class: large + resource_class: xlarge working_directory: *working_directory steps: - attach_workspace: From 3cfe20883c6de674e01d1df35c304b7c93280c94 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 22:33:30 -0300 Subject: [PATCH 12/14] fix: reduce concurrency --- .circleci/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f75a885be2..622734841b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,7 +117,8 @@ jobs: --ignore @requestnetwork/smart-contracts \ --ignore @requestnetwork/payment-detection \ --ignore @requestnetwork/payment-processor \ - --ignore @requestnetwork/integration-test + --ignore @requestnetwork/integration-test \ + --concurrency=2 - store_test_results: path: packages/advance-logic/reports/ - store_test_results: @@ -170,7 +171,8 @@ jobs: --scope @requestnetwork/request-client.js \ --scope @requestnetwork/smart-contracts \ --scope @requestnetwork/payment-detection \ - --scope @requestnetwork/payment-processor + --scope @requestnetwork/payment-processor \ + --concurrency=2 - store_test_results: path: packages/request-node/reports/ - store_test_results: From a0881d7e94c3a1c2fa178a5e3d8c2c1dc88dc376 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 22:52:31 -0300 Subject: [PATCH 13/14] fix: by lower concurrency on integration test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 622734841b..57b5337b53 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -172,7 +172,7 @@ jobs: --scope @requestnetwork/smart-contracts \ --scope @requestnetwork/payment-detection \ --scope @requestnetwork/payment-processor \ - --concurrency=2 + --concurrency=1 - store_test_results: path: packages/request-node/reports/ - store_test_results: From b28d88c5f2bdf22820895adbc2cec43896d88a22 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 23:07:11 -0300 Subject: [PATCH 14/14] fix: decrease resource for unit test = --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 57b5337b53..8e5176f7d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,7 +102,7 @@ jobs: test-unit: docker: - *node_image - resource_class: xlarge + resource_class: large working_directory: *working_directory steps: - attach_workspace: