Skip to content

Move personal namespace creation to outside of User model

What does this MR do and why?

This MR is preparation to make the user's personal namespace optional.

This is a code refactor to move personal namespace creation to outside of the User model. Instead of the personal namespace being created implicitly on User validation/save it now needs to be explicitly created.

Importantly a User is still not valid without a personal namespace. I've explicitly added required: true on the User has_one :namespace association. This will be flipped to required: false at a later date.

The behavior change has been wrapped in a feature flag called create_user_ns_outside_model.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #427730

Edited by Alex Pooley

Merge request reports