Skip to content

Commit 9d01c88

Browse files
committed
WIP stripping right back to waitpoints just having a URL associated with them…
1 parent d8c76ee commit 9d01c88

File tree

23 files changed

+60
-762
lines changed

23 files changed

+60
-762
lines changed

apps/webapp/app/assets/icons/HttpCallbackIcon.tsx

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

apps/webapp/app/components/BlankStatePanels.tsx

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import { TextLink } from "./primitives/TextLink";
3636
import { InitCommandV3, PackageManagerProvider, TriggerDevStepV3 } from "./SetupCommands";
3737
import { StepContentContainer } from "./StepContentContainer";
3838
import { WaitpointTokenIcon } from "~/assets/icons/WaitpointTokenIcon";
39-
import { HttpCallbackIcon } from "~/assets/icons/HttpCallbackIcon";
4039

4140
export function HasNoTasksDev() {
4241
return (
@@ -432,33 +431,6 @@ export function NoWaitpointTokens() {
432431
);
433432
}
434433

435-
export function NoHttpCallbacks() {
436-
return (
437-
<InfoPanel
438-
title="You don't have any HTTP callbacks"
439-
icon={HttpCallbackIcon}
440-
iconClassName="text-teal-500"
441-
panelClassName="max-w-md"
442-
accessory={
443-
<LinkButton
444-
to={docsPath("wait-for-http-callback")}
445-
variant="docs/small"
446-
LeadingIcon={BookOpenIcon}
447-
>
448-
Waitpoint docs
449-
</LinkButton>
450-
}
451-
>
452-
<Paragraph spacing variant="small">
453-
HTTP callbacks are used to pause runs until an HTTP request is made to a provided URL.
454-
</Paragraph>
455-
<Paragraph spacing variant="small">
456-
They are useful when using APIs that provide a callback URL. You can send the URL to them
457-
and when they callback your run will continue.
458-
</Paragraph>
459-
</InfoPanel>
460-
);
461-
}
462434
function SwitcherPanel() {
463435
const organization = useOrganization();
464436
const project = useProject();

apps/webapp/app/components/navigation/SideMenu.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ import {
5454
v3SchedulesPath,
5555
v3TestPath,
5656
v3UsagePath,
57-
v3WaitpointHttpCallbacksPath,
5857
v3WaitpointTokensPath,
5958
} from "~/utils/pathBuilder";
6059
import { useKapaWidget } from "../../hooks/useKapaWidget";
@@ -247,12 +246,6 @@ export function SideMenu({
247246
activeIconColor="text-sky-500"
248247
to={v3WaitpointTokensPath(organization, project, environment)}
249248
/>
250-
<SideMenuItem
251-
name="HTTP callbacks"
252-
icon={HttpCallbackIcon}
253-
activeIconColor="text-teal-500"
254-
to={v3WaitpointHttpCallbacksPath(organization, project, environment)}
255-
/>
256249
</SideMenuSection>
257250

258251
<SideMenuSection title="Manage">

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { FunctionIcon } from "~/assets/icons/FunctionIcon";
1919
import { TriggerIcon } from "~/assets/icons/TriggerIcon";
2020
import { PythonLogoIcon } from "~/assets/icons/PythonLogoIcon";
2121
import { TraceIcon } from "~/assets/icons/TraceIcon";
22-
import { HttpCallbackIcon } from "~/assets/icons/HttpCallbackIcon";
2322
import { WaitpointTokenIcon } from "~/assets/icons/WaitpointTokenIcon";
2423

2524
type TaskIconProps = {
@@ -77,8 +76,6 @@ export function RunIcon({ name, className, spanName }: TaskIconProps) {
7776
return <TriggerIcon className={cn(className, "text-orange-500")} />;
7877
case "python":
7978
return <PythonLogoIcon className={className} />;
80-
case "wait-http-callback":
81-
return <HttpCallbackIcon className={cn(className, "text-teal-500")} />;
8279
case "wait-token":
8380
return <WaitpointTokenIcon className={cn(className, "text-sky-500")} />;
8481
case "function":

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

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,11 @@ import { useOrganization } from "~/hooks/useOrganizations";
77
import { useProject } from "~/hooks/useProject";
88
import { type WaitpointDetail } from "~/presenters/v3/WaitpointPresenter.server";
99
import { ForceTimeout } from "~/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.$waitpointFriendlyId.complete/route";
10-
import {
11-
v3WaitpointHttpCallbackPath,
12-
v3WaitpointTokenPath,
13-
v3WaitpointTokensPath,
14-
} from "~/utils/pathBuilder";
10+
import { v3WaitpointTokenPath, v3WaitpointTokensPath } from "~/utils/pathBuilder";
1511
import { PacketDisplay } from "./PacketDisplay";
1612
import { WaitpointStatusCombo } from "./WaitpointStatus";
1713
import { RunTag } from "./RunTag";
18-
import { CopyableText } from "~/components/primitives/CopyableText";
1914
import { ClipboardField } from "~/components/primitives/ClipboardField";
20-
import { WaitpointResolver } from "@trigger.dev/database";
21-
import { WaitpointTokenIcon } from "~/assets/icons/WaitpointTokenIcon";
22-
import { HttpCallbackIcon } from "~/assets/icons/HttpCallbackIcon";
2315

2416
export function WaitpointDetailTable({
2517
waitpoint,
@@ -48,15 +40,9 @@ export function WaitpointDetailTable({
4840
<Property.Value className="whitespace-pre-wrap">
4941
{linkToList ? (
5042
<TextLink
51-
to={
52-
waitpoint.resolver === "TOKEN"
53-
? v3WaitpointTokenPath(organization, project, environment, waitpoint, {
54-
id: waitpoint.id,
55-
})
56-
: v3WaitpointHttpCallbackPath(organization, project, environment, waitpoint, {
57-
id: waitpoint.id,
58-
})
59-
}
43+
to={v3WaitpointTokenPath(organization, project, environment, waitpoint, {
44+
id: waitpoint.id,
45+
})}
6046
>
6147
{waitpoint.id}
6248
</TextLink>
@@ -66,19 +52,11 @@ export function WaitpointDetailTable({
6652
</Property.Value>
6753
</Property.Item>
6854
<Property.Item>
69-
<Property.Label>Type</Property.Label>
70-
<Property.Value>
71-
<WaitpointResolverCombo resolver={waitpoint.resolver} />
55+
<Property.Label>Callback URL</Property.Label>
56+
<Property.Value className="my-1">
57+
<ClipboardField value={waitpoint.callbackUrl} variant={"secondary/small"} />
7258
</Property.Value>
7359
</Property.Item>
74-
{waitpoint.callbackUrl && (
75-
<Property.Item>
76-
<Property.Label>Callback URL</Property.Label>
77-
<Property.Value className="my-1">
78-
<ClipboardField value={waitpoint.callbackUrl} variant={"secondary/small"} />
79-
</Property.Value>
80-
</Property.Item>
81-
)}
8260
<Property.Item>
8361
<Property.Label>Idempotency key</Property.Label>
8462
<Property.Value>
@@ -157,22 +135,3 @@ export function WaitpointDetailTable({
157135
</Property.Table>
158136
);
159137
}
160-
161-
export function WaitpointResolverCombo({ resolver }: { resolver: WaitpointResolver }) {
162-
switch (resolver) {
163-
case "TOKEN":
164-
return (
165-
<div className="flex items-center gap-1">
166-
<WaitpointTokenIcon className="size-4" />
167-
<span>Token</span>
168-
</div>
169-
);
170-
case "HTTP_CALLBACK":
171-
return (
172-
<div className="flex items-center gap-1">
173-
<HttpCallbackIcon className="size-4" />
174-
<span>HTTP Callback</span>
175-
</div>
176-
);
177-
}
178-
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,11 @@ export class ApiWaitpointListPresenter extends BasePresenter {
7070
};
7171
apiKey: string;
7272
},
73-
resolver: WaitpointResolver,
7473
searchParams: ApiWaitpointListSearchParams
7574
) {
7675
return this.trace("call", async (span) => {
7776
const options: WaitpointListOptions = {
7877
environment,
79-
resolver,
8078
};
8179

8280
if (searchParams["page[size]"]) {

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export type WaitpointListOptions = {
2626
};
2727
apiKey: string;
2828
};
29-
resolver: WaitpointResolver;
3029
// filters
3130
id?: string;
3231
statuses?: WaitpointTokenStatus[];
@@ -70,7 +69,6 @@ type Result =
7069
export class WaitpointListPresenter extends BasePresenter {
7170
public async call({
7271
environment,
73-
resolver,
7472
id,
7573
statuses,
7674
idempotencyKey,
@@ -170,8 +168,8 @@ export class WaitpointListPresenter extends BasePresenter {
170168
${sqlDatabaseSchema}."Waitpoint" w
171169
WHERE
172170
w."environmentId" = ${environment.id}
173-
AND w.resolver = ${resolver}::"WaitpointResolver"
174-
-- cursor
171+
AND w.type = 'MANUAL'
172+
-- cursor
175173
${
176174
cursor
177175
? direction === "forward"
@@ -255,7 +253,7 @@ export class WaitpointListPresenter extends BasePresenter {
255253
const firstToken = await this._replica.waitpoint.findFirst({
256254
where: {
257255
environmentId: environment.id,
258-
resolver,
256+
type: "MANUAL",
259257
},
260258
});
261259

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export class WaitpointPresenter extends BasePresenter {
3939
completedAfter: true,
4040
completedAt: true,
4141
createdAt: true,
42-
resolver: true,
4342
connectedRuns: {
4443
select: {
4544
friendlyId: true,
@@ -93,11 +92,7 @@ export class WaitpointPresenter extends BasePresenter {
9392
return {
9493
id: waitpoint.friendlyId,
9594
type: waitpoint.type,
96-
resolver: waitpoint.resolver,
97-
callbackUrl:
98-
waitpoint.resolver === "HTTP_CALLBACK"
99-
? generateHttpCallbackUrl(waitpoint.id, waitpoint.environment.apiKey)
100-
: undefined,
95+
callbackUrl: generateHttpCallbackUrl(waitpoint.id, waitpoint.environment.apiKey),
10196
status: waitpointStatusToApiStatus(waitpoint.status, waitpoint.outputIsError),
10297
idempotencyKey: waitpoint.idempotencyKey,
10398
userProvidedIdempotencyKey: waitpoint.userProvidedIdempotencyKey,

0 commit comments

Comments
 (0)