Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
21797c5e
Commit
21797c5e
authored
Jan 07, 2021
by
Jonston Chan
Committed by
Patrick Bajao
Jan 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverse allow_collaboration test case
Reverse test case as the default for allow_collaboration is now truthy
parent
8c5b7e92
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
9 deletions
+36
-9
changelogs/unreleased/23308-allow-commits-to-fork-from-maintainers.yml
...released/23308-allow-commits-to-fork-from-maintainers.yml
+5
-0
db/migrate/20201214000000_change_mr_allow_maintainer_to_push_default.rb
...01214000000_change_mr_allow_maintainer_to_push_default.rb
+17
-0
db/schema_migrations/20201214000000
db/schema_migrations/20201214000000
+1
-0
db/structure.sql
db/structure.sql
+1
-1
doc/user/project/merge_requests/allow_collaboration.md
doc/user/project/merge_requests/allow_collaboration.md
+4
-4
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+4
-0
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+4
-4
No files found.
changelogs/unreleased/23308-allow-commits-to-fork-from-maintainers.yml
0 → 100644
View file @
21797c5e
---
title
:
Allow collaboration on merge requests across forks by default
merge_request
:
49904
author
:
Jonston Chan @JonstonChan
type
:
changed
db/migrate/20201214000000_change_mr_allow_maintainer_to_push_default.rb
0 → 100644
View file @
21797c5e
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
db/schema_migrations/20201214000000
0 → 100644
View file @
21797c5e
58f2bd74adf8b4ef616c8f341053dbeaa8116430a0f4493cbf5f8456d7f4b907
\ No newline at end of file
db/structure.sql
View file @
21797c5e
...
@@ -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
,
...
...
doc/user/project/merge_requests/allow_collaboration.md
View file @
21797c5e
...
@@ -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 th
e
permissions to the source project. Once enabled, upstream members will also b
e
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
**
.
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
21797c5e
...
@@ -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
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
21797c5e
...
@@ -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:
tru
e
,
title:
'Updated title'
)
update_merge_request
(
allow_collaboration:
fals
e
,
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_
fals
y
expect
(
merge_request
.
allow_collaboration
).
to
be_
truth
y
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:
tru
e
,
title:
'Updated title'
)
update_merge_request
(
allow_collaboration:
fals
e
,
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_
truth
y
expect
(
merge_request
.
allow_collaboration
).
to
be_
fals
y
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment