Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

MUL-8249: enable Workflow for all users (#9535)

Multica Evef805e0f223af
diff --git a/packages/core/api/client.ts b/packages/core/api/client.ts
index 8ab0ab4c6c..2648e8bf09 100644
--- a/packages/core/api/client.ts
+++ b/packages/core/api/client.ts
@@ -4185,10 +4185,8 @@ export class ApiClient {
await this.fetch(`/api/labels/${id}`, { method: "DELETE" });
}
- // Workspace workflows (MUL-7420). Reads are open to any workspace member;
- // creating, editing and deleting a workflow is owner/admin only. Adoption
- // (creating a workflow, pointing a project at one) is gated server-side by
- // the project_workflows_v1 flag and returns 403 when it is off.
+ // Workspace workflows (MUL-7420). Any workspace member may read and create
+ // workflows; only the workflow owner and workspace admins may edit or delete.
async listIssueWorkflows(): Promise<ListIssueWorkflowsResponse> {
const raw = await this.fetch<unknown>(`/api/issue-workflows`);
return parseWithFallback(raw, ListIssueWorkflowsResponseSchema, EMPTY_LIST_ISSUE_WORKFLOWS_RESPONSE, {
diff --git a/packages/core/feature-flags/index.ts b/packages/core/feature-flags/index.ts
index c54f183f72..4683dcb667 100644
--- a/packages/core/feature-flags/index.ts
+++ b/packages/core/feature-flags/index.ts
@@ -21,7 +21,6 @@ export {
BILLING_WORKSPACE_SUBSCRIPTIONS_FLAG,
COMPOSIO_MCP_APPS_FLAG,
PLUGINS_V1_FLAG,
- PROJECT_WORKFLOWS_V1_FLAG,
} from "./keys";
export {
FeatureFlagsProvider,
diff --git a/packages/core/feature-flags/keys.ts b/packages/core/feature-flags/keys.ts
index 957a3bfe23..db0dd7123d 100644
--- a/packages/core/feature-flags/keys.ts
+++ b/packages/core/feature-flags/keys.ts
@@ -2,4 +2,3 @@ export const COMPOSIO_MCP_APPS_FLAG = "composio_mcp_apps";
export const PLUGINS_V1_FLAG = "plugins_v1";
export const BILLING_WORKSPACE_SUBSCRIPTIONS_FLAG =
"billing_workspace_subscriptions";
-export const PROJECT_WORKFLOWS_V1_FLAG = "project_workflows_v1";
diff --git a/packages/views/issues/utils/workflow-columns.test.ts b/packages/views/issues/utils/workflow-columns.test.ts
index 331b8d46de..cb27ea738a 100644
--- a/packages/views/issues/utils/workflow-columns.test.ts
+++ b/packages/views/issues/utils/workflow-columns.test.ts
@@ -39,7 +39,6 @@ const { defaultWithoutBlocked } = vi.hoisted(() => ({
},
}));
-vi.mock("@multica/core/config", () => ({ useFeatureEnabled: () => true }));
vi.mock("@multica/core/issue-workflows", () => ({
defaultWorkflow: () => defaultWithoutBlocked,
useIssueWorkflows: () => ({ workflows: [defaultWithoutBlocked] }),
@@ -67,6 +66,10 @@ describe("workflowColumns (MUL-7420)", () => {
});
describe("useColumnWorkflow (MUL-7420)", () => {
+ it("follows Default outside a project without feature flag configuration", () => {
+ expect(useColumnWorkflow("ws-1", null, false).workflow).toBe(defaultWithoutBlocked);
+ });
+
it("follows the project's workflow on a project board", () => {
expect(useColumnWorkflow("ws-1", "project-1", false).workflow).toBe(defaultWithoutBlocked);
});
diff --git a/packages/views/issues/utils/workflow-columns.ts b/packages/views/issues/utils/workflow-columns.ts
index cf96b2e29c..90aab32774 100644
--- a/packages/views/issues/utils/workflow-columns.ts
+++ b/packages/views/issues/utils/workflow-columns.ts
@@ -1,5 +1,3 @@
-import { useFeatureEnabled } from "@multica/core/config";
-import { PROJECT_WORKFLOWS_V1_FLAG } from "@multica/core/feature-flags";
import { defaultWorkflow, useIssueWorkflows, useProjectWorkflow } from "@multica/core/issue-workflows";
import type { IssueStatus, IssueWorkflow } from "@multica/core/types";
@@ -23,8 +21,8 @@ export function workflowColumns(
/**
* The workflow a surface's columns follow (MUL-7420). A project surface shows
- * its project's columns. Elsewhere, while workflows are on, columns follow
- * Default. A status outside the workflow is never a column; a status filter
+ * its project's columns. Elsewhere, columns follow Default.
+ * A status outside the workflow is never a column; a status filter
* that picks keys explicitly shows exactly those — on a project too, which is
* how an issue left in a status its workflow no longer lists is found.
*/
@@ -33,11 +31,9 @@ export function useColumnWorkflow(
projectId: string | null | undefined,
hasStatusFilter: boolean,
): { workflow: IssueWorkflow | null } {
- const enabled = useFeatureEnabled(PROJECT_WORKFLOWS_V1_FLAG, false);
const { workflows } = useIssueWorkflows(wsId);
const projectWorkflow = useProjectWorkflow(wsId, projectId);
if (hasStatusFilter) return { workflow: null };
if (projectId) return { workflow: projectWorkflow };
- if (!enabled) return { workflow: null };
return { workflow: defaultWorkflow(workflows) };
}
diff --git a/packages/views/modals/create-project.test.tsx b/packages/views/modals/create-project.test.tsx
index b6cef05a57..b866c491ee 100644
--- a/packages/views/modals/create-project.test.tsx
+++ b/packages/views/modals/create-project.test.tsx
@@ -146,6 +146,8 @@ vi.mock("@multica/ui/components/ui/dropdown-menu", () => ({
DropdownMenu: ({ children }: { children: React.ReactNode }) => <>{children}</>,
DropdownMenuTrigger: ({ render }: { render: React.ReactNode }) => <>{render}</>,
DropdownMenuContent: ({ children }: { children: React.ReactNode }) => <>{children}</>,
+ DropdownMenuGroup: ({ children }: { children: React.ReactNode }) => <>{children}</>,
+ DropdownMenuLabel: ({ children }: { children: React.ReactNode }) => <>{children}</>,
DropdownMenuItem: ({
children,
onClick,
diff --git a/packages/views/projects/components/project-detail.test.tsx b/packages/views/projects/components/project-detail.test.tsx
index 58f011c94a..2a4933fcde 100644
--- a/packages/views/projects/components/project-detail.test.tsx
+++ b/packages/views/projects/components/project-detail.test.tsx
@@ -22,6 +22,7 @@ vi.mock("@multica/ui/lib/clipboard", () => ({
}));
vi.mock("../../workflows/project-workflow-menu", () => ({ ProjectWorkflowMenu: () => null }));
+vi.mock("../../workflows/project-workflow-row", () => ({ ProjectWorkflowControl: () => null }));
vi.mock("@tanstack/react-query", () => ({
useQuery: (options: { queryKey?: readonly unknown[] }) => {
diff --git a/packages/views/projects/components/project-detail.tsx b/packages/views/projects/components/project-detail.tsx
index 6591ed6108..be113f6618 100644
--- a/packages/views/projects/components/project-detail.tsx
+++ b/packages/views/projects/components/project-detail.tsx
@@ -8,8 +8,6 @@ import { cn } from "@multica/ui/lib/utils";
import { copyText } from "@multica/ui/lib/clipboard";
import { toast } from "sonner";
import type { Project, ProjectStatus, ProjectPriority } from "@multica/core/types";
-import { useFeatureEnabled } from "@multica/core/config";
-import { PROJECT_WORKFLOWS_V1_FLAG } from "@multica/core/feature-flags";
import { useAuthStore } from "@multica/core/auth";
import { projectDetailOptions } from "@multica/core/projects/queries";
import { useUpdateProject, useDeleteProject } from "@multica/core/projects/mutations";
@@ -99,12 +97,9 @@ function PropRow({
);
}
-// The project's workflow (MUL-7420). Hidden while workflows are off, unless the
-// project already uses one — it can always switch back to Default.
+// The project's workflow (MUL-7420).
function ProjectWorkflowPropRow({ project }: { project: Project }) {
const { t } = useT("issues");
- const enabled = useFeatureEnabled(PROJECT_WORKFLOWS_V1_FLAG, false);
- if (!enabled && !project.workflow_id) return null;
return (
<PropRow label={t(($) => $.workflows.project.label)}>
<ProjectWorkflowControl project={project} />
diff --git a/packages/views/settings/components/settings-navigation.test.ts b/packages/views/settings/components/settings-navigation.test.ts
index a26e1f2e81..d9d0e96825 100644
--- a/packages/views/settings/components/settings-navigation.test.ts
+++ b/packages/views/settings/components/settings-navigation.test.ts
@@ -7,6 +7,7 @@ const resolve = (search: string) =>
describe("settings location", () => {
it.each([
+ ["tab=issue-statuses", { tab: "workflows", section: null, integration: null }],
["tab=issue", { tab: "preferences", section: "issue", integration: null }],
["tab=chat", { tab: "preferences", section: "chat", integration: null }],
["tab=labs", { tab: "workspace", section: null, integration: null }],
diff --git a/packages/views/settings/components/settings-navigation.ts b/packages/views/settings/components/settings-navigation.ts
index 27dbadef89..3eb15b4062 100644
--- a/packages/views/settings/components/settings-navigation.ts
+++ b/packages/views/settings/components/settings-navigation.ts
@@ -37,6 +37,8 @@ export function resolveSettingsLocation(
const section = params.get("section");
const integration = params.get("integration");
switch (tab) {
+ case "issue-statuses":
+ return { tab: "workflows", section: null, integration: null };
case "issue":
case "chat":
return { tab: "preferences", section: tab, integration: null };
diff --git a/packages/views/settings/components/settings-page.test.tsx b/packages/views/settings/components/settings-page.test.tsx
index c5e821aa3b..8dd5280b98 100644
--- a/packages/views/settings/components/settings-page.test.tsx
+++ b/packages/views/settings/components/settings-page.test.tsx
@@ -6,7 +6,6 @@ import { configStore } from "@multica/core/config";
import {
BILLING_WORKSPACE_SUBSCRIPTIONS_FLAG,
PLUGINS_V1_FLAG,
- PROJECT_WORKFLOWS_V1_FLAG,
} from "@multica/core/feature-flags";
import { renderWithI18n } from "../../test/i18n";
@@ -24,7 +23,6 @@ vi.mock("./code-tab", stub("CodeTab"));
vi.mock("./channels-tab", stub("ChannelsTab"));
vi.mock("./notifications-tab", stub("NotificationsTab"));
vi.mock("./labels-tab", stub("LabelsTab"));
-vi.mock("./issue-statuses-tab", stub("IssueStatusesTab"));
vi.mock("../../workflows/workflows-tab", stub("WorkflowsTab"));
vi.mock("./properties-tab", stub("PropertiesTab"));
vi.mock("./quick-actions-tab", stub("QuickActionsTab"));
@@ -175,10 +173,9 @@ describe("SettingsPage Plugin feature flag", () => {
});
});
-describe("SettingsPage workflow feature flag", () => {
- it("mounts workflows in workspace settings without losing wakeups", () => {
+describe("SettingsPage workflows", () => {
+ it("mounts workflows without feature flag configuration and keeps wakeups", () => {
navigationState.search = "tab=workflows";
- configStore.getState().setFeatureFlags({ [PROJECT_WORKFLOWS_V1_FLAG]: true });
renderWithI18n(<SettingsPage />);
@@ -188,13 +185,13 @@ describe("SettingsPage workflow feature flag", () => {
expect(screen.getByRole("link", { name: "Wakeups" })).toBeInTheDocument();
});
- it("keeps the status catalog when workflows are disabled", () => {
+ it("opens old status catalog links in workflows", () => {
navigationState.search = "tab=issue-statuses";
renderWithI18n(<SettingsPage />);
- expect(screen.getByText("IssueStatusesTab")).toBeInTheDocument();
- expect(screen.queryByRole("link", { name: "Workflows" })).not.toBeInTheDocument();
+ expect(screen.getByText("WorkflowsTab")).toBeInTheDocument();
+ expect(screen.getByRole("link", { name: "Workflows" })).toHaveAttribute("aria-current", "page");
expect(screen.getByRole("link", { name: "Wakeups" })).toBeInTheDocument();
});
});
@@ -236,7 +233,7 @@ describe("SettingsPage information architecture", () => {
const workspace = within(nav()).getByRole("region", { name: /Acme/ });
const issues = within(workspace).getByRole("group", { name: "Issues & workflow" });
expect(
- within(issues).getByRole("link", { name: "Issue Statuses" }),
+ within(issues).getByRole("link", { name: "Workflows" }),
).toBeInTheDocument();
const connections = within(workspace).getByRole("group", {
name: "Connections & extensions",
diff --git a/packages/views/settings/components/settings-page.tsx b/packages/views/settings/components/settings-page.tsx
index e5066ff076..a5e7ca9dfe 100644
--- a/packages/views/settings/components/settings-page.tsx
+++ b/packages/views/settings/components/settings-page.tsx
@@ -5,7 +5,6 @@ import {
AlarmClock,
Bell,
Blocks,
- CircleDot,
CreditCard,
FolderGit2,
Keyboard,
@@ -33,7 +32,6 @@ import { useCurrentMember } from "@multica/core/permissions";
import {
BILLING_WORKSPACE_SUBSCRIPTIONS_FLAG,
PLUGINS_V1_FLAG,
- PROJECT_WORKFLOWS_V1_FLAG,
} from "@multica/core/feature-flags";
import { resolvePublicFileUrl } from "@multica/core/workspace/avatar-url";
import { ActorAvatar } from "@multica/ui/components/common/actor-avatar";
@@ -52,7 +50,6 @@ import { ChannelsTab } from "./channels-tab";
import { ConnectedAppsTab, useComposioAvailable } from "./connected-apps-tab";
import { NotificationsTab } from "./notifications-tab";
import { LabelsTab } from "./labels-tab";
-import { IssueStatusesTab } from "./issue-statuses-tab";
import { WorkflowsTab } from "../../workflows/workflows-tab";
import { PropertiesTab } from "./properties-tab";
import { QuickActionsTab } from "./quick-actions-tab";
@@ -114,7 +111,6 @@ export function SettingsPage({ extraDeviceTabs = [] }: SettingsPageProps = {}) {
const isMember = role === "member";
const navigation = useNavigation();
const pluginsEnabled = useFeatureEnabled(PLUGINS_V1_FLAG, false);
- const workflowsEnabled = useFeatureEnabled(PROJECT_WORKFLOWS_V1_FLAG, false);
const billingEnabled = useFeatureEnabled(
BILLING_WORKSPACE_SUBSCRIPTIONS_FLAG,
false,
@@ -210,14 +206,9 @@ export function SettingsPage({ extraDeviceTabs = [] }: SettingsPageProps = {}) {
key: "issues",
label: t(($) => $.page.groups.issues),
entries: [
- ...(workflowsEnabled
- ? [entry("workflows", t(($) => $.page.tabs.workflows), Workflow, <WorkflowsTab />, {
- wide: true,
- })]
- : [entry("issue-statuses", t(($) => $.page.tabs.issue_statuses), CircleDot, <IssueStatusesTab />, {
- wide: true,
- adminOnly: true,
- })]),
+ entry("workflows", t(($) => $.page.tabs.workflows), Workflow, <WorkflowsTab />, {
+ wide: true,
+ }),
entry("wakeups", t(($) => $.page.tabs.wakeups), AlarmClock, <WakeupsTab />, {
wide: true,
adminOnly: true,
diff --git a/packages/views/workflows/issue-flow-card.tsx b/packages/views/workflows/issue-flow-card.tsx
index d23a663d57..62f923fc77 100644
--- a/packages/views/workflows/issue-flow-card.tsx
+++ b/packages/views/workflows/issue-flow-card.tsx
@@ -2,8 +2,6 @@
import { useState } from "react";
import { Settings, Workflow } from "lucide-react";
-import { useFeatureEnabled } from "@multica/core/config";
-import { PROJECT_WORKFLOWS_V1_FLAG } from "@multica/core/feature-flags";
import { useWorkspaceId } from "@multica/core/hooks";
import { useIssueStatuses } from "@multica/core/issue-statuses/hooks";
import { useProjectWithWorkflow } from "@multica/core/issue-workflows";
@@ -29,7 +27,6 @@ export function IssueFlowCard({ projectId, currentStatus }: { projectId: string
const wsId = useWorkspaceId();
const navigation = useNavigation();
const paths = useWorkspacePaths();
- const enabled = useFeatureEnabled(PROJECT_WORKFLOWS_V1_FLAG, false);
const catalog = useIssueStatuses(wsId);
const labelOf = useStatusLabel(wsId);
const { project, workflow } = useProjectWithWorkflow(wsId, projectId);
@@ -87,7 +84,7 @@ export function IssueFlowCard({ projectId, currentStatus }: { projectId: string
);
})}
</ol>
- {canCreateWorkflow && enabled && (
+ {canCreateWorkflow && (
<div className="-mx-3 -mb-3 mt-2 border-t border-surface-border p-1">
<Button
variant="ghost"
diff --git a/packages/views/workflows/project-workflow-menu.tsx b/packages/views/workflows/project-workflow-menu.tsx
index 942bb9c6e3..6259f2de03 100644
--- a/packages/views/workflows/project-workflow-menu.tsx
+++ b/packages/views/workflows/project-workflow-menu.tsx
@@ -3,8 +3,6 @@
import { useState } from "react";
import { useQuery } from "@tanstack/react-query";
import { ChevronDown, ChevronRight, ListTree, Settings, Workflow } from "lucide-react";
-import { useFeatureEnabled } from "@multica/core/config";
-import { PROJECT_WORKFLOWS_V1_FLAG } from "@multica/core/feature-flags";
import { useWorkspaceId } from "@multica/core/hooks";
import { useIssueStatuses } from "@multica/core/issue-statuses/hooks";
import {
@@ -42,22 +40,20 @@ import { stepHandlerActor, useStepHandlerLabel } from "./step-handler";
/**
* The project board's "Workflow" menu (MUL-7420): open the full flow or switch
- * workflows; workflows themselves are made in settings. Shown while workflows
- * are on, or when the project already names one.
+ * workflows; workflows themselves are made in settings.
*/
export function ProjectWorkflowMenu({ project }: { project: Project }) {
const { t } = useT("issues");
const wsId = useWorkspaceId();
const navigation = useNavigation();
const paths = useWorkspacePaths();
- const enabled = useFeatureEnabled(PROJECT_WORKFLOWS_V1_FLAG, false);
const { workflows } = useIssueWorkflows(wsId);
const { canManageProject, canCreateWorkflow } = useWorkflowPermissions(project);
const { choose, busy, dialog } = useProjectWorkflowSwitch(project);
const [flowOpen, setFlowOpen] = useState(false);
const workflow = resolveProjectWorkflow(workflows, project);
- if (!workflow || (!enabled && !project.workflow_id)) return null;
+ if (!workflow) return null;
return (
<>
@@ -91,7 +87,7 @@ export function ProjectWorkflowMenu({ project }: { project: Project }) {
</DropdownMenuSubContent>
</DropdownMenuSub>
)}
- {canCreateWorkflow && enabled && (
+ {canCreateWorkflow && (
<>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={() => navigation.push(`${paths.settings()}?tab=workflows`)}>
diff --git a/packages/views/workflows/project-workflow-row.test.tsx b/packages/views/workflows/project-workflow-row.test.tsx
index c76d6e4f26..8a7c7e848a 100644
--- a/packages/views/workflows/project-workflow-row.test.tsx
+++ b/packages/views/workflows/project-workflow-row.test.tsx
@@ -19,7 +19,6 @@ const releaseWorkflow = {
vi.mock("@tanstack/react-query", () => ({ useQuery: () => ({ data: [] }) }));
vi.mock("@multica/core/api", () => ({ api: {}, clientErrorMessage: () => null }));
-vi.mock("@multica/core/config", () => ({ useFeatureEnabled: () => true }));
vi.mock("@multica/core/hooks", () => ({ useWorkspaceId: () => "workspace-1" }));
vi.mock("@multica/core/paths", () => ({ useWorkspacePaths: () => ({ settings: () => "/settings" }) }));
vi.mock("@multica/core/projects/queries", () => ({ projectListOptions: () => ({}) }));
diff --git a/packages/views/workflows/project-workflow-row.tsx b/packages/views/workflows/project-workflow-row.tsx
index 0a943f9df6..8b533d0af5 100644
--- a/packages/views/workflows/project-workflow-row.tsx
+++ b/packages/views/workflows/project-workflow-row.tsx
@@ -5,8 +5,6 @@ import { useQuery } from "@tanstack/react-query";
import { Check, ChevronDown, Settings, Workflow } from "lucide-react";
import { toast } from "sonner";
import { api, clientErrorMessage } from "@multica/core/api";
-import { useFeatureEnabled } from "@multica/core/config";
-import { PROJECT_WORKFLOWS_V1_FLAG } from "@multica/core/feature-flags";
import { useWorkspaceId } from "@multica/core/hooks";
import { handoffStepCount, resolveProjectWorkflow, useIssueWorkflows, useSetProjectWorkflow } from "@multica/core/issue-workflows";
import { useWorkspacePaths } from "@multica/core/paths";
@@ -112,16 +110,14 @@ export function WorkflowChoiceItems({
}) {
const { t } = useT("issues");
const wsId = useWorkspaceId();
- const enabled = useFeatureEnabled(PROJECT_WORKFLOWS_V1_FLAG, false);
const { workflows } = useIssueWorkflows(wsId);
const { data: projects = [] } = useQuery(projectListOptions(wsId));
const current = resolveProjectWorkflow(workflows, project);
const separator = t(($) => $.workflows.list_separator);
- const options = enabled ? workflows : workflows.filter((w) => w.is_default || w.id === current?.id);
return (
<>
- {options.map((workflow) => {
+ {workflows.map((workflow) => {
const usedBy = projects
.filter((p) => (workflow.is_default ? !p.workflow_id : workflow.project_ids.includes(p.id)))
.map((p) => p.title)
@@ -166,13 +162,11 @@ export function ProjectWorkflowControl({ project }: { project: Project }) {
const wsId = useWorkspaceId();
const navigation = useNavigation();
const paths = useWorkspacePaths();
- const enabled = useFeatureEnabled(PROJECT_WORKFLOWS_V1_FLAG, false);
const { workflows } = useIssueWorkflows(wsId);
const { canManageProject } = useWorkflowPermissions(project);
const { choose, busy, dialog } = useProjectWorkflowSwitch(project);
const current = resolveProjectWorkflow(workflows, project);
- if (!enabled && !project.workflow_id) return null;
const name = current?.name ?? t(($) => $.workflows.default_name);
const handoffs = current ? handoffStepCount(current) : 0;
const handoffLabel = handoffs > 0 ? t(($) => $.workflows.settings.handoffs, { count: handoffs }) : null;
@@ -212,15 +206,11 @@ export function ProjectWorkflowControl({ project }: { project: Project }) {
<DropdownMenuLabel>{t(($) => $.workflows.project.picker_title)}</DropdownMenuLabel>
<WorkflowChoiceItems project={project} onChoose={(w) => void choose(w)} />
</DropdownMenuGroup>
- {enabled && (
- <>
- <DropdownMenuSeparator />
- <DropdownMenuItem onClick={() => navigation.push(`${paths.settings()}?tab=workflows`)}>
- <Settings aria-hidden className="size-3.5" />
- {t(($) => $.workflows.project.manage)}
- </DropdownMenuItem>
- </>
- )}
+ <DropdownMenuSeparator />
+ <DropdownMenuItem onClick={() => navigation.push(`${paths.settings()}?tab=workflows`)}>
+ <Settings aria-hidden className="size-3.5" />
+ {t(($) => $.workflows.project.manage)}
+ </DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
{dialog}
diff --git a/packages/views/workflows/workflow-pill.test.tsx b/packages/views/workflows/workflow-pill.test.tsx
index 6b96c7e77c..773d2dcf0b 100644
--- a/packages/views/workflows/workflow-pill.test.tsx
+++ b/packages/views/workflows/workflow-pill.test.tsx
@@ -19,7 +19,6 @@ function workflow(id: string, name: string, isDefault: boolean): IssueWorkflow {
};
}
-vi.mock("@multica/core/config", () => ({ useFeatureEnabled: () => true }));
vi.mock("@multica/core/hooks", () => ({ useWorkspaceId: () => "workspace-1" }));
const workflows = vi.hoisted(() => ({ list: [] as IssueWorkflow[] }));
vi.mock("@multica/core/issue-workflows", () => ({
diff --git a/packages/views/workflows/workflow-pill.tsx b/packages/views/workflows/workflow-pill.tsx
index c0b3d04708..96efad295d 100644
--- a/packages/views/workflows/workflow-pill.tsx
+++ b/packages/views/workflows/workflow-pill.tsx
@@ -1,8 +1,6 @@
"use client";
import { Check, Workflow } from "lucide-react";
-import { useFeatureEnabled } from "@multica/core/config";
-import { PROJECT_WORKFLOWS_V1_FLAG } from "@multica/core/feature-flags";
import { useWorkspaceId } from "@multica/core/hooks";
import { useIssueWorkflows } from "@multica/core/issue-workflows";
import {
@@ -17,9 +15,8 @@ import { PillButton } from "../common/pill-button";
import { useT } from "../i18n";
/**
- * The workflow a new project starts on (MUL-7420); null is Default. Shown
- * while workflows are on, so the choice is visible even before the workspace
- * has more than Default.
+ * The workflow a new project starts on (MUL-7420); null is Default. The choice
+ * stays visible even before the workspace has more than Default.
*/
export function WorkflowPill({
value,
@@ -30,10 +27,8 @@ export function WorkflowPill({
}) {
const { t } = useT("issues");
const wsId = useWorkspaceId();
- const enabled = useFeatureEnabled(PROJECT_WORKFLOWS_V1_FLAG, false);
const { workflows } = useIssueWorkflows(wsId);
const named = workflows.filter((w) => !w.is_default);
- if (!enabled) return null;
const defaultName = workflows.find((w) => w.is_default)?.name ?? t(($) => $.workflows.default_name);
const current = named.find((w) => w.id === value);
const options = [{ id: null as string | null, name: defaultName, columns: workflows.find((w) => w.is_default)?.steps.length }, ...named.map((w) => ({ id: w.id as string | null, name: w.name, columns: w.steps.length }))];
diff --git a/server/internal/featureflags/keys.go b/server/internal/featureflags/keys.go
index 7a1fa60726..bd24aa2122 100644
--- a/server/internal/featureflags/keys.go
+++ b/server/internal/featureflags/keys.go
@@ -30,12 +30,6 @@ const (
// either way. Turning it off stops new intake and triage runs but leaves
// existing Triage issues workable.
TriageV1 = "triage_v1"
- // ProjectWorkflowsV1 gates project workflows (MUL-7420): creating a
- // workflow and pointing a project at one, plus the Settings → Workflows
- // and project workflow UI. Turning it off stops new adoption but leaves
- // workflows already in use working, and a project can always switch back
- // to the Default workflow.
- ProjectWorkflowsV1 = "project_workflows_v1"
// LocalSearchIndex gates the sync endpoints behind Web/Desktop local search
// (MUL-7754). On by default. Turning it off (FF_LOCAL_SEARCH_INDEX=off)
// makes those endpoints answer 404, so clients stop syncing and search
@@ -56,13 +50,15 @@ const (
// gate remained in every such client and fails closed (default false) if
// the key stops being published.
resourceLabelsCompat = "settings_resource_labels"
+ // projectWorkflowsCompat keeps workflow UI available in installed desktop
+ // clients that still gate it on this config decision and default to false.
+ projectWorkflowsCompat = "project_workflows_v1"
)
var frontendPublicFlags = []string{
BillingWorkspaceSubscriptions,
ComposioMCPApps,
PluginsV1,
- ProjectWorkflowsV1,
}
func BillingWorkspaceSubscriptionsEnabled(ctx context.Context, flags *featureflag.Service) bool {
@@ -86,16 +82,13 @@ func LocalSearchIndexEnabled(ctx context.Context, flags *featureflag.Service) bo
}
func EvaluateFrontendPublicFlags(ctx context.Context, flags *featureflag.Service) map[string]bool {
- out := make(map[string]bool, len(frontendPublicFlags)+3)
+ out := make(map[string]bool, len(frontendPublicFlags)+4)
for _, key := range frontendPublicFlags {
out[key] = flags.IsEnabled(ctx, key, false)
}
out[agentBuilderCompat] = true
out[agentSkillTogglesCompat] = true
out[resourceLabelsCompat] = true
+ out[projectWorkflowsCompat] = true
return out
}
-
-func ProjectWorkflowsV1Enabled(ctx context.Context, flags *featureflag.Service) bool {
- return flags.IsEnabled(ctx, ProjectWorkflowsV1, false)
-}
diff --git a/server/internal/handler/config_test.go b/server/internal/handler/config_test.go
index 8641b83432..1027ab5c09 100644
--- a/server/internal/handler/config_test.go
+++ b/server/internal/handler/config_test.go
@@ -457,6 +457,9 @@ func TestGetConfigExposesFrontendFeatureFlags(t *testing.T) {
if !cfg.FeatureFlags["settings_resource_labels"] {
t.Fatalf("settings_resource_labels: want true for installed clients, got false")
}
+ if !cfg.FeatureFlags["project_workflows_v1"] {
+ t.Fatal("project_workflows_v1: want true for installed clients")
+ }
if !cfg.FeatureFlags["agents_agent_builder"] {
t.Fatalf("agents_agent_builder: want true for installed clients, got false")
}
@@ -508,6 +511,24 @@ func TestGetConfigExposesEnabledPluginsV1Flag(t *testing.T) {
}
}
+func TestGetConfigKeepsProjectWorkflowsEnabledForInstalledClients(t *testing.T) {
+ h := &Handler{}
+ withFeatureFlag(t, h, "project_workflows_v1", false)
+
+ w := httptest.NewRecorder()
+ h.GetConfig(w, httptest.NewRequest(http.MethodGet, "/api/config", nil))
+ if w.Code != http.StatusOK {
+ t.Fatalf("GetConfig: expected 200, got %d: %s", w.Code, w.Body.String())
+ }
+ var cfg AppConfig
+ if err := json.Unmarshal(w.Body.Bytes(), &cfg); err != nil {
+ t.Fatalf("decode config: %v", err)
+ }
+ if !cfg.FeatureFlags["project_workflows_v1"] {
+ t.Fatal("retired project_workflows_v1 overrides must not hide workflows in installed clients")
+ }
+}
+
// Clients fail closed on this flag: absent covers every server that predates
// the signal, including the ones that accept a worktree resource, silently drop
// execution_mode and run the task in the user's working copy (#7113). A build
diff --git a/server/internal/handler/issue_workflow.go b/server/internal/handler/issue_workflow.go
index ed0bae6de3..b72465e81e 100644
--- a/server/internal/handler/issue_workflow.go
+++ b/server/internal/handler/issue_workflow.go
@@ -15,7 +15,6 @@ import (
"github.com/go-chi/chi/v5"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgtype"
- "github.com/multica-ai/multica/server/internal/featureflags"
"github.com/multica-ai/multica/server/internal/issuestatus"
"github.com/multica-ai/multica/server/internal/issueworkflow"
"github.com/multica-ai/multica/server/internal/logger"
@@ -34,18 +33,6 @@ import (
// owners/admins change it. Which workflow a project uses is open to
// owners/admins and to the project's lead.
-// requireProjectWorkflowsV1 gates adopting workflows behind the
-// project_workflows_v1 flag. Reads, edits of existing workflows and switching
-// a project back to Default stay open, so turning the flag off never strands
-// a project on a workflow nobody can maintain.
-func (h *Handler) requireProjectWorkflowsV1(w http.ResponseWriter, r *http.Request) bool {
- if featureflags.ProjectWorkflowsV1Enabled(r.Context(), h.FeatureFlags) {
- return true
- }
- writeFeatureDisabled(w, "project_workflows_disabled", "Project workflows are not enabled")
- return false
-}
-
func isWorkspaceAdmin(member db.Member) bool {
return roleAllowed(member.Role, "owner", "admin")
}
@@ -225,14 +212,11 @@ func (h *Handler) ListIssueWorkflows(w http.ResponseWriter, r *http.Request) {
if _, ok := h.requireWorkspaceMember(w, r, workspaceID, "workspace not found"); !ok {
return
}
- // Default is stored the first time workflows are read with the feature
- // on, so every client sees the same Default from then on.
- if featureflags.ProjectWorkflowsV1Enabled(r.Context(), h.FeatureFlags) {
- if _, err := issueworkflow.EnsureDefault(r.Context(), h.Queries, wsUUID); err != nil {
- slog.Warn("ListIssueWorkflows ensure default failed", append(logger.RequestAttrs(r), "error", err)...)
- writeError(w, http.StatusInternalServerError, "failed to list workflows")
- return
- }
+ // Store Default on the first read so every client sees the same workflow.
+ if _, err := issueworkflow.EnsureDefault(r.Context(), h.Queries, wsUUID); err != nil {
+ slog.Warn("ListIssueWorkflows ensure default failed", append(logger.RequestAttrs(r), "error", err)...)
+ writeError(w, http.StatusInternalServerError, "failed to list workflows")
+ return
}
rows, err := h.Queries.ListIssueWorkflows(r.Context(), wsUUID)
if err != nil {
@@ -477,9 +461,6 @@ func (h *Handler) CreateIssueWorkflow(w http.ResponseWriter, r *http.Request) {
if !ok {
return
}
- if !h.requireProjectWorkflowsV1(w, r) {
- return
- }
var req IssueWorkflowWriteRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
writeError(w, http.StatusBadRequest, "invalid request body")
@@ -957,9 +938,6 @@ func (h *Handler) SetProjectWorkflow(w http.ResponseWriter, r *http.Request) {
}
var targetID pgtype.UUID
if req.WorkflowID != nil && *req.WorkflowID != "" {
- if !h.requireProjectWorkflowsV1(w, r) {
- return
- }
id, ok := parseUUIDOrBadRequest(w, *req.WorkflowID, "workflow_id")
if !ok {
return
@@ -1108,9 +1086,6 @@ func (h *Handler) SetIssueWorkflowHandoff(w http.ResponseWriter, r *http.Request
return
}
step := issueworkflow.NormalizeHandoff(payloadToStep(chi.URLParam(r, "status"), req.IssueWorkflowStepPayload))
- if (step.HandsOff() || req.CopyForProjectID != "") && !h.requireProjectWorkflowsV1(w, r) {
- return
- }
var copyFor pgtype.UUID
if req.CopyForProjectID != "" {
copyFor, ok = parseUUIDOrBadRequest(w, req.CopyForProjectID, "copy_for_project_id")
diff --git a/server/internal/handler/issue_workflow_test.go b/server/internal/handler/issue_workflow_test.go
index 77a577f2c7..5a5f71370a 100644
--- a/server/internal/handler/issue_workflow_test.go
+++ b/server/internal/handler/issue_workflow_test.go
@@ -10,7 +10,6 @@ import (
"unicode/utf8"
"github.com/jackc/pgx/v5/pgtype"
- "github.com/multica-ai/multica/server/internal/featureflags"
"github.com/multica-ai/multica/server/internal/issueworkflow"
"github.com/multica-ai/multica/server/internal/service"
"github.com/multica-ai/multica/server/internal/testutil"
@@ -48,7 +47,6 @@ func createTestWorkflow(t *testing.T, name string, middle ...string) IssueWorkfl
func createTestWorkflowSteps(t *testing.T, name string, steps []map[string]any) IssueWorkflowResponse {
t.Helper()
- withFeatureFlag(t, testHandler, featureflags.ProjectWorkflowsV1, true)
var created IssueWorkflowResponse
testutil.Call(t, testHandler.CreateIssueWorkflow, workflowRequest("POST", "/api/issue-workflows", map[string]any{
"name": name,
@@ -101,7 +99,6 @@ func projectWorkflowID(t *testing.T, projectID string) string {
return *id
}
resetDefaultWorkflow(t)
- withFeatureFlag(t, testHandler, featureflags.ProjectWorkflowsV1, true)
var list struct {
Workflows []IssueWorkflowResponse `json:"workflows"`
}
@@ -111,7 +108,6 @@ func projectWorkflowID(t *testing.T, projectID string) string {
func setWorkflowHandoff(t *testing.T, workflowID, statusKey string, body map[string]any) *testutil.Response {
t.Helper()
- withFeatureFlag(t, testHandler, featureflags.ProjectWorkflowsV1, true)
req := withURLParams(workflowRequest("PUT", "/api/issue-workflows/"+workflowID+"/handoffs/"+statusKey, body),
"id", workflowID, "status", statusKey)
return testutil.Call(t, testHandler.SetIssueWorkflowHandoff, req)
@@ -157,12 +153,69 @@ func deliveryProject(t *testing.T, title, agentID string) string {
return projectID
}
-func TestCreateIssueWorkflowRequiresFlag(t *testing.T) {
- withFeatureFlag(t, testHandler, featureflags.ProjectWorkflowsV1, false)
- testutil.Call(t, testHandler.CreateIssueWorkflow, workflowRequest("POST", "/api/issue-workflows", map[string]any{
- "name": "Flag off " + workflowTestSuffix(),
- "steps": statusSteps(),
- })).Want(http.StatusForbidden)
+func TestProjectWorkflowsAvailableWithoutFlag(t *testing.T) {
+ seedTestCatalog(t)
+ resetDefaultWorkflow(t)
+ withFeatureFlag(t, testHandler, "project_workflows_v1", false)
+
+ var list struct {
+ Workflows []IssueWorkflowResponse `json:"workflows"`
+ }
+ testutil.Call(t, testHandler.ListIssueWorkflows, workflowRequest("GET", "/api/issue-workflows", nil)).Want(http.StatusOK).JSON(&list)
+ if len(list.Workflows) == 0 || !list.Workflows[0].IsDefault {
+ t.Fatalf("list = %+v, want Default without feature flag configuration", list.Workflows)
+ }
+
+ wf := createTestWorkflow(t, "Available "+workflowTestSuffix(), "in_progress")
+ projectID := createWorkflowTestProject(t, "Workflow available project")
+ setProjectWorkflow(t, projectID, map[string]any{"workflow_id": wf.ID}).Want(http.StatusOK)
+ agentID := seededReadyAgentID(t)
+ setWorkflowHandoff(t, wf.ID, "in_progress", handToAgent(agentID, "")).Want(http.StatusOK)
+
+ var project ProjectResponse
+ testutil.Call(t, testHandler.CreateProject, workflowRequest("POST", "/api/projects", map[string]any{
+ "title": "Created with workflow", "workflow_id": wf.ID,
+ })).Want(http.StatusCreated).JSON(&project)
+ t.Cleanup(func() {
+ testPool.Exec(context.Background(), `DELETE FROM project WHERE id = $1`, project.ID)
+ })
+ if project.WorkflowID == nil || *project.WorkflowID != wf.ID {
+ t.Fatalf("workflow_id = %v, want %s", project.WorkflowID, wf.ID)
+ }
+}
+
+func TestProjectWorkflowsKeepWorkspaceIsolation(t *testing.T) {
+ seedTestCatalog(t)
+ resetDefaultWorkflow(t)
+ wf := createTestWorkflow(t, "Isolated "+workflowTestSuffix(), "in_progress")
+ projectID := createWorkflowTestProject(t, "Isolated workflow project")
+ outsiderID := dbfx.User(t, "Workflow outsider", "workflow-outsider-"+workflowTestSuffix()+"@example.com")
+ for _, method := range []string{http.MethodGet, http.MethodPost} {
+ req := workflowRequest(method, "/api/issue-workflows", map[string]any{"name": "Unauthorized", "steps": statusSteps()})
+ req.Header.Set("X-User-ID", outsiderID)
+ if method == http.MethodGet {
+ testutil.Call(t, testHandler.ListIssueWorkflows, req).Want(http.StatusNotFound)
+ } else {
+ testutil.Call(t, testHandler.CreateIssueWorkflow, req).Want(http.StatusNotFound)
+ }
+ }
+
+ otherWorkspaceID := dbfx.Workspace(t, "Other workflow workspace", "wf-isolated-"+workflowTestSuffix())
+ dbfx.Member(t, otherWorkspaceID, testUserID, "owner")
+ otherRequest := func(method, path string, body any) *http.Request {
+ req := newRequest(method, path, body)
+ req.Header.Set("X-Workspace-ID", otherWorkspaceID)
+ return req
+ }
+ get := withURLParam(otherRequest("GET", "/api/issue-workflows/"+wf.ID, nil), "id", wf.ID)
+ testutil.Call(t, testHandler.GetIssueWorkflow, get).Want(http.StatusNotFound)
+ switchReq := withURLParam(otherRequest("POST", "/api/projects/"+projectID+"/workflow", map[string]any{"workflow_id": wf.ID}), "id", projectID)
+ testutil.Call(t, testHandler.SetProjectWorkflow, switchReq).Want(http.StatusNotFound)
+ handoff := withURLParams(otherRequest("PUT", "/api/issue-workflows/"+wf.ID+"/handoffs/in_progress", map[string]any{"handler": map[string]any{"type": "none"}}), "id", wf.ID, "status", "in_progress")
+ testutil.Call(t, testHandler.SetIssueWorkflowHandoff, handoff).Want(http.StatusNotFound)
+ testutil.Call(t, testHandler.CreateProject, otherRequest("POST", "/api/projects", map[string]any{
+ "title": "Cross-workspace workflow", "workflow_id": wf.ID,
+ })).Want(http.StatusBadRequest)
}
func TestCreateIssueWorkflowPlacesFixedStatusesAndValidates(t *testing.T) {
@@ -197,7 +250,6 @@ func TestCreateIssueWorkflowCreatesNewStatusesOutsideDefault(t *testing.T) {
seedTestCatalog(t)
resetDefaultWorkflow(t)
statusName := "Spec " + workflowTestSuffix()[10:]
- withFeatureFlag(t, testHandler, featureflags.ProjectWorkflowsV1, true)
var created IssueWorkflowResponse
testutil.Call(t, testHandler.CreateIssueWorkflow, workflowRequest("POST", "/api/issue-workflows", map[string]any{
"name": "Template " + workflowTestSuffix(),
@@ -236,7 +288,6 @@ func lookupStatusName(t *testing.T, key string) string {
func TestDefaultWorkflowIsEditableButNotDeletable(t *testing.T) {
seedTestCatalog(t)
resetDefaultWorkflow(t)
- withFeatureFlag(t, testHandler, featureflags.ProjectWorkflowsV1, true)
var list struct {
Workflows []IssueWorkflowResponse `json:"workflows"`
}
@@ -314,8 +365,7 @@ func TestSetProjectWorkflowMapsOnlyUnlistedStatuses(t *testing.T) {
t.Fatalf("a workflow switch handed the issue off (assignee type %q)", assigneeType)
}
- // Switching back to Default needs no mapping and works with the flag off.
- withFeatureFlag(t, testHandler, featureflags.ProjectWorkflowsV1, false)
+ // Switching back to Default needs no mapping.
setProjectWorkflow(t, projectID, map[string]any{"workflow_id": nil}).Want(http.StatusOK)
}
@@ -445,7 +495,6 @@ func addWorkflowTestMember(t *testing.T, label string) (string, func(*http.Reque
func TestWorkflowOwnerPermissions(t *testing.T) {
seedTestCatalog(t)
agentID := seededReadyAgentID(t)
- withFeatureFlag(t, testHandler, featureflags.ProjectWorkflowsV1, true)
ownerID, asOwner := addWorkflowTestMember(t, "owner")
_, asOther := addWorkflowTestMember(t, "other")
@@ -674,7 +723,6 @@ func TestMoveIntoWorkflowProjectKeepsEquivalentStatusWithoutHandoff(t *testing.T
func TestWorkflowHandoffCopyForProject(t *testing.T) {
seedTestCatalog(t)
agentID := seededReadyAgentID(t)
- withFeatureFlag(t, testHandler, featureflags.ProjectWorkflowsV1, true)
wf := createTestWorkflow(t, "Shared "+workflowTestSuffix(), "in_progress")
mine := createWorkflowTestProject(t, "Workflow copy mine")
theirs := createWorkflowTestProject(t, "Workflow copy theirs")
diff --git a/server/internal/handler/project.go b/server/internal/handler/project.go
index accfb0ce8a..4739de5916 100644
--- a/server/internal/handler/project.go
+++ b/server/internal/handler/project.go
@@ -310,9 +310,6 @@ func (h *Handler) CreateProject(w http.ResponseWriter, r *http.Request) {
}
var workflowID pgtype.UUID
if req.WorkflowID != nil && *req.WorkflowID != "" {
- if !h.requireProjectWorkflowsV1(w, r) {
- return
- }
id, ok := parseUUIDOrBadRequest(w, *req.WorkflowID, "workflow_id")
if !ok {
return