From 7634b5ec11f814f25eea354990b37643db618488 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 11:04:46 +0200 Subject: [PATCH 01/16] Cache setup-node --- .github/workflows/budibase_ci.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 55c4405e10..20d2635aca 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -24,9 +24,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use Node.js 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x + cache: "yarn" - run: yarn - run: yarn lint @@ -38,9 +39,10 @@ jobs: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Use Node.js 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x + cache: "yarn" - run: yarn - run: yarn bootstrap - run: yarn build @@ -53,9 +55,10 @@ jobs: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Use Node.js 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x + cache: "yarn" - run: yarn - run: yarn bootstrap - run: yarn build @@ -74,9 +77,10 @@ jobs: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Use Node.js 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x + cache: "yarn" - run: yarn - run: yarn bootstrap - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core @@ -90,9 +94,10 @@ jobs: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Use Node.js 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x + cache: "yarn" - run: yarn && yarn bootstrap && yarn build - run: | cd qa-core From aa46f5a969417020fd98b9a075cf2e190925c6f1 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 11:06:32 +0200 Subject: [PATCH 02/16] Clean unnecessary steps --- .github/workflows/budibase_ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 20d2635aca..1869617f33 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -44,7 +44,6 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn bootstrap - run: yarn build test: @@ -60,8 +59,7 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn bootstrap - - run: yarn build + - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core - run: yarn test --ignore=@budibase/pro - uses: codecov/codecov-action@v3 with: @@ -82,7 +80,6 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn bootstrap - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core - run: yarn test --scope=@budibase/pro From 3e238f3e2fec9a5dee919218cc08f180ca46da45 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 11:17:50 +0200 Subject: [PATCH 03/16] Build string templates before tests --- .github/workflows/budibase_ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 1869617f33..b1607ba319 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -59,7 +59,7 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core + - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates - run: yarn test --ignore=@budibase/pro - uses: codecov/codecov-action@v3 with: @@ -95,7 +95,8 @@ jobs: with: node-version: 14.x cache: "yarn" - - run: yarn && yarn bootstrap && yarn build + - run: yarn + - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates - run: | cd qa-core yarn setup From 8795bba6e04fd09aa2cc53d5cbae8cb4cf6c7ccf Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 11:22:46 +0200 Subject: [PATCH 04/16] Build all on integration tests --- .github/workflows/budibase_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index b1607ba319..17929cc33d 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -96,7 +96,7 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates + - run: yarn build - run: | cd qa-core yarn setup From f33f7b1143590057aaf50af89f446099f7bf0b63 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 11:59:14 +0200 Subject: [PATCH 05/16] Tidy pipelines --- .github/workflows/budibase_ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 17929cc33d..d05497c3a8 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -97,7 +97,8 @@ jobs: cache: "yarn" - run: yarn - run: yarn build - - run: | + - name: Run tests + run: | cd qa-core yarn setup yarn test:ci From 08babf719e5d4c446a3a5d7c1453cc4fec58f2c4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 12:41:26 +0200 Subject: [PATCH 06/16] Fix build deps --- .github/workflows/budibase_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index d05497c3a8..930d878488 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -59,7 +59,7 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates + - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates --scope=@budibase/client - run: yarn test --ignore=@budibase/pro - uses: codecov/codecov-action@v3 with: From 60109ebcda5a9edafb64d01b4b39a0d60ed3ed3e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 12:55:04 +0200 Subject: [PATCH 07/16] Fix manifest usage --- .github/workflows/budibase_ci.yml | 2 +- packages/server/src/utilities/fileSystem/app.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 930d878488..d05497c3a8 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -59,7 +59,7 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates --scope=@budibase/client + - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates - run: yarn test --ignore=@budibase/pro - uses: codecov/codecov-action@v3 with: diff --git a/packages/server/src/utilities/fileSystem/app.ts b/packages/server/src/utilities/fileSystem/app.ts index f5e1f6e40e..0decf73a54 100644 --- a/packages/server/src/utilities/fileSystem/app.ts +++ b/packages/server/src/utilities/fileSystem/app.ts @@ -35,7 +35,7 @@ export const getComponentLibraryManifest = async (library: string) => { const filename = "manifest.json" if (env.isDev() || env.isTest()) { - const path = join(NODE_MODULES_PATH, "@budibase", "client", filename) + const path = join(TOP_LEVEL_PATH, "../client", filename) // always load from new so that updates are refreshed delete require.cache[require.resolve(path)] return require(path) From e06d0c91f21b4334287bd54df78c6f115efbe4d7 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 15:47:33 +0200 Subject: [PATCH 08/16] Update checkout action --- .github/workflows/budibase_ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index d05497c3a8..1f9e640b51 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -22,7 +22,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -34,7 +34,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} @@ -49,7 +49,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} @@ -61,6 +61,9 @@ jobs: - run: yarn - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates - run: yarn test --ignore=@budibase/pro + env: + JEST_MAX_WORKERS: ${{ steps.cpu-cores.outputs.count }} + - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos @@ -70,7 +73,7 @@ jobs: test-pro: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} @@ -86,7 +89,7 @@ jobs: integration-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} @@ -110,7 +113,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} From 61a7e4bbcf9d29b64332d703a886ac34d37eb4c2 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 May 2023 09:08:53 +0200 Subject: [PATCH 09/16] Remove build step from test --- .github/workflows/budibase_ci.yml | 2 -- packages/pro | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 1f9e640b51..1f0e575803 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -59,7 +59,6 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates - run: yarn test --ignore=@budibase/pro env: JEST_MAX_WORKERS: ${{ steps.cpu-cores.outputs.count }} @@ -83,7 +82,6 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core - run: yarn test --scope=@budibase/pro integration-test: diff --git a/packages/pro b/packages/pro index 64a2025727..a590dc237a 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 64a2025727c25d5813832c92eb360de3947b7aa6 +Subproject commit a590dc237a16983b8f39dc8e65005b7736d23467 From 6d44fd012dd2365910d95b706046cc70124c0001 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 May 2023 10:22:14 +0200 Subject: [PATCH 10/16] Remove unnecessary paths --- packages/builder/tsconfig.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/builder/tsconfig.json b/packages/builder/tsconfig.json index 400f964e30..0913aea33d 100644 --- a/packages/builder/tsconfig.json +++ b/packages/builder/tsconfig.json @@ -4,12 +4,7 @@ "composite": true, "declaration": true, "sourceMap": true, - "baseUrl": ".", - "paths": { - "@budibase/types": ["../types/src"], - "@budibase/backend-core": ["../backend-core/src"], - "@budibase/backend-core/*": ["../backend-core/*.js"] - } + "baseUrl": "." }, "ts-node": { "require": ["tsconfig-paths/register"] From ba00b8b47d8f63b8c1932ab3bacab2e7e968e679 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 May 2023 10:29:08 +0200 Subject: [PATCH 11/16] Add build share-core before test --- .github/workflows/budibase_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 1f0e575803..b8b3d54635 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -59,6 +59,7 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn + - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates - run: yarn test --ignore=@budibase/pro env: JEST_MAX_WORKERS: ${{ steps.cpu-cores.outputs.count }} From de28670be12b286e3831b6d571a28ba2f383469f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 May 2023 12:27:52 +0200 Subject: [PATCH 12/16] Clean pipeline --- .github/workflows/budibase_ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index b8b3d54635..757a9a4983 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -61,9 +61,6 @@ jobs: - run: yarn - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates - run: yarn test --ignore=@budibase/pro - env: - JEST_MAX_WORKERS: ${{ steps.cpu-cores.outputs.count }} - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos From 0850ee7b8c32a4a92c63bd07b805ff93a72849cd Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 May 2023 17:37:33 +0200 Subject: [PATCH 13/16] Fix flakiness --- packages/worker/src/tests/structures/groups.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/worker/src/tests/structures/groups.ts b/packages/worker/src/tests/structures/groups.ts index 33af533bd4..b0d6bb8fc0 100644 --- a/packages/worker/src/tests/structures/groups.ts +++ b/packages/worker/src/tests/structures/groups.ts @@ -18,7 +18,7 @@ export const UserGroup = () => { apps: [], color: generator.color(), icon: generator.word(), - name: generator.word({ length: 2 }), + name: generator.word(), roles: roles, users: [], } From d9b105a001d9db048a0009f69c3843a60b073cf5 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 May 2023 17:46:24 +0200 Subject: [PATCH 14/16] Don't run tests in parallel --- .github/workflows/budibase_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 757a9a4983..73e000fcda 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -60,7 +60,7 @@ jobs: cache: "yarn" - run: yarn - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates - - run: yarn test --ignore=@budibase/pro + - run: yarn test --ignore=@budibase/pro --concurrency=1 - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos From 5ba9c75e70ee20b9a2bcc3f5d40a66fe937151e4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 May 2023 10:07:46 +0200 Subject: [PATCH 15/16] Remove concurrency=1 --- .github/workflows/budibase_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 73e000fcda..757a9a4983 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -60,7 +60,7 @@ jobs: cache: "yarn" - run: yarn - run: yarn build --scope=@budibase/types --scope=@budibase/shared-core --scope=@budibase/string-templates - - run: yarn test --ignore=@budibase/pro --concurrency=1 + - run: yarn test --ignore=@budibase/pro - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos From e47aef13d58f4505c385adbfc2f1d338e74f07c9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 May 2023 10:36:23 +0200 Subject: [PATCH 16/16] Fix jest refs --- packages/worker/jest.config.ts | 1 + packages/worker/tsconfig.json | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/worker/jest.config.ts b/packages/worker/jest.config.ts index 2b0d8fe23b..49b6c5d425 100644 --- a/packages/worker/jest.config.ts +++ b/packages/worker/jest.config.ts @@ -16,6 +16,7 @@ const config: Config.InitialOptions = { "@budibase/backend-core/(.*)": "/../backend-core/$1", "@budibase/backend-core": "/../backend-core/src", "@budibase/types": "/../types/src", + "@budibase/shared-core": ["/../shared-core/src"], }, } diff --git a/packages/worker/tsconfig.json b/packages/worker/tsconfig.json index 45c50934b3..0c0d948d27 100644 --- a/packages/worker/tsconfig.json +++ b/packages/worker/tsconfig.json @@ -16,11 +16,7 @@ "require": ["tsconfig-paths/register"], "swc": true }, - "references": [ - { "path": "../types" }, - { "path": "../backend-core" }, - { "path": "../../../budibase-pro/packages/pro" } - ], + "references": [{ "path": "../types" }, { "path": "../backend-core" }], "include": ["src/**/*"], "exclude": ["dist"] }