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
243e6401
Commit
243e6401
authored
Dec 02, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
98621d44
c3f15d49
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
141 additions
and
9 deletions
+141
-9
app/assets/javascripts/pages/projects/forks/new/components/fork_groups_list.vue
.../pages/projects/forks/new/components/fork_groups_list.vue
+1
-0
doc/administration/troubleshooting/log_parsing.md
doc/administration/troubleshooting/log_parsing.md
+30
-7
ee/app/views/groups/settings/_prevent_forking.html.haml
ee/app/views/groups/settings/_prevent_forking.html.haml
+1
-1
qa/qa/ee/page/group/settings/general.rb
qa/qa/ee/page/group/settings/general.rb
+16
-0
qa/qa/page/project/fork/new.rb
qa/qa/page/project/fork/new.rb
+8
-0
qa/qa/resource/sandbox.rb
qa/qa/resource/sandbox.rb
+13
-0
qa/qa/specs/features/ee/browser_ui/1_manage/group/prevent_forking_outside_group_spec.rb
...r_ui/1_manage/group/prevent_forking_outside_group_spec.rb
+70
-0
spec/support/helpers/features/merge_request_helpers.rb
spec/support/helpers/features/merge_request_helpers.rb
+2
-1
No files found.
app/assets/javascripts/pages/projects/forks/new/components/fork_groups_list.vue
View file @
243e6401
...
...
@@ -85,6 +85,7 @@ export default {
v-model=
"filter"
:placeholder=
"$options.i18n.searchPlaceholder"
class=
"gl-align-self-center gl-ml-auto fork-filtered-search"
data-qa-selector=
"fork_groups_list_search_field"
/>
</
template
>
</gl-tabs>
...
...
doc/administration/troubleshooting/log_parsing.md
View file @
243e6401
...
...
@@ -143,16 +143,39 @@ jq 'select(."grpc.code" != null and ."grpc.code" != "OK")' current
jq
'select(."grpc.time_ms" > 30000)'
current
```
#### Print top three projects by request volume and their three longest durations
```
shell
jq
-s
-r
'map(select(."grpc.request.glProjectPath" != null and ."grpc.request.glProjectPath" != "" and ."grpc.time_ms" != null)) | group_by(."grpc.request.glProjectPath") | sort_by(-length) | limit(3; .[]) | sort_by(-."grpc.time_ms") | "CT: \(length)\tPROJECT: \(.[0]."grpc.request.glProjectPath")\tDURS: \(.[0]."grpc.time_ms"), \(.[1]."grpc.time_ms"), \(.[2]."grpc.time_ms")"'
current
#### Print top ten projects by request volume and their three longest durations
```
shell
jq
--raw-output
--slurp
'
map(
select(
."grpc.request.glProjectPath" != null
and ."grpc.request.glProjectPath" != ""
and ."grpc.time_ms" != null
)
)
| group_by(."grpc.request.glProjectPath")
| sort_by(-length)
| limit(10; .[])
| sort_by(-."grpc.time_ms")
| [
length,
.[0]."grpc.time_ms",
.[1]."grpc.time_ms",
.[2]."grpc.time_ms",
.[0]."grpc.request.glProjectPath"
]
| @sh'
/var/log/gitlab/gitaly/current
\
|
awk
'BEGIN { printf "%7s %10s %10s %10s\t%s\n", "CT", "MAX DURS", "", "", "PROJECT" }
{ printf "%7u %7u ms, %7u ms, %7u ms\t%s\n", $1, $2, $3, $4, $5 }'
```
**Example output**
```
plaintext
CT: 635 PROJECT: groupA/project1 DURS: 4292.269, 4228.853, 2885.548
CT: 462 PROJECT: groupB/project5 DURS: 4368.981, 3623.553, 361.399
CT: 455 PROJECT: groupC/project7 DURS: 387.295, 381.874, 373.988
CT MAX DURS PROJECT
206 4898 ms, 1101 ms, 1032 ms 'groupD/project4'
109 1420 ms, 962 ms, 875 ms 'groupEF/project56'
663 106 ms, 96 ms, 94 ms 'groupABC/project123'
...
```
ee/app/views/groups/settings/_prevent_forking.html.haml
View file @
243e6401
...
...
@@ -2,7 +2,7 @@
.form-group.gl-mb-3
.form-check
=
f
.
check_box
:prevent_forking_outside_group
,
checked:
group
.
prevent_forking_outside_group?
,
class:
'form-check-input'
,
disabled:
!
can_change_prevent_forking?
(
current_user
,
group
)
=
f
.
check_box
:prevent_forking_outside_group
,
checked:
group
.
prevent_forking_outside_group?
,
class:
'form-check-input'
,
disabled:
!
can_change_prevent_forking?
(
current_user
,
group
)
,
data:
{
qa_selector:
'prevent_forking_outside_group_checkbox'
}
=
f
.
label
:prevent_forking_outside_group
,
class:
'form-check-label'
do
%span
.gl-display-block
=
s_
(
'GroupSettings|Prevent forking outside of the group'
)
%span
.text-muted
=
s_
(
'GroupSettings|This setting will prevent group members from forking projects outside of the group.'
)
qa/qa/ee/page/group/settings/general.rb
View file @
243e6401
...
...
@@ -29,6 +29,10 @@ module QA
element
:membership_lock_checkbox
end
view
'ee/app/views/groups/settings/_prevent_forking.html.haml'
do
element
:prevent_forking_outside_group_checkbox
end
view
'ee/app/views/shared/_repository_size_limit_setting.html.haml'
do
element
:repository_size_limit_field
end
...
...
@@ -88,6 +92,18 @@ module QA
click_element
:save_permissions_changes_button
end
def
set_prevent_forking_outside_group_enabled
expand_content
:permission_lfs_2fa_content
check_element
:prevent_forking_outside_group_checkbox
click_element
:save_permissions_changes_button
end
def
set_prevent_forking_outside_group_disabled
expand_content
:permission_lfs_2fa_content
uncheck_element
:prevent_forking_outside_group_checkbox
click_element
:save_permissions_changes_button
end
def
set_repository_size_limit
(
limit
)
find_element
(
:repository_size_limit_field
).
set
limit
end
...
...
qa/qa/page/project/fork/new.rb
View file @
243e6401
...
...
@@ -9,9 +9,17 @@ module QA
element
:fork_namespace_button
end
view
'app/assets/javascripts/pages/projects/forks/new/components/fork_groups_list.vue'
do
element
:fork_groups_list_search_field
end
def
choose_namespace
(
namespace
=
Runtime
::
Namespace
.
path
)
click_element
(
:fork_namespace_button
,
name:
namespace
)
end
def
search_for_group
(
group_name
)
find_element
(
:fork_groups_list_search_field
).
set
(
group_name
)
end
end
end
end
...
...
qa/qa/resource/sandbox.rb
View file @
243e6401
...
...
@@ -76,6 +76,19 @@ module QA
visibility:
'public'
}
end
def
api_put_path
"/groups/
#{
id
}
"
end
def
update_group_setting
(
group_setting
:,
value
:)
put_body
=
{
"
#{
group_setting
}
"
:
value
}
response
=
put
Runtime
::
API
::
Request
.
new
(
api_client
,
api_put_path
).
url
,
put_body
unless
response
.
code
==
HTTP_STATUS_OK
raise
ResourceUpdateFailedError
,
"Could not update
#{
group_setting
}
to
#{
value
}
. Request returned (
#{
response
.
code
}
): `
#{
response
}
`."
end
end
end
end
end
qa/qa/specs/features/ee/browser_ui/1_manage/group/prevent_forking_outside_group_spec.rb
0 → 100644
View file @
243e6401
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Manage'
do
describe
'prevent forking outside group'
do
let!
(
:group_for_fork
)
do
Resource
::
Sandbox
.
fabricate_via_api!
do
|
sandbox_group
|
sandbox_group
.
path
=
"group_for_fork_
#{
SecureRandom
.
hex
(
8
)
}
"
end
end
let
(
:project
)
do
Resource
::
Project
.
fabricate!
do
|
project
|
project
.
name
=
"project_to_fork"
project
.
initialize_with_readme
=
true
end
end
context
'when disabled'
do
before
do
set_prevent_forking_outside_group
(
'disabled'
)
end
it
'allows forking outside of group'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1070'
do
visit_project_and_search_group_for_fork
expect
(
page
).
to
have_text
(
group_for_fork
.
path
)
expect
(
page
).
to
have_text
(
'Select a namespace to fork the project'
)
end
end
context
'when enabled'
do
before
do
set_prevent_forking_outside_group
(
'enabled'
)
end
it
'does not allow forking outside of group'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1107'
do
visit_project_and_search_group_for_fork
expect
(
page
).
not_to
have_text
(
group_for_fork
.
path
)
expect
(
page
).
not_to
have_text
(
'Select a namespace to fork the project'
)
end
end
after
do
project
.
group
.
sandbox
.
update_group_setting
(
group_setting:
'prevent_forking_outside_group'
,
value:
false
)
project
.
remove_via_api!
group_for_fork
.
remove_via_api!
end
def
set_prevent_forking_outside_group
(
enabled_or_disabled
)
Flow
::
Login
.
sign_in
project
.
group
.
sandbox
.
visit!
Page
::
Group
::
Menu
.
perform
(
&
:click_group_general_settings_item
)
Page
::
Group
::
Settings
::
General
.
perform
do
|
general_setting
|
general_setting
.
send
(
"set_prevent_forking_outside_group_
#{
enabled_or_disabled
}
"
)
end
end
def
visit_project_and_search_group_for_fork
project
.
visit!
Page
::
Project
::
Show
.
perform
(
&
:fork_project
)
Page
::
Project
::
Fork
::
New
.
perform
do
|
fork_new
|
fork_new
.
search_for_group
(
group_for_fork
.
path
)
end
end
end
end
end
spec/support/helpers/features/merge_request_helpers.rb
View file @
243e6401
...
...
@@ -7,7 +7,8 @@ module Spec
module
MergeRequestHelpers
def
preload_view_requirements
(
merge_request
,
note
)
# This will load the status fields of the author of the note and merge request
# to avoid queries in when rendering the view being tested.
# to avoid queries when rendering the view being tested.
#
merge_request
.
author
.
status
note
.
author
.
status
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