Skip to content

Commit

Permalink
Merge branch 'spike/account-holder-login-without-budibase-user-id' of h…
Browse files Browse the repository at this point in the history
…ttps://github.com/Budibase/budibase into spike/account-holder-login-without-budibase-user-id
  • Loading branch information
melohagan committed Oct 23, 2024
2 parents 2e9b836 + 5a09d5d commit d2da480
Show file tree
Hide file tree
Showing 85 changed files with 1,848 additions and 680 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy QA
on:
push:
branches:
- master
- v3-ui
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "2.33.0",
"version": "2.33.2",
"npmClient": "yarn",
"packages": [
"packages/*",
Expand Down
3 changes: 2 additions & 1 deletion packages/backend-core/src/db/couch/DatabaseImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
DatabaseQueryOpts,
DBError,
Document,
FeatureFlag,
isDocument,
RowResponse,
RowValue,
Expand Down Expand Up @@ -456,7 +457,7 @@ export class DatabaseImpl implements Database {

async destroy() {
if (
(await flags.isEnabled("SQS")) &&
(await flags.isEnabled(FeatureFlag.SQS)) &&
(await this.exists(SQLITE_DESIGN_DOC_ID))
) {
// delete the design document, then run the cleanup operation
Expand Down
50 changes: 33 additions & 17 deletions packages/backend-core/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,46 @@ function getPackageJsonFields(): {
VERSION: string
SERVICE_NAME: string
} {
function findFileInAncestors(
fileName: string,
currentDir: string
): string | null {
const filePath = `${currentDir}/${fileName}`
if (existsSync(filePath)) {
return filePath
}
function getParentFile(file: string) {
function findFileInAncestors(
fileName: string,
currentDir: string
): string | null {
const filePath = `${currentDir}/${fileName}`
if (existsSync(filePath)) {
return filePath
}

const parentDir = `${currentDir}/..`
if (parentDir === currentDir) {
// reached root directory
return null
}

const parentDir = `${currentDir}/..`
if (parentDir === currentDir) {
// reached root directory
return null
return findFileInAncestors(fileName, parentDir)
}

return findFileInAncestors(fileName, parentDir)
const packageJsonFile = findFileInAncestors(file, process.cwd())
const content = readFileSync(packageJsonFile!, "utf-8")
const parsedContent = JSON.parse(content)
return parsedContent
}

let localVersion: string | undefined
if (isDev() && !isTest()) {
try {
const lerna = getParentFile("lerna.json")
localVersion = `${lerna.version}+local`
} catch {
//
}
}

try {
const packageJsonFile = findFileInAncestors("package.json", process.cwd())
const content = readFileSync(packageJsonFile!, "utf-8")
const parsedContent = JSON.parse(content)
const parsedContent = getParentFile("package.json")
return {
VERSION: process.env.BUDIBASE_VERSION || parsedContent.version,
VERSION:
localVersion || process.env.BUDIBASE_VERSION || parsedContent.version,
SERVICE_NAME: parsedContent.name,
}
} catch {
Expand Down
7 changes: 4 additions & 3 deletions packages/backend-core/src/features/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,13 @@ export class FlagSet<V extends Flag<any>, T extends { [key: string]: V }> {
// All of the machinery in this file is to make sure that flags have their
// default values set correctly and their types flow through the system.
export const flags = new FlagSet({
DEFAULT_VALUES: Flag.boolean(env.isDev()),
AUTOMATION_BRANCHING: Flag.boolean(env.isDev()),
SQS: Flag.boolean(true),
[FeatureFlag.DEFAULT_VALUES]: Flag.boolean(env.isDev()),
[FeatureFlag.AUTOMATION_BRANCHING]: Flag.boolean(env.isDev()),
[FeatureFlag.SQS]: Flag.boolean(true),
[FeatureFlag.AI_CUSTOM_CONFIGS]: Flag.boolean(env.isDev()),
[FeatureFlag.ENRICHED_RELATIONSHIPS]: Flag.boolean(env.isDev()),
[FeatureFlag.TABLES_DEFAULT_ADMIN]: Flag.boolean(env.isDev()),
[FeatureFlag.BUDIBASE_AI]: Flag.boolean(env.isDev()),
})

type UnwrapPromise<T> = T extends Promise<infer U> ? U : T
Expand Down
Loading

0 comments on commit d2da480

Please sign in to comment.