-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat(forks): opt-in fork sync for new workflows #8318
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9b4dcde
feat(forks): opt-in fork sync for new workflows
mzxchandra 851c223
fix(forks): break the fork lock cycle and derive review-round values …
mzxchandra 2a47bec
test(forks): drive the lock-order suite through the production helpers
mzxchandra 0727e46
test(forks): scope the lock-order barrier to the unlink backend
mzxchandra 297cb1b
test(forks): settle every lock-order barrier on the failure path
mzxchandra 439319b
test(forks): drop call-count assertions from the sync-default suite
mzxchandra 7adf342
Merge origin/staging into feat/fork-sync-opt-in
mzxchandra 3362008
revert(forks): drop the "Copy unsynced workflows" fork override
mzxchandra f79b234
refactor(forks): stop projecting a column the source query already pins
mzxchandra 4ae7641
test(knowledge): give the member-tombstone budget test its own timeout
mzxchandra 3e8732f
refactor(forks): render the fork-sync default with ChipSwitch
mzxchandra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
apps/sim/app/api/workspaces/[id]/fork/sync-default/route.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { updateForkSyncDefaultContract } from '@/lib/api/contracts/workspace-fork' | ||
| import { | ||
| defineInternalJsonRoute, | ||
| internalRateLimits, | ||
| internalSessionAuth, | ||
| } from '@/lib/api/server/routes' | ||
| import { internalForkErrorPolicy } from '@/ee/workspace-forking/api/route-policies' | ||
| import { forkOperations } from '@/ee/workspace-forking/application/operations' | ||
| import { setForkSyncDefault } from '@/ee/workspace-forking/application/sync-default' | ||
|
|
||
| export const PUT = defineInternalJsonRoute({ | ||
| contract: updateForkSyncDefaultContract, | ||
| auth: internalSessionAuth, | ||
| operation: forkOperations.syncDefault, | ||
| /** | ||
| * Rated, unlike its sibling fork routes. This is the one that writes workspaces the | ||
| * caller may not administer, under the feature's coarsest advisory lock, so an admin of | ||
| * any single lineage member could otherwise loop it and starve fork creation across the | ||
| * whole lineage. | ||
| */ | ||
| rateLimit: internalRateLimits.user({ bucketName: 'workspace-fork-sync-default' }), | ||
| errorPolicy: internalForkErrorPolicy, | ||
| mapInput: ({ params, body }) => ({ workspaceId: params.id, ...body }), | ||
| present: ({ excludeNewWorkflows, changedWorkspaces }) => ({ | ||
| excludeNewWorkflows, | ||
| workspacesUpdated: changedWorkspaces.length, | ||
| }), | ||
| useCase: setForkSyncDefault, | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.