Scope + menu dropdown to current organization
What does this MR do and why?
Related to #608081 and !253291 (merged).
When a user has adopted organizations, the + (Create new…) top-bar menu now scopes its create links to the relevant organization:
- General section — scopes to the request's organization (resolved from the
/o/:organization_pathsegment or the group/project in the URL, including legacy global routes) and is titled In this organization instead of In GitLab. Links point to the organization-scoped pages (/o/:organization_path/...). - Group section — scopes the New project/repository and New subgroup links to the group's own organization, so they create within it even when the group is reached via a legacy global route.
"Adopted organizations" is determined by Organizations::Release.enrolled?(current_user). The default organization is never URL-scoped (scoped_paths? is false), so its links stay global and the section keeps the In GitLab title.
The change is gated behind the organization_scoped_new_dropdown gitlab_com_derisk feature flag (see Feature flag section below).
Feature flag
This change is behind the organization_scoped_new_dropdown feature flag (type gitlab_com_derisk, default disabled) out of an abundance of caution. Should be low-risk change but we're putting Organizations::Release.enrolled? in a high-volume critical request path.
- Rollout issue: #629444
When "In this organization" appears
Assumes the organization_scoped_new_dropdown feature flag is enabled; when it is disabled the menu is always global (In GitLab).
| Scenario | Section title | Link scope |
|---|---|---|
| SaaS (.com) — user enrolled (has a non-default active organization), viewing a scoped (non-default) organization or one of its groups/projects — including via a legacy global URL | In this organization | Org-scoped (/o/:organization_path/...) |
| SaaS (.com) — user enrolled, but the resolved organization is the default (unscoped) organization | In GitLab | Global |
| SaaS (.com) — user not enrolled (no non-default active organization) | In GitLab | Global |
Self-managed / Dedicated — no enrollment flag passed, so Organizations::Release.enrolled? is always false |
In GitLab | Global |
Notes:
- "Enrolled" is
Organizations::Release.enrolled?(current_user). On.comthis is true when the user has a non-default active organization; on self-managed it requires an enrollment flag (none is passed here), so it is alwaysfalse. - The default organization is never URL-scoped (
scoped_paths?isfalse), so even for enrolled users its links stay global. - The group section scopes to the group's own organization; the general section scopes to the request's organization (resolved from the
/o/:pathsegment or the group/project in the URL).
Screenshots or screen recordings
Notice the URL rendered in the bottom left corner of each screenshot, as well as which menu sections appear.
Note: Since these screenshots were posted, new organization and new snippet no longer appear in the "In this organization" menu.
| Before | After |
|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to set up and validate locally
- Go to
/rails/featuresand enable theorg_stage_experimental,org_stage_beta, andorganization_scoped_new_dropdownfeature flags. - Go to
/o/newand create an organization. - Open the
+menu — the general section should be titled In this organization and its links should be org-scoped.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.





