Commit b936b2d5 authored by Markus Koller's avatar Markus Koller

Merge branch 'rp/change-instance-administrators-name' into 'master'

Change name of GitLab Instance Administrators group

See merge request gitlab-org/gitlab!41684
parents f84ce98f 493f00a7
...@@ -22,7 +22,9 @@ class ApplicationSetting < ApplicationRecord ...@@ -22,7 +22,9 @@ class ApplicationSetting < ApplicationRecord
belongs_to :push_rule belongs_to :push_rule
alias_attribute :self_monitoring_project_id, :instance_administration_project_id alias_attribute :self_monitoring_project_id, :instance_administration_project_id
belongs_to :instance_administrators_group, class_name: "Group" belongs_to :instance_group, class_name: "Group", foreign_key: 'instance_administrators_group_id'
alias_attribute :instance_group_id, :instance_administrators_group_id
alias_attribute :instance_administrators_group, :instance_group
def self.repository_storages_weighted_attributes def self.repository_storages_weighted_attributes
@repository_storages_weighted_atributes ||= Gitlab.config.repositories.storages.keys.map { |k| "repository_storages_weighted_#{k}".to_sym }.freeze @repository_storages_weighted_atributes ||= Gitlab.config.repositories.storages.keys.map { |k| "repository_storages_weighted_#{k}".to_sym }.freeze
......
---
title: Change name of GitLab Instance Administrators group to GitLab Instance
merge_request: 41684
author:
type: changed
...@@ -6,6 +6,8 @@ module Gitlab ...@@ -6,6 +6,8 @@ module Gitlab
class CreateGroup < ::BaseService class CreateGroup < ::BaseService
include Stepable include Stepable
NAME = 'GitLab Instance'
PATH_PREFIX = 'gitlab-instance'
VISIBILITY_LEVEL = Gitlab::VisibilityLevel::INTERNAL VISIBILITY_LEVEL = Gitlab::VisibilityLevel::INTERNAL
steps :validate_application_settings, steps :validate_application_settings,
...@@ -117,12 +119,12 @@ module Gitlab ...@@ -117,12 +119,12 @@ module Gitlab
def create_group_params def create_group_params
{ {
name: 'GitLab Instance Administrators', name: NAME,
visibility_level: VISIBILITY_LEVEL, visibility_level: VISIBILITY_LEVEL,
# The 8 random characters at the end are so that the path does not # The 8 random characters at the end are so that the path does not
# clash with any existing group that the user might have created. # clash with any existing group that the user might have created.
path: "gitlab-instance-administrators-#{SecureRandom.hex(4)}" path: "#{PATH_PREFIX}-#{SecureRandom.hex(4)}"
} }
end end
end end
......
...@@ -9,7 +9,7 @@ module Gitlab ...@@ -9,7 +9,7 @@ module Gitlab
include SelfMonitoring::Helpers include SelfMonitoring::Helpers
VISIBILITY_LEVEL = Gitlab::VisibilityLevel::INTERNAL VISIBILITY_LEVEL = Gitlab::VisibilityLevel::INTERNAL
PROJECT_NAME = 'GitLab self monitoring' PROJECT_NAME = 'Monitoring'
steps :validate_application_settings, steps :validate_application_settings,
:create_group, :create_group,
......
...@@ -65,8 +65,8 @@ RSpec.describe Gitlab::DatabaseImporters::InstanceAdministrators::CreateGroup do ...@@ -65,8 +65,8 @@ RSpec.describe Gitlab::DatabaseImporters::InstanceAdministrators::CreateGroup do
it 'creates group' do it 'creates group' do
expect(result[:status]).to eq(:success) expect(result[:status]).to eq(:success)
expect(group).to be_persisted expect(group).to be_persisted
expect(group.name).to eq('GitLab Instance Administrators') expect(group.name).to eq('GitLab Instance')
expect(group.path).to start_with('gitlab-instance-administrators') expect(group.path).to start_with('gitlab-instance')
expect(group.path.split('-').last.length).to eq(8) expect(group.path.split('-').last.length).to eq(8)
expect(group.visibility_level).to eq(described_class::VISIBILITY_LEVEL) expect(group.visibility_level).to eq(described_class::VISIBILITY_LEVEL)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment