Skip to content

Conversation

@agustin-conductor
Copy link
Contributor

@agustin-conductor agustin-conductor commented Dec 12, 2025

[X] Bugfix

Linear updated their platform, when upgrading to enterprise ALL admin users become Owners. This is a newly created role, added to the existing ones.

Summary by CodeRabbit

New Features

  • Introduced a new owner role to the system, providing an additional user role option alongside the existing guest, user, and admin roles.
  • Owner status is now tracked, retrieved, and managed across the application for individual users and organization members.
  • Enhanced role management system to support proper assignment and handling of the owner role designation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 12, 2025

Walkthrough

The changes introduce support for an "owner" role to the connector system. A new owner role constant is added and included in role enumeration, GraphQL queries are extended to fetch owner information from the Linear API, data models are updated with owner fields, and user role assignment logic handles the owner flag.

Changes

Cohort / File(s) Summary
Role System Updates
pkg/connector/role.go, pkg/connector/user.go
Adds "owner" role constant to role enumeration and implements owner role assignment in the user role switch statement when the Owner flag is true.
Linear API Integration
pkg/linear/client.go, pkg/linear/models.go
Extends GraphQL queries (GetUsers, GetOrganization, Authorize) to fetch the owner field; adds Owner bool field to User and ViewerPermissions structs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify the owner role is properly threaded through the role enumeration
  • Confirm GraphQL field selections are added correctly in all three query locations
  • Validate struct field definitions match the Linear API schema

Poem

🐰 An owner arrives in the warren's deep,
New role constants make structures complete,
Fields flow from Linear, GraphQL's beat,
The connector now knows who's in command—
Another hop forward, a well-planned expand! 🌟

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add owner role' directly and clearly summarizes the main change: introducing a new owner role to the connector.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/add_owner_role

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
pkg/linear/client.go (1)

155-199: GetUsers query: owner field is added in the right spot; consider a fallback if schema doesn’t support it.
If Linear ever returns “Cannot query field owner …”, this call will hard-fail; a targeted retry without owner would keep older schemas working (if that matters for this connector).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0135838 and bbdd48b.

⛔ Files ignored due to path filters (3)
  • .github/workflows/ci.yaml is excluded by none and included by none
  • .github/workflows/main.yaml is excluded by none and included by none
  • .golangci.yml is excluded by none and included by none
📒 Files selected for processing (4)
  • pkg/connector/role.go (1 hunks)
  • pkg/connector/user.go (1 hunks)
  • pkg/linear/client.go (3 hunks)
  • pkg/linear/models.go (2 hunks)
🔇 Additional comments (6)
pkg/linear/models.go (2)

45-61: Modeling looks fine; only compatibility risk is whether owner is always present in Linear’s schema.
Go-side change is safe (absent field decodes to false), but if some Linear tenants/plans don’t expose the owner field, the query changes elsewhere would fail.


111-116: ViewerPermissions.Owner addition is straightforward.
No concerns on the Go model; same schema-availability caveat as above.

pkg/linear/client.go (2)

274-336: GetOrganization query: same schema-compatibility concern as GetUsers.
The selection is minimal (id/admin/guest/owner), which is good; just ensure owner is always queryable.


448-469: Authorize query: adding owner makes sense; confirm downstream authorization logic expectations.
This now surfaces an additional privilege bit; ensure anything consuming ViewerPermissions won’t accidentally treat “Owner but not Admin” unexpectedly (if that state exists).

pkg/connector/user.go (1)

39-49: Role precedence is clear and likely correct (Owner > Admin > Guest > User).
If Linear can return overlapping flags (e.g., both owner and admin), this will intentionally pick owner. Worth confirming that’s the desired mapping.

pkg/connector/role.go (1)

24-36: Adding roleOwner + including it in roles is clean and consistent with existing patterns.
Only thing to double-check is whether any tests/assertions depend on the exact enumerated set/order of roles.

@agustin-conductor agustin-conductor merged commit 95a7b2d into main Dec 15, 2025
3 checks passed
@agustin-conductor agustin-conductor deleted the bugfix/add_owner_role branch December 15, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants