Repository navigation
feat(projects): enforce Project membership and retire the connector - #8590
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ty-enforcement # Conflicts: # apps/sim/lib/projects/__integration__/foundation.integration.ts
@mzxchandra I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 175 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
…pace-column-expand
…t-entity-enforcement
There was a problem hiding this comment.
No issues found across 175 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Turn on auto-fix | Re-trigger cubic
|
@greptile Please re-review head 6a43776. The staging fixture type errors are fixed using shared Project-aware insertion and cleanup. Fresh Docker PostgreSQL 17 migration, all 87 focused database tests, all 49 affected application tests, application typecheck, and affected-file lint passed locally before this push. The open #8781 finding is a valid downstream synchronization requirement, documented in the PR description with its current head and the three affected files. Those files are not in #8590; no downstream completion is claimed and the retired connector is not restored here. Please distinguish current-PR defects from that outstanding stack adaptation. |
|
@cubic-dev-ai review this PR |
@mzxchandra I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 178 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Summary
Complete the migration to
workspace.project_idafter #8830 is deployed and incompatible membership activity has drained. Release-2 migrations run before application promotion, while release 1 serves traffic.0032_project_membershiprunner switches the checked singleton to column authority under the workspace barrier, then performs bounded, resumable assignment and reconciliation. SQL 0411 remains a placeholder because SQL migrations precede script migrations.workspace.project_id NOT NULLand its restrictive FK, then atomically remove bothproject_workspaceandproject_membership_rollout. The authority-aware feat(projects): move Project membership to the workspace column #8830 runtime remains the supported rollback version after contraction.Permanent enforcement
Replace all custom Project integrity triggers, trigger-specific advisory locks, deferred row-version dispatch, and
UPDATE project SET updated_at = updated_atwith native constraints:personaland IDs asorganization:<id>. The expression always yields a value, cannot be overridden by writers, and supports a composite organization-consistency FK without the nullable-FK loophole.Project non-emptiness and archive lifecycle remain application-owned. Keep existing application Project/lineage/edge/workspace locks and transactional workflow admission. Backfill still validates legacy lifecycle state once; it does not install permanent lifecycle triggers. Keep
project.updated_atas ordinary metadata, and exclude the new internal scope key from Project presentation.Deployment sequence
Migration trade-off and rollback
On PostgreSQL 16/17, adding stored generated columns rewrites the Project/workspace tables. This phase refuses busy tables and bounds each statement to five seconds; a timeout rolls it back before connector removal. This is a bounded blocking operation, not a zero-interruption column addition. Assess table size/capacity before deployment; do not silently extend its lock budget. Interrupted concurrent unique-index builds are repaired on replay.
Use the existing all-at-once traffic cutover and verify the concrete old membership operations/workers have drained. No new maintenance mechanism, dual writes, synchronization triggers, extra compatibility release, or Project-specific PostgreSQL16 CI is introduced. Once authority switches, keep column authority on retries/rollback and never deploy pre-#8830 code. Updated #8830 recognizes the completed schema without the marker, so rollback requires no retained rollout table. Fresh schema push creates no marker; migration replay recognizes completed contraction even when recording its receipt previously failed.
Validation
Focused local verification on
6a43776bc2, using isolated Docker PostgreSQL 17 and Redis:Full current-head CI runs in GitHub Actions; these local results do not claim hosted CI or production rollout completion. No phone/Android matrix or full repository suite was run locally.
Downstream synchronization
Greptile's open finding on #8781 is a valid downstream dependency: its supplied head
10f89e065fstill imports/queriesprojectWorkspaceinproject-file-read.integration.ts,project-file-write-transport.integration.ts, andproject-file-context.integration.ts. When synchronizing that branch with this stack, replace the connector lookup withworkspace.projectId(or the row returned byinsertWorkspaceFixture) and remove the retired schema import. Those files are absent from #8590; this PR does not claim the downstream adaptation is complete. Downstream #8609/#8610 also retain their previously recorded synchronization requirement.