From d8d4686e01f3ee71fdf9e3de55cd3931d92f54b2 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 13 Jul 2023 12:36:50 +0100 Subject: [PATCH 01/35] Account Portal API Testing --- packages/backend-core/src/constants/misc.ts | 2 + .../src/account-api/api/apis/AccountAPI.ts | 55 +++++++++++++++++++ .../account-api/config/TestConfiguration.ts | 34 ++++++++++++ qa-core/src/account-api/fixtures/accounts.ts | 20 +++++++ qa-core/src/account-api/fixtures/index.ts | 1 + .../account-api/tests/accounts/create.spec.ts | 20 +++++++ .../account-api/tests/accounts/delete.spec.ts | 25 +++++++++ .../account-api/tests/accounts/search.spec.ts | 22 ++++++++ .../tests/accounts/validate.spec.ts | 27 +++++++++ .../account-api/tests/accounts/verify.spec.ts | 24 ++++++++ 10 files changed, 230 insertions(+) create mode 100644 qa-core/src/account-api/config/TestConfiguration.ts create mode 100644 qa-core/src/account-api/fixtures/accounts.ts create mode 100644 qa-core/src/account-api/fixtures/index.ts create mode 100644 qa-core/src/account-api/tests/accounts/create.spec.ts create mode 100644 qa-core/src/account-api/tests/accounts/delete.spec.ts create mode 100644 qa-core/src/account-api/tests/accounts/search.spec.ts create mode 100644 qa-core/src/account-api/tests/accounts/validate.spec.ts create mode 100644 qa-core/src/account-api/tests/accounts/verify.spec.ts diff --git a/packages/backend-core/src/constants/misc.ts b/packages/backend-core/src/constants/misc.ts index ba2533cf4a..0c68798164 100644 --- a/packages/backend-core/src/constants/misc.ts +++ b/packages/backend-core/src/constants/misc.ts @@ -20,6 +20,8 @@ export enum Header { TYPE = "x-budibase-type", PREVIEW_ROLE = "x-budibase-role", TENANT_ID = "x-budibase-tenant-id", + VERIFICATION_CODE = "x-budibase-verification-code", + RETURN_VERIFICATION_CODE = "x-budibase-return-verification-code", TOKEN = "x-budibase-token", CSRF_TOKEN = "x-csrf-token", CORRELATION_ID = "x-budibase-correlation-id", diff --git a/qa-core/src/account-api/api/apis/AccountAPI.ts b/qa-core/src/account-api/api/apis/AccountAPI.ts index fc6f6caecb..0e457c07e8 100644 --- a/qa-core/src/account-api/api/apis/AccountAPI.ts +++ b/qa-core/src/account-api/api/apis/AccountAPI.ts @@ -72,4 +72,59 @@ export default class AccountAPI { } return response } + + async verifyAccount( + verificationCode: string, + opts: APIRequestOpts = { doExpect: true } + ): Promise { + const [response, json] = await this.client.post( + `/api/accounts/verify`, + { + body: { verificationCode }, + } + ) + if (opts.doExpect) { + expect(response).toHaveStatusCode(200) + } + return response + } + + async verifyAccountSendEmail( + email: string, + opts: APIRequestOpts = { doExpect: true } + ): Promise { + const [response, json] = await this.client.post( + `/api/accounts/verify/send`, + { + body: { email }, + } + ) + if (opts.doExpect) { + expect(response).toHaveStatusCode(200) + } + return response + } + + async search( + searchType: string, + search: 'email' | 'tenantId', + opts: APIRequestOpts = { doExpect: true } + ): Promise { + let body: { email?: string; tenantId?: string } = {} + + if (search === 'email') { + body.email = searchType; + } else if (search === 'tenantId') { + body.tenantId = searchType; + } + + const [response, json] = await this.client.post( + `/api/accounts/search`, + {body: body} + ) + if (opts.doExpect) { + expect(response).toHaveStatusCode(200) + } + return response + } } diff --git a/qa-core/src/account-api/config/TestConfiguration.ts b/qa-core/src/account-api/config/TestConfiguration.ts new file mode 100644 index 0000000000..827cee42b7 --- /dev/null +++ b/qa-core/src/account-api/config/TestConfiguration.ts @@ -0,0 +1,34 @@ +import { AccountInternalAPI } from "../api" +import { BudibaseTestConfiguration } from "../../shared" + +export default class TestConfiguration extends BudibaseTestConfiguration { + // apis + api: AccountInternalAPI + + context: T + + constructor() { + super() + this.api = new AccountInternalAPI(this.state) + this.context = {} + } + + async beforeAll() { + await super.beforeAll() + await this.setApiKey() + } + + async afterAll() { + await super.afterAll() + } + + async setApiKey() { + const apiKeyResponse = await this.internalApi.self.getApiKey() + this.state.apiKey = apiKeyResponse.apiKey + } + + async setCookieAuth() { + const apiKeyResponse = await this.internalApi.self.getApiKey() + this.state.apiKey = apiKeyResponse.apiKey + } +} diff --git a/qa-core/src/account-api/fixtures/accounts.ts b/qa-core/src/account-api/fixtures/accounts.ts new file mode 100644 index 0000000000..c6c6fa163f --- /dev/null +++ b/qa-core/src/account-api/fixtures/accounts.ts @@ -0,0 +1,20 @@ +import { generator } from "../../shared" +import { Hosting, CreateAccountRequest } from "@budibase/types" + +export const generateAccount = (): CreateAccountRequest => { + const uuid = generator.guid() + + const email = `${uuid}@budibase.com` + const tenant = `tenant${uuid.replace(/-/g, "")}` + + return { + email, + hosting: Hosting.CLOUD, + name: email, + password: uuid, + profession: "software_engineer", + size: "10+", + tenantId: tenant, + tenantName: tenant, + } +} diff --git a/qa-core/src/account-api/fixtures/index.ts b/qa-core/src/account-api/fixtures/index.ts new file mode 100644 index 0000000000..7d09ee1c2c --- /dev/null +++ b/qa-core/src/account-api/fixtures/index.ts @@ -0,0 +1 @@ +export * as accounts from "./accounts" \ No newline at end of file diff --git a/qa-core/src/account-api/tests/accounts/create.spec.ts b/qa-core/src/account-api/tests/accounts/create.spec.ts new file mode 100644 index 0000000000..e46a56e591 --- /dev/null +++ b/qa-core/src/account-api/tests/accounts/create.spec.ts @@ -0,0 +1,20 @@ +import TestConfiguration from "../../config/TestConfiguration" +import * as fixtures from "../../fixtures" + +describe("Account API - Create Account", () => { + const config = new TestConfiguration() + + beforeAll(async () => { + await config.beforeAll() + }) + + afterAll(async () => { + await config.afterAll() + }) + + it("Creates a new account", async () => { + await config.api.accounts.create({ + ...fixtures.accounts.generateAccount() + }) + }) +}) \ No newline at end of file diff --git a/qa-core/src/account-api/tests/accounts/delete.spec.ts b/qa-core/src/account-api/tests/accounts/delete.spec.ts new file mode 100644 index 0000000000..22fd39d17f --- /dev/null +++ b/qa-core/src/account-api/tests/accounts/delete.spec.ts @@ -0,0 +1,25 @@ +import TestConfiguration from "../../config/TestConfiguration" +import * as fixtures from "../../fixtures" + +describe("Account API - Delete Account", () => { + const config = new TestConfiguration() + + beforeAll(async () => { + await config.beforeAll() + }) + + afterAll(async () => { + await config.afterAll() + }) + + // it("Deletes an account", async () => { + // + // }) + + it("Deletes an account by ID", async () => { + const [response, account] = await config.api.accounts.create({ + ...fixtures.accounts.generateAccount() + }) + await config.api.accounts.delete(account.accountId) + }) +}) \ No newline at end of file diff --git a/qa-core/src/account-api/tests/accounts/search.spec.ts b/qa-core/src/account-api/tests/accounts/search.spec.ts new file mode 100644 index 0000000000..6f4437d119 --- /dev/null +++ b/qa-core/src/account-api/tests/accounts/search.spec.ts @@ -0,0 +1,22 @@ +import TestConfiguration from "../../config/TestConfiguration" +import { generator } from "../../../shared" + +describe("Account API - Search for Account", () => { + const config = new TestConfiguration() + + beforeAll(async () => { + await config.beforeAll() + }) + + afterAll(async () => { + await config.afterAll() + }) + + it("Search account by email", async () => { + await config.api.accounts.search(generator.email(), "email") + }) + + it("Search account by tenantId", async () => { + await config.api.accounts.search(generator.word(), "tenantId") + }) +}) \ No newline at end of file diff --git a/qa-core/src/account-api/tests/accounts/validate.spec.ts b/qa-core/src/account-api/tests/accounts/validate.spec.ts new file mode 100644 index 0000000000..56894bb03f --- /dev/null +++ b/qa-core/src/account-api/tests/accounts/validate.spec.ts @@ -0,0 +1,27 @@ +import TestConfiguration from "../../config/TestConfiguration" +import { generator } from "../../../shared" +import * as fixtures from "../../fixtures"; + +describe("Account API - Validate Account", () => { + const config = new TestConfiguration() + + beforeAll(async () => { + await config.beforeAll() + }) + + afterAll(async () => { + await config.afterAll() + }) + + const tenant = generator.word({length: 6}) + const email = `${tenant}@budibase.com` + + + it("Validates an email", async () => { + await config.api.accounts.validateEmail(email) + }) + + it("Validates a tenant ID", async () => { + await config.api.accounts.validateTenantId(tenant) + }) +}) \ No newline at end of file diff --git a/qa-core/src/account-api/tests/accounts/verify.spec.ts b/qa-core/src/account-api/tests/accounts/verify.spec.ts new file mode 100644 index 0000000000..d3f2ff1a18 --- /dev/null +++ b/qa-core/src/account-api/tests/accounts/verify.spec.ts @@ -0,0 +1,24 @@ +import TestConfiguration from "../../config/TestConfiguration" +import { generator } from "../../../shared" +import * as fixtures from "../../fixtures"; + +describe("Account API - Verify Account", () => { + const config = new TestConfiguration() + + beforeAll(async () => { + await config.beforeAll() + }) + + afterAll(async () => { + await config.afterAll() + }) + + + it("Verify an account", async () => { + await config.api.accounts.verifyAccount() + }) + + it("Send account verification email ", async () => { + await config.api.accounts.verifyAccountSendEmail() + }) +}) \ No newline at end of file From 6f7ef18084389c8e525109b01e58cfeb742239a4 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 13 Jul 2023 12:48:44 +0100 Subject: [PATCH 02/35] Add account password login integration with global setup --- .../src/account-api/api/AccountInternalAPI.ts | 4 ++- qa-core/src/account-api/api/apis/AuthAPI.ts | 32 +++++++++++++++++++ qa-core/src/account-api/api/apis/index.ts | 1 + qa-core/src/jest/globalSetup.ts | 3 +- 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 qa-core/src/account-api/api/apis/AuthAPI.ts diff --git a/qa-core/src/account-api/api/AccountInternalAPI.ts b/qa-core/src/account-api/api/AccountInternalAPI.ts index a5abdcbccd..3813ad2c9e 100644 --- a/qa-core/src/account-api/api/AccountInternalAPI.ts +++ b/qa-core/src/account-api/api/AccountInternalAPI.ts @@ -1,15 +1,17 @@ import AccountInternalAPIClient from "./AccountInternalAPIClient" -import { AccountAPI, LicenseAPI } from "./apis" +import { AccountAPI, LicenseAPI, AuthAPI } from "./apis" import { State } from "../../types" export default class AccountInternalAPI { client: AccountInternalAPIClient + auth: AuthAPI accounts: AccountAPI licenses: LicenseAPI constructor(state: State) { this.client = new AccountInternalAPIClient(state) + this.auth = new AuthAPI(this.client) this.accounts = new AccountAPI(this.client) this.licenses = new LicenseAPI(this.client) } diff --git a/qa-core/src/account-api/api/apis/AuthAPI.ts b/qa-core/src/account-api/api/apis/AuthAPI.ts new file mode 100644 index 0000000000..4d2dee6a0d --- /dev/null +++ b/qa-core/src/account-api/api/apis/AuthAPI.ts @@ -0,0 +1,32 @@ +import { Response } from "node-fetch" +import AccountInternalAPIClient from "../AccountInternalAPIClient" +import { APIRequestOpts } from "../../../types" + +export default class AuthAPI { + client: AccountInternalAPIClient + + constructor(client: AccountInternalAPIClient) { + this.client = client + } + + async login( + email: string, + password: string, + opts: APIRequestOpts = { doExpect: true } + ): Promise<[Response, string]> { + const [response, json] = await this.client.post( + `/api/auth/login`, + { + body: { + username: email, + password: password, + }, + } + ) + if (opts.doExpect) { + expect(response).toHaveStatusCode(200) + } + const cookie = response.headers.get("set-cookie") + return [response, cookie!] + } +} diff --git a/qa-core/src/account-api/api/apis/index.ts b/qa-core/src/account-api/api/apis/index.ts index b8a1dc7b4a..1137ac3e36 100644 --- a/qa-core/src/account-api/api/apis/index.ts +++ b/qa-core/src/account-api/api/apis/index.ts @@ -1,2 +1,3 @@ +export { default as AuthAPI } from "./AuthAPI" export { default as AccountAPI } from "./AccountAPI" export { default as LicenseAPI } from "./LicenseAPI" diff --git a/qa-core/src/jest/globalSetup.ts b/qa-core/src/jest/globalSetup.ts index 040a65ecef..f73ea1011e 100644 --- a/qa-core/src/jest/globalSetup.ts +++ b/qa-core/src/jest/globalSetup.ts @@ -68,8 +68,7 @@ async function loginAsAdmin() { } async function loginAsAccount(account: CreateAccountRequest) { - const [res, cookie] = await internalApi.auth.login( - account.tenantId, + const [res, cookie] = await accountsApi.auth.login( account.email, account.password, API_OPTS From fa94b8b9fc43f8a58e130daa9ca7946821b585ab Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Fri, 14 Jul 2023 14:24:01 +0100 Subject: [PATCH 03/35] Changes for Account API Testing --- .../worker/src/api/controllers/global/auth.ts | 2 ++ .../src/account-api/api/apis/AccountAPI.ts | 7 ++++++ qa-core/src/account-api/api/apis/AuthAPI.ts | 2 +- .../account-api/config/TestConfiguration.ts | 6 ++--- .../account-api/tests/accounts/create.spec.ts | 2 +- .../account-api/tests/accounts/delete.spec.ts | 23 ++++++++++++++++--- .../tests/accounts/validate.spec.ts | 2 ++ .../account-api/tests/accounts/verify.spec.ts | 14 +++++++++++ .../src/shared/BudibaseTestConfiguration.ts | 3 ++- 9 files changed, 51 insertions(+), 10 deletions(-) diff --git a/packages/worker/src/api/controllers/global/auth.ts b/packages/worker/src/api/controllers/global/auth.ts index 131601c6ad..a458a98aa7 100644 --- a/packages/worker/src/api/controllers/global/auth.ts +++ b/packages/worker/src/api/controllers/global/auth.ts @@ -53,6 +53,8 @@ async function passportCallback( } export const login = async (ctx: Ctx, next: any) => { + const tenantId = context.getTenantId() + console.log(tenantId) const email = ctx.request.body.username const user = await userSdk.getUserByEmail(email) diff --git a/qa-core/src/account-api/api/apis/AccountAPI.ts b/qa-core/src/account-api/api/apis/AccountAPI.ts index 0e457c07e8..7897a3c210 100644 --- a/qa-core/src/account-api/api/apis/AccountAPI.ts +++ b/qa-core/src/account-api/api/apis/AccountAPI.ts @@ -73,6 +73,13 @@ export default class AccountAPI { return response } + async deleteCurrentAccount() { + const [response, json] = await this.client.del( + `/api/accounts` + ) + return response + } + async verifyAccount( verificationCode: string, opts: APIRequestOpts = { doExpect: true } diff --git a/qa-core/src/account-api/api/apis/AuthAPI.ts b/qa-core/src/account-api/api/apis/AuthAPI.ts index 4d2dee6a0d..9c375d2b5d 100644 --- a/qa-core/src/account-api/api/apis/AuthAPI.ts +++ b/qa-core/src/account-api/api/apis/AuthAPI.ts @@ -18,7 +18,7 @@ export default class AuthAPI { `/api/auth/login`, { body: { - username: email, + email: email, password: password, }, } diff --git a/qa-core/src/account-api/config/TestConfiguration.ts b/qa-core/src/account-api/config/TestConfiguration.ts index 827cee42b7..ee5f3fbd45 100644 --- a/qa-core/src/account-api/config/TestConfiguration.ts +++ b/qa-core/src/account-api/config/TestConfiguration.ts @@ -27,8 +27,6 @@ export default class TestConfiguration extends BudibaseTestConfiguration { this.state.apiKey = apiKeyResponse.apiKey } - async setCookieAuth() { - const apiKeyResponse = await this.internalApi.self.getApiKey() - this.state.apiKey = apiKeyResponse.apiKey - } + + } diff --git a/qa-core/src/account-api/tests/accounts/create.spec.ts b/qa-core/src/account-api/tests/accounts/create.spec.ts index e46a56e591..2c26c5170b 100644 --- a/qa-core/src/account-api/tests/accounts/create.spec.ts +++ b/qa-core/src/account-api/tests/accounts/create.spec.ts @@ -14,7 +14,7 @@ describe("Account API - Create Account", () => { it("Creates a new account", async () => { await config.api.accounts.create({ - ...fixtures.accounts.generateAccount() + ...fixtures.accounts.generateAccount() }) }) }) \ No newline at end of file diff --git a/qa-core/src/account-api/tests/accounts/delete.spec.ts b/qa-core/src/account-api/tests/accounts/delete.spec.ts index 22fd39d17f..20df48dafb 100644 --- a/qa-core/src/account-api/tests/accounts/delete.spec.ts +++ b/qa-core/src/account-api/tests/accounts/delete.spec.ts @@ -12,9 +12,26 @@ describe("Account API - Delete Account", () => { await config.afterAll() }) - // it("Deletes an account", async () => { - // - // }) + it("Deletes an account", async () => { + // Create account + const createAccountRequest = fixtures.accounts.generateAccount() + + await config.api.accounts.create( + createAccountRequest + ) + + // Login - Get cookie + await config.login( + createAccountRequest.email, + createAccountRequest.password, + createAccountRequest.tenantId + ) + + // Delete account + const [ res ] = await config.api.accounts.deleteCurrentAccount() + + expect(res.status).toBe(204) + }) it("Deletes an account by ID", async () => { const [response, account] = await config.api.accounts.create({ diff --git a/qa-core/src/account-api/tests/accounts/validate.spec.ts b/qa-core/src/account-api/tests/accounts/validate.spec.ts index 56894bb03f..5794949eee 100644 --- a/qa-core/src/account-api/tests/accounts/validate.spec.ts +++ b/qa-core/src/account-api/tests/accounts/validate.spec.ts @@ -18,10 +18,12 @@ describe("Account API - Validate Account", () => { it("Validates an email", async () => { + await config.api.accounts.validateEmail(email) }) it("Validates a tenant ID", async () => { + await config.api.accounts.validateTenantId(tenant) }) }) \ No newline at end of file diff --git a/qa-core/src/account-api/tests/accounts/verify.spec.ts b/qa-core/src/account-api/tests/accounts/verify.spec.ts index d3f2ff1a18..222c4cb4ea 100644 --- a/qa-core/src/account-api/tests/accounts/verify.spec.ts +++ b/qa-core/src/account-api/tests/accounts/verify.spec.ts @@ -15,10 +15,24 @@ describe("Account API - Verify Account", () => { it("Verify an account", async () => { + // Create account + await config.api.accounts.create({ + ...fixtures.accounts.generateAccount() + }) + // Invite user + + // Verify account via code await config.api.accounts.verifyAccount() }) it("Send account verification email ", async () => { + // Create account + await config.api.accounts.create({ + ...fixtures.accounts.generateAccount() + }) + // Invite user + + // Verify account via email await config.api.accounts.verifyAccountSendEmail() }) }) \ No newline at end of file diff --git a/qa-core/src/shared/BudibaseTestConfiguration.ts b/qa-core/src/shared/BudibaseTestConfiguration.ts index 12a0f16138..d8fd2bee61 100644 --- a/qa-core/src/shared/BudibaseTestConfiguration.ts +++ b/qa-core/src/shared/BudibaseTestConfiguration.ts @@ -43,7 +43,8 @@ export default class BudibaseTestConfiguration { async login(email: string, password: string, tenantId?: string) { if (!tenantId && this.state.tenantId) { tenantId = this.state.tenantId - } else { + } + if (!tenantId) { throw new Error("Could not determine tenant id") } const [res, cookie] = await this.internalApi.auth.login( From f45a439b2686fcd70b85d9597bf0d432811bbafb Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 14 Jul 2023 15:03:51 +0100 Subject: [PATCH 04/35] Add state helpers for isolating account deletion test --- .../account-api/tests/accounts/delete.spec.ts | 30 +++++++++---------- .../src/shared/BudibaseTestConfiguration.ts | 24 +++++++++++++++ 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/qa-core/src/account-api/tests/accounts/delete.spec.ts b/qa-core/src/account-api/tests/accounts/delete.spec.ts index 20df48dafb..2d476d78c0 100644 --- a/qa-core/src/account-api/tests/accounts/delete.spec.ts +++ b/qa-core/src/account-api/tests/accounts/delete.spec.ts @@ -13,24 +13,22 @@ describe("Account API - Delete Account", () => { }) it("Deletes an account", async () => { - // Create account - const createAccountRequest = fixtures.accounts.generateAccount() + await config.doInNewState(async () => { + // Create account + const createAccountRequest = fixtures.accounts.generateAccount() + await config.api.accounts.create(createAccountRequest) - await config.api.accounts.create( - createAccountRequest - ) + // Login - Get cookie + await config.login( + createAccountRequest.email, + createAccountRequest.password, + createAccountRequest.tenantId + ) - // Login - Get cookie - await config.login( - createAccountRequest.email, - createAccountRequest.password, - createAccountRequest.tenantId - ) - - // Delete account - const [ res ] = await config.api.accounts.deleteCurrentAccount() - - expect(res.status).toBe(204) + // Delete account + const res = await config.api.accounts.deleteCurrentAccount() + expect(res.status).toBe(204) + }) }) it("Deletes an account by ID", async () => { diff --git a/qa-core/src/shared/BudibaseTestConfiguration.ts b/qa-core/src/shared/BudibaseTestConfiguration.ts index d8fd2bee61..c1aaeb0cae 100644 --- a/qa-core/src/shared/BudibaseTestConfiguration.ts +++ b/qa-core/src/shared/BudibaseTestConfiguration.ts @@ -40,6 +40,30 @@ export default class BudibaseTestConfiguration { // AUTH + async doInNewState(task: any) { + return this.doWithState(task, {}) + } + + async doWithState(task: any, state: State) { + const original = this.state + + // override the state + this.state.apiKey = state.apiKey + this.state.appId = state.appId + this.state.cookie = state.cookie + this.state.tableId = state.tableId + this.state.tenantId = state.tenantId + + await task() + + // restore the state + this.state.apiKey = original.apiKey + this.state.appId = original.appId + this.state.cookie = original.cookie + this.state.tableId = original.tableId + this.state.tenantId = original.tenantId + } + async login(email: string, password: string, tenantId?: string) { if (!tenantId && this.state.tenantId) { tenantId = this.state.tenantId From c464e5c91d471596bfae031b8f1330b22b1bfefd Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 14 Jul 2023 15:22:44 +0100 Subject: [PATCH 05/35] Type /api/accounts/search request + response bodies --- packages/types/src/api/account/accounts.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/types/src/api/account/accounts.ts b/packages/types/src/api/account/accounts.ts index 9191babc86..e2accf7c18 100644 --- a/packages/types/src/api/account/accounts.ts +++ b/packages/types/src/api/account/accounts.ts @@ -1,3 +1,4 @@ +import { Account } from "../../documents" import { Hosting } from "../../sdk" export interface CreateAccountRequest { @@ -11,3 +12,11 @@ export interface CreateAccountRequest { name?: string password: string } + +export interface SearchAccountsRequest { + // one or the other - not both + email?: string + tenantId?: string +} + +export type SearchAccountsResponse = Account[] \ No newline at end of file From 278f6f8df3ec48cbcc6331a0338dea0aa60fde8f Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 14 Jul 2023 15:23:22 +0100 Subject: [PATCH 06/35] Update account search tests / add email to state --- .../src/account-api/api/apis/AccountAPI.ts | 8 ++--- .../account-api/config/TestConfiguration.ts | 3 -- .../account-api/tests/accounts/search.spec.ts | 31 ++++++++++++++++--- qa-core/src/jest/globalSetup.ts | 2 ++ .../src/shared/BudibaseTestConfiguration.ts | 4 +++ qa-core/src/types/state.ts | 1 + 6 files changed, 37 insertions(+), 12 deletions(-) diff --git a/qa-core/src/account-api/api/apis/AccountAPI.ts b/qa-core/src/account-api/api/apis/AccountAPI.ts index 7897a3c210..37aa3313ba 100644 --- a/qa-core/src/account-api/api/apis/AccountAPI.ts +++ b/qa-core/src/account-api/api/apis/AccountAPI.ts @@ -1,5 +1,5 @@ import { Response } from "node-fetch" -import { Account, CreateAccountRequest } from "@budibase/types" +import { Account, CreateAccountRequest, SearchAccountsRequest, SearchAccountsResponse } from "@budibase/types" import AccountInternalAPIClient from "../AccountInternalAPIClient" import { APIRequestOpts } from "../../../types" @@ -116,8 +116,8 @@ export default class AccountAPI { searchType: string, search: 'email' | 'tenantId', opts: APIRequestOpts = { doExpect: true } - ): Promise { - let body: { email?: string; tenantId?: string } = {} + ): Promise<[Response, SearchAccountsResponse]> { + let body: SearchAccountsRequest = {} if (search === 'email') { body.email = searchType; @@ -132,6 +132,6 @@ export default class AccountAPI { if (opts.doExpect) { expect(response).toHaveStatusCode(200) } - return response + return [response, json] } } diff --git a/qa-core/src/account-api/config/TestConfiguration.ts b/qa-core/src/account-api/config/TestConfiguration.ts index ee5f3fbd45..6322be97f0 100644 --- a/qa-core/src/account-api/config/TestConfiguration.ts +++ b/qa-core/src/account-api/config/TestConfiguration.ts @@ -26,7 +26,4 @@ export default class TestConfiguration extends BudibaseTestConfiguration { const apiKeyResponse = await this.internalApi.self.getApiKey() this.state.apiKey = apiKeyResponse.apiKey } - - - } diff --git a/qa-core/src/account-api/tests/accounts/search.spec.ts b/qa-core/src/account-api/tests/accounts/search.spec.ts index 6f4437d119..a39cf8e325 100644 --- a/qa-core/src/account-api/tests/accounts/search.spec.ts +++ b/qa-core/src/account-api/tests/accounts/search.spec.ts @@ -12,11 +12,32 @@ describe("Account API - Search for Account", () => { await config.afterAll() }) - it("Search account by email", async () => { - await config.api.accounts.search(generator.email(), "email") - }) - it("Search account by tenantId", async () => { - await config.api.accounts.search(generator.word(), "tenantId") + describe("POST /api/accounts/search", () => { + describe("by tenant", () => { + it("returns 200 + empty", async () => { + const tenantId = generator.string() + const [res, body] = await config.api.accounts.search(tenantId, "tenantId") + expect(res.status).toBe(200) + expect(body.length).toBe(0) + }) + + it("returns 200 + found", async () => { + const [res, body] = await config.api.accounts.search(config.state.tenantId!, "tenantId") + expect(res.status).toBe(200) + expect(body.length).toBe(1) + expect(body[0].tenantId).toBe(config.state.tenantId) + }) + }) + + describe("by email", () => { + it("returns 200 + empty", async () => { + await config.api.accounts.search(generator.word(), "email") + }) + + it("returns 200 + found", async () => { + await config.api.accounts.search(generator.word(), "email") + }) + }) }) }) \ No newline at end of file diff --git a/qa-core/src/jest/globalSetup.ts b/qa-core/src/jest/globalSetup.ts index f73ea1011e..e52f8cfe16 100644 --- a/qa-core/src/jest/globalSetup.ts +++ b/qa-core/src/jest/globalSetup.ts @@ -89,6 +89,8 @@ async function setup() { // @ts-ignore global.qa.tenantId = account.tenantId // @ts-ignore + global.qa.email = account.email + // @ts-ignore global.qa.accountId = newAccount.accountId await loginAsAccount(account) } else { diff --git a/qa-core/src/shared/BudibaseTestConfiguration.ts b/qa-core/src/shared/BudibaseTestConfiguration.ts index c1aaeb0cae..c6955fd87f 100644 --- a/qa-core/src/shared/BudibaseTestConfiguration.ts +++ b/qa-core/src/shared/BudibaseTestConfiguration.ts @@ -23,6 +23,8 @@ export default class BudibaseTestConfiguration { // @ts-ignore this.state.tenantId = global.qa.tenantId // @ts-ignore + this.state.email = global.qa.email + // @ts-ignore this.state.cookie = global.qa.authCookie } @@ -53,6 +55,7 @@ export default class BudibaseTestConfiguration { this.state.cookie = state.cookie this.state.tableId = state.tableId this.state.tenantId = state.tenantId + this.state.email = state.email await task() @@ -62,6 +65,7 @@ export default class BudibaseTestConfiguration { this.state.cookie = original.cookie this.state.tableId = original.tableId this.state.tenantId = original.tenantId + this.state.email = original.email } async login(email: string, password: string, tenantId?: string) { diff --git a/qa-core/src/types/state.ts b/qa-core/src/types/state.ts index 0da471e090..8fab3998ce 100644 --- a/qa-core/src/types/state.ts +++ b/qa-core/src/types/state.ts @@ -4,4 +4,5 @@ export interface State { cookie?: string tableId?: string tenantId?: string + email?: string } From 263df94076eb7197be28fc235a0fa16b2d22d405 Mon Sep 17 00:00:00 2001 From: Dean Date: Mon, 17 Jul 2023 14:07:53 +0100 Subject: [PATCH 07/35] Altered structure of the tours to allow tour level config with an onSkip fn option. Tour steps now moved to 'steps' entry --- .../portal/onboarding/TourPopover.svelte | 38 +++- .../portal/onboarding/TourWrap.svelte | 2 +- .../src/components/portal/onboarding/tours.js | 194 +++++++++--------- .../builder/app/[application]/_layout.svelte | 2 +- 4 files changed, 125 insertions(+), 111 deletions(-) diff --git a/packages/builder/src/components/portal/onboarding/TourPopover.svelte b/packages/builder/src/components/portal/onboarding/TourPopover.svelte index d4958b386e..4607150c29 100644 --- a/packages/builder/src/components/portal/onboarding/TourPopover.svelte +++ b/packages/builder/src/components/portal/onboarding/TourPopover.svelte @@ -1,5 +1,5 @@ diff --git a/packages/client/src/components/app/blocks/CardsBlock.svelte b/packages/client/src/components/app/blocks/CardsBlock.svelte index bbe54867ee..3e48247f92 100644 --- a/packages/client/src/components/app/blocks/CardsBlock.svelte +++ b/packages/client/src/components/app/blocks/CardsBlock.svelte @@ -126,7 +126,7 @@ order={1} > {#if enrichedSearchColumns?.length} - {#each enrichedSearchColumns as column, idx} + {#each enrichedSearchColumns as column, idx (column.name)} {#if enrichedSearchColumns?.length} - {#each enrichedSearchColumns as column, idx} + {#each enrichedSearchColumns as column, idx (column.name)} { actions.slice(i + 1), newContext ) - resolve(await next()) + resolve(typeof next === "function" ? await next() : true) } else { resolve(false) } diff --git a/scripts/versionCommit.sh b/scripts/versionCommit.sh index 71c931d736..86db0136e7 100755 --- a/scripts/versionCommit.sh +++ b/scripts/versionCommit.sh @@ -13,6 +13,6 @@ node ./bumpVersion.js $1 NEW_VERSION=$(node -p "require('../lerna.json').version") git add ../lerna.json git commit -m "Bump version to $NEW_VERSION" -git tag v$NEW_VERSION +git tag $NEW_VERSION git push git push --tags \ No newline at end of file From 6631c2644d3c1840bdb838faab567d4698353dc8 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 19 Jul 2023 17:18:37 +0100 Subject: [PATCH 21/35] Fixing merge issue --- packages/backend-core/src/logging/index.ts | 3 --- packages/backend-core/src/logging/pino/logger.ts | 2 -- qa-core/src/jest/jestSetup.ts | 8 +++----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/backend-core/src/logging/index.ts b/packages/backend-core/src/logging/index.ts index f7e1c4fa41..0824fa681b 100644 --- a/packages/backend-core/src/logging/index.ts +++ b/packages/backend-core/src/logging/index.ts @@ -2,6 +2,3 @@ export * as correlation from "./correlation/correlation" export { logger } from "./pino/logger" export * from "./alerts" export * as system from "./system" - -// turn off or on context logging i.e. tenantId, appId etc -export let LOG_CONTEXT = true diff --git a/packages/backend-core/src/logging/pino/logger.ts b/packages/backend-core/src/logging/pino/logger.ts index 73b91d2fde..f2024db72b 100644 --- a/packages/backend-core/src/logging/pino/logger.ts +++ b/packages/backend-core/src/logging/pino/logger.ts @@ -2,11 +2,9 @@ import pino, { LoggerOptions } from "pino" import pinoPretty from "pino-pretty" import { IdentityType } from "@budibase/types" - import env from "../../environment" import * as context from "../../context" import * as correlation from "../correlation" -import { LOG_CONTEXT } from "../index" import { localFileDestination } from "../system" diff --git a/qa-core/src/jest/jestSetup.ts b/qa-core/src/jest/jestSetup.ts index 6c60845c87..f89d71dfcb 100644 --- a/qa-core/src/jest/jestSetup.ts +++ b/qa-core/src/jest/jestSetup.ts @@ -1,5 +1,3 @@ -import { logging } from "@budibase/backend-core" -logging.LOG_CONTEXT = false - -jest.retryTimes(2) -jest.setTimeout(60000) +const envTimeout = process.env.JEST_TIMEOUT +const timeout = envTimeout && parseInt(envTimeout) +jest.setTimeout(timeout || 60000) \ No newline at end of file From 9ecce2c5dc6e772501a68e4b325a692e8183d318 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 19 Jul 2023 16:28:22 +0000 Subject: [PATCH 22/35] Bump version to 2.8.16-alpha.0 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 551b1f60f2..498d8a91b5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.15", + "version": "2.8.16-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" From f9b54d6de493e3abcef75b474a4afcb5494d255d Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 19 Jul 2023 17:30:16 +0100 Subject: [PATCH 23/35] Update test commands to use dedicated environments: ci / prod / qa --- .github/workflows/budibase_ci.yml | 2 +- qa-core/package.json | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index b644a6bdb9..86e7df66da 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -159,7 +159,7 @@ jobs: run: | cd qa-core yarn setup - yarn test:ci + yarn serve:test:ci env: BB_ADMIN_USER_EMAIL: admin BB_ADMIN_USER_PASSWORD: admin diff --git a/qa-core/package.json b/qa-core/package.json index 555b277742..1fbd0c0254 100644 --- a/qa-core/package.json +++ b/qa-core/package.json @@ -15,8 +15,10 @@ "test:watch": "yarn run test --watch", "test:debug": "DEBUG=1 yarn run test", "test:notify": "node scripts/testResultsWebhook", - "test:smoke": "yarn run test --testPathIgnorePatterns=/.+\\.integration\\.spec\\.ts", - "test:ci": "start-server-and-test dev:built http://localhost:4001/health test:smoke", + "test:cloud:prod": "yarn run test --testPathIgnorePatterns=/.+\\.integration\\.spec\\.ts", + "test:cloud:qa": "yarn run test", + "test:ci": "yarn run test --testPathIgnorePatterns=/.+\\.integration\\.spec\\.ts /account-api/", + "serve:test:ci": "start-server-and-test dev:built http://localhost:4001/health test:smoke", "serve": "start-server-and-test dev:built http://localhost:4001/health", "dev:built": "cd ../ && yarn dev:built" }, From ec5203f775f8820a172a846b981faf38f316b681 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Wed, 19 Jul 2023 17:31:33 +0100 Subject: [PATCH 24/35] PR changes --- packages/worker/src/api/controllers/global/auth.ts | 2 -- qa-core/src/account-api/api/apis/BaseAPI.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/packages/worker/src/api/controllers/global/auth.ts b/packages/worker/src/api/controllers/global/auth.ts index a458a98aa7..131601c6ad 100644 --- a/packages/worker/src/api/controllers/global/auth.ts +++ b/packages/worker/src/api/controllers/global/auth.ts @@ -53,8 +53,6 @@ async function passportCallback( } export const login = async (ctx: Ctx, next: any) => { - const tenantId = context.getTenantId() - console.log(tenantId) const email = ctx.request.body.username const user = await userSdk.getUserByEmail(email) diff --git a/qa-core/src/account-api/api/apis/BaseAPI.ts b/qa-core/src/account-api/api/apis/BaseAPI.ts index 7b74a2d3f5..ed5d261e9e 100644 --- a/qa-core/src/account-api/api/apis/BaseAPI.ts +++ b/qa-core/src/account-api/api/apis/BaseAPI.ts @@ -1,8 +1,6 @@ import { Response } from "node-fetch" import { APIRequestOpts } from "../../../types" -// TODO: Add to LicenseAPI - export default class BaseAPI { async doRequest( request: () => Promise<[Response, any]>, From 8f2d8a7b642460dcb1c9081784c08960782a2c84 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 09:21:38 +0100 Subject: [PATCH 25/35] Update test commands to ignore cloud specific tests in CI --- qa-core/package.json | 6 +++--- ...nts.internal.spec.ts => accounts.cloud.internal.spec.ts} | 0 .../accounts/{accounts.spec.ts => accounts.cloud.spec.ts} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename qa-core/src/account-api/tests/accounts/{accounts.internal.spec.ts => accounts.cloud.internal.spec.ts} (100%) rename qa-core/src/account-api/tests/accounts/{accounts.spec.ts => accounts.cloud.spec.ts} (100%) diff --git a/qa-core/package.json b/qa-core/package.json index 1fbd0c0254..710e0b6a3b 100644 --- a/qa-core/package.json +++ b/qa-core/package.json @@ -15,10 +15,10 @@ "test:watch": "yarn run test --watch", "test:debug": "DEBUG=1 yarn run test", "test:notify": "node scripts/testResultsWebhook", - "test:cloud:prod": "yarn run test --testPathIgnorePatterns=/.+\\.integration\\.spec\\.ts", + "test:cloud:prod": "yarn run test --testPathIgnorePatterns=\\.integration\\.", "test:cloud:qa": "yarn run test", - "test:ci": "yarn run test --testPathIgnorePatterns=/.+\\.integration\\.spec\\.ts /account-api/", - "serve:test:ci": "start-server-and-test dev:built http://localhost:4001/health test:smoke", + "test:self:ci": "yarn run test --testPathIgnorePatterns=\\.integration\\. \\.cloud\\.", + "serve:test:self:ci": "start-server-and-test dev:built http://localhost:4001/health test:self:ci", "serve": "start-server-and-test dev:built http://localhost:4001/health", "dev:built": "cd ../ && yarn dev:built" }, diff --git a/qa-core/src/account-api/tests/accounts/accounts.internal.spec.ts b/qa-core/src/account-api/tests/accounts/accounts.cloud.internal.spec.ts similarity index 100% rename from qa-core/src/account-api/tests/accounts/accounts.internal.spec.ts rename to qa-core/src/account-api/tests/accounts/accounts.cloud.internal.spec.ts diff --git a/qa-core/src/account-api/tests/accounts/accounts.spec.ts b/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts similarity index 100% rename from qa-core/src/account-api/tests/accounts/accounts.spec.ts rename to qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts From e2a792797368f249cd7df806bf00c43c6ad9a2b4 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 10:52:28 +0100 Subject: [PATCH 26/35] Lint + update ci test command --- .github/workflows/budibase_ci.yml | 2 +- qa-core/src/jest/jestSetup.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 86e7df66da..9509a22e99 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -159,7 +159,7 @@ jobs: run: | cd qa-core yarn setup - yarn serve:test:ci + yarn serve:test:self:ci env: BB_ADMIN_USER_EMAIL: admin BB_ADMIN_USER_PASSWORD: admin diff --git a/qa-core/src/jest/jestSetup.ts b/qa-core/src/jest/jestSetup.ts index f89d71dfcb..928e547337 100644 --- a/qa-core/src/jest/jestSetup.ts +++ b/qa-core/src/jest/jestSetup.ts @@ -1,3 +1,3 @@ const envTimeout = process.env.JEST_TIMEOUT const timeout = envTimeout && parseInt(envTimeout) -jest.setTimeout(timeout || 60000) \ No newline at end of file +jest.setTimeout(timeout || 60000) From ebc5caf6590892df5bd3114ca120dff1e44548e2 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 10:54:36 +0100 Subject: [PATCH 27/35] Fix develop reference --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index 9c564edb37..4d9840700e 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 9c564edb37cb619cb5971e10c4317fa6e7c5bb00 +Subproject commit 4d9840700e7684581c39965b7cb6a2b2428c477c From b60794d73ad0dff989432bf3da4aff551555350a Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 11:13:57 +0100 Subject: [PATCH 28/35] Update pro reference to latest develop and fix compile errors --- packages/pro | 2 +- packages/server/src/api/controllers/query/index.ts | 4 ++-- packages/server/src/api/controllers/row/index.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/pro b/packages/pro index 9c564edb37..4d9840700e 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 9c564edb37cb619cb5971e10c4317fa6e7c5bb00 +Subproject commit 4d9840700e7684581c39965b7cb6a2b2428c477c diff --git a/packages/server/src/api/controllers/query/index.ts b/packages/server/src/api/controllers/query/index.ts index 4c1cad6b5b..466fe90e07 100644 --- a/packages/server/src/api/controllers/query/index.ts +++ b/packages/server/src/api/controllers/query/index.ts @@ -157,7 +157,7 @@ export async function preview(ctx: any) { } const runFn = () => Runner.run(inputs) - const { rows, keys, info, extra } = await quotas.addQuery(runFn, { + const { rows, keys, info, extra } = await quotas.addQuery(runFn, { datasourceId: datasource._id, }) const schemaFields: any = {} @@ -246,7 +246,7 @@ async function execute( } const runFn = () => Runner.run(inputs) - const { rows, pagination, extra, info } = await quotas.addQuery(runFn, { + const { rows, pagination, extra, info } = await quotas.addQuery(runFn, { datasourceId: datasource._id, }) // remove the raw from execution incase transformer being used to hide data diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 673f2adb53..aa3aa3e21c 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -25,7 +25,7 @@ export async function patch(ctx: any): Promise { return save(ctx) } try { - const { row, table } = await quotas.addQuery( + const { row, table } = await quotas.addQuery( () => pickApi(tableId).patch(ctx), { datasourceId: tableId, @@ -104,7 +104,7 @@ export async function destroy(ctx: any) { const tableId = utils.getTableId(ctx) let response, row if (inputs.rows) { - let { rows } = await quotas.addQuery( + let { rows } = await quotas.addQuery( () => pickApi(tableId).bulkDestroy(ctx), { datasourceId: tableId, @@ -117,7 +117,7 @@ export async function destroy(ctx: any) { gridSocket?.emitRowDeletion(ctx, row._id) } } else { - let resp = await quotas.addQuery(() => pickApi(tableId).destroy(ctx), { + let resp = await quotas.addQuery(() => pickApi(tableId).destroy(ctx), { datasourceId: tableId, }) await quotas.removeRow() From 76f61cfd3a983d3513c010bd6572fbb879abb07d Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 11:21:34 +0100 Subject: [PATCH 29/35] Lint --- packages/server/src/api/controllers/query/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/query/index.ts b/packages/server/src/api/controllers/query/index.ts index 466fe90e07..11ad25f037 100644 --- a/packages/server/src/api/controllers/query/index.ts +++ b/packages/server/src/api/controllers/query/index.ts @@ -246,9 +246,12 @@ async function execute( } const runFn = () => Runner.run(inputs) - const { rows, pagination, extra, info } = await quotas.addQuery(runFn, { - datasourceId: datasource._id, - }) + const { rows, pagination, extra, info } = await quotas.addQuery( + runFn, + { + datasourceId: datasource._id, + } + ) // remove the raw from execution incase transformer being used to hide data if (extra?.raw) { delete extra.raw From 2141a8ef297ee5d880d6b1b791d822b3f0edbf77 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 20 Jul 2023 10:23:04 +0000 Subject: [PATCH 30/35] Bump version to 2.8.16-alpha.1 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 498d8a91b5..4f2eab4463 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.16-alpha.0", + "version": "2.8.16-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" From 2f5e7d35be9c181a7180f1a3c62119dbdac57759 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 20 Jul 2023 10:54:26 +0000 Subject: [PATCH 31/35] Bump version to 2.8.16-alpha.2 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 4f2eab4463..6c4c087642 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.16-alpha.1", + "version": "2.8.16-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" From bf5d72d7e36ec49741775063edf25033cda5d8c0 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 12:05:04 +0100 Subject: [PATCH 32/35] Fix release and prerelease tag triggers --- .github/workflows/release-develop.yml | 2 +- .github/workflows/release-master.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index a7bf041eb5..e8d88fa136 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -6,7 +6,7 @@ concurrency: on: push: tags: - - v*-alpha.* + - ".*-alpha.*" workflow_dispatch: env: diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index c0e012bb27..7f8b8f1d55 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -6,9 +6,9 @@ concurrency: on: push: tags: - - "v[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+" # Exclude all pre-releases - - "!v*[0-9]+.[0-9]+.[0-9]+-*" + - "!*[0-9]+.[0-9]+.[0-9]+-*" env: # Posthog token used by ui at build time From 8e0674e77f038d8dda2aa0035af3a293e5bc81e4 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 20 Jul 2023 11:09:31 +0000 Subject: [PATCH 33/35] Bump version to 2.8.16-alpha.3 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 6c4c087642..070a50bdac 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.16-alpha.2", + "version": "2.8.16-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" From 829c3e38bd146f0c112f6db5ea20f77a29a921bf Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 12:18:00 +0100 Subject: [PATCH 34/35] Adjust tag regex for prerelease --- .github/workflows/release-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index e8d88fa136..61cb283e28 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -6,7 +6,7 @@ concurrency: on: push: tags: - - ".*-alpha.*" + - "*-alpha.*" workflow_dispatch: env: From 5bf4ae3967c68e0ac336210a14d13a050a1d94aa Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 20 Jul 2023 11:20:22 +0000 Subject: [PATCH 35/35] Bump version to 2.8.16-alpha.4 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 070a50bdac..f9c639e296 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.16-alpha.3", + "version": "2.8.16-alpha.4", "npmClient": "yarn", "packages": [ "packages/*"