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
5d397c42
Commit
5d397c42
authored
Mar 04, 2020
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add condition for fallback on license scan
- to produce reliable results
parent
5a38c4eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+1
-3
ee/spec/lib/gitlab/usage_data_spec.rb
ee/spec/lib/gitlab/usage_data_spec.rb
+6
-0
No files found.
ee/lib/ee/gitlab/usage_data.rb
View file @
5d397c42
...
...
@@ -119,9 +119,7 @@ module EE
# handle license rename https://gitlab.com/gitlab-org/gitlab/issues/8911
license_scan_count
=
results
.
delete
(
:license_scanning_jobs
)
if
license_scan_count
&&
results
[
:license_management_jobs
]
results
[
:license_management_jobs
]
+=
license_scan_count
end
results
[
:license_management_jobs
]
+=
license_scan_count
results
end
...
...
ee/spec/lib/gitlab/usage_data_spec.rb
View file @
5d397c42
...
...
@@ -123,6 +123,12 @@ describe Gitlab::UsageData do
expect
(
count_data
[
:sast_jobs
]).
to
eq
(
1
)
end
it
'correctly shows failure for combined license management'
do
allow
(
Gitlab
::
Database
::
BatchCount
).
to
receive
(
:batch_count
).
and_raise
(
ActiveRecord
::
StatementInvalid
)
expect
(
count_data
[
:license_management_jobs
]).
to
eq
(
-
1
)
end
it
'gathers group overview preferences usage data'
,
:aggregate_failures
do
expect
(
subject
[
:counts
][
:user_preferences_group_overview_details
]).
to
eq
(
User
.
active
.
count
-
2
)
# we have exactly 2 active users with security dashboard set
expect
(
subject
[
:counts
][
:user_preferences_group_overview_security_dashboard
]).
to
eq
2
...
...
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