Remove legacy user role implementation - #1067
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
adc8f56 to
3b22dc0
Compare
3b22dc0 to
5799621
Compare
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0395d-6d80-73a8-b33a-86a09a22cede
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0395d-6d80-73a8-b33a-86a09a22cede
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0395d-6d80-73a8-b33a-86a09a22cede
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0395d-6d80-73a8-b33a-86a09a22cede
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0395d-6d80-73a8-b33a-86a09a22cede
5799621 to
a7b0956
Compare
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0395d-6d80-73a8-b33a-86a09a22cede
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0395d-6d80-73a8-b33a-86a09a22cede
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0395d-6d80-73a8-b33a-86a09a22cede
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a0395d-6d80-73a8-b33a-86a09a22cede
julietshen
left a comment
There was a problem hiding this comment.
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.
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
rolecolumn in the database. Instead, we can always userole_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 changedserver/models/**/{ContentTypeModel,ActionModel,RuleModel,PolicyModel}.ts:Did you update the corresponding history tables and their triggers?
If you changeddb/src/scripts/**and usedCREATE TABLE,ADD COLUMN, orALTER COLUMN:Are as many columns marked
NOT NULLas possible? If some columns can sometimes be null depending on other columns, are thereCHECKconstraints capturing those relationships, and are these also reflected using unions in the associated Kysely types?If you added a new signal inserver/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 aSignalPermanentError.