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
8785e309
Commit
8785e309
authored
Jul 28, 2020
by
Tristan Read
Committed by
Ezekiel Kigbo
Jul 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `alert_runbooks` feature flag
parent
3d5d66b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
1 deletion
+31
-1
app/assets/javascripts/monitoring/components/alert_widget_form.vue
...s/javascripts/monitoring/components/alert_widget_form.vue
+8
-0
app/controllers/projects/metrics_dashboard_controller.rb
app/controllers/projects/metrics_dashboard_controller.rb
+1
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/monitoring/components/alert_widget_form_spec.js
.../frontend/monitoring/components/alert_widget_form_spec.js
+19
-1
No files found.
app/assets/javascripts/monitoring/components/alert_widget_form.vue
View file @
8785e309
...
...
@@ -294,6 +294,14 @@ export default {
data-qa-selector=
"alert_threshold_field"
/>
</gl-form-group>
<gl-form-group
v-if=
"glFeatures.alertRunbooks"
:label=
"s__('PrometheusAlerts|Runbook')"
label-for=
"alert-runbook"
data-testid=
"alertRunbookField"
>
<gl-form-input
id=
"alert-runbook"
:disabled=
"formDisabled"
type=
"text"
/>
</gl-form-group>
</div>
<
template
#modal-ok
>
<gl-link
...
...
app/controllers/projects/metrics_dashboard_controller.rb
View file @
8785e309
...
...
@@ -10,6 +10,7 @@ module Projects
before_action
do
push_frontend_feature_flag
(
:prometheus_computed_alerts
)
push_frontend_feature_flag
(
:disable_metric_dashboard_refresh_rate
)
push_frontend_feature_flag
(
:alert_runbooks
)
end
def
show
...
...
locale/gitlab.pot
View file @
8785e309
...
...
@@ -18991,6 +18991,9 @@ msgstr ""
msgid "PrometheusAlerts|Operator"
msgstr ""
msgid "PrometheusAlerts|Runbook"
msgstr ""
msgid "PrometheusAlerts|Select query"
msgstr ""
...
...
spec/frontend/monitoring/components/alert_widget_form_spec.js
View file @
8785e309
...
...
@@ -29,7 +29,7 @@ describe('AlertWidgetForm', () => {
configuredAlert
:
metricId
,
};
function
createComponent
(
props
=
{})
{
function
createComponent
(
props
=
{}
,
featureFlags
=
{}
)
{
const
propsData
=
{
...
defaultProps
,
...
props
,
...
...
@@ -37,6 +37,9 @@ describe('AlertWidgetForm', () => {
wrapper
=
shallowMount
(
AlertWidgetForm
,
{
propsData
,
provide
:
{
glFeatures
:
featureFlags
,
},
stubs
:
{
GlModal
:
ModalStub
,
},
...
...
@@ -46,6 +49,7 @@ describe('AlertWidgetForm', () => {
const
modal
=
()
=>
wrapper
.
find
(
ModalStub
);
const
modalTitle
=
()
=>
modal
().
attributes
(
'
title
'
);
const
submitButton
=
()
=>
modal
().
find
(
GlLink
);
const
alertRunbookField
=
()
=>
wrapper
.
find
(
'
[data-testid="alertRunbookField"]
'
);
const
submitButtonTrackingOpts
=
()
=>
JSON
.
parse
(
submitButton
().
attributes
(
'
data-tracking-options
'
));
const
e
=
{
...
...
@@ -217,4 +221,18 @@ describe('AlertWidgetForm', () => {
});
});
});
describe
(
'
alert runbooks feature flag
'
,
()
=>
{
it
(
'
hides the runbook field when the flag is disabled
'
,
()
=>
{
createComponent
(
undefined
,
{
alertRunbooks
:
false
});
expect
(
alertRunbookField
().
exists
()).
toBe
(
false
);
});
it
(
'
shows the runbook field when the flag is enabled
'
,
()
=>
{
createComponent
(
undefined
,
{
alertRunbooks
:
true
});
expect
(
alertRunbookField
().
exists
()).
toBe
(
true
);
});
});
});
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