feat(cli,webapp): default new projects to node-24 (#4649)
This commit is contained in:
@@ -113,6 +113,7 @@ export async function createProject(
|
||||
// for historical rows; the V1->V2 upgrade guards on worker-register / deploy
|
||||
// stay in place to migrate existing legacy projects.
|
||||
engine: "V2",
|
||||
defaultRuntime: "node-24",
|
||||
onboardingData,
|
||||
},
|
||||
include: {
|
||||
|
||||
@@ -6,6 +6,7 @@ import { controlPlaneResolver } from "~/v3/runOpsMigration/controlPlaneResolver.
|
||||
import { logger } from "~/services/logger.server";
|
||||
import { getUsername } from "~/utils/username";
|
||||
import { hashApiKey } from "~/utils/apiKeys";
|
||||
import { BuildRuntime } from "@trigger.dev/core/v3";
|
||||
import { isAdditionalApiKey } from "@trigger.dev/core/v3/apiKeys";
|
||||
import { isDefaultDevBranch, sanitizeBranchName } from "@trigger.dev/core/v3/utils/gitBranch";
|
||||
import { scopesGrantFullAccess } from "@trigger.dev/rbac";
|
||||
@@ -77,6 +78,7 @@ export function toAuthenticated(
|
||||
defaultWorkerGroupId: env.project.defaultWorkerGroupId,
|
||||
organizationId: env.project.organizationId,
|
||||
builderProjectId: env.project.builderProjectId,
|
||||
defaultRuntime: BuildRuntime.nullable().safeParse(env.project.defaultRuntime).data ?? null,
|
||||
},
|
||||
organization: {
|
||||
id: env.organization.id,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { json, type LoaderFunctionArgs } from "@remix-run/server-runtime";
|
||||
import { type GetProjectEnvResponse } from "@trigger.dev/core/v3";
|
||||
import { BuildRuntime, type GetProjectEnvResponse } from "@trigger.dev/core/v3";
|
||||
import { z } from "zod";
|
||||
import { env as processEnv } from "~/env.server";
|
||||
import {
|
||||
@@ -65,6 +65,8 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
|
||||
name: environment.project.name,
|
||||
apiUrl: processEnv.API_ORIGIN ?? processEnv.APP_ORIGIN,
|
||||
projectId: environment.project.id,
|
||||
defaultRuntime:
|
||||
BuildRuntime.nullable().safeParse(environment.project.defaultRuntime ?? null).data ?? null,
|
||||
};
|
||||
|
||||
return json(result);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { json } from "@remix-run/server-runtime";
|
||||
import type { GetProjectResponseBody } from "@trigger.dev/core/v3";
|
||||
import { BuildRuntime, type GetProjectResponseBody } from "@trigger.dev/core/v3";
|
||||
import { z } from "zod";
|
||||
import { prisma } from "~/db.server";
|
||||
import { DeleteProjectService } from "~/services/deleteProject.server";
|
||||
@@ -53,6 +53,8 @@ export const loader = createLoaderPATApiRoute(
|
||||
slug: project.slug,
|
||||
createdAt: project.createdAt,
|
||||
defaultRegion: project.defaultWorkerGroup?.name ?? null,
|
||||
defaultRuntime:
|
||||
BuildRuntime.nullable().safeParse(project.defaultRuntime ?? null).data ?? null,
|
||||
organization: {
|
||||
id: project.organization.id,
|
||||
title: project.organization.title,
|
||||
|
||||
@@ -253,7 +253,7 @@ export class InitializeDeploymentService extends BaseService {
|
||||
imagePlatform: env.DEPLOY_IMAGE_PLATFORM,
|
||||
git: payload.gitMeta ?? undefined,
|
||||
commitSHA: payload.gitMeta?.commitSha ?? undefined,
|
||||
runtime: payload.runtime ?? undefined,
|
||||
runtime: payload.runtime ?? environment.project.defaultRuntime ?? undefined,
|
||||
triggeredVia: payload.triggeredVia ?? undefined,
|
||||
startedAt: initialStatus === "BUILDING" ? new Date() : undefined,
|
||||
};
|
||||
|
||||
@@ -37,6 +37,7 @@ const environment = {
|
||||
project: {
|
||||
id: "proj_123",
|
||||
name: "Example project",
|
||||
defaultRuntime: "node-24",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -82,6 +83,7 @@ describe("project environment credential response", () => {
|
||||
await expect(responseJson(response)).resolves.toMatchObject({
|
||||
apiKey: "tr_prod_sk_presented",
|
||||
projectId: "proj_123",
|
||||
defaultRuntime: "node-24",
|
||||
});
|
||||
expect(mocks.authorizePatEnvironmentAccess).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user