Skip to content

feat(db): columns for the workspace drive (migrations only, split from #9847) - #9915

Draft
saddlepaddle wants to merge 1 commit into
mainfrom
superset/workspace-drive-columns
Draft

saddlepaddle wants to merge 1 commit into
mainfrom
superset/workspace-drive-columns

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Migrations and schema only, split out of #9847 so they land before the code that reads them (packages/trpc/AGENTS.md rule 10). Draft until the coordinator says so.

What changed

  • One migration, 0199_workspace_drive: cloud_workspaces.drive_name text, cloud_workspaces.drive_laid_out_at timestamptz, environments.golden_drive_name text.
  • The matching columns in packages/db/src/schema/schema.ts.

All three are nullable, with no default and no index. Nothing on main reads or writes them, so there is no tRPC input or output change. On 2026-11-18 main gained its own 0197 and 0198. So the branch was rebuilt on main (e0f54fa): only the schema change was applied, and drizzle-kit generate wrote the migration as 0199 on top of main's journal. The SQL is the same three statements as before. Nothing under packages/db/drizzle/ was hand-edited.

Safety checklist (.agents/skills/db-migrations/SKILL.md)

  • Production sizes, read-only on the Neon default branch on 2026-11-17: cloud_workspaces 9,680 kB (~6,649 rows), environments 232 kB (~258 rows).
  • No column type change.
  • No foreign keys, so no lock order to get wrong.
  • No long ACCESS EXCLUSIVE: ADD COLUMN with no default is a catalog-only change; the lock is held for a moment.
  • Every statement finishes well inside 60 seconds at these sizes.
  • Rehearsal under load: not done. Not required by the skill for a catalog-only change on small tables.
  • No reads move to new columns in this PR.
  • No tRPC input or output change.
  • After changing an already-pushed migration, the PR's preview Neon branch was deleted: not done. It needs the coordinator's OK first.

Checks

  • Ran: drizzle-kit migrate on a new Neon dev branch made from production on 2026-11-18 (dev/workspace-drive-0199, br-soft-frog-afohxaia), with lock_timeout=5s and statement_timeout=60s. It was at 0198 before and applied 0199; the three columns exist with the expected types. biome check on the schema file passed.
  • Not run: CI on this head; a rehearsal under load.

Summary by cubic

Adds three nullable DB columns for the workspace drive as a migrations-only PR, split from #9847 so they land before the code that reads them.

  • environments.golden_drive_name and cloud_workspaces.drive_name (text), plus cloud_workspaces.drive_laid_out_at (timestamptz).
  • All columns are nullable, with no default and no index; no existing code reads or writes them.
  • The ALTER TABLEs are catalog-only, so they hold no long locks and don't change existing behavior.

Written for commit 78a831b. Summary will update on new commits.

View guided diff Turn on auto-fix

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@expo

expo Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Preview update published for development build 0dd268df (fingerprint 08a5e03ce5fb). Open the build on your phone and scan:

Update group 062fd547

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) ❌ View Branch
Vercel API (Vercel) ✅ Open Preview
Vercel Web (Vercel) ✅ Open Preview
Vercel Agents Web (Vercel) ➖ Not set up
Vercel Marketing (Vercel) ✅ Open Preview
Vercel Docs (Vercel) ✅ Open Preview

Preview updates automatically with new commits

@saddlepaddle
saddlepaddle force-pushed the superset/workspace-drive-columns branch from 99b0fd8 to 8bec0b7 Compare November 18, 2026 03:01
@saddlepaddle
saddlepaddle force-pushed the superset/workspace-drive-columns branch from 8bec0b7 to 7b454fc Compare November 18, 2026 03:14
Adds three nullable columns, no defaults, nothing reads them yet:
- environments.golden_drive_name: the Vercel drive an environment's
  workspace drives fork from.
- cloud_workspaces.drive_name: the drive mounted on every session of a
  workspace's box.
- cloud_workspaces.drive_laid_out_at: when a boot first answered with the
  drive laid out.

One migration, 0199, generated by drizzle-kit on main after 0198.
Split from #9847 so the migration lands before the code that uses it.
@saddlepaddle
saddlepaddle force-pushed the superset/workspace-drive-columns branch from 7b454fc to 78a831b Compare November 18, 2026 21:44
saddlepaddle added a commit that referenced this pull request Nov 18, 2026
The workspace drive work of #9847 as one commit on main after 78a831b
(#9915, migration 0199), resolved by hand against main's M5b failure
reasons, M7s logging, M8 metering, M9 non-resuming handles, and the
agent-tools drive. The previous 33 commits are kept locally as
backup/9847-pre-rebase.

Merged with main:
- wakeSandbox keeps the resume lock, the drive detach, the composed
  mounts and withLiveSession, and takes main's onlyIfRunning and its
  non-resuming handles; a session withLiveSession resumes mid-wake is
  reported to beforeResume as resumedSession before it boots, so it is
  metered as M9 meters it.
- promoteSandboxToEnvironment takes main's shape: the snapshot ends the
  source's session and the caller's wakeAfterStop starts it again; the
  drive fork and the golden drive's strip stay.
- provision fails through failCloudWorkspace, which now takes onBox and
  answers whether it moved the row, so a provision still fails only its
  own row.
- A delete or a failed create still retires the names (retireAndTearDown).

This branch was previously deployed

1 inactive deployment
preview — 78a831b9 Deployed Nov 18, 2026 by saddlepaddle via Deploy API #15235
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