chore: update Org role titles for brevity#1705
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughFour ChangesRole Title Updates
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/bootstrap/schema/schema.go (1)
350-357:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winDuplicate role
Nameconstant shared with the "Viewer" role.The "Group Viewer" role at line 351–352 uses
Name: RoleOrganizationViewer, which is identical to the "Viewer" role at line 343–344. Role names must be unique identifiers for API operations, permissions checks, and role lookups. Having two roles with the same name breaks that invariant and can cause runtime failures.A new role name constant should be defined (e.g.,
RoleOrganizationGroupViewer="app_organization_group_viewer") and assigned to this role.🔧 Proposed fix to define and use a unique role name constant
Add a new constant near the existing role constants at the top of the file:
const ( RoleOrganizationViewer = "app_organization_viewer" RoleOrganizationManager = "app_organization_manager" RoleOrganizationOwner = "app_organization_owner" + RoleOrganizationGroupViewer = "app_organization_group_viewer" RoleProjectOwner = "app_project_owner"Then update the "Group Viewer" role definition:
{ Title: "Group Viewer", - Name: RoleOrganizationViewer, + Name: RoleOrganizationGroupViewer, Permissions: []string{ "app_organization_get", }, Scopes: []string{OrganizationNamespace}, },
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 45ae9120-16d2-485f-a844-84057097ca89
📒 Files selected for processing (1)
internal/bootstrap/schema/schema.go
Coverage Report for CI Build 27665761249Coverage remained the same at 43.631%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/bootstrap/schema/schema.go (1)
343-353:⚠️ Potential issue | 🟠 Major | ⚡ Quick win
Membertitle is overwritten by a duplicate role keyLine 343 introduces
Title: "Member", but Lines 350-353 define anotherPredefinedRolesentry with the sameName: RoleOrganizationViewer. Since role migration/upsert is keyed byName, the later entry overwrites the earlier one, so"Member"will not be the persisted final title.Please make these entries uniquely keyed (distinct
Name) or collapse them into a single definition so the intended title change actually takes effect.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c1cbd424-849b-428a-a446-104e19e6402e
📒 Files selected for processing (1)
internal/bootstrap/schema/schema.go
No description provided.