-
Notifications
You must be signed in to change notification settings - Fork 943
chore: ensure default org always exists #12412
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e4b1bb8
chore: ensure default org always exists
Emyrk b4a4dd4
fix ctx for inserting first user
Emyrk 627c9f8
The system user could not read organizations
Emyrk 179828c
manual dbmem migration
Emyrk db8da5a
Fix first org name check:
Emyrk b830625
correctly return implied roles
Emyrk 6b086c6
fix authz tests
Emyrk 9997f59
ensure everyone group on first user
Emyrk 3977c71
fix old unit test, changed assumption
Emyrk d35933d
log critical on a 'should never happen' parsing org roles
Emyrk 1b8690f
drop code that attempts to correct the implied roles
Emyrk c9af8c0
Test 'TestInitialRoles' to not expect member role
Emyrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ensure everyone group on first user
- Loading branch information
commit 9997f59e0129beddea723822ccfe3a4ac6a511d8
There are no files selected for viewing
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
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
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.
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.
should this also be part of the migration?
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 thought about that too. What I didn't like about the migration was I can't tell if the
INSERT INTO organizations
ran with an insert, or without. So the followup ofINSERT INTO groups
cannot be dependent on if an org did not exist at the start of the migration or not.Putting it in
postFirstUser
ensures that it is a new instance setup, so I know this is safe.Although we do not allow dropping the everyone group, so it should be a safe
INSERT INTO groups ... DO NOTHING
.I can move it to a migration if you feel that is better.
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'm just wary of all this side-effect stuff of creating a user.
I also kind of like the symmetry of creating an org and the corresponding everyone group together, since that's presumably what we'll do when we allow creating new organizations, since there is no similar "first user creation" event to tie it to.
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 saw this comment after the approval merge, my mistake.
I can make another migration for the everyone group and do nothing on conflict.
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.
Up to you