fix(forks): route new workflows through one row builder and harden lineage locking - #8406
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
All reported issues were addressed across 40 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
Comments Outside DiffThese findings could not be posted inline.
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Follow-up to #8318 (opt-in fork sync for new workflows).
Correctness
buildNewWorkflowRow, which reads the workspace's fork-sync policy itself — a new insert path can no longer silently fall back to the column default. Fork/promote copies still writeforkSyncExcluded: falsecreateForktakes the lineage lock shared: forks in one lineage no longer serialize behind each other's full copy (and risk the 10s lock timeout), while the default write and unlink stay exclusiveunlinkForkEdgere-checks the lineage root under the lock (409 if an unlink higher up moved it; still idempotent when this edge is already gone), matchingcreateForkandsetForkSyncDefaultsetForkSyncDefaultwalks the lineage once instead of three times, locks only live members whose value differs (FOR NO KEY UPDATE, id order), so a no-op toggle takes no row locks and FK inserts aren't blockedassertForkSourceVersionsrestored to its pre-feat(forks): opt-in fork sync for new workflows #8318 predicate — it was loosened for the "Copy unsynced workflows" override that was reverted before mergeCleanup
lib/lineage/lineage-root.ts(it no longer has anything to do with the sync default); central@sim/testingmock for itforkSyncExcludedfrom the promote plan / copy params, the deadcreateWorkflowRecord, and an unneeded resources refetcharia-expanded, consistent disabled styling; toggle only renders once this workspace's lineage has loadedType of Change
Testing
fork-sync.integration.ts(real Postgres): new end-to-end case — set from a fork reaches the parent, repeat is a no-op, create/duplicate/starter take the policy, copies stay synced, archived middle member is traversed but not writtenfork-lock-order.integration.ts: shipped order (shared fork lock) completes; pre-fix order assertsdeadlockby error codetx, archived traversal, no-op filter, unlink re-check, membership check, inheritance) turns its test redbun run lint, fulltype-check,check:audits(52/52),check:migrations,docs-manifest:check, 3190 unit tests across the touched areasChecklist
test-auditauthoring gate)