Read about our upcoming Code of Conduct on this issue

Commit e22d200a authored by Mark Chao's avatar Mark Chao Committed by Dmitriy Zaporozhets
Browse files

Resolve "Rename the `Master` role to `Maintainer`" Backend

parent 2649cbe0cb26
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
let(:user2) { create(:user) } let(:user2) { create(:user) }
before do before do
project.add_master(user) project.add_maintainer(user)
project.add_master(user2) project.add_maintainer(user2)
end end
describe 'GET #index' do describe 'GET #index' do
...@@ -291,7 +291,7 @@ def update_snippet(snippet_params = {}, additional_params = {}) ...@@ -291,7 +291,7 @@ def update_snippet(snippet_params = {}, additional_params = {})
def mark_as_spam def mark_as_spam
admin = create(:admin) admin = create(:admin)
create(:user_agent_detail, subject: snippet) create(:user_agent_detail, subject: snippet)
project.add_master(admin) project.add_maintainer(admin)
sign_in(admin) sign_in(admin)
post :mark_as_spam, post :mark_as_spam,
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
end end
before do before do
project.add_user(user, Gitlab::Access::MASTER) project.add_user(user, Gitlab::Access::MAINTAINER)
project.repository.create_file(user, file_path_1, 'something valid', project.repository.create_file(user, file_path_1, 'something valid',
message: 'test 3', branch_name: 'master') message: 'test 3', branch_name: 'master')
end end
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
before do before do
sign_in(user) sign_in(user)
project.add_master(user) project.add_maintainer(user)
controller.instance_variable_set(:@project, project) controller.instance_variable_set(:@project, project)
end end
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
before do before do
sign_in(user) sign_in(user)
project.add_master(user) project.add_maintainer(user)
end end
describe 'GET #show' do describe 'GET #show' do
......
...@@ -759,7 +759,7 @@ def update_project(**parameters) ...@@ -759,7 +759,7 @@ def update_project(**parameters)
before do before do
sign_in(user) sign_in(user)
project.add_master(user) project.add_maintainer(user)
end end
context 'when project export is enabled' do context 'when project export is enabled' do
...@@ -787,7 +787,7 @@ def update_project(**parameters) ...@@ -787,7 +787,7 @@ def update_project(**parameters)
before do before do
sign_in(user) sign_in(user)
project.add_master(user) project.add_maintainer(user)
end end
context 'object storage disabled' do context 'object storage disabled' do
...@@ -847,7 +847,7 @@ def update_project(**parameters) ...@@ -847,7 +847,7 @@ def update_project(**parameters)
before do before do
sign_in(user) sign_in(user)
project.add_master(user) project.add_maintainer(user)
end end
context 'when project export is enabled' do context 'when project export is enabled' do
...@@ -875,7 +875,7 @@ def update_project(**parameters) ...@@ -875,7 +875,7 @@ def update_project(**parameters)
before do before do
sign_in(user) sign_in(user)
project.add_master(user) project.add_maintainer(user)
end end
context 'when project export is enabled' do context 'when project export is enabled' do
......
...@@ -269,13 +269,13 @@ ...@@ -269,13 +269,13 @@
context "when the user has access to the project" do context "when the user has access to the project" do
before do before do
project.add_master(user) project.add_maintainer(user)
end end
context "when the user is blocked" do context "when the user is blocked" do
before do before do
user.block user.block
project.add_master(user) project.add_maintainer(user)
end end
it "redirects to the sign in page" do it "redirects to the sign in page" do
...@@ -475,13 +475,13 @@ ...@@ -475,13 +475,13 @@
context "when the user has access to the project" do context "when the user has access to the project" do
before do before do
project.add_master(user) project.add_maintainer(user)
end end
context "when the user is blocked" do context "when the user is blocked" do
before do before do
user.block user.block
project.add_master(user) project.add_maintainer(user)
end end
it "redirects to the sign in page" do it "redirects to the sign in page" do
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
trait(:guest) { access_level GroupMember::GUEST } trait(:guest) { access_level GroupMember::GUEST }
trait(:reporter) { access_level GroupMember::REPORTER } trait(:reporter) { access_level GroupMember::REPORTER }
trait(:developer) { access_level GroupMember::DEVELOPER } trait(:developer) { access_level GroupMember::DEVELOPER }
trait(:master) { access_level GroupMember::MASTER } trait(:maintainer) { access_level GroupMember::MAINTAINER }
trait(:owner) { access_level GroupMember::OWNER } trait(:owner) { access_level GroupMember::OWNER }
trait(:access_request) { requested_at Time.now } trait(:access_request) { requested_at Time.now }
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
factory :project_member do factory :project_member do
user user
project project
master maintainer
trait(:guest) { access_level ProjectMember::GUEST } trait(:guest) { access_level ProjectMember::GUEST }
trait(:reporter) { access_level ProjectMember::REPORTER } trait(:reporter) { access_level ProjectMember::REPORTER }
trait(:developer) { access_level ProjectMember::DEVELOPER } trait(:developer) { access_level ProjectMember::DEVELOPER }
trait(:master) { access_level ProjectMember::MASTER } trait(:maintainer) { access_level ProjectMember::MAINTAINER }
trait(:access_request) { requested_at Time.now } trait(:access_request) { requested_at Time.now }
trait(:invited) do trait(:invited) do
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
# user have access to the project. Our specs don't use said service class, # user have access to the project. Our specs don't use said service class,
# thus we must manually refresh things here. # thus we must manually refresh things here.
unless project.group || project.pending_delete unless project.group || project.pending_delete
project.add_master(project.owner) project.add_maintainer(project.owner)
end end
project.group&.refresh_members_authorized_projects project.group&.refresh_members_authorized_projects
......
...@@ -39,23 +39,23 @@ ...@@ -39,23 +39,23 @@
end end
end end
trait :masters_can_push do trait :maintainers_can_push do
transient do transient do
default_push_level false default_push_level false
end end
after(:build) do |protected_branch| after(:build) do |protected_branch|
protected_branch.push_access_levels.new(access_level: Gitlab::Access::MASTER) protected_branch.push_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end end
end end
after(:build) do |protected_branch, evaluator| after(:build) do |protected_branch, evaluator|
if evaluator.default_access_level && evaluator.default_push_level if evaluator.default_access_level && evaluator.default_push_level
protected_branch.push_access_levels.new(access_level: Gitlab::Access::MASTER) protected_branch.push_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end end
if evaluator.default_access_level && evaluator.default_merge_level if evaluator.default_access_level && evaluator.default_merge_level
protected_branch.merge_access_levels.new(access_level: Gitlab::Access::MASTER) protected_branch.merge_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end end
end end
......
...@@ -27,19 +27,19 @@ ...@@ -27,19 +27,19 @@
end end
end end
trait :masters_can_create do trait :maintainers_can_create do
transient do transient do
default_access_level false default_access_level false
end end
after(:build) do |protected_tag| after(:build) do |protected_tag|
protected_tag.create_access_levels.new(access_level: Gitlab::Access::MASTER) protected_tag.create_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end end
end end
after(:build) do |protected_tag, evaluator| after(:build) do |protected_tag, evaluator|
if evaluator.default_access_level if evaluator.default_access_level
protected_tag.create_access_levels.new(access_level: Gitlab::Access::MASTER) protected_tag.create_access_levels.new(access_level: Gitlab::Access::MAINTAINER)
end end
end end
end end
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
it 'renders shared project' do it 'renders shared project' do
empty_project = create(:project) empty_project = create(:project)
empty_project.project_group_links.create!( empty_project.project_group_links.create!(
group_access: Gitlab::Access::MASTER, group_access: Gitlab::Access::MAINTAINER,
group: group group: group
) )
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
describe 'add admin himself to a project' do describe 'add admin himself to a project' do
before do before do
project.add_master(user) project.add_maintainer(user)
end end
it 'adds admin a to a project as developer', :js do it 'adds admin a to a project as developer', :js do
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
describe 'admin remove himself from a project' do describe 'admin remove himself from a project' do
before do before do
project.add_master(user) project.add_maintainer(user)
project.add_developer(current_user) project.add_developer(current_user)
end end
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
let!(:project2) { create(:project) } let!(:project2) { create(:project) }
before do before do
project1.add_master(user) project1.add_maintainer(user)
project2.add_master(user) project2.add_maintainer(user)
end end
describe "atom feed" do describe "atom feed" do
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) } let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) }
before do before do
project.add_master(user) project.add_maintainer(user)
issue_event(issue, user) issue_event(issue, user)
note_event(note, user) note_event(note, user)
visit dashboard_projects_path(:atom, feed_token: user.feed_token) visit dashboard_projects_path(:atom, feed_token: user.feed_token)
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
let!(:push_event_payload) { create(:push_event_payload, event: push_event) } let!(:push_event_payload) { create(:push_event_payload, event: push_event) }
before do before do
project.add_master(user) project.add_maintainer(user)
issue_event(issue, user) issue_event(issue, user)
note_event(note, user) note_event(note, user)
merge_request_event(merge_request, user) merge_request_event(merge_request, user)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
let!(:issue2) { create(:issue, project: project, title: 'hij', description: 'klm') } let!(:issue2) { create(:issue, project: project, title: 'hij', description: 'klm') }
before do before do
project.add_master(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
let!(:user2) { create(:user) } let!(:user2) { create(:user) }
before do before do
project.add_master(user) project.add_maintainer(user)
project.add_master(user2) project.add_maintainer(user2)
set_cookie('sidebar_collapsed', 'true') set_cookie('sidebar_collapsed', 'true')
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
let!(:issue3) { create(:labeled_issue, project: project, title: 'testing 3', labels: [label], relative_position: 1) } let!(:issue3) { create(:labeled_issue, project: project, title: 'testing 3', labels: [label], relative_position: 1) }
before do before do
project.add_master(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
end end
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
let!(:issue1) { create(:issue, project: project) } let!(:issue1) { create(:issue, project: project) }
before do before do
project.add_master(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
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