Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: disallow background migrations on langfuse cloud (#9027)

Max Deichmann217ae648d65b
diff --git a/web/src/features/background-migrations/server/background-migrations-router.ts b/web/src/features/background-migrations/server/background-migrations-router.ts
index e15f2398fb..52febe3107 100644
--- a/web/src/features/background-migrations/server/background-migrations-router.ts
+++ b/web/src/features/background-migrations/server/background-migrations-router.ts
@@ -4,9 +4,20 @@ import {
authenticatedProcedure,
} from "@/src/server/api/trpc";
import { TRPCError } from "@trpc/server";
+import { env } from "@/src/env.mjs";
+
+const denyOnLangfuseCloud = () => {
+ if (env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION) {
+ throw new TRPCError({
+ code: "FORBIDDEN",
+ message: "Background migrations are not available in Langfuse Cloud",
+ });
+ }
+};
export const backgroundMigrationsRouter = createTRPCRouter({
all: authenticatedProcedure.query(async ({ ctx }) => {
+ denyOnLangfuseCloud();
const backgroundMigrations = await ctx.prisma.backgroundMigration.findMany({
orderBy: {
name: "asc",
@@ -16,6 +27,7 @@ export const backgroundMigrationsRouter = createTRPCRouter({
return { migrations: backgroundMigrations };
}),
status: authenticatedProcedure.query(async ({ ctx }) => {
+ denyOnLangfuseCloud();
const backgroundMigrations = await ctx.prisma.backgroundMigration.findMany({
orderBy: {
name: "asc",
@@ -39,6 +51,8 @@ export const backgroundMigrationsRouter = createTRPCRouter({
retry: authenticatedProcedure
.input(z.object({ name: z.string() }))
.mutation(async ({ input, ctx }) => {
+ denyOnLangfuseCloud();
+
const backgroundMigration =
await ctx.prisma.backgroundMigration.findUnique({
where: {