fix(project): make org immutable via UpdateProject#1598
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR makes project organization immutable in the UpdateProject RPC by removing organization from the update request contract, handler logic, and repository SQL operations. UpdateProject can no longer change a project's parent organization. Request body type alignment, handler refactoring, repository enforcement, and all test suites are coordinated to ensure org_id cannot be modified. ChangesProject Organization Immutability
🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for CI Build 25725078679Coverage decreased (-0.01%) to 42.034%Details
Uncovered Changes
Coverage Regressions4 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
Description:
Summary
Closes #1584.
UpdateProjectno longer allows re-parenting a project to a different organization. Parent org becomes structurally immutable through this RPC.Changes
ProjectRequestBody— newUpdateProjectRequestBody(noorg_id, tag 4 reserved).ProjectRequestBodyretained forCreateProject.internal/store/postgres/project_repository.go): droporg_idfromUpdateByID/UpdateByNameSET clauses. Remove unreachableErrForeignKeyViolation → organization.ErrNotExistbranches.internal/api/v1beta1connect/project.go): stop readingorg_idfrom request body; auditor org now sourced from the updated project(
updatedProject.Organization.ID) instead of caller-supplied.cmd/project.go):frontier project editbody parses intoUpdateProjectRequestBody.org_idFK-error cases removed.Technical Details
DiscardUnknown: true(pkg/server/codecs.go:46) and proto3 binary ignores unknown fields, so legacy clients still sendingorg_idcontinue to work — the field is silently dropped server-side. Not a client-side breaking change.IsAuthorized(project, update)already inherits through SpiceDB's org→project graph; withorg_idgone from the request there's no destination-org to authorize.Follow-ups (not in this PR)
core/group/service.go::Update+internal/store/postgres/group_repository.gohave the identical re-parenting shape — worth a separate ticket.web/sdk/admin/.../rename-project.tsx,web/sdk/react/views-new/.../edit-project-dialog.tsx,web/sdk/react/views/.../project-general.tsx) still sendorgIdin the body. Safe today (server drops it); cleanup once@raystack/protonbumps inweb/sdk/package.json.Test Plan
make lintcleango test ./core/... ./internal/api/... ./cmd/...passesorg_idunchanged in Postgresorg_idset to a different org → silently ignored, project remains in original org, SpiceDB tuple unchanged