Conversation
The connect_as credential model (PLAT-539/552/553) made ServiceUserRole obsolete. This commit deletes it entirely. - Delete `ServiceUserRole` resource type and all tests - Remove `ServiceUser` type and `GenerateServiceUsername` from the database package - Remove `Credentials` field from `ServiceInstance`, `ServiceInstanceSpec`, `ServiceInstanceSpecResource`, and `ServiceContainerSpecOptions` - Remove `populateCredentials()` from `ServiceInstanceSpecResource` - Remove dead `serviceType == "rag"` ServiceUserRole creation block from `generateMCPInstanceResources` (RAG dispatches to its own function; this path was never reached) - Move `sanitizeIdentifier` to `postgrest_authenticator_resource.go`, its only remaining consumer - Remove ServiceUserRole from the resource registry
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -4 |
| Duplication | -4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes. Give us feedback
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
💤 Files with no reviewable changes (8)
📝 WalkthroughWalkthroughThis pull request removes service instance credential management by deleting the Changes
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
LGTM! Test 1 — PostgREST deployment: no svc_ roles, authenticator configured correctly Test 2 — Validation: connect_as enforced for PostgREST Missing connect_as: services block with no connect_as fieldTest 3 — Service removal: connect_as user not dropped Test 4 — Preflight blocks deployment when anon role does not exist |
Summary
ServiceUserRoleresource type and all associated dead code now that all service types use theconnect_ascredential model introduced in PLAT-539/552/553ServiceUsertype andGenerateServiceUsernamefrom the database packageCredentialsfield from all structs that carried it (ServiceInstance,ServiceInstanceSpec,ServiceInstanceSpecResource,ServiceContainerSpecOptions)generateMCPInstanceResourceswhere aserviceType == "rag"guard would createServiceUserRole resources that could never be reached (RAG dispatches to
generateRAGInstanceResourcesbefore that block)Test plan
make testServiceUserRole,ServiceUser, orGenerateServiceUsernameoutside the state migration added in feat: add state migration to remove ServiceUserRole resources #357PLAT-558