From b1b861139dbb1d607978395e5df2d9f468054316 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 5 Sep 2024 14:25:04 +0100 Subject: [PATCH 1/2] feature flag the branch action definition --- packages/backend-core/src/features/index.ts | 1 + packages/server/src/automations/actions.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/packages/backend-core/src/features/index.ts b/packages/backend-core/src/features/index.ts index 49f8044e8f..5951bbc292 100644 --- a/packages/backend-core/src/features/index.ts +++ b/packages/backend-core/src/features/index.ts @@ -267,6 +267,7 @@ export class FlagSet, T extends { [key: string]: V }> { // 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(env.isDev()), [FeatureFlag.ENRICHED_RELATIONSHIPS]: Flag.boolean(false), }) diff --git a/packages/server/src/automations/actions.ts b/packages/server/src/automations/actions.ts index 2058723faa..a9b839fedd 100644 --- a/packages/server/src/automations/actions.ts +++ b/packages/server/src/automations/actions.ts @@ -16,6 +16,7 @@ import * as delay from "./steps/delay" import * as queryRow from "./steps/queryRows" import * as loop from "./steps/loop" import * as collect from "./steps/collect" +import * as branch from "./steps/branch" import * as triggerAutomationRun from "./steps/triggerAutomationRun" import env from "../environment" import { @@ -25,9 +26,11 @@ import { Hosting, ActionImplementation, AutomationStepDefinition, + FeatureFlag, } from "@budibase/types" import sdk from "../sdk" import { getAutomationPlugin } from "../utilities/fileSystem" +import { features } from "@budibase/backend-core" type ActionImplType = ActionImplementations< typeof env.SELF_HOSTED extends "true" ? Hosting.SELF : Hosting.CLOUD @@ -98,6 +101,9 @@ if (env.SELF_HOSTED) { } export async function getActionDefinitions() { + if (await features.flags.isEnabled("AUTOMATION_BRANCHING")) { + BUILTIN_ACTION_DEFINITIONS["BRANCH"] = branch.definition + } const actionDefinitions = BUILTIN_ACTION_DEFINITIONS if (env.SELF_HOSTED) { const plugins = await sdk.plugins.fetch(PluginType.AUTOMATION) From 4231dafc94b01782d2056166460339537dec777f Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 9 Sep 2024 14:26:37 +0100 Subject: [PATCH 2/2] remove uneeded import --- packages/server/src/automations/actions.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/server/src/automations/actions.ts b/packages/server/src/automations/actions.ts index a9b839fedd..f78174aa7a 100644 --- a/packages/server/src/automations/actions.ts +++ b/packages/server/src/automations/actions.ts @@ -26,7 +26,6 @@ import { Hosting, ActionImplementation, AutomationStepDefinition, - FeatureFlag, } from "@budibase/types" import sdk from "../sdk" import { getAutomationPlugin } from "../utilities/fileSystem"