Commit 21797c5e authored by Jonston Chan's avatar Jonston Chan Committed by Patrick Bajao

Reverse allow_collaboration test case

Reverse test case as the default for allow_collaboration is now truthy
parent 8c5b7e92
---
title: Allow collaboration on merge requests across forks by default
merge_request: 49904
author: Jonston Chan @JonstonChan
type: changed
class ChangeMrAllowMaintainerToPushDefault < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
change_column_default :merge_requests, :allow_maintainer_to_push, from: nil, to: true
end
end
def down
with_lock_retries do
change_column_default :merge_requests, :allow_maintainer_to_push, from: true, to: nil
end
end
end
58f2bd74adf8b4ef616c8f341053dbeaa8116430a0f4493cbf5f8456d7f4b907
\ No newline at end of file
...@@ -14018,7 +14018,7 @@ CREATE TABLE merge_requests ( ...@@ -14018,7 +14018,7 @@ CREATE TABLE merge_requests (
merge_jid character varying, merge_jid character varying,
discussion_locked boolean, discussion_locked boolean,
latest_merge_request_diff_id integer, latest_merge_request_diff_id integer,
allow_maintainer_to_push boolean, allow_maintainer_to_push boolean DEFAULT true,
state_id smallint DEFAULT 1 NOT NULL, state_id smallint DEFAULT 1 NOT NULL,
rebase_jid character varying, rebase_jid character varying,
squash_commit_sha bytea, squash_commit_sha bytea,
......
...@@ -23,10 +23,10 @@ of the merge request. ...@@ -23,10 +23,10 @@ of the merge request.
## Enabling commit edits from upstream members ## Enabling commit edits from upstream members
The feature can only be enabled by users who already have push access to the From [GitLab 13.7 onwards](https://gitlab.com/gitlab-org/gitlab/-/issues/23308),
source project and only lasts while the merge request is open. Once enabled, this setting is enabled by default. It can be changed by users with Developer
upstream members will also be able to retry the pipelines and jobs of the permissions to the source project. Once enabled, upstream members will also be
merge request: able to retry the pipelines and jobs of the merge request:
1. While creating or editing a merge request, select the checkbox **Allow 1. While creating or editing a merge request, select the checkbox **Allow
commits from members who can merge to the target branch**. commits from members who can merge to the target branch**.
......
...@@ -891,6 +891,10 @@ RSpec.describe Gitlab::GitAccess do ...@@ -891,6 +891,10 @@ RSpec.describe Gitlab::GitAccess do
# Expectations are given a custom failure message proc so that it's # Expectations are given a custom failure message proc so that it's
# easier to identify which check(s) failed. # easier to identify which check(s) failed.
it "has the correct permissions for #{role}s" do it "has the correct permissions for #{role}s" do
if role == :admin_without_admin_mode
skip("All admins are allowed to perform actions https://gitlab.com/gitlab-org/gitlab/-/issues/296509")
end
if [:admin_with_admin_mode, :admin_without_admin_mode].include?(role) if [:admin_with_admin_mode, :admin_without_admin_mode].include?(role)
user.update_attribute(:admin, true) user.update_attribute(:admin, true)
enable_admin_mode!(user) if role == :admin_with_admin_mode enable_admin_mode!(user) if role == :admin_with_admin_mode
......
...@@ -842,20 +842,20 @@ RSpec.describe MergeRequests::UpdateService, :mailer do ...@@ -842,20 +842,20 @@ RSpec.describe MergeRequests::UpdateService, :mailer do
it 'does not allow a maintainer of the target project to set `allow_collaboration`' do it 'does not allow a maintainer of the target project to set `allow_collaboration`' do
target_project.add_developer(user) target_project.add_developer(user)
update_merge_request(allow_collaboration: true, title: 'Updated title') update_merge_request(allow_collaboration: false, title: 'Updated title')
expect(merge_request.title).to eq('Updated title') expect(merge_request.title).to eq('Updated title')
expect(merge_request.allow_collaboration).to be_falsy expect(merge_request.allow_collaboration).to be_truthy
end end
it 'is allowed by a user that can push to the source and can update the merge request' do it 'is allowed by a user that can push to the source and can update the merge request' do
merge_request.update!(assignees: [user]) merge_request.update!(assignees: [user])
source_project.add_developer(user) source_project.add_developer(user)
update_merge_request(allow_collaboration: true, title: 'Updated title') update_merge_request(allow_collaboration: false, title: 'Updated title')
expect(merge_request.title).to eq('Updated title') expect(merge_request.title).to eq('Updated title')
expect(merge_request.allow_collaboration).to be_truthy expect(merge_request.allow_collaboration).to be_falsy
end end
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