Repository navigation
chore(trpc,db): shrink the v2_projects surface ahead of its removal - #6439
Conversation
Deletes the three v2Project procedures left with zero callers after #6436 (get, linkRepoCloneUrl, delete) and drops the v2_workspaces.project_id foreign key, keeping the column as a bare uuid — the same shape automations.v2_project_id took in 0062. After this, v2_projects has no inbound FKs and exactly one consumer repo-wide: findByGitHubRemote, called by the v1 to v2 importer. No shipped desktop version subscribes to the v2_projects Electric shape (verified across 1.15 through 1.20.2), so the table's only remaining gate is the importer, which is still live: ~67 auto-migrations and ~68 bulk imports this week as the rollout ramps.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis change removes the foreign-key relationship from ChangesV2 project cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to This PR removes unused procedures and the obsolete workspace foreign key while retaining the remaining project lookup. No actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Prework for dropping
v2_projectsand reclaiming theprojectsname. Does not drop the table.Removed
v2Project.get,v2Project.linkRepoCloneUrl,v2Project.delete— all left with zero callers by chore(host-service,trpc,cli,desktop): decouple the app from v2_projects #6436.findByGitHubRemoteremains, fencedv2_workspaces.project_id→v2_projectsforeign key (migration0069). The column stays as a bare uuid, exactly the shapeautomations.v2_project_idtook in0062State after this PR:
v2_projectshas no inbound FKs and one consumer repo-wide —findByGitHubRemote, called by the v1→v2 importer so an imported repo reuses its existing cloud project id.Why the table still can't drop
Two things I checked that change the picture:
v2_projectsElectric shape — verified across 1.15, 1.17, 1.19, and 1.20.2. So unlikeworkspaces/agent_commands/v2_clients, this table is not gated on old-build adoption.So
v2_projects's gate is the v1 migration finishing, not Electric adoption — a different and likely shorter clock.Note on
agent_commandsWorth recording: it is not droppable yet despite having zero code references. desktop-v1.19.0 subscribes to its Electric shape (~2,000 weekly users), even though 1.20.2 does not. Any table drop must be checked against every version still in use, not just the latest.
I re-verified the already-merged drops on that basis:
device_presence,secrets, andsandbox_imageswere subscribed by no shipped version (1.15 → 1.20.2), so #6431 and #6435 were safe.Verification: lint exit 0 · typecheck exit 0 (36/36).
Summary by cubic
Shrinks the
v2_projectssurface ahead of its removal by deleting unused TRPC procedures and dropping thev2_workspaces.project_idforeign key. This keeps data intact and preserves the importer’s lookup viafindByGitHubRemote. The table is not dropped.v2Project.get,v2Project.linkRepoCloneUrl, andv2Project.delete; onlyv2Project.findByGitHubRemoteremains for the v1→v2 importer.v2_workspaces.project_id→v2_projects.idforeign key via migration0069; the column stays as a bareuuid(same shape asautomations.v2_project_idfrom0062).Rollout
0069. No client changes required.v2_projectsyet. The importer still uses it, while no shipped desktop versions subscribe to its Electric shape. Proceed with the table drop after the importer completes.Written for commit 318f073. Summary will update on new commits.
Summary by CodeRabbit