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
ade38e8f
Commit
ade38e8f
authored
Nov 17, 2021
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inherit BaseProjectService for prometheus services
parent
3beb188e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
9 deletions
+9
-9
app/controllers/projects/prometheus/alerts_controller.rb
app/controllers/projects/prometheus/alerts_controller.rb
+3
-3
app/services/projects/prometheus/alerts/create_service.rb
app/services/projects/prometheus/alerts/create_service.rb
+1
-1
app/services/projects/prometheus/alerts/destroy_service.rb
app/services/projects/prometheus/alerts/destroy_service.rb
+1
-1
app/services/projects/prometheus/alerts/update_service.rb
app/services/projects/prometheus/alerts/update_service.rb
+1
-1
spec/services/projects/prometheus/alerts/create_service_spec.rb
...ervices/projects/prometheus/alerts/create_service_spec.rb
+1
-1
spec/services/projects/prometheus/alerts/destroy_service_spec.rb
...rvices/projects/prometheus/alerts/destroy_service_spec.rb
+1
-1
spec/services/projects/prometheus/alerts/update_service_spec.rb
...ervices/projects/prometheus/alerts/update_service_spec.rb
+1
-1
No files found.
app/controllers/projects/prometheus/alerts_controller.rb
View file @
ade38e8f
...
...
@@ -82,17 +82,17 @@ module Projects
def
create_service
Projects
::
Prometheus
::
Alerts
::
CreateService
.
new
(
project
,
current_user
,
alerts_params
)
.
new
(
project
:
project
,
current_user:
current_user
,
params:
alerts_params
)
end
def
update_service
Projects
::
Prometheus
::
Alerts
::
UpdateService
.
new
(
project
,
current_user
,
alerts_params
)
.
new
(
project
:
project
,
current_user:
current_user
,
params:
alerts_params
)
end
def
destroy_service
Projects
::
Prometheus
::
Alerts
::
DestroyService
.
new
(
project
,
current_user
,
nil
)
.
new
(
project
:
project
,
current_user:
current_user
,
params:
nil
)
end
def
schedule_prometheus_update!
...
...
app/services/projects/prometheus/alerts/create_service.rb
View file @
ade38e8f
...
...
@@ -3,7 +3,7 @@
module
Projects
module
Prometheus
module
Alerts
class
CreateService
<
BaseService
class
CreateService
<
Base
Project
Service
include
AlertParams
def
execute
...
...
app/services/projects/prometheus/alerts/destroy_service.rb
View file @
ade38e8f
...
...
@@ -3,7 +3,7 @@
module
Projects
module
Prometheus
module
Alerts
class
DestroyService
<
BaseService
class
DestroyService
<
Base
Project
Service
def
execute
(
alert
)
alert
.
destroy
end
...
...
app/services/projects/prometheus/alerts/update_service.rb
View file @
ade38e8f
...
...
@@ -3,7 +3,7 @@
module
Projects
module
Prometheus
module
Alerts
class
UpdateService
<
BaseService
class
UpdateService
<
Base
Project
Service
include
AlertParams
def
execute
(
alert
)
...
...
spec/services/projects/prometheus/alerts/create_service_spec.rb
View file @
ade38e8f
...
...
@@ -6,7 +6,7 @@ RSpec.describe Projects::Prometheus::Alerts::CreateService do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
params
)
}
let
(
:service
)
{
described_class
.
new
(
project
:
project
,
current_user:
user
,
params:
params
)
}
subject
{
service
.
execute
}
...
...
spec/services/projects/prometheus/alerts/destroy_service_spec.rb
View file @
ade38e8f
...
...
@@ -7,7 +7,7 @@ RSpec.describe Projects::Prometheus::Alerts::DestroyService do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:alert
)
{
create
(
:prometheus_alert
,
project:
project
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
nil
)
}
let
(
:service
)
{
described_class
.
new
(
project
:
project
,
current_user:
user
,
params:
nil
)
}
describe
'#execute'
do
subject
{
service
.
execute
(
alert
)
}
...
...
spec/services/projects/prometheus/alerts/update_service_spec.rb
View file @
ade38e8f
...
...
@@ -11,7 +11,7 @@ RSpec.describe Projects::Prometheus::Alerts::UpdateService do
create
(
:prometheus_alert
,
project:
project
,
environment:
environment
)
end
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
params
)
}
let
(
:service
)
{
described_class
.
new
(
project
:
project
,
current_user:
user
,
params:
params
)
}
let
(
:params
)
do
{
...
...
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