From 79d1b22caeb6bf47974fb588f1bdf2d5de9d101a Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 11:00:13 +0000 Subject: [PATCH 1/8] Pull images separately from tests, enable testcontainers debug logs. --- .github/workflows/budibase_ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 5c474aa826..c2a4fcb176 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -138,6 +138,8 @@ jobs: test-server: runs-on: ubuntu-latest + env: + DEBUG: testcontainers,testcontainers:exec,testcontainers:build,testcontainers:pull steps: - name: Checkout repo uses: actions/checkout@v4 @@ -151,7 +153,17 @@ jobs: with: node-version: 20.x cache: yarn + + - name: Pull testcontainers images + run: | + docker pull mcr.microsoft.com/mssql/server:2022-latest + docker pull mysql:8.3 + docker pull postgres:16.1-bullseye + docker pull mongo:7.0-jammy + docker pull mariadb:lts + - run: yarn --frozen-lockfile + - name: Test server run: | if ${{ env.USE_NX_AFFECTED }}; then From 077ca2d12089a56efe5ff6963705c23de3a1b7cc Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 11:16:37 +0000 Subject: [PATCH 2/8] Make a change in packages/server to trigger the tests. --- packages/server/src/integrations/tests/utils/mssql.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/server/src/integrations/tests/utils/mssql.ts b/packages/server/src/integrations/tests/utils/mssql.ts index 6bd4290a90..cff6809c0a 100644 --- a/packages/server/src/integrations/tests/utils/mssql.ts +++ b/packages/server/src/integrations/tests/utils/mssql.ts @@ -1,6 +1,8 @@ import { Datasource, SourceName } from "@budibase/types" import { GenericContainer, Wait, StartedTestContainer } from "testcontainers" +// TODO: remove this comment + let container: StartedTestContainer | undefined export async function start(): Promise { From 44b448f3e13412953c11ddd8edc65948dcb47fa8 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 11:52:01 +0000 Subject: [PATCH 3/8] Also pull couchdb --- .github/workflows/budibase_ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index c2a4fcb176..94a001ba96 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -161,6 +161,8 @@ jobs: docker pull postgres:16.1-bullseye docker pull mongo:7.0-jammy docker pull mariadb:lts + docker pull testcontainers/ryuk:0.3.0 + docker pull budibase/couchdb - run: yarn --frozen-lockfile From fc41d16d1d67a2e25c1dfbeb3246d559155c5808 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 11:52:18 +0000 Subject: [PATCH 4/8] Remove comment added to trigger tests. --- packages/server/src/integrations/tests/utils/mssql.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/server/src/integrations/tests/utils/mssql.ts b/packages/server/src/integrations/tests/utils/mssql.ts index cff6809c0a..6bd4290a90 100644 --- a/packages/server/src/integrations/tests/utils/mssql.ts +++ b/packages/server/src/integrations/tests/utils/mssql.ts @@ -1,8 +1,6 @@ import { Datasource, SourceName } from "@budibase/types" import { GenericContainer, Wait, StartedTestContainer } from "testcontainers" -// TODO: remove this comment - let container: StartedTestContainer | undefined export async function start(): Promise { From 538f3b9dbe595bb246b51aca80bd83850e972e57 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 25 Mar 2024 13:51:27 +0000 Subject: [PATCH 5/8] Align our use of images across the codebase. --- packages/server/src/sdk/app/rows/search/tests/external.spec.ts | 2 +- .../src/integrations/external-schema/mysql.integration.spec.ts | 2 +- .../integrations/external-schema/postgres.integration.spec.ts | 2 +- qa-core/src/integrations/validators/mongo.integration.spec.ts | 2 +- qa-core/src/integrations/validators/mssql.integration.spec.ts | 2 +- qa-core/src/integrations/validators/mysql.integration.spec.ts | 2 +- .../src/integrations/validators/postgres.integration.spec.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/server/src/sdk/app/rows/search/tests/external.spec.ts b/packages/server/src/sdk/app/rows/search/tests/external.spec.ts index 8ecec784dd..bae58d6a2c 100644 --- a/packages/server/src/sdk/app/rows/search/tests/external.spec.ts +++ b/packages/server/src/sdk/app/rows/search/tests/external.spec.ts @@ -26,7 +26,7 @@ describe("external search", () => { const rows: Row[] = [] beforeAll(async () => { - const container = await new GenericContainer("mysql") + const container = await new GenericContainer("mysql:8.3") .withExposedPorts(3306) .withEnvironment({ MYSQL_ROOT_PASSWORD: "admin", diff --git a/qa-core/src/integrations/external-schema/mysql.integration.spec.ts b/qa-core/src/integrations/external-schema/mysql.integration.spec.ts index 5a7e1989d2..c8d285a021 100644 --- a/qa-core/src/integrations/external-schema/mysql.integration.spec.ts +++ b/qa-core/src/integrations/external-schema/mysql.integration.spec.ts @@ -6,7 +6,7 @@ describe("datasource validators", () => { let config: any beforeAll(async () => { - const container = await new GenericContainer("mysql") + const container = await new GenericContainer("mysql:8.3") .withExposedPorts(3306) .withEnv("MYSQL_ROOT_PASSWORD", "admin") .withEnv("MYSQL_DATABASE", "db") diff --git a/qa-core/src/integrations/external-schema/postgres.integration.spec.ts b/qa-core/src/integrations/external-schema/postgres.integration.spec.ts index a0812c9677..7581d7f88a 100644 --- a/qa-core/src/integrations/external-schema/postgres.integration.spec.ts +++ b/qa-core/src/integrations/external-schema/postgres.integration.spec.ts @@ -17,7 +17,7 @@ describe("getExternalSchema", () => { } beforeAll(async () => { - const container = await new GenericContainer("postgres:13.12") + const container = await new GenericContainer("postgres:16.1-bullseye") .withExposedPorts(5432) .withEnv("POSTGRES_PASSWORD", "password") .start() diff --git a/qa-core/src/integrations/validators/mongo.integration.spec.ts b/qa-core/src/integrations/validators/mongo.integration.spec.ts index 9132d79f74..b1bab3bd1f 100644 --- a/qa-core/src/integrations/validators/mongo.integration.spec.ts +++ b/qa-core/src/integrations/validators/mongo.integration.spec.ts @@ -26,7 +26,7 @@ describe("datasource validators", () => { beforeAll(async () => { const user = generator.name() const password = generator.hash() - const container = await new GenericContainer("mongo") + const container = await new GenericContainer("mongo:7.0-jammy") .withExposedPorts(27017) .withEnv("MONGO_INITDB_ROOT_USERNAME", user) .withEnv("MONGO_INITDB_ROOT_PASSWORD", password) diff --git a/qa-core/src/integrations/validators/mssql.integration.spec.ts b/qa-core/src/integrations/validators/mssql.integration.spec.ts index d8f36e8bd0..c07f1d1129 100644 --- a/qa-core/src/integrations/validators/mssql.integration.spec.ts +++ b/qa-core/src/integrations/validators/mssql.integration.spec.ts @@ -13,7 +13,7 @@ describe("datasource validators", () => { beforeAll(async () => { const container = await new GenericContainer( - "mcr.microsoft.com/mssql/server" + "mcr.microsoft.com/mssql/server:2022-latest" ) .withExposedPorts(1433) .withEnv("ACCEPT_EULA", "Y") diff --git a/qa-core/src/integrations/validators/mysql.integration.spec.ts b/qa-core/src/integrations/validators/mysql.integration.spec.ts index e828d192af..95f7d4abbd 100644 --- a/qa-core/src/integrations/validators/mysql.integration.spec.ts +++ b/qa-core/src/integrations/validators/mysql.integration.spec.ts @@ -7,7 +7,7 @@ describe("datasource validators", () => { let port: number beforeAll(async () => { - const container = await new GenericContainer("mysql") + const container = await new GenericContainer("mysql:8.3") .withExposedPorts(3306) .withEnv("MYSQL_ROOT_PASSWORD", "admin") .withEnv("MYSQL_DATABASE", "db") diff --git a/qa-core/src/integrations/validators/postgres.integration.spec.ts b/qa-core/src/integrations/validators/postgres.integration.spec.ts index 5101cf1d2d..9e3e1ab30f 100644 --- a/qa-core/src/integrations/validators/postgres.integration.spec.ts +++ b/qa-core/src/integrations/validators/postgres.integration.spec.ts @@ -9,7 +9,7 @@ describe("datasource validators", () => { let port: number beforeAll(async () => { - const container = await new GenericContainer("postgres") + const container = await new GenericContainer("postgres:16.1-bullseye") .withExposedPorts(5432) .withEnv("POSTGRES_PASSWORD", "password") .start() From d9033b2636476e943a19f786532583f004586671 Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Mon, 25 Mar 2024 16:39:42 +0000 Subject: [PATCH 6/8] Un-revert Skeleton Loader PR (#13180) * wip * wip * wip * client versions init * wip * wip * wip * wip * wip * linting * remove log * comment client version script * lint * skeleton loader type fix * fix types * lint * fix types again * fix manifest not being served locally * remove preinstalled old client version * add constant for dev client version * linting * Dean PR Feedback * linting * pr feedback * wip * wip * clientVersions empty array * delete from git * empty array again * fix tests * pr feedback --------- Co-authored-by: Andrew Kingston --- .eslintignore | 3 +- .gitignore | 3 + package.json | 1 + .../deploy/RevertModalVersionSelect.svelte | 33 +++ .../src/components/deploy/VersionModal.svelte | 18 +- .../src/components/deploy/clientVersions.json | 1 + .../[screenId]/_components/AppPreview.svelte | 43 ++- .../builder/portal/apps/[appId]/index.svelte | 63 +++- packages/client/manifest.json | 3 +- .../client/src/components/ClientApp.svelte | 276 ++++++++++-------- .../client/src/components/FreeFooter.svelte | 1 + packages/client/src/licensing/features.js | 5 - packages/client/src/licensing/index.js | 7 - packages/client/src/licensing/utils.js | 32 -- packages/client/src/stores/features.js | 42 +++ packages/client/src/stores/index.js | 1 + packages/frontend-core/src/api/app.js | 9 + .../src/components/ClientAppSkeleton.svelte | 244 ++++++++++++++++ .../frontend-core/src/components/index.js | 1 + .../frontend-core/src/themes/midnight.css | 1 - packages/server/package.json | 1 + .../server/src/api/controllers/application.ts | 30 +- .../src/api/controllers/static/index.ts | 34 ++- .../static/templates/BudibaseApp.svelte | 10 + .../api/controllers/static/templates/app.hbs | 8 +- packages/server/src/api/routes/application.ts | 5 + packages/server/src/api/routes/static.ts | 2 +- packages/server/src/constants/index.ts | 2 + packages/server/src/constants/themes.ts | 54 ++++ .../server/src/utilities/fileSystem/app.ts | 33 ++- .../src/utilities/fileSystem/clientLibrary.ts | 56 +++- packages/types/src/documents/app/app.ts | 1 + scripts/build.js | 28 +- scripts/getPastClientVersion.js | 45 +++ 34 files changed, 850 insertions(+), 246 deletions(-) create mode 100644 packages/builder/src/components/deploy/RevertModalVersionSelect.svelte create mode 100644 packages/builder/src/components/deploy/clientVersions.json delete mode 100644 packages/client/src/licensing/features.js delete mode 100644 packages/client/src/licensing/index.js delete mode 100644 packages/client/src/licensing/utils.js create mode 100644 packages/client/src/stores/features.js create mode 100644 packages/frontend-core/src/components/ClientAppSkeleton.svelte create mode 100644 packages/server/src/constants/themes.ts create mode 100644 scripts/getPastClientVersion.js diff --git a/.eslintignore b/.eslintignore index f2c53c2fdc..94984a446f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -12,4 +12,5 @@ packages/sdk/sdk packages/account-portal/packages/server/build packages/account-portal/packages/ui/.routify packages/account-portal/packages/ui/build -**/*.ivm.bundle.js \ No newline at end of file +**/*.ivm.bundle.js +packages/server/build/oldClientVersions/**/** diff --git a/.gitignore b/.gitignore index 8861a14d20..661c60e95e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ packages/server/runtime_apps/ bb-airgapped.tar.gz *.iml +packages/server/build/oldClientVersions/**/* +packages/builder/src/components/deploy/clientVersions.json + # Logs logs *.log diff --git a/package.json b/package.json index 7de22ab456..79a7b06eff 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ }, "scripts": { "preinstall": "node scripts/syncProPackage.js", + "get-past-client-version": "node scripts/getPastClientVersion.js", "setup": "git config submodule.recurse true && git submodule update && node ./hosting/scripts/setup.js && yarn && yarn build && yarn dev", "build": "NODE_OPTIONS=--max-old-space-size=1500 lerna run build --stream", "build:dev": "lerna run --stream prebuild && yarn nx run-many --target=build --output-style=dynamic --watch --preserveWatchOutput", diff --git a/packages/builder/src/components/deploy/RevertModalVersionSelect.svelte b/packages/builder/src/components/deploy/RevertModalVersionSelect.svelte new file mode 100644 index 0000000000..ed40a101d0 --- /dev/null +++ b/packages/builder/src/components/deploy/RevertModalVersionSelect.svelte @@ -0,0 +1,33 @@ + + +
+