Commit eac43a02 authored by Dan Jensen's avatar Dan Jensen Committed by Pavel Shutsin

Remove securityScansSucceeded from DevOps Adoption

The securityScansSucceeded query was causing a timeout error. Also,
it has already been mostly replaced with queries for individual scan
types. This removes the column from DevOps adoption, and removes the
data collection from the snapshot. This does not remove the column,
because this is an urgent change, so that will be removed in a
follow-up MR.

Changelog: removed
EE: true
parent 881f2bd4
......@@ -8552,7 +8552,7 @@ Snapshot.
| <a id="devopsadoptionsnapshotrecordedat"></a>`recordedAt` | [`Time!`](#time) | The time the snapshot was recorded. |
| <a id="devopsadoptionsnapshotrunnerconfigured"></a>`runnerConfigured` | [`Boolean!`](#boolean) | At least one runner was used. |
| <a id="devopsadoptionsnapshotsastenabledcount"></a>`sastEnabledCount` | [`Int`](#int) | Total number of projects with enabled SAST. |
| <a id="devopsadoptionsnapshotsecurityscansucceeded"></a>`securityScanSucceeded` | [`Boolean!`](#boolean) | At least one security scan succeeded. |
| <a id="devopsadoptionsnapshotsecurityscansucceeded"></a>`securityScanSucceeded` **{warning-solid}** | [`Boolean!`](#boolean) | **Deprecated** in 14.1. Substituted with specific security metrics. Always false. |
| <a id="devopsadoptionsnapshotstarttime"></a>`startTime` | [`Time!`](#time) | The start time for the snapshot where the data points were collected. |
| <a id="devopsadoptionsnapshottotalprojectscount"></a>`totalProjectsCount` | [`Int`](#int) | Total number of projects. |
| <a id="devopsadoptionsnapshotvulnerabilitymanagementusedcount"></a>`vulnerabilityManagementUsedCount` | [`Int`](#int) | Total number of projects with vulnerability management used at least once. |
......
......@@ -57,7 +57,6 @@ DevOps Adoption shows you which groups in your organization are using the most e
- Sec
- DAST
- SAST
- Scans
- Ops
- Deployments
- Pipelines
......
......@@ -27,7 +27,6 @@ Group DevOps Adoption shows you how individual groups and sub-groups within your
- Sec
- DAST
- SAST
- Scans
- Ops
- Deployments
- Pipelines
......
......@@ -128,12 +128,6 @@ export const DEVOPS_ADOPTION_TABLE_CONFIGURATION = [
tooltip: s__('DevopsAdoption|SAST enabled for at least one project'),
testId: 'sastCol',
},
{
key: 'securityScanSucceeded',
label: s__('DevopsAdoption|Scanning'),
tooltip: s__('DevopsAdoption|At least one security scan of any type run in pipeline'),
testId: 'scanningCol',
},
],
},
{
......
......@@ -5,7 +5,6 @@ fragment LatestSnapshot on DevopsAdoptionSnapshot {
runnerConfigured
pipelineSucceeded
deploySucceeded
securityScanSucceeded
recordedAt
codeOwnersUsedCount
sastEnabledCount
......
......@@ -21,7 +21,8 @@ module Types
field :deploy_succeeded, GraphQL::BOOLEAN_TYPE, null: false,
description: 'At least one deployment succeeded.'
field :security_scan_succeeded, GraphQL::BOOLEAN_TYPE, null: false,
description: 'At least one security scan succeeded.'
description: 'At least one security scan succeeded.',
deprecated: { reason: 'Substituted with specific security metrics. Always false', milestone: '14.1' }
field :code_owners_used_count, GraphQL::INT_TYPE, null: true,
description: 'Total number of projects with existing CODEOWNERS file.'
field :sast_enabled_count, GraphQL::INT_TYPE, null: true,
......
......@@ -72,16 +72,9 @@ module Analytics
Deployment.success.for_project(snapshot_project_ids).updated_before(range_end).updated_after(range_start).exists?
end
# rubocop: disable CodeReuse/ActiveRecord
def security_scan_succeeded
Security::Scan
.joins(:build)
.merge(Ci::Build.for_project(snapshot_project_ids))
.created_before(range_end)
.created_after(range_start)
.exists?
false
end
# rubocop: enable CodeReuse/ActiveRecord
def total_projects_count
snapshot_project_ids.count
......
......@@ -40,7 +40,6 @@ export const devopsAdoptionNamespaceData = {
runnerConfigured: true,
pipelineSucceeded: false,
deploySucceeded: false,
securityScanSucceeded: false,
codeOwnersUsedCount: 0,
sastEnabledCount: 0,
dastEnabledCount: 0,
......@@ -129,10 +128,6 @@ export const overallAdoptionData = {
adopted: false,
title: 'SAST',
},
{
adopted: false,
title: 'Scanning',
},
{
adopted: false,
title: 'Deploys',
......
......@@ -117,15 +117,9 @@ RSpec.describe Analytics::DevopsAdoption::SnapshotCalculator do
describe 'security_scan_succeeded' do
subject { data[:security_scan_succeeded] }
let!(:old_security_scan) { create :security_scan, build: create(:ci_build, project: project), created_at: 100.days.ago(range_end) }
context 'with successful security scan within month' do
let!(:fresh_security_scan) { create :security_scan, build: create(:ci_build, project: project), created_at: 10.days.ago(range_end) }
it { is_expected.to eq true }
it 'is always false' do
is_expected.to eq false
end
it { is_expected.to eq false }
end
describe 'total_projects_count' do
......
......@@ -11333,9 +11333,6 @@ msgstr ""
msgid "DevopsAdoption|At least one pipeline successfully run"
msgstr ""
msgid "DevopsAdoption|At least one security scan of any type run in pipeline"
msgstr ""
msgid "DevopsAdoption|Code owners"
msgstr ""
......@@ -11402,9 +11399,6 @@ msgstr ""
msgid "DevopsAdoption|SAST enabled for at least one project"
msgstr ""
msgid "DevopsAdoption|Scanning"
msgstr ""
msgid "DevopsAdoption|Sec"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment