Skip to content

Commit 04e673f

Browse files
authored
Merge branch 'main' into feat/mcp-server-disable-readonly-options
2 parents 180e506 + 59df4af commit 04e673f

File tree

24 files changed

+682
-229
lines changed

24 files changed

+682
-229
lines changed

.changeset/kind-kids-teach.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
Added INSTALLING status to the deployment status enum.

apps/webapp/app/components/runs/v3/DeploymentStatus.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function DeploymentStatusIcon({
5353
return (
5454
<RectangleStackIcon className={cn(deploymentStatusClassNameColor(status), className)} />
5555
);
56+
case "INSTALLING":
5657
case "BUILDING":
5758
case "DEPLOYING":
5859
return <Spinner className={cn(deploymentStatusClassNameColor(status), className)} />;
@@ -78,6 +79,7 @@ export function deploymentStatusClassNameColor(status: WorkerDeploymentStatus):
7879
switch (status) {
7980
case "PENDING":
8081
return "text-charcoal-500";
82+
case "INSTALLING":
8183
case "BUILDING":
8284
case "DEPLOYING":
8385
return "text-pending";
@@ -98,6 +100,8 @@ export function deploymentStatusTitle(status: WorkerDeploymentStatus, isBuilt: b
98100
switch (status) {
99101
case "PENDING":
100102
return "Queued…";
103+
case "INSTALLING":
104+
return "Installing…";
101105
case "BUILDING":
102106
return "Building…";
103107
case "DEPLOYING":
@@ -127,17 +131,21 @@ export function deploymentStatusTitle(status: WorkerDeploymentStatus, isBuilt: b
127131
// PENDING and CANCELED are not used so are ommited from the UI
128132
export const deploymentStatuses: WorkerDeploymentStatus[] = [
129133
"PENDING",
134+
"INSTALLING",
130135
"BUILDING",
131136
"DEPLOYING",
132137
"DEPLOYED",
133138
"FAILED",
134139
"TIMED_OUT",
140+
"CANCELED",
135141
];
136142

137143
export function deploymentStatusDescription(status: WorkerDeploymentStatus): string {
138144
switch (status) {
139145
case "PENDING":
140146
return "The deployment is queued and waiting to be processed.";
147+
case "INSTALLING":
148+
return "The project dependencies are being installed.";
141149
case "BUILDING":
142150
return "The code is being built and prepared for deployment.";
143151
case "DEPLOYING":

apps/webapp/app/components/runs/v3/RollbackDeploymentDialog.tsx

Lines changed: 0 additions & 102 deletions
This file was deleted.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ export class DeploymentPresenter {
103103
deployedAt: true,
104104
createdAt: true,
105105
startedAt: true,
106+
installedAt: true,
107+
canceledAt: true,
108+
canceledReason: true,
106109
git: true,
107110
promotions: {
108111
select: {
@@ -147,8 +150,11 @@ export class DeploymentPresenter {
147150
status: deployment.status,
148151
createdAt: deployment.createdAt,
149152
startedAt: deployment.startedAt,
153+
installedAt: deployment.installedAt,
150154
builtAt: deployment.builtAt,
151155
deployedAt: deployment.deployedAt,
156+
canceledAt: deployment.canceledAt,
157+
canceledReason: deployment.canceledReason,
152158
tasks: deployment.worker?.tasks,
153159
label: deployment.promotions?.[0]?.label,
154160
environment: {

apps/webapp/app/routes/_app.github.callback/route.tsx

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
import { type LoaderFunctionArgs, redirect } from "@remix-run/node";
1+
import { type LoaderFunctionArgs } from "@remix-run/node";
22
import { z } from "zod";
33
import { validateGitHubAppInstallSession } from "~/services/gitHubSession.server";
44
import { linkGitHubAppInstallation, updateGitHubAppInstallation } from "~/services/gitHub.server";
55
import { logger } from "~/services/logger.server";
6-
import {
7-
redirectWithErrorMessage,
8-
setRequestSuccessMessage,
9-
commitSession,
10-
} from "~/models/message.server";
6+
import { redirectWithErrorMessage, redirectWithSuccessMessage } from "~/models/message.server";
117
import { tryCatch } from "@trigger.dev/core";
128
import { $replica } from "~/db.server";
139
import { requireUser } from "~/services/session.server";
@@ -92,14 +88,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
9288
return redirectWithErrorMessage(redirectTo, request, "Failed to install GitHub App");
9389
}
9490

95-
const session = await setRequestSuccessMessage(request, "GitHub App installed successfully");
96-
session.flash("gitHubAppInstalled", true);
97-
98-
return redirect(redirectTo, {
99-
headers: {
100-
"Set-Cookie": await commitSession(session),
101-
},
102-
});
91+
return redirectWithSuccessMessage(redirectTo, request, "GitHub App installed successfully");
10392
}
10493

10594
case "update": {
@@ -112,14 +101,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
112101
return redirectWithErrorMessage(redirectTo, request, "Failed to update GitHub App");
113102
}
114103

115-
const session = await setRequestSuccessMessage(request, "GitHub App updated successfully");
116-
session.flash("gitHubAppInstalled", true);
117-
118-
return redirect(redirectTo, {
119-
headers: {
120-
"Set-Cookie": await commitSession(session),
121-
},
122-
});
104+
return redirectWithSuccessMessage(redirectTo, request, "GitHub App updated successfully");
123105
}
124106

125107
case "request": {
@@ -129,13 +111,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
129111
callbackData,
130112
});
131113

132-
const session = await setRequestSuccessMessage(request, "GitHub App installation requested");
133-
134-
return redirect(redirectTo, {
135-
headers: {
136-
"Set-Cookie": await commitSession(session),
137-
},
138-
});
114+
return redirectWithSuccessMessage(redirectTo, request, "GitHub App installation requested");
139115
}
140116

141117
default:

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,22 @@ export default function Page() {
158158
/>
159159
</Property.Value>
160160
</Property.Item>
161+
{deployment.canceledAt && (
162+
<Property.Item>
163+
<Property.Label>Canceled at</Property.Label>
164+
<Property.Value>
165+
<>
166+
<DateTimeAccurate date={deployment.canceledAt} /> UTC
167+
</>
168+
</Property.Value>
169+
</Property.Item>
170+
)}
171+
{deployment.canceledReason && (
172+
<Property.Item>
173+
<Property.Label>Cancelation reason</Property.Label>
174+
<Property.Value>{deployment.canceledReason}</Property.Value>
175+
</Property.Item>
176+
)}
161177
<Property.Item>
162178
<Property.Label>Tasks</Property.Label>
163179
<Property.Value>{deployment.tasks ? deployment.tasks.length : "–"}</Property.Value>
@@ -200,6 +216,18 @@ export default function Page() {
200216
)}
201217
</Property.Value>
202218
</Property.Item>
219+
<Property.Item>
220+
<Property.Label>Installed at</Property.Label>
221+
<Property.Value>
222+
{deployment.installedAt ? (
223+
<>
224+
<DateTimeAccurate date={deployment.installedAt} /> UTC
225+
</>
226+
) : (
227+
"–"
228+
)}
229+
</Property.Value>
230+
</Property.Item>
203231
<Property.Item>
204232
<Property.Label>Built at</Property.Label>
205233
<Property.Value>

0 commit comments

Comments
 (0)