fix(server): dev database copies drop links to other environments#27127

closed1
main
GitHub fork: fix/dev-db-drops-peer-links
opened1d agobyEeyeveil
View on GitHubTwo-way sync enabledPR last imported 17h ago

Problem

vp run migrate-dev-db is meant to keep a dev server away from the developer's real agents and work. It cleared scheduled tasks and auth sessions but kept links to other environments. A seeded dev server listed the developer's real linked machines and could call them once secrets were copied too.

Change

  • migrate-dev-db.ts adds peer_environment_links to CLEARED_TABLES.
  • The test data section of AGENTS.md now lists links among the dropped data.

Only dev servers seeded by this script change. They start with no linked environments. The live database is untouched.

Scope and approval

This is a very small, focused fix for an obvious bug, so it has no prior issue. The script promises that a dev server never reaches the developer's real work, and keeping live links to their other machines breaks that promise. The fix adds one table to an existing list.

Verification

  • vp test run scripts/migrate-dev-db.test.ts: the existing pending-work test now seeds a link. On main it fails with links: 1. With the fix, all 7 tests pass.
  • vp run check:changed passes.
  • I did not run a dev server against a seeded copy.

Written by Opus 5.5 on behalf of eyeveil.

Checks

21 successful · 16 skipped
All checks passed
3611d21

Added 1 commit

  • fix(server): dev database copies drop links to other environments3611d21
Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review.

External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 8bf4822f5eb5b24f3129960ce771daacc5c01a44 and 3611d218b78bc3dc8dfd635bd2bcfd37055b5526.

External image Files selected for processing: 3
  • AGENTS.md
  • apps/server/scripts/migrate-dev-db.test.ts
  • apps/server/scripts/migrate-dev-db.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The development database migration now excludes peer environment links from the copied snapshot and clears them during pruning. The test verifies that no links remain, and the instructions describe this removal.

Changes: Development database refresh

Layer / File(s)Summary
Clear and verify peer environment links
apps/server/scripts/migrate-dev-db.ts, apps/server/scripts/migrate-dev-db.test.ts, AGENTS.md
peer_environment_links is added to CLEARED_TABLES. The test inserts a link and checks that the remaining link count is zero. The instructions now include links among the data removed during refresh.

Priority: External image Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested labels: size:XS

Suggested reviewers: juliusmarminge, t3dotgg, macroscopeapp

Merge Risk: External image Minimal · up to 3611d

No actionable merge-blocking risk remains from this change.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely identifies the main change: development database copies no longer retain links to other environments.
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Description checkPassedThe description covers the problem, change, scope and approval rationale, verification results, and the limitation that a seeded dev server was not tested. It also identifies the model used. The harne…
Full details: Description check

Explanation

The description covers the problem, change, scope and approval rationale, verification results, and the limitation that a seeded dev server was not tested. It also identifies the model used. The harness is not specified, but this is a minor omission and does not prevent review.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Note

Written by gpt-6.1-sol on behalf of Maria

thanks @eyeveil. your change correctly uses the existing cleared-table mechanism and extends the existing migration test to catch retained peer links.

replacement: https://git.cafe/pingdotgg/t3code/pulls/27313

the fork rejected a maintainer push with 403 despite reporting maintainerCanModify: true, so i rebuilt the same fix on current main with your co-author credit. i compared the original diff against the replacement: the table entry, regression test, and guidance update are preserved; only the redundant code comment was dropped. no behavior moved.

verification: main reproduced links: 1; the fix passes all 7 migration tests and blacksmith check:changed (format, lint, knip, graphql, affected typechecks, 8 tests). the real migration cli preserved the isolated source's 1 peer link and produced a destination with 0. two independent reviews found no issues. starting a seeded server with copied secrets remains unverified. no ui changes.

Synced from GitHub

Thanks for rebuilding this on current main, Maria. Closing in favor of #27313.

Written by Opus 5.5 on behalf of eyeveil.