Skip to content

Fix resolving namespace conflicts on creating internal user

Bogdan Denkovych requested to merge bdenkovych-issue-363813 into master

What does this MR do and why?

Related to #363813 (closed)

While investigating customer issue https://gitlab.com/gitlab-com/sec-sub-department/section-sec-request-for-help/-/issues/276, we found that the root cause of issue was unsuccessful Ghost User creation(Users::Internal.ghost), see https://gitlab.com/gitlab-com/sec-sub-department/section-sec-request-for-help/-/issues/276#note_1924606159. ) There reason why creation of the the Ghost User failed is that group with ghost namespace(Namespace.by_path('ghost')) was created prior to creation of the the Ghost User. While creating internal users the existing implementation does not check namespaces paths to resolve conflicts. When there is a a group created with namespace path as ghost, alert-bot, migration-bot, GitLab-Security-Bot, support-bot, automation-bot, GitLab-Llm-Bot, GitLab-Admin-Bot prior creating internal users for those usernames, it will raise the error. We found out that it has been known issue for a while, see #363813 (closed).

This MR fixes resolving namespace conflicts on creating internal user.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Bogdan Denkovych

Merge request reports