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
6a18c230
Commit
6a18c230
authored
Sep 09, 2020
by
Philip Cunningham
Committed by
Mark Chao
Sep 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add usage ping and index for DAST On-Demand Scans
parent
b1070678
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
0 deletions
+44
-0
changelogs/unreleased/add-dast-on-demand-scan-usage-ping-220951.yml
.../unreleased/add-dast-on-demand-scan-usage-ping-220951.yml
+5
-0
db/post_migrate/20200826053152_add_index_on_ci_pipelines_source_for_on_demand_dast.rb
...52_add_index_on_ci_pipelines_source_for_on_demand_dast.rb
+29
-0
db/schema_migrations/20200826053152
db/schema_migrations/20200826053152
+1
-0
db/structure.sql
db/structure.sql
+2
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+5
-0
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+2
-0
No files found.
changelogs/unreleased/add-dast-on-demand-scan-usage-ping-220951.yml
0 → 100644
View file @
6a18c230
---
title
:
Add usage ping and index for DAST On-Demand Scans
merge_request
:
40219
author
:
type
:
added
db/post_migrate/20200826053152_add_index_on_ci_pipelines_source_for_on_demand_dast.rb
0 → 100644
View file @
6a18c230
# frozen_string_literal: true
class
AddIndexOnCiPipelinesSourceForOnDemandDast
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_ci_pipelines_for_ondemand_dast_scans'
SOURCE_ONDEMAND_DAST_SCAN_PIPELINE
=
13
disable_ddl_transaction!
def
up
add_concurrent_index
(
:ci_pipelines
,
:id
,
where:
"source =
#{
SOURCE_ONDEMAND_DAST_SCAN_PIPELINE
}
"
,
name:
INDEX_NAME
)
end
def
down
remove_concurrent_index
(
:ci_pipelines
,
:id
,
where:
"source =
#{
SOURCE_ONDEMAND_DAST_SCAN_PIPELINE
}
"
,
name:
INDEX_NAME
)
end
end
db/schema_migrations/20200826053152
0 → 100644
View file @
6a18c230
d7dd6ef7c39576988d1efd7bb179f75e3104fc8058a671e47c7b68ba2ddc9ba8
\ No newline at end of file
db/structure.sql
View file @
6a18c230
...
...
@@ -19461,6 +19461,8 @@ CREATE UNIQUE INDEX index_ci_pipeline_variables_on_pipeline_id_and_key ON public
CREATE
INDEX
index_ci_pipelines_config_on_pipeline_id
ON
public
.
ci_pipelines_config
USING
btree
(
pipeline_id
);
CREATE
INDEX
index_ci_pipelines_for_ondemand_dast_scans
ON
public
.
ci_pipelines
USING
btree
(
id
)
WHERE
(
source
=
13
);
CREATE
INDEX
index_ci_pipelines_on_auto_canceled_by_id
ON
public
.
ci_pipelines
USING
btree
(
auto_canceled_by_id
);
CREATE
INDEX
index_ci_pipelines_on_ci_ref_id
ON
public
.
ci_pipelines
USING
btree
(
ci_ref_id
)
WHERE
(
ci_ref_id
IS
NOT
NULL
);
...
...
ee/lib/ee/gitlab/usage_data.rb
View file @
6a18c230
...
...
@@ -121,6 +121,10 @@ module EE
results
end
def
on_demand_pipelines_usage
{
dast_on_demand_pipelines:
count
(
::
Ci
::
Pipeline
.
ondemand_dast_scan
)
}
end
# Note: when adding a preference, check if it's mapped to an attribute of a User model. If so, name
# the base key part after a corresponding User model attribute, use its possible values as suffix values.
override
:user_preferences_usage
...
...
@@ -181,6 +185,7 @@ module EE
},
requirements_counts
,
security_products_usage
,
on_demand_pipelines_usage
,
epics_deepest_relationship_level
,
operations_dashboard_usage
)
end
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
6a18c230
...
...
@@ -28,6 +28,7 @@ RSpec.describe Gitlab::UsageData do
create
(
:ci_build
,
name:
'sast'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'secret_detection'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'coverage_fuzzing'
,
pipeline:
pipeline
)
create
(
:ci_pipeline
,
source: :ondemand_dast_scan
,
project:
projects
[
0
])
create
(
:prometheus_alert
,
project:
projects
[
0
])
create
(
:prometheus_alert
,
project:
projects
[
0
])
...
...
@@ -145,6 +146,7 @@ RSpec.describe Gitlab::UsageData do
expect
(
count_data
[
:sast_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:secret_detection_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:coverage_fuzzing_jobs
]).
to
eq
(
1
)
expect
(
count_data
[
:dast_on_demand_pipelines
]).
to
eq
(
1
)
end
it
'gathers group overview preferences usage data'
,
:aggregate_failures
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