fix: remove the unassignable Spaces administrator role - #1391
Merged
igboyes merged 2 commits intoAug 14, 2026
Conversation
Python dropped the role in migration 997cf9a66f10, which remapped existing rows to base, converted administrator_role to text and dropped the administratorrole type. The role picker still offered it and assigning it failed against the administrator_role_valid CHECK constraint. The Drizzle mirror declared a pgEnum for the dropped type; it is now text plus $type, matching jobs.state.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The allowed administrator role values are duplicated across the contracts type, Zod schema, ADMINISTRATOR_ROLES, and test fakes; consider centralizing them from a single source (e.g., the AdministratorRoleName union) to reduce the risk of future divergence.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The allowed administrator role values are duplicated across the contracts type, Zod schema, ADMINISTRATOR_ROLES, and test fakes; consider centralizing them from a single source (e.g., the AdministratorRoleName union) to reduce the risk of future divergence.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Matches PERMISSION_NAMES in permissions.ts, so the request validator's enum cannot drift from the union.
Member
Author
|
Applied in 8b7e957:
|
igboyes
deleted the
igboyes/vir-2977-drop-the-spaces-administrator-role
branch
August 14, 2026 18:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spaces, but assigning it 500s: Python's migration997cf9a66f10remapped those rows tobaseand added anadministrator_role_validCHECK permitting onlyfull,settings,usersandbase. Dropped it fromAdministratorRoleName, the level map,ADMINISTRATOR_ROLESand the request validator.administratorroletype, so the Drizzle mirror was describing a type Postgres no longer has.users.administrator_roleis nowtext().$type<AdministratorRoleName>(), matchingjobs.state.Free Spacesline from thebaserole description to match Python's current docstring.