Skip to content

Route new/create project through Org scope

What does this MR do and why?

  • Adds Organization scoped routes for new and create project
    • Only applies to Organizations that are not the Default Organization.
  • Automatically maps global URL helpers to Organization URL helpers
  • Defines a way forward for further Organization scoped routes - there are many to come

There is a more detailed description of Organization paths in the Organization Path Scope ADR.

The primary changes are:

  • app/helpers/routing/organizations_helper.rb overrides the global route helpers that have an Organization equivalent.
  • config/routes/organizations.rb is where we create the /o/ Organization scoped routes.

The URL helper overrides can not be placed behind a feature flag because it's part of the Ruby on Rails initialization process. However the select of global vs Organization scoped paths by the modified URL helpers are behind a feature flag.

Relates to #553914 (closed)

References

Screenshots or screen recordings

Before After
Screenshot_2025-07-14_at_10.51.05_AM Screenshot_2025-07-14_at_10.47.10_AM
Screenshot_2025-07-14_at_10.46.55_AM Screenshot_2025-07-14_at_10.47.21_AM

How to set up and validate locally

  1. In rails console enable the feature flag
Feature.enable :allow_organization_creation
Feature.enable :organization_switching
Feature.enable :ui_for_organizations
Feature.enable :organization_scoped_paths
  1. Create an Organization through the + sidebar button.
  2. Navigate to Organization Groups & Projects

Screenshot_2025-07-18_at_9.38.50_AM

  1. Create a group through the New group button
  2. From within that Group click the New project button and observe the URL is /o/ Organization scoped.
  3. Create a project and observe the project is successfully created within the group.

MR acceptance checklist

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

Edited by Rémy Coutable

Merge request reports

Loading