Skip to content

refactor(control-plane): group Vercel files under providers/vercel#709

Merged
ColeMurray merged 2 commits into
mainfrom
refactor/group-vercel-sandbox-files
Jun 8, 2026
Merged

refactor(control-plane): group Vercel files under providers/vercel#709
ColeMurray merged 2 commits into
mainfrom
refactor/group-vercel-sandbox-files

Conversation

@ColeMurray

@ColeMurray ColeMurray commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Groups the Vercel sandbox modules added in #700 into a dedicated packages/control-plane/src/sandbox/providers/vercel/ directory and drops the redundant vercel- filename prefix. Previously the Vercel files were split between the top of sandbox/ (client, bootstrap, base-snapshot) and sandbox/providers/ (the provider).

Structure

src/sandbox/providers/vercel/
├── provider.ts          (was providers/vercel-provider.ts)
├── provider.test.ts
├── client.ts            (was vercel-client.ts)
├── client.test.ts
├── bootstrap.ts         (was vercel-bootstrap.ts)
├── base-snapshot.ts     (was vercel-base-snapshot.ts)
└── base-snapshot.test.ts

Why under providers/ (not sandbox/vercel/)

Keeping the provider under providers/ preserves that directory as the home for every provider and establishes a per-provider convention (providers/<name>/) that Modal and Daytona can adopt later, leaving top-level sandbox/ for cross-provider concerns (provider.ts interface, provider-name.ts, index.ts, lifecycle/).

Scope / notes

  • Pure move + import-path update. No exported symbols change, so the sandbox barrel's public API is identical.
  • All 7 files moved via git mv (renames detected at 96–100% similarity, history preserved).
  • Import specifiers updated in 5 consumers: the sandbox barrel (index.ts), routes/repo-images.ts (+ test, including the vi.mock path string), session/durable-object.ts, and scripts/build-vercel-base-snapshot.ts.
  • Modal/Daytona providers intentionally left as flat files for now — a follow-up can nest them into providers/modal/ and providers/daytona/ for full symmetry.
  • No changes needed to package.json, Terraform, CI, or docs (verified — no hardcoded module paths; snapshot bundle output stays dist/vercel-base-snapshot.js).

Validation

  • npm run typecheck -w @open-inspect/control-plane
  • npm run lint -w @open-inspect/control-plane
  • npm test -w @open-inspect/control-plane — 77 files, 1257 tests passed
  • npm run build:vercel-base-snapshot -w @open-inspect/control-plane
  • npm run build -w @open-inspect/control-plane

Summary by CodeRabbit

  • Chores
    • Internal reorganization of Vercel sandbox provider and client modules and related imports. No changes to user-facing functionality or behavior.
    • Updated tests and build/infra reference inputs to align with the new module layout; test behavior and runtime behavior remain unchanged.
    • Re-exports adjusted to reflect the new internal structure without altering public APIs.

Move the Vercel sandbox modules added in #700 into a dedicated
src/sandbox/providers/vercel/ directory and drop the redundant
"vercel-" filename prefix:

  providers/vercel-provider.ts -> providers/vercel/provider.ts
  vercel-client.ts             -> providers/vercel/client.ts
  vercel-bootstrap.ts          -> providers/vercel/bootstrap.ts
  vercel-base-snapshot.ts      -> providers/vercel/base-snapshot.ts
  (+ co-located tests)

Keeping the provider under providers/ preserves that directory as the
home for every provider and sets up a per-provider convention that
Modal and Daytona can adopt later. Pure move plus import-path update:
no exported symbols change, so the sandbox barrel's public surface is
identical.
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5473f7ac-7948-477a-bbbf-0e66f17b6c40

📥 Commits

Reviewing files that changed from the base of the PR and between 484660a and fe362c8.

📒 Files selected for processing (1)
  • terraform/environments/production/vercel.tf

📝 Walkthrough

Walkthrough

Vercel sandbox provider modules are reorganized from flat paths to a nested sandbox/providers/vercel/ directory structure. Import paths across the codebase—in the central sandbox export barrel, route handlers, session layer, build script, Terraform, and all test files—are updated to reference the new module locations.

Changes

Vercel module path reorganization

