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
503d8542
Commit
503d8542
authored
Feb 27, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-02-27
parents
64270139
81852d1f
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
140 additions
and
73 deletions
+140
-73
app/assets/stylesheets/pages/commits.scss
app/assets/stylesheets/pages/commits.scss
+0
-8
app/controllers/groups/application_controller.rb
app/controllers/groups/application_controller.rb
+0
-4
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+0
-1
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+14
-4
app/models/ci/group_variable.rb
app/models/ci/group_variable.rb
+4
-1
app/models/ci/variable.rb
app/models/ci/variable.rb
+4
-1
app/validators/variable_duplicates_validator.rb
app/validators/variable_duplicates_validator.rb
+2
-0
app/views/groups/issues.html.haml
app/views/groups/issues.html.haml
+3
-4
app/views/groups/merge_requests.html.haml
app/views/groups/merge_requests.html.haml
+1
-1
app/views/layouts/nav/sidebar/_group.html.haml
app/views/layouts/nav/sidebar/_group.html.haml
+2
-3
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+1
-1
changelogs/unreleased/43261-fix-prometheus-installation.yml
changelogs/unreleased/43261-fix-prometheus-installation.yml
+5
-0
changelogs/unreleased/43275-improve-variables-validation-message.yml
...unreleased/43275-improve-variables-validation-message.yml
+5
-0
changelogs/unreleased/43315-gpg-popover.yml
changelogs/unreleased/43315-gpg-popover.yml
+5
-0
changelogs/unreleased/43510-merge-requests-and-issues-don-t-show-for-all-subgroups.yml
...erge-requests-and-issues-don-t-show-for-all-subgroups.yml
+6
-0
spec/features/groups/empty_states_spec.rb
spec/features/groups/empty_states_spec.rb
+81
-43
spec/models/ci/group_variable_spec.rb
spec/models/ci/group_variable_spec.rb
+1
-1
spec/models/ci/variable_spec.rb
spec/models/ci/variable_spec.rb
+1
-1
spec/support/features/variable_list_shared_examples.rb
spec/support/features/variable_list_shared_examples.rb
+2
-0
vendor/prometheus/values.yaml
vendor/prometheus/values.yaml
+3
-0
No files found.
app/assets/stylesheets/pages/commits.scss
View file @
503d8542
...
...
@@ -200,17 +200,9 @@
@media
(
min-width
:
$screen-sm-min
)
{
font-size
:
0
;
div
{
display
:
inline
;
}
.fa-spinner
{
font-size
:
12px
;
}
span
{
font-size
:
6px
;
}
}
.ci-status-link
{
...
...
app/controllers/groups/application_controller.rb
View file @
503d8542
...
...
@@ -19,10 +19,6 @@ class Groups::ApplicationController < ApplicationController
@projects
||=
GroupProjectsFinder
.
new
(
group:
group
,
current_user:
current_user
).
execute
end
def
group_merge_requests
@group_merge_requests
=
MergeRequestsFinder
.
new
(
current_user
,
group_id:
@group
.
id
).
execute
end
def
authorize_admin_group!
unless
can?
(
current_user
,
:admin_group
,
group
)
return
render_404
...
...
app/controllers/groups_controller.rb
View file @
503d8542
...
...
@@ -15,7 +15,6 @@ class GroupsController < Groups::ApplicationController
before_action
:authorize_create_group!
,
only:
[
:new
]
before_action
:group_projects
,
only:
[
:projects
,
:activity
,
:issues
,
:merge_requests
]
before_action
:group_merge_requests
,
only:
[
:merge_requests
]
before_action
:event_filter
,
only:
[
:activity
]
before_action
:user_actions
,
only:
[
:show
,
:subgroups
]
...
...
app/helpers/groups_helper.rb
View file @
503d8542
...
...
@@ -21,6 +21,20 @@ module GroupsHelper
can?
(
current_user
,
:change_share_with_group_lock
,
group
)
end
def
group_issues_count
(
state
:)
IssuesFinder
.
new
(
current_user
,
group_id:
@group
.
id
,
state:
state
,
non_archived:
true
,
include_subgroups:
true
)
.
execute
.
count
end
def
group_merge_requests_count
(
state
:)
MergeRequestsFinder
.
new
(
current_user
,
group_id:
@group
.
id
,
state:
state
,
non_archived:
true
,
include_subgroups:
true
)
.
execute
.
count
end
def
group_icon
(
group
,
options
=
{})
img_path
=
group_icon_url
(
group
,
options
)
image_tag
img_path
,
options
...
...
@@ -85,10 +99,6 @@ module GroupsHelper
end
end
def
group_issues
(
group
)
IssuesFinder
.
new
(
current_user
,
group_id:
group
.
id
).
execute
end
def
remove_group_message
(
group
)
_
(
"You are going to remove %{group_name}. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?"
)
%
{
group_name:
group
.
name
}
...
...
app/models/ci/group_variable.rb
View file @
503d8542
...
...
@@ -6,7 +6,10 @@ module Ci
belongs_to
:group
validates
:key
,
uniqueness:
{
scope: :group_id
}
validates
:key
,
uniqueness:
{
scope: :group_id
,
message:
"(%{value}) has already been taken"
}
scope
:unprotected
,
->
{
where
(
protected:
false
)
}
end
...
...
app/models/ci/variable.rb
View file @
503d8542
...
...
@@ -7,7 +7,10 @@ module Ci
belongs_to
:project
validates
:key
,
uniqueness:
{
scope:
[
:project_id
,
:environment_scope
]
}
validates
:key
,
uniqueness:
{
scope:
[
:project_id
,
:environment_scope
],
message:
"(%{value}) has already been taken"
}
scope
:unprotected
,
->
{
where
(
protected:
false
)
}
end
...
...
app/validators/variable_duplicates_validator.rb
View file @
503d8542
...
...
@@ -5,6 +5,8 @@
# - Use `validates :xxx, uniqueness: { scope: :xxx_id }` in a child model
class
VariableDuplicatesValidator
<
ActiveModel
::
EachValidator
def
validate_each
(
record
,
attribute
,
value
)
return
if
record
.
errors
.
include?
(
:"
#{
attribute
}
.key"
)
if
options
[
:scope
]
scoped
=
value
.
group_by
do
|
variable
|
Array
(
options
[
:scope
]).
map
{
|
attr
|
variable
.
send
(
attr
)
}
# rubocop:disable GitlabSecurity/PublicSend
...
...
app/views/groups/issues.html.haml
View file @
503d8542
-
page_title
"Issues"
-
group_issues_exists
=
group_issues
(
@group
).
exists?
=
content_for
:meta_tags
do
=
auto_discovery_link_tag
(
:atom
,
params
.
merge
(
rss_url_options
),
title:
"
#{
@group
.
name
}
issues"
)
...
...
@@ -7,7 +6,9 @@
=
webpack_bundle_tag
'common_vue'
=
webpack_bundle_tag
'issues'
-
if
group_issues_exists
-
if
group_issues_count
(
state:
'all'
).
zero?
=
render
'shared/empty_states/issues'
,
project_select_button:
true
-
else
.top-area
=
render
'shared/issuable/nav'
,
type: :issues
.nav-controls
...
...
@@ -20,5 +21,3 @@
=
render
'shared/issuable/search_bar'
,
type: :issues
=
render
'shared/issues'
-
else
=
render
'shared/empty_states/issues'
,
project_select_button:
true
app/views/groups/merge_requests.html.haml
View file @
503d8542
...
...
@@ -3,7 +3,7 @@
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
'common_vue'
-
if
@group_merge_requests
.
empty
?
-
if
group_merge_requests_count
(
state:
'all'
).
zero
?
=
render
'shared/empty_states/merge_requests'
,
project_select_button:
true
-
else
.top-area
...
...
app/views/layouts/nav/sidebar/_group.html.haml
View file @
503d8542
-
issues_count
=
IssuesFinder
.
new
(
current_user
,
group_id:
@group
.
id
,
state:
'opened'
).
execute
.
count
-
merge_requests_count
=
MergeRequestsFinder
.
new
(
current_user
,
group_id:
@group
.
id
,
state:
'opened'
,
non_archived:
true
).
execute
.
count
-
issues_count
=
group_issues_count
(
state:
'opened'
)
-
merge_requests_count
=
group_merge_requests_count
(
state:
'opened'
)
-
issues_sub_menu_items
=
[
'groups#issues'
,
'labels#index'
,
'milestones#index'
]
-
if
@group
.
feature_available?
(
:group_issue_boards
)
...
...
app/views/projects/commits/_commit.html.haml
View file @
503d8542
...
...
@@ -24,7 +24,7 @@
.avatar-cell.hidden-xs
=
author_avatar
(
commit
,
size:
36
)
.commit-detail
.commit-detail
.flex-list
.commit-content
=
link_to_markdown_field
(
commit
,
:title
,
link
,
class:
"commit-row-message item-title"
)
%span
.commit-row-message.visible-xs-inline
...
...
changelogs/unreleased/43261-fix-prometheus-installation.yml
0 → 100644
View file @
503d8542
---
title
:
Allow Prometheus application to be installed from Cluster applications
merge_request
:
17372
author
:
type
:
fixed
changelogs/unreleased/43275-improve-variables-validation-message.yml
0 → 100644
View file @
503d8542
---
title
:
Remove duplicated error message on duplicate variable validation
merge_request
:
17135
author
:
type
:
fixed
changelogs/unreleased/43315-gpg-popover.yml
0 → 100644
View file @
503d8542
---
title
:
Fixes gpg popover layout
merge_request
:
17323
author
:
type
:
fixed
changelogs/unreleased/43510-merge-requests-and-issues-don-t-show-for-all-subgroups.yml
0 → 100644
View file @
503d8542
---
title
:
Ensure group issues and merge requests pages show results from subgroups when
there are no results from the current group
merge_request
:
17312
author
:
type
:
fixed
spec/features/groups/empty_states_spec.rb
View file @
503d8542
require
'spec_helper'
feature
'Group
s Merge Requests Empty S
tates'
do
feature
'Group
empty s
tates'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:user
)
{
create
(
:group_member
,
:developer
,
user:
create
(
:user
),
group:
group
).
user
}
...
...
@@ -8,62 +8,100 @@ feature 'Groups Merge Requests Empty States' do
sign_in
(
user
)
end
context
'group has a project'
do
let
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
[
:issue
,
:merge_request
].
each
do
|
issuable
|
issuable_name
=
issuable
.
to_s
.
humanize
.
downcase
project_relation
=
issuable
==
:issue
?
:project
:
:source_project
before
do
project
.
add_master
(
user
)
end
context
"for
#{
issuable_name
}
s"
do
let
(
:path
)
{
public_send
(
:"
#{
issuable
}
s_group_path"
,
group
)
}
context
'the project has a merge request'
do
before
do
create
(
:merge_request
,
source_project:
project
)
context
'group has a project'
do
let
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
visit
merge_requests_group_path
(
group
)
end
before
do
project
.
add_master
(
user
)
end
it
'should not display an empty state'
do
expect
(
page
).
not_to
have_selector
(
'.empty-state'
)
end
end
context
"the project has
#{
issuable_name
}
s"
do
before
do
create
(
issuable
,
project_relation
=>
project
)
context
'the project has no merge requests'
,
:js
do
before
do
visit
merge_requests_group_path
(
group
)
end
visit
path
end
it
'should display an empty state'
do
expect
(
page
).
to
have_selector
(
'.empty-state'
)
end
it
'does not display an empty state'
do
expect
(
page
).
not_to
have_selector
(
'.empty-state'
)
end
end
context
"the project has no
#{
issuable_name
}
s"
,
:js
do
before
do
visit
path
end
it
'displays an empty state'
do
expect
(
page
).
to
have_selector
(
'.empty-state'
)
end
it
"shows a new
#{
issuable_name
}
button"
do
within
'.empty-state'
do
expect
(
page
).
to
have_content
(
"create
#{
issuable_name
}
"
)
end
end
it
"the new
#{
issuable_name
}
button opens a project dropdown"
do
within
'.empty-state'
do
find
(
'.new-project-item-select-button'
).
click
end
it
'should show a new merge request button'
do
within
'.empty-state'
do
expect
(
page
).
to
have_content
(
'create merge request'
)
expect
(
page
).
to
have_selector
(
'.ajax-project-dropdown'
)
end
end
end
it
'the new merge request button opens a project dropdown
'
do
within
'.empty-state'
do
find
(
'.new-project-item-select-button'
).
click
end
context
'group without a project
'
do
context
'group has a subgroup'
,
:nested_groups
do
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let
(
:subgroup_project
)
{
create
(
:project
,
namespace:
subgroup
)
}
expect
(
page
).
to
have_selector
(
'.ajax-project-dropdown'
)
end
end
end
context
"the project has
#{
issuable_name
}
s"
do
before
do
create
(
issuable
,
project_relation
=>
subgroup_project
)
context
'group without a project'
do
before
do
visit
merge_requests_group_path
(
group
)
end
visit
path
end
it
'should display an empty state'
do
expect
(
page
).
to
have_selector
(
'.empty-state'
)
end
it
'does not display an empty state'
do
expect
(
page
).
not_to
have_selector
(
'.empty-state'
)
end
end
it
'should not show a new merge request button'
do
within
'.empty-state'
do
expect
(
page
).
not_to
have_link
(
'create merge request'
)
context
"the project has no
#{
issuable_name
}
s"
do
before
do
visit
path
end
it
'displays an empty state'
do
expect
(
page
).
to
have_selector
(
'.empty-state'
)
end
end
end
context
'group has no subgroups'
do
before
do
visit
path
end
it
'displays an empty state'
do
expect
(
page
).
to
have_selector
(
'.empty-state'
)
end
it
"shows a new
#{
issuable_name
}
button"
do
within
'.empty-state'
do
expect
(
page
).
not_to
have_link
(
"create
#{
issuable_name
}
"
)
end
end
end
end
end
end
...
...
spec/models/ci/group_variable_spec.rb
View file @
503d8542
...
...
@@ -5,7 +5,7 @@ describe Ci::GroupVariable do
it
{
is_expected
.
to
include_module
(
HasVariable
)
}
it
{
is_expected
.
to
include_module
(
Presentable
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:key
).
scoped_to
(
:group_id
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:key
).
scoped_to
(
:group_id
)
.
with_message
(
/\(\w+\) has already been taken/
)
}
describe
'.unprotected'
do
subject
{
described_class
.
unprotected
}
...
...
spec/models/ci/variable_spec.rb
View file @
503d8542
...
...
@@ -12,7 +12,7 @@ describe Ci::Variable do
it
{
is_expected
.
to
include_module
(
HasEnvironmentScope
)
}
it
{
is_expected
.
to
include_module
(
HasVariable
)
}
it
{
is_expected
.
to
include_module
(
Presentable
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:key
).
scoped_to
(
:project_id
,
:environment_scope
)
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:key
).
scoped_to
(
:project_id
,
:environment_scope
)
.
with_message
(
/\(\w+\) has already been taken/
)
}
end
describe
'.unprotected'
do
...
...
spec/support/features/variable_list_shared_examples.rb
View file @
503d8542
...
...
@@ -261,6 +261,8 @@ shared_examples 'variable list' do
click_button
(
'Save variables'
)
wait_for_requests
expect
(
all
(
'.js-ci-variable-list-section .js-ci-variable-error-box ul li'
).
count
).
to
eq
(
1
)
# We check the first row because it re-sorts to alphabetical order on refresh
page
.
within
(
'.js-ci-variable-list-section'
)
do
expect
(
find
(
'.js-ci-variable-error-box'
)).
to
have_content
(
/Validation failed Variables have duplicate values \(.+\)/
)
...
...
vendor/prometheus/values.yaml
View file @
503d8542
...
...
@@ -10,6 +10,9 @@ nodeExporter:
pushgateway
:
enabled
:
false
rbac
:
create
:
false
server
:
image
:
tag
:
v2.1.0
...
...
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