Skip to content
Merged
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
6 changes: 3 additions & 3 deletions packages/control-plane/scripts/build-vercel-base-snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "no
import { tmpdir } from "node:os";
import { basename, dirname, join, resolve } from "node:path";

import { buildVercelBaseSnapshot } from "../src/sandbox/vercel-base-snapshot";
import { VERCEL_LOCAL_RUNTIME_EXTRACT_DIR } from "../src/sandbox/vercel-bootstrap";
import { createVercelSandboxClient } from "../src/sandbox/vercel-client";
import { buildVercelBaseSnapshot } from "../src/sandbox/providers/vercel/base-snapshot";
Comment thread
ColeMurray marked this conversation as resolved.
import { VERCEL_LOCAL_RUNTIME_EXTRACT_DIR } from "../src/sandbox/providers/vercel/bootstrap";
import { createVercelSandboxClient } from "../src/sandbox/providers/vercel/client";

function env(name: string, fallback = ""): string {
return process.env[name] || fallback;
Expand Down
4 changes: 2 additions & 2 deletions packages/control-plane/src/routes/repo-images.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { repoImageRoutes } from "./repo-images";
import type { RepoImageProvider } from "../db/repo-images";
import type { Env } from "../types";
import type { RequestContext, Route } from "./shared";
import type * as VercelClientModule from "../sandbox/vercel-client";
import type * as VercelClientModule from "../sandbox/providers/vercel/client";

const vercelClient = vi.hoisted(() => ({
snapshotSession: vi.fn(),
Expand All @@ -15,7 +15,7 @@ const vercelClient = vi.hoisted(() => ({

const VERCEL_CALLBACK_TOKEN = "a".repeat(64);

vi.mock("../sandbox/vercel-client", async (importOriginal) => {
vi.mock("../sandbox/providers/vercel/client", async (importOriginal) => {
const actual = await importOriginal<typeof VercelClientModule>();
return {
...actual,
Expand Down
4 changes: 2 additions & 2 deletions packages/control-plane/src/routes/repo-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { GlobalSecretsStore } from "../db/global-secrets";
import { RepoSecretsStore } from "../db/repo-secrets";
import { mergeSecrets } from "../db/secrets-validation";
import { createModalClient } from "../sandbox/client";
import { createVercelSandboxClient } from "../sandbox/vercel-client";
import { createVercelProvider } from "../sandbox/providers/vercel-provider";
import { createVercelSandboxClient } from "../sandbox/providers/vercel/client";
import { createVercelProvider } from "../sandbox/providers/vercel/provider";
import { resolveSandboxBackendName, supportsRepoImageBackend } from "../sandbox/provider-name";
import { resolveScmProviderFromEnv } from "../source-control";
import { createLogger } from "../logger";
Expand Down
8 changes: 4 additions & 4 deletions packages/control-plane/src/sandbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export {
type VercelProviderConfig,
type TriggerVercelRepoImageBuildConfig,
type TriggerVercelRepoImageBuildResult,
} from "./providers/vercel-provider";
} from "./providers/vercel/provider";
export {
VercelSandboxClient,
VercelSandboxApiError,
Expand All @@ -50,19 +50,19 @@ export {
type VercelCreateSandboxResponse,
type VercelSandboxRoute,
type VercelSandboxSession,
} from "./vercel-client";
} from "./providers/vercel/client";
export {
buildVercelBaseSnapshot,
buildBaseSnapshotSandboxName,
type BuildVercelBaseSnapshotConfig,
type BuildVercelBaseSnapshotResult,
} from "./vercel-base-snapshot";
} from "./providers/vercel/base-snapshot";
export {
DEFAULT_VERCEL_RUNTIME,
VERCEL_LOCAL_RUNTIME_EXTRACT_DIR,
VERCEL_PYTHON_BIN,
buildVercelBootstrapScript,
} from "./vercel-bootstrap";
} from "./providers/vercel/bootstrap";
export {
DaytonaRestClient,
DaytonaNotFoundError,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { describe, expect, it, vi } from "vitest";
import { buildBaseSnapshotSandboxName, buildVercelBaseSnapshot } from "./vercel-base-snapshot";
import { buildBaseSnapshotSandboxName, buildVercelBaseSnapshot } from "./base-snapshot";
import type {
VercelCreateSandboxResponse,
VercelRunCommandRequest,
VercelSandboxClient,
VercelSnapshotResponse,
VercelWriteFileArchiveRequest,
} from "./vercel-client";
} from "./client";

function createSessionResponse(sessionId = "session-1"): VercelCreateSandboxResponse {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
* name and the control plane resolves that name to the latest snapshot ID.
*/

import { createLogger } from "../logger";
import type { CorrelationContext } from "../logger";
import { createLogger } from "../../../logger";
import type { CorrelationContext } from "../../../logger";
import {
DEFAULT_VERCEL_RUNTIME,
VERCEL_LOCAL_RUNTIME_EXTRACT_DIR,
VERCEL_RUNTIME_WORKDIR,
buildVercelBootstrapScript,
} from "./vercel-bootstrap";
import type { VercelSandboxClient } from "./vercel-client";
} from "./bootstrap";
import type { VercelSandboxClient } from "./client";

const log = createLogger("vercel-base-snapshot");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { VercelSandboxApiError, VercelSandboxClient } from "./vercel-client";
import { VercelSandboxApiError, VercelSandboxClient } from "./client";

function jsonResponse(body: unknown, status = 200): Response {
return new Response(JSON.stringify(body), {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* with fetch directly.
*/

import { createLogger } from "../logger";
import type { CorrelationContext } from "../logger";
import { createLogger } from "../../../logger";
import type { CorrelationContext } from "../../../logger";

const log = createLogger("vercel-sandbox-client");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
*/

import { describe, expect, it, vi } from "vitest";
import { VercelSandboxProvider, type VercelProviderConfig } from "./vercel-provider";
import type { CreateSandboxConfig, RestoreConfig } from "../provider";
import { VercelSandboxProvider, type VercelProviderConfig } from "./provider";
import type { CreateSandboxConfig, RestoreConfig } from "../../provider";
import type {
VercelCreateSandboxRequest,
VercelCreateSandboxResponse,
VercelRunCommandRequest,
VercelSandboxClient,
VercelSnapshotMetadata,
VercelSnapshotResponse,
} from "../vercel-client";
} from "./client";

function createSessionResponse(
sessionId = "vercel-session-1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/

import { computeHmacHex, MAX_TUNNEL_PORTS, type SandboxSettings } from "@open-inspect/shared";
import { createLogger } from "../../logger";
import type { CorrelationContext } from "../../logger";
import type { SourceControlProviderName } from "../../source-control";
import { createLogger } from "../../../logger";
import type { CorrelationContext } from "../../../logger";
import type { SourceControlProviderName } from "../../../source-control";
import {
DEFAULT_SANDBOX_TIMEOUT_SECONDS,
SandboxProviderError,
Expand All @@ -19,15 +19,15 @@ import {
type SnapshotResult,
type StopConfig,
type StopResult,
} from "../provider";
} from "../../provider";
import type {
VercelCommandResult,
VercelCreateSandboxResponse,
VercelSandboxClient,
VercelSandboxRoute,
} from "../vercel-client";
import { VercelSandboxApiError } from "../vercel-client";
import { DEFAULT_VERCEL_RUNTIME, VERCEL_PYTHON_BIN } from "../vercel-bootstrap";
} from "./client";
import { VercelSandboxApiError } from "./client";
import { DEFAULT_VERCEL_RUNTIME, VERCEL_PYTHON_BIN } from "./bootstrap";

const log = createLogger("vercel-provider");

Expand Down
4 changes: 2 additions & 2 deletions packages/control-plane/src/session/durable-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { resolveAppName, timingSafeEqual } from "@open-inspect/shared";
import { generateId, hashToken, encryptToken, decryptToken } from "../auth/crypto";
import { buildModalSandboxDashboardUrl, createModalClient } from "../sandbox/client";
import { createDaytonaRestClient } from "../sandbox/daytona-rest-client";
import { createVercelSandboxClient } from "../sandbox/vercel-client";
import { createVercelSandboxClient } from "../sandbox/providers/vercel/client";
import { createModalProvider } from "../sandbox/providers/modal-provider";
import { createDaytonaProvider } from "../sandbox/providers/daytona-provider";
import { createVercelProvider } from "../sandbox/providers/vercel-provider";
import { createVercelProvider } from "../sandbox/providers/vercel/provider";
import { resolveSandboxBackendName, supportsRepoImageBackend } from "../sandbox/provider-name";
import { createLogger, parseLogLevel } from "../logger";
import type { Logger } from "../logger";
Expand Down
6 changes: 3 additions & 3 deletions terraform/environments/production/vercel.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ data "external" "vercel_source_hash" {
packages/sandbox-runtime/pyproject.toml
packages/sandbox-runtime/src
packages/control-plane/scripts/build-vercel-base-snapshot.ts
packages/control-plane/src/sandbox/vercel-base-snapshot.ts
packages/control-plane/src/sandbox/vercel-bootstrap.ts
packages/control-plane/src/sandbox/vercel-client.ts
packages/control-plane/src/sandbox/providers/vercel/base-snapshot.ts
packages/control-plane/src/sandbox/providers/vercel/bootstrap.ts
packages/control-plane/src/sandbox/providers/vercel/client.ts
)
if command -v sha256sum &> /dev/null; then
hash=$(find "$${paths[@]}" -type f \
Expand Down
Loading