fix: keep workspaces tied to repository identity - #993
Conversation
This comment has been minimized.
This comment has been minimized.
Workspace listing resolved each stable repository with a nested read while the outer result rows still held a pool connection. Concurrent callers could consume every read connection and stop all list requests. Resolve the current repository route in the list query instead. Base-branch sync also acquired the reconciliation read lock again during repository verification. A queued writer could then block the nested read while the outer read prevented that writer from proceeding. Reuse the existing lock for verification. The existing rename and route-reuse tests now assert the stable workspace ownership introduced by this pull request. Review decision: the user marked route-keyed local Git storage as not an issue, so this commit makes no change for that finding. Source: roborev-ci comment #993 (comment). Generated with Codex Co-authored-by: Codex <noreply@openai.com>
This comment has been minimized.
This comment has been minimized.
Existing databases can contain the same repository item under both sides of a rename. Assigning both rows the same repository ID made the new unique index reject the migration and prevented startup. Keep the newest workspace and delete the older workspace as one unit instead of extending legacy route support. Background pull request association and pushed-head refreshes also resolved mutable routes after loading a workspace. A replacement repository could therefore receive work for the old workspace. Carry the stable repository ID through refresh operations and stop when that repository is inactive. Review source: #993 (comment) Generated with Codex Co-authored-by: Codex <noreply@openai.com>
This comment has been minimized.
This comment has been minimized.
roborev: Combined Review (
|
Workspace listing resolved each stable repository with a nested read while the outer result rows still held a pool connection. Concurrent callers could consume every read connection and stop all list requests. Resolve the current repository route in the list query instead. Base-branch sync also acquired the reconciliation read lock again during repository verification. A queued writer could then block the nested read while the outer read prevented that writer from proceeding. Reuse the existing lock for verification. The existing rename and route-reuse tests now assert the stable workspace ownership introduced by this pull request. Review decision: the user marked route-keyed local Git storage as not an issue, so this commit makes no change for that finding. Source: roborev-ci comment #993 (comment). Generated with Codex Co-authored-by: Codex <noreply@openai.com>
Existing databases can contain the same repository item under both sides of a rename. Assigning both rows the same repository ID made the new unique index reject the migration and prevented startup. Keep the newest workspace and delete the older workspace as one unit instead of extending legacy route support. Background pull request association and pushed-head refreshes also resolved mutable routes after loading a workspace. A replacement repository could therefore receive work for the old workspace. Carry the stable repository ID through refresh operations and stop when that repository is inactive. Review source: #993 (comment) Generated with Codex Co-authored-by: Codex <noreply@openai.com>
290959e to
c3e81d2
Compare
roborev: Combined Review (
|
roborev: Combined Review (
|
e7f5ae7 to
0556cb8
Compare
roborev: Combined Review (
|
0556cb8 to
6191c12
Compare
roborev: Combined Review (
|
6191c12 to
f8dac58
Compare
roborev: Combined Review (
|
f8dac58 to
a375326
Compare
This comment has been minimized.
This comment has been minimized.
a375326 to
5bda0b3
Compare
roborev: Combined Review (
|
5bda0b3 to
61f4cf8
Compare
roborev: Combined Review (
|
roborev: Combined Review (
|
e2032b3 to
edf815e
Compare
roborev: Combined Review (
|
edf815e to
b44558f
Compare
roborev: Combined Review (
|
b44558f to
f0ab6b1
Compare
roborev: Combined Review (
|
f0ab6b1 to
b8a2b76
Compare
roborev: Combined Review (
|
8a62a7f to
e4126b1
Compare
Repository routes can change after a rename or removal. Route-keyed workspace records can then reject the renamed repository or follow a later occupant of the old route. Persist the catalog repository ID on provider workspaces so a rename keeps its workspace associations and route reuse creates a separate workspace, clone, and worktree namespace. Migration 55 backfills unambiguous routes and removes duplicate workspaces for the same repository item before adding the stable-ID constraint. Existing route-keyed clones remain usable after backfill only when their route has a single historical owner. A replacement repository gets a separate workspace without deleting the previous checkout. Launch facts, activity projections, pull request trust facts, and network Git work remain fenced to the stable repository identity throughout setup and refresh. - Recover identity-scoped and pre-identity managed clones across consecutive renames by searching safe routes from the repository's own history and retargeting network work to the fenced current route. - Roll existing shared clones back after a rejected fetch while removing fresh invalid clones, so linked worktrees survive without retaining replacement-repository refs or origins. - Retire unresolved legacy workspaces through dirty-aware deletion and atomically leave failures stable until explicit user action. - Preserve inactive repository identity tombstones while workspaces reference them, so provider-host purge cannot null stable IDs into the legacy uniqueness lane. - Close preparation inventory cursors before per-workspace identity and launch-fact reads so bounded SQLite read pools cannot wait on themselves. Generated with Codex Co-authored-by: Marius van Niekerk <marius.v.niekerk@gmail.com> Co-authored-by: Codex <noreply@openai.com>
e4126b1 to
16abb33
Compare
roborev: Combined Review (
|
Workspaces now stay attached to the same repository when it is renamed. If another repository later takes the old owner/name route, Forge creates a separate workspace and checkout instead of rejecting the request or reusing the previous repository's files.
Tests cover route reuse, consecutive renames, clone rollback and recovery, dirty-workspace preservation, launch data, database migration and cleanup, and concurrent deletion handling. The relevant Go suites, vet, lint, migration-history check, and repository hooks pass locally.