-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename core developer (take 2) #4639
base: main
Are you sure you want to change the base?
Conversation
61d63b1
to
31f9050
Compare
df093e2
to
bd8f5a8
Compare
I have tested locally this with a fresh dump of the prod database, running |
9598117
to
9ca2b76
Compare
9ca2b76
to
e9d04b2
Compare
I think the non-docs commits should be squished before merging, as they're atomic, I think? You don't want to roll back or deploy any one individually. Re-name and references work together, you need to migrate if your DB has been either side of these commits. |
@@ -0,0 +1,44 @@ | |||
# Generated by Django 5.1.1 on 2024-10-02 11:00 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is mostly hand-written and should have a docstring explaining why it exists, what the purpose and rationale are, and the approach taken. If anyone need to come back to where we are I think that will be very non-obvious.
@mikerkelly yes, will squash before merge - keeping them separate made it easier for me to iterate on reworking this. |
1c716e4
to
2af1d21
Compare
2af1d21
to
81cc5ed
Compare
Where a role path in the db is not found in the current codebase, create a skeleton permissionless role instead of blowing up. This means we can remove role names from the python code and legacy entries in the db will no longer cause adverse effects. This supports finding of the old roles in (for example) a migration, but leaves these old unknown roles untouched unless they are explicitly acted on.
This role controls access to the Staff Area, role holders might not necessarily be developers, but admin staff. Therefore, Staff Area Administrator was deemed to be a better fit for this role
Coupling of migrations to role classes (be the historic or current) causes difficulties for future changes to role classes. This migration therefore uses local classes which will match database values created from the real role classes, and whose own corresponding database values will parse to real role classes (if existing).
81cc5ed
to
81e4354
Compare
fixes #4604
In order for us to successfully migrate from one role to another, we need to be able to remove the old role from the codebase.
Prior to this PR, there was no graceful handling of the situation where a user record in the db had
roles
whose path was no longer present in the codebase.This change handles this situation more gracefully by creating a skeleton role type with that path (but no model associations or permissions) in such a way that these "legacy" roles round trip from the database.
This change includes the change of name of role in the codebase, this more graceful role parsing, and a migration to change the existing role records in the database. The migration also includes local fake role classes and as such is not coupled to the old
CoreDeveloper
or newStaffAreaAdministrator
roles in the codebase.