Commit 51c56902 authored by rpereira2's avatar rpereira2

Change name of GitLab Instance Administrators group

Change name to "GitLab Instance", since we might invite non-admins to
it.
Name change suggested by Sid.
parent 9063dea6
...@@ -21,7 +21,9 @@ class ApplicationSetting < ApplicationRecord ...@@ -21,7 +21,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
......
...@@ -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