-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(vercel): Flow to support Vercel's template deployment #3229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,8 @@ import { parse } from "@conform-to/zod"; | |
| import { CheckCircleIcon, LockClosedIcon, PlusIcon } from "@heroicons/react/20/solid"; | ||
| import { Form, useActionData, useNavigation, useNavigate, useSearchParams, useLocation } from "@remix-run/react"; | ||
| import { type ActionFunctionArgs, type LoaderFunctionArgs, json } from "@remix-run/server-runtime"; | ||
| import { typedjson, useTypedFetcher } from "remix-typedjson"; | ||
| import { redirect, | ||
| typedjson, useTypedFetcher } from "remix-typedjson"; | ||
| import { z } from "zod"; | ||
| import { OctoKitty } from "~/components/GitHubLoginButton"; | ||
| import { Dialog, DialogContent, DialogHeader, DialogTrigger } from "~/components/primitives/Dialog"; | ||
|
|
@@ -39,6 +40,7 @@ import { findProjectBySlug } from "~/models/project.server"; | |
| import { findEnvironmentBySlug } from "~/models/runtimeEnvironment.server"; | ||
| import { ProjectSettingsService } from "~/services/projectSettings.server"; | ||
| import { logger } from "~/services/logger.server"; | ||
| import { triggerInitialDeployment } from "~/services/platform.v3.server"; | ||
| import { requireUserId } from "~/services/session.server"; | ||
| import { | ||
| githubAppInstallPath, | ||
|
|
@@ -208,6 +210,18 @@ export async function action({ request, params }: ActionFunctionArgs) { | |
| ); | ||
|
|
||
| if (resultOrFail.isOk()) { | ||
| // Trigger initial deployment for marketplace flows now that GitHub is connected | ||
| if (redirectUrl) { | ||
| try { | ||
| if (redirectUrl.includes("origin=marketplace")) { | ||
| await triggerInitialDeployment(projectId, { environment: "prod" }); | ||
| } | ||
| } catch (error) { | ||
| logger.error("Invalid redirect URL, skipping initial deployment trigger", { redirectUrl, error }); | ||
| // Invalid redirectUrl, skip initial deployment check | ||
| } | ||
| } | ||
|
Comment on lines
+213
to
+223
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fragile origin detection and conflated error handling. Two concerns with this implementation:
🔧 Proposed fix for robust origin detection // Trigger initial deployment for marketplace flows now that GitHub is connected
if (redirectUrl) {
try {
- if (redirectUrl.includes("origin=marketplace")) {
+ const redirectUrlParams = new URL(redirectUrl, "http://placeholder").searchParams;
+ if (redirectUrlParams.get("origin") === "marketplace") {
await triggerInitialDeployment(projectId, { environment: "prod" });
}
} catch (error) {
- logger.error("Invalid redirect URL, skipping initial deployment trigger", { redirectUrl, error });
- // Invalid redirectUrl, skip initial deployment check
+ logger.warn("Failed to trigger initial deployment for marketplace flow", { redirectUrl, error });
}
}🤖 Prompt for AI Agents |
||
|
|
||
| return redirectWithMessage( | ||
| request, | ||
| redirectUrl, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 51
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 172
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 96
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 115
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 3842
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 4799
🏁 Script executed:
# Read the platform.v3.server.ts file to find the function definition cat -n apps/webapp/app/services/platform.v3.server.tsRepository: triggerdotdev/trigger.dev
Length of output: 23536
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 51
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 1031
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 2200
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 4474
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 96
🏁 Script executed:
Repository: triggerdotdev/trigger.dev
Length of output: 31210
Remove non-existent import:
triggerInitialDeploymentis not exported fromplatform.v3.server.ts.The function
triggerInitialDeploymentimported on line 43 does not exist in~/services/platform.v3.server.ts. This will cause a runtime error. Replace with the correct initialization service:InitializeDeploymentServicefrom~/v3/services/initializeDeployment.server.tsor verify the correct function name and location.🤖 Prompt for AI Agents