Skip to content

Resolve "Seed organization owner"

Alex Pooley requested to merge 463888-seed-organization-owner into master

What does this MR do and why?

Adds the admin as the organization owner of the default organization during instance seeding.

Currently this line will already add the admin as the organization owner, but that feature is scheduled for removal.

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

This will destroy all data on your local database

gdk stop; gdk start db; rails db:drop db:create db:schema:load; gdk restart; yarn

> rails runner db/fixtures/production/001_application_settings.rb
> rails runner db/fixtures/production/002_default_organization.rb
> rails runner db/fixtures/production/003_admin.rb

> rails runner 'puts User.last.organizations.last.attributes'
{"id"=>1, "created_at"=>Wed, 12 Jun 2024 05:37:07.278102000 UTC +00:00, "updated_at"=>Wed, 12 Jun 2024 05:37:07.278102000 UTC +00:00, "name"=>"Default", "path"=>"default", "visibility_level"=>20}

You can run the validation steps and comment out https://gitlab.com/gitlab-org/gitlab/-/blob/d9669d24a11c6062ad5555c41ca2a2d0dec7f670/app/models/user.rb#L389 to emulate removal of #443611.

Related to #463888 (closed)

Edited by Alex Pooley

Merge request reports