Skip to content

Commit fcd467e

Browse files
committed
add runtime and version to deployments
1 parent 01ef5b2 commit fcd467e

File tree

20 files changed

+82
-9
lines changed

20 files changed

+82
-9
lines changed

apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ export class DeploymentListPresenter {
9797
id: string;
9898
shortCode: string;
9999
version: string;
100+
runtime: string | null;
101+
runtimeVersion: string | null;
100102
status: WorkerDeploymentStatus;
101103
environmentId: string;
102104
builtAt: Date | null;
@@ -114,6 +116,8 @@ export class DeploymentListPresenter {
114116
wd."id",
115117
wd."shortCode",
116118
wd."version",
119+
wd."runtime",
120+
wd."runtimeVersion",
117121
(SELECT COUNT(*) FROM ${sqlDatabaseSchema}."BackgroundWorkerTask" WHERE "BackgroundWorkerTask"."workerId" = wd."workerId") AS "tasksCount",
118122
wd."environmentId",
119123
wd."status",
@@ -148,6 +152,8 @@ LIMIT ${pageSize} OFFSET ${pageSize * (page - 1)};`;
148152
id: deployment.id,
149153
shortCode: deployment.shortCode,
150154
version: deployment.version,
155+
runtime: deployment.runtime,
156+
runtimeVersion: deployment.runtimeVersion,
151157
status: deployment.status,
152158
builtAt: deployment.builtAt,
153159
deployedAt: deployment.deployedAt,

apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ export class DeploymentPresenter {
7272
id: true,
7373
shortCode: true,
7474
version: true,
75+
runtime: true,
76+
runtimeVersion: true,
7577
errorData: true,
7678
imageReference: true,
7779
imagePlatform: true,
@@ -157,6 +159,8 @@ export class DeploymentPresenter {
157159
deployedBy: deployment.triggeredBy,
158160
sdkVersion: deployment.worker?.sdkVersion,
159161
cliVersion: deployment.worker?.cliVersion,
162+
runtime: deployment.runtime,
163+
runtimeVersion: deployment.runtimeVersion,
160164
imageReference: deployment.imageReference,
161165
imagePlatform: deployment.imagePlatform,
162166
externalBuildData:

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,21 @@ export default function Page() {
169169
{deployment.cliVersion ? deployment.cliVersion : "–"}
170170
</Property.Value>
171171
</Property.Item>
172+
<Property.Item>
173+
<Property.Label>Runtime</Property.Label>
174+
<Property.Value>
175+
{deployment.runtime ? (
176+
<>
177+
{deployment.runtime}
178+
{deployment.runtimeVersion && (
179+
<span className="ml-1 text-text-dimmed">v{deployment.runtimeVersion}</span>
180+
)}
181+
</>
182+
) : (
183+
"–"
184+
)}
185+
</Property.Value>
186+
</Property.Item>
172187
<Property.Item>
173188
<Property.Label>Worker type</Property.Label>
174189
<Property.Value>{capitalizeWord(deployment.type)}</Property.Value>

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments/route.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export default function Page() {
166166
<TableRow>
167167
<TableHeaderCell>Deploy</TableHeaderCell>
168168
<TableHeaderCell>Version</TableHeaderCell>
169+
<TableHeaderCell>Runtime</TableHeaderCell>
169170
<TableHeaderCell
170171
tooltip={
171172
<div className="flex flex-col divide-y divide-grid-dimmed">
@@ -221,6 +222,20 @@ export default function Page() {
221222
<TableCell to={path} isSelected={isSelected}>
222223
{deployment.version}
223224
</TableCell>
225+
<TableCell to={path} isSelected={isSelected}>
226+
{deployment.runtime ? (
227+
<>
228+
{deployment.runtime}
229+
{deployment.runtimeVersion && (
230+
<span className="ml-1 text-text-dimmed">
231+
v{deployment.runtimeVersion}
232+
</span>
233+
)}
234+
</>
235+
) : (
236+
"–"
237+
)}
238+
</TableCell>
224239
<TableCell to={path} isSelected={isSelected}>
225240
<DeploymentStatus
226241
status={deployment.status}
@@ -272,7 +287,7 @@ export default function Page() {
272287
);
273288
})
274289
) : (
275-
<TableBlankRow colSpan={7}>
290+
<TableBlankRow colSpan={8}>
276291
<Paragraph className="flex items-center justify-center">
277292
No deploys match your filters
278293
</Paragraph>

apps/webapp/app/v3/services/createDeploymentBackgroundWorkerV4.server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ export class CreateDeploymentBackgroundWorkerServiceV4 extends BaseService {
160160
workerId: backgroundWorker.id,
161161
builtAt: new Date(),
162162
type: backgroundWorker.engine === "V2" ? "MANAGED" : "V1",
163+
// runtime is already set when the deployment is created, we only need to set the version
164+
runtimeVersion: body.metadata.runtimeVersion,
163165
},
164166
});
165167

apps/webapp/app/v3/services/initializeDeployment.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export class InitializeDeploymentService extends BaseService {
124124
imageReference: imageRef,
125125
imagePlatform: env.DEPLOY_IMAGE_PLATFORM,
126126
git: payload.gitMeta ?? undefined,
127+
runtime: payload.runtime ?? undefined,
127128
},
128129
});
129130

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "WorkerDeployment" ADD COLUMN "runtime" TEXT;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "WorkerDeployment" ADD COLUMN "runtimeVersion" TEXT;

internal-packages/database/prisma/schema.prisma

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,9 @@ model WorkerDeployment {
16451645
shortCode String
16461646
version String
16471647
1648+
runtime String?
1649+
runtimeVersion String?
1650+
16481651
imageReference String?
16491652
imagePlatform String @default("linux/amd64")
16501653

packages/cli-v3/src/commands/deploy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ async function _deployCommand(dir: string, options: DeployCommandOptions) {
311311
userId: authorization.userId,
312312
gitMeta,
313313
type: features.run_engine_v2 ? "MANAGED" : "V1",
314+
runtime: buildManifest.runtime,
314315
});
315316

316317
if (!deploymentResponse.success) {

0 commit comments

Comments
 (0)