Skip to content

Draft: Explicitly set organization_id when creating new Groups

Rutger Wessels requested to merge 443338-pass-organization_id-subscription into master

What does this MR do and why?

As part of Cells project, we are working on adding support for Organizations. One of the implications is that Groups should be assigned an Organization.

In this MR, we started to use Current.organization which will be set by future Cells router. However, Current is set in Rack Middleware and usage should be limited to request layer (controllers)

So we need to adapt all code paths that are using Groups::CreateService. In order to keep the MR's small, I decided to create a series of MR's:

MR Description
!149109 (merged) Pass organization explicitly for manually creation of groups
!150829 (merged) Pass organization explicitly for group creation related to import
This MR Remaining code paths
!149111 Clean up

Code paths in this MR:

  • ee/app/controllers/subscriptions_controller.rb
  • ee/app/services/gitlab_subscriptions/trials/base_create_service.rb
    • GitlabSubscriptions::Trials::CreateDuoProService
  • ee/app/services/registrations/import_namespace_create_service.rb
    • ee/app/controllers/registrations/groups_controller.rb
  • ee/app/services/registrations/standard_namespace_create_service.rb
    • ee/app/controllers/registrations/groups_controller.rb
  • ee/lib/gitlab/duo/developments/setup.rb
  • lib/gitlab/seeders/ci/runner/runner_fleet_seeder.rb
  • lib/tasks/gitlab/seed/group_seed.rake

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.

How to set up and validate locally

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

Related to #443338

Edited by Rutger Wessels

Merge request reports