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
186c79c3
Commit
186c79c3
authored
Jul 15, 2019
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix assign code owners spec
...by enabling the option in merge request approval setting
parent
350de545
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
97 additions
and
15 deletions
+97
-15
ee/app/views/projects/_merge_request_approvals_settings.html.haml
...iews/projects/_merge_request_approvals_settings.html.haml
+2
-2
ee/app/views/projects/_merge_request_approvals_settings_form.html.haml
...projects/_merge_request_approvals_settings_form.html.haml
+1
-1
ee/app/views/projects/merge_requests/_code_owner_approval_rules.html.haml
...jects/merge_requests/_code_owner_approval_rules.html.haml
+2
-2
qa/qa/ee.rb
qa/qa/ee.rb
+2
-0
qa/qa/ee/page/merge_request/show.rb
qa/qa/ee/page/merge_request/show.rb
+11
-0
qa/qa/ee/page/project/settings/main.rb
qa/qa/ee/page/project/settings/main.rb
+27
-0
qa/qa/ee/page/project/settings/merge_request_approval.rb
qa/qa/ee/page/project/settings/merge_request_approval.rb
+29
-0
qa/qa/page/merge_request/show.rb
qa/qa/page/merge_request/show.rb
+0
-6
qa/qa/page/project/settings/main.rb
qa/qa/page/project/settings/main.rb
+2
-0
qa/qa/page/project/sub_menus/common.rb
qa/qa/page/project/sub_menus/common.rb
+5
-1
qa/qa/resource/merge_request.rb
qa/qa/resource/merge_request.rb
+3
-0
qa/qa/specs/features/browser_ui/3_create/repository/ee_assign_code_owners_spec.rb
...wser_ui/3_create/repository/ee_assign_code_owners_spec.rb
+13
-3
No files found.
ee/app/views/projects/_merge_request_approvals_settings.html.haml
View file @
186c79c3
-
return
unless
@project
.
feature_available?
(
:merge_requests
,
current_user
)
-
return
unless
@project
.
feature_available?
(
:merge_request_approvers
,
current_user
)
%section
.settings.merge-requests-feature.no-animate
#js-merge-request-approval-settings
{
class:
[(
'expanded'
if
expanded
)]
}
%section
.
qa-merge-request-approval-settings.
settings.merge-requests-feature.no-animate
#js-merge-request-approval-settings
{
class:
[(
'expanded'
if
expanded
)]
}
.settings-header
%h4
.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
=
_
(
"Merge request approvals"
)
%button
.btn.js-settings-toggle
{
type:
'button'
}=
expanded
?
_
(
"Collapse"
)
:
_
(
"Expand"
)
...
...
@@ -13,4 +13,4 @@
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
class:
"merge-request-approval-settings-form js-mr-approvals-form"
},
authenticity_token:
true
do
|
f
|
%input
{
name:
'update_section'
,
type:
'hidden'
,
value:
'js-merge-request-approval-settings'
}
=
render
'projects/merge_request_approvals_settings_form'
,
form:
f
,
project:
@project
=
f
.
submit
_
(
"Save changes"
),
class:
"btn btn-success"
=
f
.
submit
_
(
"Save changes"
),
class:
"btn btn-success
qa-save-merge-request-approval-settings-button
"
ee/app/views/projects/_merge_request_approvals_settings_form.html.haml
View file @
186c79c3
...
...
@@ -14,7 +14,7 @@
-
if
project
.
code_owner_approval_required_available?
.form-group.require-code-owner-approval
.form-check
=
form
.
check_box
(
:merge_requests_require_code_owner_approval
,
class:
'form-check-input'
)
=
form
.
check_box
(
:merge_requests_require_code_owner_approval
,
class:
'form-check-input
qa-require-code-owners-approval-checkbox
'
)
=
form
.
label
:merge_requests_require_code_owner_approval
,
class:
'form-check-label'
do
%span
=
_
(
'Require approval from code owners'
)
=
link_to
icon
(
'question-circle'
),
help_page_path
(
'user/project/merge_requests/merge_request_approvals'
,
anchor:
'editing-approvals-premium'
),
target:
'_blank'
...
...
ee/app/views/projects/merge_requests/_code_owner_approval_rules.html.haml
View file @
186c79c3
...
...
@@ -14,9 +14,9 @@
%tr
.d-none.d-sm-table-row
%th
.w-25
=
s_
(
'CodeOwner|Pattern'
)
%th
=
_
(
'Members'
)
%tbody
%tbody
.qa-approver-list
-
code_owner_rules
.
each
do
|
code_owner_approval_rule
|
%tr
%tr
.qa-approver
%td
.monospace
=
code_owner_approval_rule
.
name
%td
.d-none.d-sm-table-cell
-
code_owner_approval_rule
.
approvers
.
each
do
|
approver
|
...
...
qa/qa/ee.rb
View file @
186c79c3
...
...
@@ -68,6 +68,8 @@ module QA
module
Settings
autoload
:ProtectedBranches
,
'qa/ee/page/project/settings/protected_branches'
autoload
:MirroringRepositories
,
'qa/ee/page/project/settings/mirroring_repositories'
autoload
:Main
,
'qa/ee/page/project/settings/main'
autoload
:MergeRequestApproval
,
'qa/ee/page/project/settings/merge_request_approval'
end
module
Pipeline
...
...
qa/qa/ee/page/merge_request/show.rb
View file @
186c79c3
...
...
@@ -32,6 +32,11 @@ module QA
element
:review_preview_toggle
end
view
'ee/app/views/projects/merge_requests/_code_owner_approval_rules.html.haml'
do
element
:approver
element
:approver_list
end
def
start_review
click_element
:start_review
end
...
...
@@ -62,6 +67,12 @@ module QA
def
unresolve_review_discussion
check_element
:unresolve_review_discussion
end
def
approvers
within_element
:approver_list
do
all_elements
(
:approver
).
map
{
|
item
|
item
.
find
(
'img'
)[
'title'
]
}
end
end
end
end
end
...
...
qa/qa/ee/page/project/settings/main.rb
0 → 100644
View file @
186c79c3
# frozen_string_literal: true
module
QA
module
EE
module
Page
module
Project
module
Settings
module
Main
def
self
.
prepended
(
page
)
page
.
module_eval
do
view
'ee/app/views/projects/_merge_request_approvals_settings.html.haml'
do
element
:merge_request_approval_settings
end
end
end
def
expand_request_approval_settings
(
&
block
)
expand_section
(
:merge_request_approval_settings
)
do
MergeRequestApproval
.
perform
(
&
block
)
end
end
end
end
end
end
end
end
qa/qa/ee/page/project/settings/merge_request_approval.rb
0 → 100644
View file @
186c79c3
# frozen_string_literal: true
module
QA
module
EE
module
Page
module
Project
module
Settings
class
MergeRequestApproval
<
QA
::
Page
::
Base
view
'ee/app/views/projects/_merge_request_approvals_settings_form.html.haml'
do
element
:require_code_owners_approval_checkbox
end
view
'ee/app/views/projects/_merge_request_approvals_settings.html.haml'
do
element
:save_merge_request_approval_settings_button
end
def
click_require_code_owners_approval_checkbox
check_element
:require_code_owners_approval_checkbox
end
def
click_save_merge_request_approval_button
click_element
:save_merge_request_approval_settings_button
end
end
end
end
end
end
end
qa/qa/page/merge_request/show.rb
View file @
186c79c3
...
...
@@ -175,12 +175,6 @@ module QA
click_element
:edit_button
end
def
approvers
within_element
:approver_list
do
all_elements
(
:approver
).
map
(
&
:text
)
end
end
def
view_email_patches
click_element
:dropdown_toggle
visit_link_in_element
(
:download_email_patches
)
...
...
qa/qa/page/project/settings/main.rb
View file @
186c79c3
...
...
@@ -5,6 +5,8 @@ module QA
module
Project
module
Settings
class
Main
<
Page
::
Base
prepend
QA
::
EE
::
Page
::
Project
::
Settings
::
Main
include
Common
include
Component
::
Select2
include
SubMenus
::
Project
...
...
qa/qa/page/project/sub_menus/common.rb
View file @
186c79c3
...
...
@@ -12,7 +12,11 @@ module QA
end
def
within_submenu
within
(
'.fly-out-list'
)
do
if
has_css?
(
'.fly-out-list'
)
within
(
'.fly-out-list'
)
do
yield
end
else
yield
end
end
...
...
qa/qa/resource/merge_request.rb
View file @
186c79c3
...
...
@@ -10,6 +10,7 @@ module QA
:description
,
:source_branch
,
:target_branch
,
:target_new_branch
,
:assignee
,
:milestone
,
:labels
,
...
...
@@ -28,6 +29,7 @@ module QA
Repository
::
ProjectPush
.
fabricate!
do
|
resource
|
resource
.
project
=
project
resource
.
branch_name
=
'master'
resource
.
new_branch
=
@target_new_branch
resource
.
remote_branch
=
target_branch
end
end
...
...
@@ -53,6 +55,7 @@ module QA
@labels
=
[]
@file_name
=
"added_file.txt"
@file_content
=
"File Added"
@target_new_branch
=
true
end
def
fabricate!
...
...
qa/qa/specs/features/browser_ui/3_create/repository/ee_assign_code_owners_spec.rb
View file @
186c79c3
# frozen_string_literal: true
module
QA
# https://gitlab.com/gitlab-org/quality/staging/issues/39
context
'Create'
,
:quarantine
do
context
'Create'
do
describe
'Codeowners'
do
it
'merge request assigns code owners as approvers'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
...
...
@@ -25,6 +24,15 @@ module QA
members_page
.
add_member
(
non_approver
.
username
)
end
Page
::
Project
::
Menu
.
perform
(
&
:go_to_general_settings
)
Page
::
Project
::
Settings
::
Main
.
perform
do
|
settings
|
settings
.
expand_request_approval_settings
do
|
page
|
page
.
click_require_code_owners_approval_checkbox
page
.
click_save_merge_request_approval_button
end
end
# Push CODEOWNERS to master
project_push
=
Resource
::
Repository
::
ProjectPush
.
fabricate!
do
|
push
|
push
.
project
=
project
...
...
@@ -36,16 +44,18 @@ module QA
end
# Push a new CODEOWNERS file and create a merge request
Resource
::
MergeRequest
.
fabricate!
do
|
merge_request
|
merge_request
=
Resource
::
MergeRequest
.
fabricate!
do
|
merge_request
|
merge_request
.
title
=
'This is a merge request'
merge_request
.
description
=
'Change code owners'
merge_request
.
project
=
project_push
.
project
merge_request
.
file_name
=
'CODEOWNERS'
merge_request
.
target_new_branch
=
false
merge_request
.
file_content
=
<<~
CONTENT
CODEOWNERS @
#{
non_approver
.
username
}
CONTENT
end
merge_request
.
visit!
# Check that the merge request assigns the original code owner as an
# approver (because the current CODEOWNERS file in the master branch
# doesn't have the new owner yet)
...
...
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