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
e90f195a
Commit
e90f195a
authored
Aug 24, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
375ce71b
c0af9800
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
2 deletions
+51
-2
app/views/profiles/notifications/_email_settings.html.haml
app/views/profiles/notifications/_email_settings.html.haml
+1
-1
doc/user/profile/notifications.md
doc/user/profile/notifications.md
+1
-0
lib/gitlab/ci/queue/metrics.rb
lib/gitlab/ci/queue/metrics.rb
+12
-1
lib/gitlab/metrics/instrumentation.rb
lib/gitlab/metrics/instrumentation.rb
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/views/profiles/notifications/show.html.haml_spec.rb
spec/views/profiles/notifications/show.html.haml_spec.rb
+29
-0
No files found.
app/views/profiles/notifications/_email_settings.html.haml
View file @
e90f195a
-
form
=
local_assigns
.
fetch
(
:form
)
.form-group
=
form
.
label
:notification_email
,
class:
"label-bold"
=
form
.
select
:notification_email
,
@user
.
public_verified_emails
,
{
include_blank:
false
},
class:
"select2"
,
disabled:
local_assigns
.
fetch
(
:email_change_disabled
,
nil
)
=
form
.
select
:notification_email
,
@user
.
public_verified_emails
,
{
include_blank:
_
(
'Use primary email (%{email})'
)
%
{
email:
@user
.
email
},
selected:
@user
.
read_attribute
(
:notification_email
)
},
class:
"select2"
,
disabled:
local_assigns
.
fetch
(
:email_change_disabled
,
nil
)
.help-block
=
local_assigns
.
fetch
(
:help_text
,
nil
)
.form-group
...
...
doc/user/profile/notifications.md
View file @
e90f195a
...
...
@@ -70,6 +70,7 @@ Your **Global notification settings** are the default settings unless you select
different values for a project or a group.
-
**Notification email**
: the email address your notifications are sent to.
Defaults to your primary email address.
-
**Receive product marketing emails**
: select this checkbox to receive
[
periodic emails
](
#product-marketing-emails
)
about GitLab features.
-
**Global notification level**
: the default
[
notification level
](
#notification-levels
)
...
...
lib/gitlab/ci/queue/metrics.rb
View file @
e90f195a
...
...
@@ -97,7 +97,9 @@ module Gitlab
def
observe_queue_size
(
size_proc
,
runner_type
)
return
unless
Feature
.
enabled?
(
:gitlab_ci_builds_queuing_metrics
,
default_enabled:
false
)
self
.
class
.
queue_size_total
.
observe
({
runner_type:
runner_type
},
size_proc
.
call
.
to_f
)
size
=
size_proc
.
call
.
to_f
self
.
class
.
queue_size_total
.
observe
({
runner_type:
runner_type
},
size
)
self
.
class
.
current_queue_size
.
set
({
runner_type:
runner_type
},
size
)
end
def
observe_queue_time
(
metric
,
runner_type
)
...
...
@@ -199,6 +201,15 @@ module Gitlab
end
end
def
self
.
current_queue_size
strong_memoize
(
:current_queue_size
)
do
name
=
:gitlab_ci_current_queue_size
comment
=
'Current size of initialized CI/CD builds queue'
Gitlab
::
Metrics
.
gauge
(
name
,
comment
)
end
end
def
self
.
queue_iteration_duration_seconds
strong_memoize
(
:queue_iteration_duration_seconds
)
do
name
=
:gitlab_ci_queue_iteration_duration_seconds
...
...
lib/gitlab/metrics/instrumentation.rb
View file @
e90f195a
...
...
@@ -153,6 +153,10 @@ module Gitlab
method_visibility
=
method_visibility_for
(
target
,
name
)
# We silence warnings to avoid such warnings:
# `Skipping set of ruby2_keywords flag for <...>
# (method accepts keywords or method does not accept argument splat)`
# as we apply ruby2_keywords 'blindly' for every instrumented method.
proxy_module
.
class_eval
<<-
EOF
,
__FILE__
,
__LINE__
+
1
def
#{
name
}
(
#{
args_signature
}
)
if trans = Gitlab::Metrics::Instrumentation.transaction
...
...
@@ -162,6 +166,7 @@ module Gitlab
super
end
end
silence_warnings { ruby2_keywords(:
#{
name
}
) if respond_to?(:ruby2_keywords, true) }
#{
method_visibility
}
:
#{
name
}
EOF
...
...
locale/gitlab.pot
View file @
e90f195a
...
...
@@ -36265,6 +36265,9 @@ msgstr ""
msgid "Use one line per URI"
msgstr ""
msgid "Use primary email (%{email})"
msgstr ""
msgid "Use shortcuts"
msgstr ""
...
...
spec/views/profiles/notifications/show.html.haml_spec.rb
0 → 100644
View file @
e90f195a
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'profiles/notifications/show'
do
let
(
:groups
)
{
GroupsFinder
.
new
(
user
).
execute
.
page
(
1
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
assign
(
:group_notifications
,
[])
assign
(
:project_notifications
,
[])
assign
(
:user
,
user
)
assign
(
:user_groups
,
groups
)
allow
(
controller
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
view
).
to
receive
(
:experiment_enabled?
)
end
context
'when there is no database value for User#notification_email'
do
let
(
:option_default
)
{
_
(
'Use primary email (%{email})'
)
%
{
email:
user
.
email
}
}
let
(
:option_primary_email
)
{
user
.
email
}
let
(
:options
)
{
[
option_default
,
option_primary_email
]
}
it
'displays the correct elements'
do
render
expect
(
rendered
).
to
have_select
(
'user_notification_email'
,
options:
options
,
selected:
nil
)
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