Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(regions): move project branches and commits #3843

Merged
merged 25 commits into from
Feb 13, 2025

Conversation

cdriesler
Copy link
Member

@cdriesler cdriesler commented Jan 16, 2025

Description & motivation

  • We need the ability to move a project and its associated data into a different region for a number of reasons
  • This process cannot safely use existing services/repos/api calls because of side effects throughout
  • We just need the literal records to be copied over, in the right order

Changes:

  • Create and move a project with its models and commits
  • Add region2 to CI and local test dependencies (so we can test moves between regions, instead of main => region)
    • Required assorted changes/fixes to test setup code, notably the way we drop subscriptions in hooks.ts
  • Meant to demonstrate and validate approach, this is not the entire move implemented

Copy link

linear bot commented Jan 16, 2025

@cdriesler cdriesler marked this pull request as ready for review January 27, 2025 08:33
Copy link
Contributor

github-actions bot commented Feb 7, 2025

📸 Preview service has generated an image.

@cdriesler cdriesler requested a review from alemagio February 10, 2025 10:44
alemagio
alemagio previously approved these changes Feb 10, 2025
.onConflict(Workspaces.withoutTablePrefix.col.id)
.merge(Workspaces.withoutTablePrefix.cols as (keyof Workspace)[])

return workspaceId
Copy link
Contributor

Choose a reason for hiding this comment

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

we should check how workspaces are propagated to the region db and use that to publish the change:

  • always update the main db
  • update (fake) the main db and use the publish system to update the region

Copy link
Member Author

Choose a reason for hiding this comment

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

It appears that we quite literally only care that the workspace id is defined in the regional database for foreign key constraints. Anything user-visible is pulled from the main db record. Simplified this to a copy then ignore on conflict.

Copy link
Contributor

📸 Preview service has generated an image.

@cdriesler cdriesler requested a review from alemagio February 10, 2025 23:55
@cdriesler cdriesler merged commit c382064 into main Feb 13, 2025
28 of 30 checks passed
@cdriesler cdriesler deleted the chuck/web-2433-move-project-branches-and-commits branch February 13, 2025 14:39
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.

2 participants