Skip to content

Enable Organization Presence validation for Runner Fleet rake task

What does this MR do and why?

In !155732 (merged), we added validation for presence of an Organization on Namespaces. Since this MR was already quite big and impactful, most 'Create Namespace' code paths are wrapped in a Namespace.with_disabled_organization_validation method, which caused the validation to be skipped.

This MR will enable the validation for the gitlab:seed:runner_fleet rake task.

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

  1. In rails console enable these feature flags:
    Feature.enable(:require_organization) && Feature.enable(:allow_organization_creation)
  2. Run the rake rask:
    bundle exec rake gitlab:seed:runner_fleet[root,'with_org-']
  3. Check the organization_id of the newly created projects and groups using gdk psql:
    gitlabhq_development=# select organization_id, path from projects where path like 'with_org%' union select organization_id, path from namespaces where path like 'with_org%';;
     organization_id |            path
    -----------------+----------------------------
             1002646 | with_org-group-1.1.1
             1002646 | with_org-project-1-1-2-1
             1002646 | with_org-top-level-group-1
             1002646 | with_org-top-level-group-2
             1002646 | with_org-project-1-1-1-1
             1002646 | with_org-group-1.1
             1002646 | with_org-group-2.1
             1002646 | with_org-project-2-1-1
             1002646 | with_org-group-1.1.2
     (9 rows)

No errors should be raised.

Related to #411832 (closed)

Merge request reports

Loading