Draft: Make the personal namespace optional
What does this MR do and why?
Make user personal namespace optional. Primary plan is to disconnect the personal namespace creation via the User model callbacks.
- Don't build on user create
- Auto build user personal namespace in FactoryBot so specs pass for now
- Build in
Users::CreateService
~/code/gdk/gitlab > ag -lw 'user\.namespace' app ee/app
app/models/namespace.rb
app/serializers/merge_request_current_user_entity.rb
app/serializers/admin/abuse_report_details_entity.rb
app/views/admin/users/show.html.haml
app/services/users/migrate_records_to_ghost_user_service.rb
ee/app/controllers/ee/admin/users_controller.rb
ee/app/controllers/ee/profiles/preferences_controller.rb
ee/app/views/profiles/preferences/_code_suggestions_settings.html.haml
Second stage will be to remove the before create user factory callback that creates the user's personal namespace. Then we can amend failing specs to use the uses with_namespace
trait.
Possible roadmap:
- User still requires namespace. Move namespace creation from inside User model to outside the model and into services and elsewhere.
- Make user-namespace associational optional.
Note to self: need to revisit:
- app/services/projects/fork_service.rb
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #427730
Edited by Alex Pooley