Skip to content

Resolve "Move username validation out of namespace model"

What does this MR do and why?

Currently we check username uniqueness and protected usernames via path validation within the associated personal namespace model. The username validations are better suited on the User model.

We are also making personal namespace optional so we can no longer depend on a user having a namespace:

  • The creation of the user's personal namespace now happens explicitly outside the user model callbacks - !136402 (diffs)
  • The personal namespace will soon be optional - !137713 (merged)

This MR moves the validation to the user model when the user's personal namespace does not exist. The MR skips User based validations to avoid breaching query threshold limits.

This work is also related to decoupling the user and personal namespace relationship.

MR acceptance checklist

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

Closes #429466 (closed)

Edited by Alex Pooley

Merge request reports