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
a68c51a0
Commit
a68c51a0
authored
Aug 13, 2020
by
Yevgeny Pats
Committed by
Mayra Cabrera
Aug 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add usage_data for coverage_fuzzing
Add index migration for coverage_fuzzing telemetry
parent
3e6d49c0
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
2 deletions
+57
-2
changelogs/unreleased/coverage_fuzzing_usage_ping.yml
changelogs/unreleased/coverage_fuzzing_usage_ping.yml
+5
-0
db/post_migrate/20200721140507_update_index_for_coverage_fuzzing_telemetry.rb
...0721140507_update_index_for_coverage_fuzzing_telemetry.rb
+38
-0
db/schema_migrations/20200721140507
db/schema_migrations/20200721140507
+1
-0
db/structure.sql
db/structure.sql
+1
-1
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+4
-1
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+8
-0
No files found.
changelogs/unreleased/coverage_fuzzing_usage_ping.yml
0 → 100644
View file @
a68c51a0
---
title
:
Add usage ping for coverage_fuzzing
merge_request
:
36960
author
:
type
:
added
db/post_migrate/20200721140507_update_index_for_coverage_fuzzing_telemetry.rb
0 → 100644
View file @
a68c51a0
# frozen_string_literal: true
class
UpdateIndexForCoverageFuzzingTelemetry
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
OLD_INDEX_NAME
=
'index_security_ci_builds_on_name_and_id'
NEW_INDEX_NAME
=
'index_security_ci_builds_on_name_and_id_parser_features'
OLD_CLAUSE
=
"((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text,
('dast'::character varying)::text,
('dependency_scanning'::character varying)::text,
('license_management'::character varying)::text,
('sast'::character varying)::text,
('secret_detection'::character varying)::text,
('license_scanning'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text)"
NEW_CLAUSE
=
"((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text,
('dast'::character varying)::text,
('dependency_scanning'::character varying)::text,
('license_management'::character varying)::text,
('sast'::character varying)::text,
('secret_detection'::character varying)::text,
('coverage_fuzzing'::character varying)::text,
('license_scanning'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text)"
def
up
add_concurrent_index
:ci_builds
,
[
:name
,
:id
],
name:
NEW_INDEX_NAME
,
where:
NEW_CLAUSE
remove_concurrent_index_by_name
:ci_builds
,
OLD_INDEX_NAME
end
def
down
add_concurrent_index
:ci_builds
,
[
:name
,
:id
],
name:
OLD_INDEX_NAME
,
where:
OLD_CLAUSE
remove_concurrent_index_by_name
:ci_builds
,
NEW_INDEX_NAME
end
end
db/schema_migrations/20200721140507
0 → 100644
View file @
a68c51a0
9a395ab591542ec49fc17c22747d9bbf085fd5f61ae71f49493dfe34f0389059
\ No newline at end of file
db/structure.sql
View file @
a68c51a0
...
@@ -20634,7 +20634,7 @@ CREATE UNIQUE INDEX index_scim_oauth_access_tokens_on_group_id_and_token_encrypt
...
@@ -20634,7 +20634,7 @@ CREATE UNIQUE INDEX index_scim_oauth_access_tokens_on_group_id_and_token_encrypt
CREATE
INDEX
index_secure_ci_builds_on_user_id_created_at
ON
public
.
ci_builds
USING
btree
(
user_id
,
created_at
)
WHERE
(((
type
)::
text
=
'Ci::Build'
::
text
)
AND
((
name
)::
text
=
ANY
(
ARRAY
[(
'container_scanning'
::
character
varying
)::
text
,
(
'dast'
::
character
varying
)::
text
,
(
'dependency_scanning'
::
character
varying
)::
text
,
(
'license_management'
::
character
varying
)::
text
,
(
'license_scanning'
::
character
varying
)::
text
,
(
'sast'
::
character
varying
)::
text
,
(
'secret_detection'
::
character
varying
)::
text
])));
CREATE
INDEX
index_secure_ci_builds_on_user_id_created_at
ON
public
.
ci_builds
USING
btree
(
user_id
,
created_at
)
WHERE
(((
type
)::
text
=
'Ci::Build'
::
text
)
AND
((
name
)::
text
=
ANY
(
ARRAY
[(
'container_scanning'
::
character
varying
)::
text
,
(
'dast'
::
character
varying
)::
text
,
(
'dependency_scanning'
::
character
varying
)::
text
,
(
'license_management'
::
character
varying
)::
text
,
(
'license_scanning'
::
character
varying
)::
text
,
(
'sast'
::
character
varying
)::
text
,
(
'secret_detection'
::
character
varying
)::
text
])));
CREATE
INDEX
index_security_ci_builds_on_name_and_id
ON
public
.
ci_builds
USING
btree
(
name
,
id
)
WHERE
(((
name
)::
text
=
ANY
(
ARRAY
[(
'container_scanning'
::
character
varying
)::
text
,
(
'dast'
::
character
varying
)::
text
,
(
'dependency_scanning'
::
character
varying
)::
text
,
(
'license_management'
::
character
varying
)::
text
,
(
'sast'
::
character
varying
)::
text
,
(
'secret_detection
'
::
character
varying
)::
text
,
(
'license_scanning'
::
character
varying
)::
text
]))
AND
((
type
)::
text
=
'Ci::Build'
::
text
));
CREATE
INDEX
index_security_ci_builds_on_name_and_id
_parser_features
ON
public
.
ci_builds
USING
btree
(
name
,
id
)
WHERE
(((
name
)::
text
=
ANY
(
ARRAY
[(
'container_scanning'
::
character
varying
)::
text
,
(
'dast'
::
character
varying
)::
text
,
(
'dependency_scanning'
::
character
varying
)::
text
,
(
'license_management'
::
character
varying
)::
text
,
(
'sast'
::
character
varying
)::
text
,
(
'secret_detection'
::
character
varying
)::
text
,
(
'coverage_fuzzing
'
::
character
varying
)::
text
,
(
'license_scanning'
::
character
varying
)::
text
]))
AND
((
type
)::
text
=
'Ci::Build'
::
text
));
CREATE
INDEX
index_self_managed_prometheus_alert_events_on_environment_id
ON
public
.
self_managed_prometheus_alert_events
USING
btree
(
environment_id
);
CREATE
INDEX
index_self_managed_prometheus_alert_events_on_environment_id
ON
public
.
self_managed_prometheus_alert_events
USING
btree
(
environment_id
);
...
...
ee/lib/ee/gitlab/usage_data.rb
View file @
a68c51a0
...
@@ -26,6 +26,9 @@ module EE
...
@@ -26,6 +26,9 @@ module EE
},
},
secret_detection:
{
secret_detection:
{
name: :secret_detection_jobs
name: :secret_detection_jobs
},
coverage_fuzzing:
{
name: :coverage_fuzzing_jobs
}
}
}.
freeze
}.
freeze
...
@@ -303,7 +306,7 @@ module EE
...
@@ -303,7 +306,7 @@ module EE
end
end
# Currently too complicated and to get reliable counts for these stats:
# Currently too complicated and to get reliable counts for these stats:
# container_scanning_jobs, dast_jobs, dependency_scanning_jobs, license_management_jobs, sast_jobs, secret_detection_jobs
# container_scanning_jobs, dast_jobs, dependency_scanning_jobs, license_management_jobs, sast_jobs, secret_detection_jobs
, coverage_fuzzing_jobs
# Once https://gitlab.com/gitlab-org/gitlab/merge_requests/17568 is merged, this might be doable
# Once https://gitlab.com/gitlab-org/gitlab/merge_requests/17568 is merged, this might be doable
override
:usage_activity_by_stage_secure
override
:usage_activity_by_stage_secure
def
usage_activity_by_stage_secure
(
time_period
)
def
usage_activity_by_stage_secure
(
time_period
)
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
a68c51a0
...
@@ -27,6 +27,7 @@ RSpec.describe Gitlab::UsageData do
...
@@ -27,6 +27,7 @@ RSpec.describe Gitlab::UsageData do
create
(
:ee_ci_build
,
name:
'license_scanning'
,
pipeline:
pipeline
)
create
(
:ee_ci_build
,
name:
'license_scanning'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'sast'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'sast'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'secret_detection'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'secret_detection'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'coverage_fuzzing'
,
pipeline:
pipeline
)
create
(
:prometheus_alert
,
project:
projects
[
0
])
create
(
:prometheus_alert
,
project:
projects
[
0
])
create
(
:prometheus_alert
,
project:
projects
[
0
])
create
(
:prometheus_alert
,
project:
projects
[
0
])
...
@@ -86,6 +87,7 @@ RSpec.describe Gitlab::UsageData do
...
@@ -86,6 +87,7 @@ RSpec.describe Gitlab::UsageData do
expect
(
count_data
.
keys
).
to
include
(
*
%i(
expect
(
count_data
.
keys
).
to
include
(
*
%i(
confidential_epics
confidential_epics
container_scanning_jobs
container_scanning_jobs
coverage_fuzzing_jobs
dast_jobs
dast_jobs
dependency_list_usages_total
dependency_list_usages_total
dependency_scanning_jobs
dependency_scanning_jobs
...
@@ -150,6 +152,7 @@ RSpec.describe Gitlab::UsageData do
...
@@ -150,6 +152,7 @@ RSpec.describe Gitlab::UsageData do
expect
(
count_data
[
:license_management_jobs
]).
to
eq
(
2
)
expect
(
count_data
[
:license_management_jobs
]).
to
eq
(
2
)
expect
(
count_data
[
:sast_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:sast_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:secret_detection_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:secret_detection_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:coverage_fuzzing_jobs
]).
to
eq
(
1
)
end
end
it
'correctly shows failure for combined license management'
do
it
'correctly shows failure for combined license management'
do
...
@@ -501,6 +504,7 @@ RSpec.describe Gitlab::UsageData do
...
@@ -501,6 +504,7 @@ RSpec.describe Gitlab::UsageData do
before
do
before
do
for_defined_days_back
do
for_defined_days_back
do
create
(
:ci_build
,
name:
'container_scanning'
,
user:
user
)
create
(
:ci_build
,
name:
'container_scanning'
,
user:
user
)
create
(
:ci_build
,
name:
'coverage_fuzzing'
,
user:
user
)
create
(
:ci_build
,
name:
'dast'
,
user:
user
)
create
(
:ci_build
,
name:
'dast'
,
user:
user
)
create
(
:ci_build
,
name:
'dependency_scanning'
,
user:
user
)
create
(
:ci_build
,
name:
'dependency_scanning'
,
user:
user
)
create
(
:ci_build
,
name:
'license_management'
,
user:
user
)
create
(
:ci_build
,
name:
'license_management'
,
user:
user
)
...
@@ -513,6 +517,7 @@ RSpec.describe Gitlab::UsageData do
...
@@ -513,6 +517,7 @@ RSpec.describe Gitlab::UsageData do
expect
(
described_class
.
usage_activity_by_stage_secure
(
described_class
.
last_28_days_time_period
)).
to
eq
(
expect
(
described_class
.
usage_activity_by_stage_secure
(
described_class
.
last_28_days_time_period
)).
to
eq
(
user_preferences_group_overview_security_dashboard:
3
,
user_preferences_group_overview_security_dashboard:
3
,
user_container_scanning_jobs:
1
,
user_container_scanning_jobs:
1
,
user_coverage_fuzzing_jobs:
1
,
user_dast_jobs:
1
,
user_dast_jobs:
1
,
user_dependency_scanning_jobs:
1
,
user_dependency_scanning_jobs:
1
,
user_license_management_jobs:
1
,
user_license_management_jobs:
1
,
...
@@ -581,6 +586,7 @@ RSpec.describe Gitlab::UsageData do
...
@@ -581,6 +586,7 @@ RSpec.describe Gitlab::UsageData do
expect
(
described_class
.
usage_activity_by_stage_secure
(
described_class
.
last_28_days_time_period
)).
to
eq
(
expect
(
described_class
.
usage_activity_by_stage_secure
(
described_class
.
last_28_days_time_period
)).
to
eq
(
user_preferences_group_overview_security_dashboard:
3
,
user_preferences_group_overview_security_dashboard:
3
,
user_container_scanning_jobs:
1
,
user_container_scanning_jobs:
1
,
user_coverage_fuzzing_jobs:
1
,
user_dast_jobs:
3
,
user_dast_jobs:
3
,
user_dependency_scanning_jobs:
1
,
user_dependency_scanning_jobs:
1
,
user_license_management_jobs:
1
,
user_license_management_jobs:
1
,
...
@@ -604,6 +610,7 @@ RSpec.describe Gitlab::UsageData do
...
@@ -604,6 +610,7 @@ RSpec.describe Gitlab::UsageData do
expect
(
described_class
.
usage_activity_by_stage_secure
(
described_class
.
last_28_days_time_period
)).
to
eq
(
expect
(
described_class
.
usage_activity_by_stage_secure
(
described_class
.
last_28_days_time_period
)).
to
eq
(
user_preferences_group_overview_security_dashboard:
3
,
user_preferences_group_overview_security_dashboard:
3
,
user_container_scanning_jobs:
1
,
user_container_scanning_jobs:
1
,
user_coverage_fuzzing_jobs:
1
,
user_dast_jobs:
1
,
user_dast_jobs:
1
,
user_dependency_scanning_jobs:
1
,
user_dependency_scanning_jobs:
1
,
user_license_management_jobs:
2
,
user_license_management_jobs:
2
,
...
@@ -626,6 +633,7 @@ RSpec.describe Gitlab::UsageData do
...
@@ -626,6 +633,7 @@ RSpec.describe Gitlab::UsageData do
expect
(
described_class
.
usage_activity_by_stage_secure
(
described_class
.
last_28_days_time_period
)).
to
eq
(
expect
(
described_class
.
usage_activity_by_stage_secure
(
described_class
.
last_28_days_time_period
)).
to
eq
(
user_preferences_group_overview_security_dashboard:
3
,
user_preferences_group_overview_security_dashboard:
3
,
user_container_scanning_jobs:
-
1
,
user_container_scanning_jobs:
-
1
,
user_coverage_fuzzing_jobs:
-
1
,
user_dast_jobs:
-
1
,
user_dast_jobs:
-
1
,
user_dependency_scanning_jobs:
-
1
,
user_dependency_scanning_jobs:
-
1
,
user_license_management_jobs:
-
1
,
user_license_management_jobs:
-
1
,
...
...
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