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
ba22f757
Commit
ba22f757
authored
Nov 26, 2021
by
Piotr Skorupa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling reports without metrics
parent
092f06a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
app/services/service_ping/devops_report_service.rb
app/services/service_ping/devops_report_service.rb
+10
-3
No files found.
app/services/service_ping/devops_report_service.rb
View file @
ba22f757
...
...
@@ -7,13 +7,20 @@ module ServicePing
end
def
execute
metrics
=
@data
[
'conv_index'
]
||
@data
[
'dev_ops_score'
]
# leaving dev_ops_score here, as the data comes from the gitlab-version-com
# `conv_index` was previously named `dev_ops_score` in
# gitlab-version-com, so we check both for backwards compatibility.
metrics
=
@data
[
'conv_index'
]
||
@data
[
'dev_ops_score'
]
return
unless
metrics
.
except
(
'usage_data_id'
).
present?
# Do not attempt to save a report for the first Service Ping
# response for a given GitLab instance, which comes without
# metrics.
return
if
metrics
.
keys
==
[
'usage_data_id'
]
DevOpsReport
::
Metric
.
create!
(
report
=
DevOpsReport
::
Metric
.
create
(
metrics
.
slice
(
*
DevOpsReport
::
Metric
::
METRICS
)
)
Gitlab
::
ErrorTracking
.
track_and_raise_for_dev_exception
(
ActiveRecord
::
RecordInvalid
.
new
(
report
))
if
!
report
.
persisted?
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