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
d0362748
Commit
d0362748
authored
Jan 29, 2020
by
Tetiana Chupryna
Committed by
Stan Hu
Jan 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include 'license_scanning' in Usage data
parent
c38bcf99
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+7
-0
ee/spec/lib/gitlab/usage_data_spec.rb
ee/spec/lib/gitlab/usage_data_spec.rb
+2
-1
No files found.
ee/lib/ee/gitlab/usage_data.rb
View file @
d0362748
...
...
@@ -90,10 +90,17 @@ module EE
dast: :dast_jobs
,
dependency_scanning: :dependency_scanning_jobs
,
license_management: :license_management_jobs
,
license_scanning: :license_scanning_jobs
,
sast: :sast_jobs
}
results
=
count
(
::
Ci
::
Build
.
where
(
name:
types
.
keys
).
group
(
:name
),
fallback:
Hash
.
new
(
-
1
))
license_scan_count
=
results
.
delete
(
"license_scanning"
)
if
license_scan_count
&&
results
[
"license_management"
]
results
[
"license_management"
]
+=
license_scan_count
end
results
.
each_with_object
({})
{
|
(
key
,
value
),
response
|
response
[
types
[
key
.
to_sym
]]
=
value
}
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
ee/spec/lib/gitlab/usage_data_spec.rb
View file @
d0362748
...
...
@@ -18,6 +18,7 @@ describe Gitlab::UsageData do
create
(
:ci_build
,
name:
'dast'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'dependency_scanning'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'license_management'
,
pipeline:
pipeline
)
create
(
:ee_ci_build
,
name:
'license_scanning'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'sast'
,
pipeline:
pipeline
)
create
(
:prometheus_alert
,
project:
projects
[
0
])
...
...
@@ -118,7 +119,7 @@ describe Gitlab::UsageData do
expect
(
count_data
[
:container_scanning_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:dast_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:dependency_scanning_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:license_management_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:license_management_jobs
]).
to
eq
(
2
)
expect
(
count_data
[
:sast_jobs
]).
to
eq
(
1
)
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