Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ export function VercelOnboardingModal({
formData.append("atomicBuilds", JSON.stringify(atomicBuilds));
formData.append("discoverEnvVars", JSON.stringify(discoverEnvVars));
formData.append("syncEnvVarsMapping", JSON.stringify(syncEnvVarsMapping));
if (fromMarketplaceContext) {
formData.append("origin", "marketplace");
}
if (nextUrl && fromMarketplaceContext && isGitHubConnectedForOnboarding) {
formData.append("next", nextUrl);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/app/models/vercelIntegration.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ export class VercelIntegrationRepository {
);

if (envVarsResult.isErr()) {
logger.error("pullEnvVarsFromVercel: Failed to get env vars", {
logger.warn("pullEnvVarsFromVercel: Failed to get env vars", {
triggerEnvType: mapping.triggerEnvType,
vercelTarget: mapping.vercelTarget,
error: envVarsResult.error.message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
}

return redirectWithMessage(
request,
redirectUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const CompleteOnboardingFormSchema = z.object({
syncEnvVarsMapping: z.string().optional(),
next: z.string().optional(),
skipRedirect: z.string().optional().transform((val) => val === "true"),
origin: z.string().optional(),
});

const SkipOnboardingFormSchema = z.object({
Expand Down
8 changes: 4 additions & 4 deletions apps/webapp/app/routes/vercel.connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ export async function loader({ request }: LoaderFunctionArgs) {

const parsed = VercelConnectSchema.safeParse(Object.fromEntries(url.searchParams));
if (!parsed.success) {
logger.error("Invalid Vercel connect params", { error: parsed.error });
logger.warn("Invalid Vercel connect params", { error: parsed.error });
throw new Response("Invalid parameters", { status: 400 });
}

const { state, configurationId, code, next, origin } = parsed.data;

const validationResult = await validateVercelOAuthState(state);
if (!validationResult.ok) {
logger.error("Invalid Vercel OAuth state JWT", { error: validationResult.error });
logger.warn("Invalid Vercel OAuth state JWT", { error: validationResult.error });

if (
validationResult.error?.includes("expired") ||
Expand Down Expand Up @@ -109,7 +109,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
});

if (!project) {
logger.error("Project not found or access denied", {
logger.warn("Project not found or access denied", {
projectId: stateData.projectId,
userId,
});
Expand All @@ -132,7 +132,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
});

if (!environment) {
logger.error("Environment not found", {
logger.warn("Environment not found", {
projectId: project.id,
environmentSlug: stateData.environmentSlug,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/app/services/vercelIntegration.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ export class VercelIntegrationService {
});

if (upsertResult.isErr()) {
logger.error("Failed to sync staging TRIGGER_SECRET_KEY to custom environment", {
logger.warn("Failed to sync staging TRIGGER_SECRET_KEY to custom environment", {
projectId,
newCustomEnvironmentId,
error: upsertResult.error.message,
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"@trigger.dev/core": "workspace:*",
"@trigger.dev/database": "workspace:*",
"@trigger.dev/otlp-importer": "workspace:*",
"@trigger.dev/platform": "1.0.24",
"@trigger.dev/platform": "1.0.25",
"@trigger.dev/redis-worker": "workspace:*",
"@trigger.dev/sdk": "workspace:*",
"@types/pg": "8.6.6",
Expand Down
31 changes: 15 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading