Commit 9ee37efe authored by Stan Hu's avatar Stan Hu

Merge branch 'ce-to-ee-2018-07-12' into 'master'

CE upstream - 2018-07-12 18:22 UTC

See merge request gitlab-org/gitlab-ee!6491
parents 8616d14b 873a935b
......@@ -32,6 +32,7 @@ class NotificationSetting < ActiveRecord::Base
:reopen_issue,
:close_issue,
:reassign_issue,
:issue_due,
:new_merge_request,
:push_to_merge_request,
:reopen_merge_request,
......
require 'prometheus/client/formats/text'
class MetricsService
CHECKS = [
Gitlab::HealthChecks::DbCheck,
Gitlab::HealthChecks::Redis::RedisCheck,
Gitlab::HealthChecks::Redis::CacheCheck,
Gitlab::HealthChecks::Redis::QueuesCheck,
Gitlab::HealthChecks::Redis::SharedStateCheck,
Gitlab::HealthChecks::GitalyCheck
].freeze
def prometheus_metrics_text
Prometheus::Client::Formats::Text.marshal_multiprocess(multiprocess_metrics_path)
end
def health_metrics_text
metrics = CHECKS.flat_map(&:metrics)
formatter.marshal(metrics)
end
def metrics_text
prometheus_metrics_text.concat(health_metrics_text)
prometheus_metrics_text
end
private
def formatter
@formatter ||= Gitlab::HealthChecks::PrometheusTextFormat.new
end
def multiprocess_metrics_path
::Prometheus::Client.configuration.multiprocess_files_dir
end
......
......@@ -6,7 +6,7 @@
= render_if_exists 'admin/namespace_plan', f: f
.form-group.row.group-description-holder
= f.label :avatar, "Group avatar", class: 'col-form-label col-sm-2'
= f.label :avatar, _("Group avatar"), class: 'col-form-label col-sm-2'
.col-sm-10
= render 'shared/choose_group_avatar_button', f: f
......@@ -26,12 +26,12 @@
.alert.alert-info
= render 'shared/group_tips'
.form-actions
= f.submit 'Create group', class: "btn btn-create"
= link_to 'Cancel', admin_groups_path, class: "btn btn-cancel"
= f.submit _('Create group'), class: "btn btn-create"
= link_to _('Cancel'), admin_groups_path, class: "btn btn-cancel"
- else
.form-actions
= f.submit 'Save changes', class: "btn btn-save"
= link_to 'Cancel', admin_group_path(@group), class: "btn btn-cancel"
= f.submit _('Save changes'), class: "btn btn-save"
= link_to _('Cancel'), admin_group_path(@group), class: "btn btn-cancel"
= render_if_exists 'ldap_group_links/ldap_syncrhonizations', group: @group
......@@ -3,8 +3,8 @@
%li.group-row{ class: css_class }
.controls
= link_to 'Edit', admin_group_edit_path(group), id: "edit_#{dom_id(group)}", class: 'btn'
= link_to 'Delete', [:admin, group], data: { confirm: "Are you sure you want to remove #{group.name}?" }, method: :delete, class: 'btn btn-remove'
= link_to _('Edit'), admin_group_edit_path(group), id: "edit_#{dom_id(group)}", class: 'btn'
= link_to _('Delete'), [:admin, group], data: { confirm: _("Are you sure you want to remove %{group_name}?") % { group_name: group.name } }, method: :delete, class: 'btn btn-remove'
.stats
%span.badge.badge-pill
= storage_counter(group.storage_size)
......
- page_title "Edit", @group.name, "Groups"
%h3.page-title Edit group: #{@group.name}
- page_title _("Edit"), @group.name, _("Groups")
%h3.page-title= _('Edit group: %{group_name}') % { group_name: @group.name }
%hr
= render 'form', visibility_level: @group.visibility_level
- @no_container = true
- page_title "Groups"
- page_title _("Groups")
%div{ class: container_class }
.top-area
......@@ -13,7 +13,7 @@
= icon("search", class: "search-icon")
= render "shared/groups/dropdown", options_hash: admin_groups_sort_options_hash
= link_to new_admin_group_path, class: "btn btn-new" do
New group
= _('New group')
%ul.content-list
= render @groups
......
- page_title "New Group"
%h3.page-title New group
- page_title _("New Group")
%h3.page-title= _('New group')
%hr
= render 'form', visibility_level: default_group_visibility
- add_to_breadcrumbs "Groups", admin_groups_path
- add_to_breadcrumbs _("Groups"), admin_groups_path
- breadcrumb_title @group.name
- page_title @group.name, "Groups"
- page_title @group.name, _("Groups")
%h3.page-title
Group: #{@group.full_name}
= _('Group: %{group_name}') % { group_name: @group.full_name }
= link_to admin_group_edit_path(@group), class: "btn float-right" do
%i.fa.fa-pencil-square-o
Edit
= _('Edit')
%hr
.row
.col-md-6
.card
.card-header
Group info:
= _('Group info:')
%ul.content-list
%li
.avatar-container.s60
= group_icon(@group, class: "avatar s60")
%li
%span.light Name:
%span.light= _('Name:')
%strong= @group.name
%li
%span.light Path:
%span.light= _('Path:')
%strong
= @group.path
%li
%span.light Description:
%span.light= _('Description:')
%strong
= @group.description
%li
%span.light Visibility level:
%span.light= _('Visibility level:')
%strong
= visibility_level_label(@group.visibility_level)
%li
%span.light Created on:
%span.light= _('Created on:')
%strong
= @group.created_at.to_s(:medium)
= render_if_exists 'admin/namespace_plan_info', namespace: @group
%li
%span.light Storage:
%strong= storage_counter(@group.storage_size)
(
= storage_counter(@group.repository_size)
repositories,
= storage_counter(@group.build_artifacts_size)
build artifacts,
= storage_counter(@group.lfs_objects_size)
LFS
)
%span.light= _('Storage:')
- counter_storage = storage_counter(@group.storage_size)
- counter_repositories = storage_counter(@group.repository_size)
- counter_build_artifacts = storage_counter(@group.build_artifacts_size)
- counter_lfs_objects = storage_counter(@group.lfs_objects_size)
%strong
= _("%{counter_storage} (%{counter_repositories} repositories, %{counter_build_artifacts} build artifacts, %{counter_lfs_objects} LFS)") % { counter_storage: counter_storage, counter_repositories: counter_repositories, counter_build_artifacts: counter_build_artifacts, counter_lfs_objects: counter_lfs_objects }
%li
%span.light Group Git LFS status:
%span.light= _('Group Git LFS status:')
%strong
= group_lfs_status(@group)
= link_to icon('question-circle'), help_page_path('workflow/lfs/manage_large_binaries_with_git_lfs')
......@@ -67,7 +64,7 @@
.card
.card-header
%h3.card-title
Projects
= _('Projects')
%span.badge.badge-pill
#{@group.projects.count}
%ul.content-list
......@@ -85,7 +82,7 @@
- if @group.shared_projects.any?
.card
.card-header
Projects shared with #{@group.name}
= _('Projects shared with %{group_name}') % { group_name: @group.name }
%span.badge.badge-pill
#{@group.shared_projects.count}
%ul.content-list
......@@ -102,11 +99,11 @@
- if can?(current_user, :admin_group_member, @group)
.card
.card-header
Add user(s) to the group:
= _('Add user(s) to the group:')
.card-body.form-holder
%p.light
Read more about project permissions
%strong= link_to "here", help_page_path("user/permissions"), class: "vlink"
- link_to_help = link_to(_("here"), help_page_path("user/permissions"), class: "vlink")
= _('Read more about project permissions <strong>%{link_to_help}</strong>').html_safe % { link_to_help: link_to_help }
= form_tag admin_group_members_update_path(@group), id: "new_project_member", class: "bulk_import", method: :put do
%div
......@@ -114,16 +111,15 @@
.prepend-top-10
= select_tag :access_level, options_for_select(GroupMember.access_level_roles), class: "project-access-select select2"
%hr
= button_tag 'Add users to group', class: "btn btn-create"
= button_tag _('Add users to group'), class: "btn btn-create"
= render 'shared/members/requests', membership_source: @group, requesters: @requesters, force_mobile_view: true
.card
.card-header
%strong= @group.name
group members
= _("<strong>%{group_name}</strong> group members").html_safe % { group_name: @group.name }
%span.badge.badge-pill= @group.members.size
.float-right
= link_to icon('pencil-square-o', text: 'Manage access'), polymorphic_url([@group, :members]), class: "btn btn-sm"
= link_to icon('pencil-square-o', text: _('Manage access')), polymorphic_url([@group, :members]), class: "btn btn-sm"
%ul.content-list.group-users-list.content-list.members-list
= render partial: 'shared/members/member', collection: @members, as: :member, locals: { show_controls: false }
.card-footer
......
---
title: Remove healthchecks from prometheus endpoint
merge_request: 20565
author:
type: fixed
---
title: 'Allow to toggle notifications for issues due soon'
merge_request:
author:
type: fixed
......@@ -100,6 +100,9 @@ msgstr ""
msgid "%{commit_author_link} authored %{commit_timeago}"
msgstr ""
msgid "%{counter_storage} (%{counter_repositories} repositories, %{counter_build_artifacts} build artifacts, %{counter_lfs_objects} LFS)"
msgstr ""
msgid "%{count} participant"
msgid_plural "%{count} participants"
msgstr[0] ""
......@@ -239,6 +242,9 @@ msgstr ""
msgid "<strong>%{created_count}</strong> created, <strong>%{closed_count}</strong> closed."
msgstr ""
msgid "<strong>%{group_name}</strong> group members"
msgstr ""
msgid "<strong>%{pushes}</strong> pushes, more than <strong>%{commits}</strong> commits by <strong>%{people}</strong> contributors."
msgstr ""
......@@ -341,6 +347,12 @@ msgstr ""
msgid "Add todo"
msgstr ""
msgid "Add user(s) to the group:"
msgstr ""
msgid "Add users to group"
msgstr ""
msgid "Additional text"
msgstr ""
......@@ -581,6 +593,9 @@ msgstr ""
msgid "Are you sure you want to delete this pipeline schedule?"
msgstr ""
msgid "Are you sure you want to remove %{group_name}?"
msgstr ""
msgid "Are you sure you want to remove this identity?"
msgstr ""
......@@ -1994,6 +2009,9 @@ msgstr ""
msgid "Create file"
msgstr ""
msgid "Create group"
msgstr ""
msgid "Create group label"
msgstr ""
......@@ -2045,6 +2063,9 @@ msgstr ""
msgid "Created by me"
msgstr ""
msgid "Created on:"
msgstr ""
msgid "Creating epic"
msgstr ""
......@@ -2269,6 +2290,9 @@ msgstr ""
msgid "Description templates allow you to define context-specific templates for issue and merge request description fields for your project."
msgstr ""
msgid "Description:"
msgstr ""
msgid "Details"
msgstr ""
......@@ -2377,6 +2401,9 @@ msgstr ""
msgid "Edit files in the editor and commit changes here"
msgstr ""
msgid "Edit group: %{group_name}"
msgstr ""
msgid "Edit identity for %{user_name}"
msgstr ""
......@@ -3051,15 +3078,27 @@ msgstr ""
msgid "Group CI/CD settings"
msgstr ""
msgid "Group Git LFS status:"
msgstr ""
msgid "Group ID"
msgstr ""
msgid "Group Runners"
msgstr ""
msgid "Group avatar"
msgstr ""
msgid "Group info:"
msgstr ""
msgid "Group maintainers can register group runners in the %{link}"
msgstr ""
msgid "Group: %{group_name}"
msgstr ""
msgid "GroupRoadmap|From %{dateWord}"
msgstr ""
......@@ -3591,6 +3630,9 @@ msgstr ""
msgid "Make everyone on your team more productive regardless of their location. GitLab Geo creates read-only mirrors of your GitLab instance so you can reduce the time it takes to clone and fetch large repos."
msgstr ""
msgid "Manage access"
msgstr ""
msgid "Manage all notifications"
msgstr ""
......@@ -3870,6 +3912,9 @@ msgstr ""
msgid "Name your individual key via a title"
msgstr ""
msgid "Name:"
msgstr ""
msgid "Nav|Help"
msgstr ""
......@@ -3885,6 +3930,9 @@ msgstr ""
msgid "New"
msgstr ""
msgid "New Group"
msgstr ""
msgid "New Identity"
msgstr ""
......@@ -4214,6 +4262,9 @@ msgstr ""
msgid "Paste your public SSH key, which is usually contained in the file '~/.ssh/id_rsa.pub' and begins with 'ssh-rsa'. Don't use your private SSH key."
msgstr ""
msgid "Path:"
msgstr ""
msgid "Pause"
msgstr ""
......@@ -4628,6 +4679,9 @@ msgstr ""
msgid "Projects"
msgstr ""
msgid "Projects shared with %{group_name}"
msgstr ""
msgid "ProjectsDropdown|Frequently visited"
msgstr ""
......@@ -4796,6 +4850,9 @@ msgstr ""
msgid "Read more"
msgstr ""
msgid "Read more about project permissions <strong>%{link_to_help}</strong>"
msgstr ""
msgid "Readme"
msgstr ""
......@@ -5478,6 +5535,9 @@ msgstr ""
msgid "Storage"
msgstr ""
msgid "Storage:"
msgstr ""
msgid "Subgroups"
msgstr ""
......@@ -6293,6 +6353,9 @@ msgstr ""
msgid "Visibility and access controls"
msgstr ""
msgid "Visibility level:"
msgstr ""
msgid "Visibility:"
msgstr ""
......
$: << File.expand_path(File.dirname(__FILE__))
Encoding.default_external = 'UTF-8'
module QA
##
# GitLab QA runtime classes, mostly singletons.
......
......@@ -15,55 +15,16 @@ describe MetricsController do
allow(Prometheus::Client.configuration).to receive(:multiprocess_files_dir).and_return(metrics_multiproc_dir)
allow(Gitlab::Metrics).to receive(:prometheus_metrics_enabled?).and_return(true)
allow(Settings.monitoring).to receive(:ip_whitelist).and_return([whitelisted_ip, whitelisted_ip_range])
allow_any_instance_of(MetricsService).to receive(:metrics_text).and_return("prometheus_counter 1")
end
describe '#index' do
shared_examples_for 'endpoint providing metrics' do
it 'returns DB ping metrics' do
it 'returns prometheus metrics' do
get :index
expect(response.body).to match(/^db_ping_timeout 0$/)
expect(response.body).to match(/^db_ping_success 1$/)
expect(response.body).to match(/^db_ping_latency_seconds [0-9\.]+$/)
end
it 'returns Redis ping metrics' do
get :index
expect(response.body).to match(/^redis_ping_timeout 0$/)
expect(response.body).to match(/^redis_ping_success 1$/)
expect(response.body).to match(/^redis_ping_latency_seconds [0-9\.]+$/)
end
it 'returns Caching ping metrics' do
get :index
expect(response.body).to match(/^redis_cache_ping_timeout 0$/)
expect(response.body).to match(/^redis_cache_ping_success 1$/)
expect(response.body).to match(/^redis_cache_ping_latency_seconds [0-9\.]+$/)
end
it 'returns Queues ping metrics' do
get :index
expect(response.body).to match(/^redis_queues_ping_timeout 0$/)
expect(response.body).to match(/^redis_queues_ping_success 1$/)
expect(response.body).to match(/^redis_queues_ping_latency_seconds [0-9\.]+$/)
end
it 'returns SharedState ping metrics' do
get :index
expect(response.body).to match(/^redis_shared_state_ping_timeout 0$/)
expect(response.body).to match(/^redis_shared_state_ping_success 1$/)
expect(response.body).to match(/^redis_shared_state_ping_latency_seconds [0-9\.]+$/)
end
it 'returns Gitaly metrics' do
get :index
expect(response.body).to match(/^gitaly_health_check_success{shard="default"} 1$/)
expect(response.body).to match(/^gitaly_health_check_latency_seconds{shard="default"} [0-9\.]+$/)
expect(response.status).to eq(200)
expect(response.body).to match(/^prometheus_counter 1$/)
end
context 'prometheus metrics are disabled' do
......@@ -101,7 +62,7 @@ describe MetricsController do
allow(Gitlab::RequestContext).to receive(:client_ip).and_return(not_whitelisted_ip)
end
it 'returns proper response' do
it 'returns the expected error response' do
get :index
expect(response.status).to eq(404)
......
......@@ -16,4 +16,36 @@ describe 'Projects > Show > User manages notifications', :js do
expect(page).to have_content 'On mention'
end
end
context 'custom notification settings' do
let(:email_events) do
[
:new_note,
:new_issue,
:reopen_issue,
:close_issue,
:reassign_issue,
:issue_due,
:new_merge_request,
:push_to_merge_request,
:reopen_merge_request,
:close_merge_request,
:reassign_merge_request,
:merge_merge_request,
:failed_pipeline,
:success_pipeline
]
end
it 'shows notification settings checkbox' do
first('.notifications-btn').click
page.find('a[data-notification-level="custom"]').click
page.within('.custom-notifications-form') do
email_events.each do |event_name|
expect(page).to have_selector("input[name='notification_setting[#{event_name}]']")
end
end
end
end
end
......@@ -93,4 +93,10 @@ RSpec.describe NotificationSetting do
end
end
end
context 'email events' do
it 'includes EXCLUDED_WATCHER_EVENTS in EMAIL_EVENTS' do
expect(described_class::EMAIL_EVENTS).to include(*described_class::EXCLUDED_WATCHER_EVENTS)
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