Layer / File(s) Summary
Sandbox barrel re-exports
packages/control-plane/src/sandbox/index.ts
sandbox/index.ts now re-exports Vercel provider, client, base-snapshot, and bootstrap utilities from new nested paths under ./providers/vercel/ instead of flat ./vercel-* and ./providers/vercel-* locations.
Vercel provider module imports
packages/control-plane/src/sandbox/providers/vercel/client.ts, packages/control-plane/src/sandbox/providers/vercel/base-snapshot.ts, packages/control-plane/src/sandbox/providers/vercel/provider.ts
Internal Vercel module imports are adjusted: logger utilities use corrected relative paths (../../../logger), client types import from ./client, bootstrap constants from ./bootstrap, and shared provider types from ../../provider.
Route handlers, session, and build script imports
packages/control-plane/src/routes/repo-images.ts, packages/control-plane/src/session/durable-object.ts, packages/control-plane/scripts/build-vercel-base-snapshot.ts
External consumers update Vercel imports to point to new ../sandbox/providers/vercel/client and ../sandbox/providers/vercel/provider module paths.
Test file imports
packages/control-plane/src/routes/repo-images.test.ts, packages/control-plane/src/sandbox/providers/vercel/base-snapshot.test.ts, packages/control-plane/src/sandbox/providers/vercel/client.test.ts, packages/control-plane/src/sandbox/providers/vercel/provider.test.ts
Test files redirect type imports and Vitest mock paths to match the reorganized Vercel module locations.
Terraform source hash inputs
terraform/environments/production/vercel.tf
Terraform vercel_source_hash paths updated to include packages/control-plane/src/sandbox/providers/vercel/{base-snapshot,bootstrap,client}.ts so the computed hash reflects the new file locations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • ColeMurray/background-agents#700: Adds the Vercel provider/client/base-snapshot/bootstrap modules that this PR reorganizes and re-exports under the new sandbox/providers/vercel/ directory structure.

Poem

🐰 I hopped through paths both old and new,

Repointed imports, tidy and true,
Folders nested, the map aligned,
Tests and scripts now easily find,
A neat little trail for Vercel to view.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: refactoring to group Vercel files under a dedicated providers/vercel directory structure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/group-vercel-sandbox-files

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Terraform Validation Results

Step Status
Format
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@open-inspect open-inspect Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[deep review] I did not find any high-confidence structural maintainability regressions in this refactor. The Vercel files are now grouped under a single provider directory, no file crosses the 1k-line threshold, stale old-path imports are gone, and the moved Vercel tests plus control-plane typecheck pass locally.

Comment thread packages/control-plane/scripts/build-vercel-base-snapshot.ts
open-inspect[bot]
open-inspect Bot previously requested changes Jun 8, 2026

@open-inspect open-inspect Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Reviewed PR #709, refactor(control-plane): group Vercel files under providers/vercel by @ColeMurray. The TypeScript move/import updates are consistent and npm run typecheck -w @open-inspect/control-plane passes, but one non-TypeScript reference still points at the old moved files.

Critical Issues

  • [Functionality] terraform/environments/production/vercel.tf:16 - The Vercel source-hash data source still includes packages/control-plane/src/sandbox/vercel-base-snapshot.ts, vercel-bootstrap.ts, and vercel-client.ts. Those files were moved, so Terraform will no longer hash changes to the new Vercel base snapshot/client/bootstrap sources that drive base snapshot rebuilds. Update these paths to packages/control-plane/src/sandbox/providers/vercel/... and include the provider file if it should participate in the rebuild trigger.

Suggestions

None.

Nitpicks

None.

Positive Feedback

  • The sandbox barrel preserves the existing public exports while moving implementation files.
  • Internal TypeScript imports and Vitest mock paths were updated consistently.
  • The rename keeps Vercel provider-specific code cohesive under providers/vercel/.

Questions

None.

Verdict

Request Changes: please update the Terraform source-hash paths before merging.

The data.external.vercel_source_hash block listed the pre-move Vercel
file paths (sandbox/vercel-{base-snapshot,bootstrap,client}.ts), which
no longer exist after grouping them under sandbox/providers/vercel/.
find would skip the missing paths, so edits to the moved builder code
would no longer change the hash that triggers base snapshot rebuilds.

provider.ts is intentionally excluded: it is the worker-side provider
that consumes the finished snapshot, not builder code baked into it.
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Terraform Validation Results

Step Status
Format
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@ColeMurray ColeMurray merged commit cad7e5c into main Jun 8, 2026
18 checks passed
@ColeMurray ColeMurray deleted the refactor/group-vercel-sandbox-files branch June 8, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant