Add department co-lead position support#193
Conversation
Departments can now have an optional co-head (co-lead) in addition to the
single required head. The co-head receives the same permissions as the head
and is included in the same workflows (member admission, transitions,
cancellations, system-group sync).
- Add `department_co_head` organization position with a per-department unique
index (at most one co-head per department) and relaxed check constraint.
- Treat both head and co-head as department-lead positions in permission
evaluation, recipient selection, system-group membership, and department
syncing.
- Add co-head selection to the admin positions page (validating head and
co-head are different members) with assignment notifications and audit log.
- Show the co-head in the org chart ("Co-Head of …") and member detail.
- Notify both head and co-head when a member joins/leaves their department.
The migration adds the enum value and commits it before use (matching the
existing pattern in migration 0033) so it applies cleanly to a fresh database.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6qc2iSYybYuHkUW5hnep8
Generalize department co-leads from at most one to any number per department (0..n), and rename the concept from "co-head" to "co-lead" to match how the org refers to it. - Rename the organization position `department_co_head` → `department_co_lead` and drop its per-department unique index so a department can have multiple co-leads. The head remains capped at one. - Model co-leads as an array (`departmentCoLeads`) throughout the read, write, recipient-selection, and department-sync paths; every co-lead is synced onto the same department and included in the same approval and FYI workflows as the head. - Admin positions page now supports adding/removing multiple co-leads per department, excluding already-chosen members and rejecting a member who is both head and co-lead. - Org chart renders co-leads as member-style cards directly below the head with the subtitle "Co-Lead of <Department>", supporting departments that have co-leads but no head. The migration commits the new enum value before use (matching migration 0033) so it applies cleanly to a fresh database. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6qc2iSYybYuHkUW5hnep8
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (22)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Summary
Introduces a new
department_co_leadorganizational position that grants the same authority and permissions as a department head. A department can have multiple co-leads, enabling shared leadership responsibilities while maintaining a single head-of-department role.Key Changes
department_co_leadto theorganization_positionenum type and updated uniqueness constraints onuser_organization_positiontable to allow multiple co-leads per department while maintaining single head constraintdepartmentLeadPositionsset containing bothdepartment_headanddepartment_co_leadisDepartmentLeadPosition()helper to identify both head and co-lead rolesPositionAssignmentsinterface to trackdepartmentCoLeadsas arrays (vs singledepartmentHeads)user.view_details,user.membership.propose)0055_wise_ozymandias.sqlto implement schema changesImplementation Details
PositionAssignments.departmentCoLeadsto support multiple holders per departmentisDepartmentLeadPosition()to treat heads and co-leads identicallyhttps://claude.ai/code/session_01L6qc2iSYybYuHkUW5hnep8