Skip to content

Remove legacy user role implementation - #1067

Open
taobojlen wants to merge 9 commits into
fix/seed-system-rolesfrom
refactor/remove-legacy-user-role-columns
Open

Remove legacy user role implementation#1067
taobojlen wants to merge 9 commits into
fix/seed-system-rolesfrom
refactor/remove-legacy-user-role-columns

Conversation

@taobojlen

@taobojlen taobojlen commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Context & Requests for Reviewers

Follow-up from #1061. Now that all orgs have DB-backed roles and permissions, we don't need the fallback code, and we don't need the legacy role column in the database. Instead, we can always use role_id -- an actual foreign key that refers to the role in the database.

Tests

I ran this locally, using an org first created on main, and tested that I can click around (+ edit permissions) without issues.

(Optional) Rollout Plan

Because this removes a GraphQL field, any live users may get some errors in their browsers until they refresh their page. I think this is acceptable for this self-hosted software. The alternative is to deprecate the field and stop using it, and then only later (when everyone has updated to that version), then fully remove it. I don't think the juice is worth the squeeze there.

Checklist

Only check items that apply to this PR; leave the rest unchecked.

  • If you changed anything user-facing (i.e. user interface or APIs):
    Did you update the CHANGELOG.md and related docs?

  • If you changed server/models/**/{ContentTypeModel,ActionModel,RuleModel,PolicyModel}.ts:
    Did you update the corresponding history tables and their triggers?

  • If you changed db/src/scripts/** and used CREATE TABLE, ADD COLUMN, or ALTER COLUMN:
    Are as many columns marked NOT NULL as possible? If some columns can sometimes be null depending on other columns, are there CHECK constraints capturing those relationships, and are these also reflected using unions in the associated Kysely types?

  • If you added a new signal in server/services/signalsService/signals/**:
    Did you classify every error case as a permanent error (SignalPermanentError, no retry) or a normal error (retryable)? Any case where the signal can't determine a score should be a SignalPermanentError.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: b0e0166c-fc15-4b38-ae29-e397e98bd023

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

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

@taobojlen
taobojlen force-pushed the refactor/remove-legacy-user-role-columns branch from adc8f56 to 3b22dc0 Compare August 31, 2026 14:53
@taobojlen
taobojlen force-pushed the refactor/remove-legacy-user-role-columns branch from 3b22dc0 to 5799621 Compare August 31, 2026 14:59
@taobojlen
taobojlen force-pushed the refactor/remove-legacy-user-role-columns branch from 5799621 to a7b0956 Compare September 1, 2026 10:53
@taobojlen taobojlen changed the title refactor/remove legacy user role columns remove legacy user role implementation Sep 1, 2026
@taobojlen taobojlen changed the title remove legacy user role implementation Remove legacy user role implementation Sep 1, 2026
@taobojlen
taobojlen marked this pull request as ready for review September 1, 2026 13:29
@taobojlen
taobojlen requested review from a team and julietshen as code owners September 1, 2026 13:29

@julietshen julietshen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

the DROP COLUMN part might need to be called out in the rollout note to make it super clear that the DB change is forward-only.

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.

2 participants