Remove the dast_view_scans feature flag

This removes the dast_view_scans feature flag and makes the on-demand
scans index page publicly available.

Changelog: other
EE: true
parent 737ecf8b
...@@ -24,7 +24,7 @@ module ResolvesPipelines ...@@ -24,7 +24,7 @@ module ResolvesPipelines
argument :source, argument :source,
GraphQL::Types::String, GraphQL::Types::String,
required: false, required: false,
description: "Filter pipelines by their source. Will be ignored if `dast_view_scans` feature flag is disabled." description: "Filter pipelines by their source."
end end
class_methods do class_methods do
...@@ -38,8 +38,6 @@ module ResolvesPipelines ...@@ -38,8 +38,6 @@ module ResolvesPipelines
end end
def resolve_pipelines(project, params = {}) def resolve_pipelines(project, params = {})
params.delete(:source) unless Feature.enabled?(:dast_view_scans, project, default_enabled: :yaml)
Ci::PipelinesFinder.new(project, context[:current_user], params).execute Ci::PipelinesFinder.new(project, context[:current_user], params).execute
end end
end end
---
name: dast_view_scans
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69571
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/340388
milestone: '14.3'
type: development
group: group::dynamic analysis
default_enabled: true
...@@ -9140,7 +9140,7 @@ four standard [pagination arguments](#connection-pagination-arguments): ...@@ -9140,7 +9140,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="commitpipelinesref"></a>`ref` | [`String`](#string) | Filter pipelines by the ref they are run for. | | <a id="commitpipelinesref"></a>`ref` | [`String`](#string) | Filter pipelines by the ref they are run for. |
| <a id="commitpipelinesscope"></a>`scope` | [`PipelineScopeEnum`](#pipelinescopeenum) | Filter pipelines by scope. | | <a id="commitpipelinesscope"></a>`scope` | [`PipelineScopeEnum`](#pipelinescopeenum) | Filter pipelines by scope. |
| <a id="commitpipelinessha"></a>`sha` | [`String`](#string) | Filter pipelines by the sha of the commit they are run for. | | <a id="commitpipelinessha"></a>`sha` | [`String`](#string) | Filter pipelines by the sha of the commit they are run for. |
| <a id="commitpipelinessource"></a>`source` | [`String`](#string) | Filter pipelines by their source. Will be ignored if `dast_view_scans` feature flag is disabled. | | <a id="commitpipelinessource"></a>`source` | [`String`](#string) | Filter pipelines by their source. |
| <a id="commitpipelinesstatus"></a>`status` | [`PipelineStatusEnum`](#pipelinestatusenum) | Filter pipelines by their status. | | <a id="commitpipelinesstatus"></a>`status` | [`PipelineStatusEnum`](#pipelinestatusenum) | Filter pipelines by their status. |
### `ComplianceFramework` ### `ComplianceFramework`
...@@ -11893,7 +11893,7 @@ four standard [pagination arguments](#connection-pagination-arguments): ...@@ -11893,7 +11893,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="mergerequestpipelinesref"></a>`ref` | [`String`](#string) | Filter pipelines by the ref they are run for. | | <a id="mergerequestpipelinesref"></a>`ref` | [`String`](#string) | Filter pipelines by the ref they are run for. |
| <a id="mergerequestpipelinesscope"></a>`scope` | [`PipelineScopeEnum`](#pipelinescopeenum) | Filter pipelines by scope. | | <a id="mergerequestpipelinesscope"></a>`scope` | [`PipelineScopeEnum`](#pipelinescopeenum) | Filter pipelines by scope. |
| <a id="mergerequestpipelinessha"></a>`sha` | [`String`](#string) | Filter pipelines by the sha of the commit they are run for. | | <a id="mergerequestpipelinessha"></a>`sha` | [`String`](#string) | Filter pipelines by the sha of the commit they are run for. |
| <a id="mergerequestpipelinessource"></a>`source` | [`String`](#string) | Filter pipelines by their source. Will be ignored if `dast_view_scans` feature flag is disabled. | | <a id="mergerequestpipelinessource"></a>`source` | [`String`](#string) | Filter pipelines by their source. |
| <a id="mergerequestpipelinesstatus"></a>`status` | [`PipelineStatusEnum`](#pipelinestatusenum) | Filter pipelines by their status. | | <a id="mergerequestpipelinesstatus"></a>`status` | [`PipelineStatusEnum`](#pipelinestatusenum) | Filter pipelines by their status. |
##### `MergeRequest.reference` ##### `MergeRequest.reference`
...@@ -12927,7 +12927,7 @@ Represents a file or directory in the project repository that has been locked. ...@@ -12927,7 +12927,7 @@ Represents a file or directory in the project repository that has been locked.
| <a id="pipelineconfigsource"></a>`configSource` | [`PipelineConfigSourceEnum`](#pipelineconfigsourceenum) | Configuration source of the pipeline (UNKNOWN_SOURCE, REPOSITORY_SOURCE, AUTO_DEVOPS_SOURCE, WEBIDE_SOURCE, REMOTE_SOURCE, EXTERNAL_PROJECT_SOURCE, BRIDGE_SOURCE, PARAMETER_SOURCE, COMPLIANCE_SOURCE). | | <a id="pipelineconfigsource"></a>`configSource` | [`PipelineConfigSourceEnum`](#pipelineconfigsourceenum) | Configuration source of the pipeline (UNKNOWN_SOURCE, REPOSITORY_SOURCE, AUTO_DEVOPS_SOURCE, WEBIDE_SOURCE, REMOTE_SOURCE, EXTERNAL_PROJECT_SOURCE, BRIDGE_SOURCE, PARAMETER_SOURCE, COMPLIANCE_SOURCE). |
| <a id="pipelinecoverage"></a>`coverage` | [`Float`](#float) | Coverage percentage. | | <a id="pipelinecoverage"></a>`coverage` | [`Float`](#float) | Coverage percentage. |
| <a id="pipelinecreatedat"></a>`createdAt` | [`Time!`](#time) | Timestamp of the pipeline's creation. | | <a id="pipelinecreatedat"></a>`createdAt` | [`Time!`](#time) | Timestamp of the pipeline's creation. |
| <a id="pipelinedastprofile"></a>`dastProfile` | [`DastProfile`](#dastprofile) | DAST profile associated with the pipeline. Returns `null`if `dast_view_scans` feature flag is disabled. | | <a id="pipelinedastprofile"></a>`dastProfile` | [`DastProfile`](#dastprofile) | DAST profile associated with the pipeline. |
| <a id="pipelinedetailedstatus"></a>`detailedStatus` | [`DetailedStatus!`](#detailedstatus) | Detailed status of the pipeline. | | <a id="pipelinedetailedstatus"></a>`detailedStatus` | [`DetailedStatus!`](#detailedstatus) | Detailed status of the pipeline. |
| <a id="pipelinedownstream"></a>`downstream` | [`PipelineConnection`](#pipelineconnection) | Pipelines this pipeline will trigger. (see [Connections](#connections)) | | <a id="pipelinedownstream"></a>`downstream` | [`PipelineConnection`](#pipelineconnection) | Pipelines this pipeline will trigger. (see [Connections](#connections)) |
| <a id="pipelineduration"></a>`duration` | [`Int`](#int) | Duration of the pipeline in seconds. | | <a id="pipelineduration"></a>`duration` | [`Int`](#int) | Duration of the pipeline in seconds. |
...@@ -13359,7 +13359,7 @@ Returns [`DastProfile`](#dastprofile). ...@@ -13359,7 +13359,7 @@ Returns [`DastProfile`](#dastprofile).
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| <a id="projectdastprofilehasdastprofileschedule"></a>`hasDastProfileSchedule` | [`Boolean`](#boolean) | Filter DAST Profiles by whether or not they have a schedule. Will be ignored if `dast_view_scans` feature flag is disabled. | | <a id="projectdastprofilehasdastprofileschedule"></a>`hasDastProfileSchedule` | [`Boolean`](#boolean) | Filter DAST Profiles by whether or not they have a schedule. |
| <a id="projectdastprofileid"></a>`id` | [`DastProfileID!`](#dastprofileid) | ID of the DAST Profile. | | <a id="projectdastprofileid"></a>`id` | [`DastProfileID!`](#dastprofileid) | ID of the DAST Profile. |
##### `Project.dastProfiles` ##### `Project.dastProfiles`
...@@ -13376,7 +13376,7 @@ four standard [pagination arguments](#connection-pagination-arguments): ...@@ -13376,7 +13376,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| <a id="projectdastprofileshasdastprofileschedule"></a>`hasDastProfileSchedule` | [`Boolean`](#boolean) | Filter DAST Profiles by whether or not they have a schedule. Will be ignored if `dast_view_scans` feature flag is disabled. | | <a id="projectdastprofileshasdastprofileschedule"></a>`hasDastProfileSchedule` | [`Boolean`](#boolean) | Filter DAST Profiles by whether or not they have a schedule. |
##### `Project.dastSiteProfile` ##### `Project.dastSiteProfile`
...@@ -13836,7 +13836,7 @@ four standard [pagination arguments](#connection-pagination-arguments): ...@@ -13836,7 +13836,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="projectpipelinesref"></a>`ref` | [`String`](#string) | Filter pipelines by the ref they are run for. | | <a id="projectpipelinesref"></a>`ref` | [`String`](#string) | Filter pipelines by the ref they are run for. |
| <a id="projectpipelinesscope"></a>`scope` | [`PipelineScopeEnum`](#pipelinescopeenum) | Filter pipelines by scope. | | <a id="projectpipelinesscope"></a>`scope` | [`PipelineScopeEnum`](#pipelinescopeenum) | Filter pipelines by scope. |
| <a id="projectpipelinessha"></a>`sha` | [`String`](#string) | Filter pipelines by the sha of the commit they are run for. | | <a id="projectpipelinessha"></a>`sha` | [`String`](#string) | Filter pipelines by the sha of the commit they are run for. |
| <a id="projectpipelinessource"></a>`source` | [`String`](#string) | Filter pipelines by their source. Will be ignored if `dast_view_scans` feature flag is disabled. | | <a id="projectpipelinessource"></a>`source` | [`String`](#string) | Filter pipelines by their source. |
| <a id="projectpipelinesstatus"></a>`status` | [`PipelineStatusEnum`](#pipelinestatusenum) | Filter pipelines by their status. | | <a id="projectpipelinesstatus"></a>`status` | [`PipelineStatusEnum`](#pipelinestatusenum) | Filter pipelines by their status. |
##### `Project.projectMembers` ##### `Project.projectMembers`
...@@ -11,7 +11,6 @@ module Projects ...@@ -11,7 +11,6 @@ module Projects
feature_category :dynamic_application_security_testing feature_category :dynamic_application_security_testing
def index def index
redirect_to new_project_on_demand_scan_path(project) unless Feature.enabled?(:dast_view_scans, @project, default_enabled: :yaml)
end end
def new def new
......
...@@ -28,15 +28,14 @@ module EE ...@@ -28,15 +28,14 @@ module EE
field :dast_profile, field :dast_profile,
::Types::Dast::ProfileType, ::Types::Dast::ProfileType,
null: true, null: true,
description: 'DAST profile associated with the pipeline. Returns `null`' \ description: 'DAST profile associated with the pipeline.'
'if `dast_view_scans` feature flag is disabled.'
def code_quality_reports def code_quality_reports
pipeline.codequality_reports.sort_degradations!.values.presence pipeline.codequality_reports.sort_degradations!.values.presence
end end
def dast_profile def dast_profile
pipeline.dast_profile if ::Feature.enabled?(:dast_view_scans, pipeline.project, default_enabled: :yaml) pipeline.dast_profile
end end
end end
end end
......
...@@ -12,7 +12,7 @@ module Resolvers ...@@ -12,7 +12,7 @@ module Resolvers
argument :has_dast_profile_schedule, ::GraphQL::Types::Boolean, argument :has_dast_profile_schedule, ::GraphQL::Types::Boolean,
required: false, required: false,
description: 'Filter DAST Profiles by whether or not they have a schedule. Will be ignored if `dast_view_scans` feature flag is disabled.' description: 'Filter DAST Profiles by whether or not they have a schedule.'
when_single do when_single do
argument :id, ::Types::GlobalIDType[::Dast::Profile], argument :id, ::Types::GlobalIDType[::Dast::Profile],
...@@ -21,7 +21,6 @@ module Resolvers ...@@ -21,7 +21,6 @@ module Resolvers
end end
def resolve_with_lookahead(**args) def resolve_with_lookahead(**args)
args.delete(:has_dast_profile_schedule) unless Feature.enabled?(:dast_view_scans, project, default_enabled: :yaml)
apply_lookahead(find_dast_profiles(args)) apply_lookahead(find_dast_profiles(args))
end end
......
...@@ -91,11 +91,7 @@ module EE ...@@ -91,11 +91,7 @@ module EE
return ::Sidebars::NilMenuItem.new(item_id: :on_demand_scans) return ::Sidebars::NilMenuItem.new(item_id: :on_demand_scans)
end end
link = if ::Feature.enabled?(:dast_view_scans, context.project, default_enabled: :yaml) link = project_on_demand_scans_path(context.project)
project_on_demand_scans_path(context.project)
else
new_project_on_demand_scan_path(context.project)
end
::Sidebars::MenuItem.new( ::Sidebars::MenuItem.new(
title: s_('OnDemandScans|On-demand scans'), title: s_('OnDemandScans|On-demand scans'),
......
...@@ -109,25 +109,6 @@ RSpec.describe 'Query.project(fullPath).dastProfiles' do ...@@ -109,25 +109,6 @@ RSpec.describe 'Query.project(fullPath).dastProfiles' do
expect { subject }.not_to exceed_query_limit(control) expect { subject }.not_to exceed_query_limit(control)
end end
context 'when `dast_view_scans` feature flag is disabled' do
before do
stub_feature_flags(dast_view_scans: false)
end
context 'when hasDastProfileSchedule is false' do
let(:query_args) { { hasDastProfileSchedule: false } }
include_examples 'returns all dastProfiles'
end
context 'when hasDastProfileSchedule is true' do
let(:query_args) { { hasDastProfileSchedule: true } }
include_examples 'returns all dastProfiles'
end
end
context 'when `dast_view_scans` feature flag is enabled' do
context 'when hasDastProfileSchedule is true' do context 'when hasDastProfileSchedule is true' do
let(:query_args) { { hasDastProfileSchedule: true } } let(:query_args) { { hasDastProfileSchedule: true } }
...@@ -138,7 +119,6 @@ RSpec.describe 'Query.project(fullPath).dastProfiles' do ...@@ -138,7 +119,6 @@ RSpec.describe 'Query.project(fullPath).dastProfiles' do
end end
end end
end end
end
def pagination_query(arguments) def pagination_query(arguments)
graphql_query_for( graphql_query_for(
......
...@@ -78,16 +78,6 @@ RSpec.describe 'Query.project(fullPath).pipelines.dastProfile' do ...@@ -78,16 +78,6 @@ RSpec.describe 'Query.project(fullPath).pipelines.dastProfile' do
expect { subject }.not_to exceed_query_limit(control) expect { subject }.not_to exceed_query_limit(control)
expect(dast_profile_data.size).to eq(6) expect(dast_profile_data.size).to eq(6)
end end
context 'when feature flag is not enabled' do
it 'does not return dast profile data' do
stub_feature_flags(dast_view_scans: false)
subject
expect(dast_profile_data).to contain_exactly(nil)
end
end
end end
end end
end end
...@@ -73,20 +73,6 @@ RSpec.describe Projects::OnDemandScansController, type: :request do ...@@ -73,20 +73,6 @@ RSpec.describe Projects::OnDemandScansController, type: :request do
it_behaves_like 'on-demand scans page' do it_behaves_like 'on-demand scans page' do
let(:path) { project_on_demand_scans_path(project) } let(:path) { project_on_demand_scans_path(project) }
end end
context 'when dast_view_scans feature flag is disabled' do
before do
stub_licensed_features(security_on_demand_scans: true)
stub_feature_flags(dast_view_scans: false)
project.add_developer(user)
login_as(user)
get project_on_demand_scans_path(project)
end
it 'redirects to new on-demands scans form' do
expect(response).to redirect_to(new_project_on_demand_scan_path(project))
end
end
end end
describe 'GET #new' do describe 'GET #new' do
......
...@@ -210,22 +210,6 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -210,22 +210,6 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
expect(rendered).to have_link('Audit events', href: project_audit_events_path(project)) expect(rendered).to have_link('Audit events', href: project_audit_events_path(project))
end end
end end
context 'when dast_view_scans feature flag is disabled' do
before do
allow(view).to receive(:current_user).and_return(user)
stub_feature_flags(dast_view_scans: false)
stub_licensed_features(
security_on_demand_scans: true
)
render
end
it 'links to on-demand scans form instead of index page' do
expect(rendered).to have_link('On-demand scans', href: new_project_on_demand_scan_path(project))
end
end
end end
describe 'Operations' do describe 'Operations' do
......
...@@ -62,17 +62,6 @@ RSpec.describe ResolvesPipelines do ...@@ -62,17 +62,6 @@ RSpec.describe ResolvesPipelines do
context 'filtering by source' do context 'filtering by source' do
let_it_be(:source_pipeline) { create(:ci_pipeline, project: project, source: 'web') } let_it_be(:source_pipeline) { create(:ci_pipeline, project: project, source: 'web') }
context 'when `dast_view_scans` feature flag is disabled' do
before do
stub_feature_flags(dast_view_scans: false)
end
it 'does not filter by source' do
expect(resolve_pipelines(source: 'web')).to contain_exactly(*all_pipelines, source_pipeline)
end
end
context 'when `dast_view_scans` feature flag is enabled' do
it 'does filter by source' do it 'does filter by source' do
expect(resolve_pipelines(source: 'web')).to contain_exactly(source_pipeline) expect(resolve_pipelines(source: 'web')).to contain_exactly(source_pipeline)
end end
...@@ -81,7 +70,6 @@ RSpec.describe ResolvesPipelines do ...@@ -81,7 +70,6 @@ RSpec.describe ResolvesPipelines do
expect(resolve_pipelines).to contain_exactly(*all_pipelines, source_pipeline) expect(resolve_pipelines).to contain_exactly(*all_pipelines, source_pipeline)
end end
end end
end
it 'does not return any pipelines if the user does not have access' do it 'does not return any pipelines if the user does not have access' do
expect(resolve_pipelines({}, {})).to be_empty expect(resolve_pipelines({}, {})).to be_empty
......
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