Commit f2f74407 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '33488-enable-first_class_vulnerabilities-feature-flag' into 'master'

Enable first_class_vulnerabilities feature flag by default

See merge request gitlab-org/gitlab!29431
parents 7b0a186e 9da3b69f
...@@ -3,7 +3,7 @@ class Groups::Security::DashboardController < Groups::ApplicationController ...@@ -3,7 +3,7 @@ class Groups::Security::DashboardController < Groups::ApplicationController
layout 'group' layout 'group'
before_action only: [:show] do before_action only: [:show] do
push_frontend_feature_flag(:first_class_vulnerabilities) push_frontend_feature_flag(:first_class_vulnerabilities, group, default_enabled: true)
end end
def show def show
......
...@@ -9,7 +9,7 @@ module Projects ...@@ -9,7 +9,7 @@ module Projects
before_action only: [:index] do before_action only: [:index] do
push_frontend_feature_flag(:hide_dismissed_vulnerabilities) push_frontend_feature_flag(:hide_dismissed_vulnerabilities)
push_frontend_feature_flag(:first_class_vulnerabilities, @project) push_frontend_feature_flag(:first_class_vulnerabilities, @project, default_enabled: true)
end end
def index def index
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Security module Security
class DashboardController < ::Security::ApplicationController class DashboardController < ::Security::ApplicationController
before_action only: [:show] do before_action only: [:show] do
push_frontend_feature_flag(:first_class_vulnerabilities) push_frontend_feature_flag(:first_class_vulnerabilities, default_enabled: true)
end end
end end
end end
...@@ -148,7 +148,7 @@ module EE ...@@ -148,7 +148,7 @@ module EE
end end
def first_class_vulnerabilities_available?(project) def first_class_vulnerabilities_available?(project)
::Feature.enabled?(:first_class_vulnerabilities, project) ::Feature.enabled?(:first_class_vulnerabilities, project, default_enabled: true)
end end
def merge_pipelines_available? def merge_pipelines_available?
......
...@@ -313,7 +313,7 @@ module EE ...@@ -313,7 +313,7 @@ module EE
end end
def first_class_vulnerabilities_enabled? def first_class_vulnerabilities_enabled?
::Feature.enabled?(:first_class_vulnerabilities, self) ::Feature.enabled?(:first_class_vulnerabilities, self, default_enabled: true)
end end
def feature_available?(feature, user = nil) def feature_available?(feature, user = nil)
......
...@@ -138,7 +138,7 @@ module Vulnerabilities ...@@ -138,7 +138,7 @@ module Vulnerabilities
def state def state
return 'dismissed' if dismissal_feedback.present? return 'dismissed' if dismissal_feedback.present?
return 'detected' unless Feature.enabled?(:first_class_vulnerabilities, project) return 'detected' unless Feature.enabled?(:first_class_vulnerabilities, project, default_enabled: true)
if vulnerability.nil? if vulnerability.nil?
'detected' 'detected'
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
= link_to project_security_dashboard_index_path(@project), title: _('Security Dashboard') do = link_to project_security_dashboard_index_path(@project), title: _('Security Dashboard') do
%span= _('Security Dashboard') %span= _('Security Dashboard')
- if project_nav_tab?(:security) && Feature.enabled?(:first_class_vulnerabilities, @project) - if project_nav_tab?(:security) && Feature.enabled?(:first_class_vulnerabilities, @project, default_enabled: true)
= nav_link(path: 'projects/security/vulnerabilities#index') do = nav_link(path: 'projects/security/vulnerabilities#index') do
= link_to project_security_vulnerabilities_path(@project), title: _('Vulnerability List') do = link_to project_security_vulnerabilities_path(@project), title: _('Vulnerability List') do
%span= _('Vulnerability List') %span= _('Vulnerability List')
......
---
title: Enable Standalone Vulnerabilities feature for improving Vulnerability Management
merge_request: 29431
author:
type: added
...@@ -34,7 +34,7 @@ module API ...@@ -34,7 +34,7 @@ module API
end end
get ':id' do get ':id' do
vulnerability = find_and_authorize_vulnerability!(:read_vulnerability) vulnerability = find_and_authorize_vulnerability!(:read_vulnerability)
not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project) not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project, default_enabled: true)
render_vulnerability(vulnerability) render_vulnerability(vulnerability)
end end
...@@ -44,7 +44,7 @@ module API ...@@ -44,7 +44,7 @@ module API
end end
post ':id/resolve' do post ':id/resolve' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability) vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability)
not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project) not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project, default_enabled: true)
not_modified! if vulnerability.resolved? not_modified! if vulnerability.resolved?
...@@ -57,7 +57,7 @@ module API ...@@ -57,7 +57,7 @@ module API
end end
post ':id/dismiss' do post ':id/dismiss' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability) vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability)
not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project) not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project, default_enabled: true)
not_modified! if vulnerability.dismissed? not_modified! if vulnerability.dismissed?
...@@ -70,7 +70,7 @@ module API ...@@ -70,7 +70,7 @@ module API
end end
post ':id/confirm' do post ':id/confirm' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability) vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability)
not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project) not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project, default_enabled: true)
not_modified! if vulnerability.confirmed? not_modified! if vulnerability.confirmed?
...@@ -87,7 +87,7 @@ module API ...@@ -87,7 +87,7 @@ module API
success EE::API::Entities::Vulnerability success EE::API::Entities::Vulnerability
end end
before do before do
not_found! unless Feature.enabled?(:first_class_vulnerabilities, user_project) not_found! unless Feature.enabled?(:first_class_vulnerabilities, user_project, default_enabled: true)
end end
params do params do
use :pagination use :pagination
......
...@@ -43,7 +43,7 @@ module API ...@@ -43,7 +43,7 @@ module API
end end
before do before do
not_found! unless Feature.enabled?(:first_class_vulnerabilities, user_project) not_found! unless Feature.enabled?(:first_class_vulnerabilities, user_project, default_enabled: true)
end end
post ':id/vulnerability_exports' do post ':id/vulnerability_exports' do
...@@ -55,7 +55,7 @@ module API ...@@ -55,7 +55,7 @@ module API
namespace do namespace do
before do before do
not_found! unless Feature.enabled?(:first_class_vulnerabilities) not_found! unless Feature.enabled?(:first_class_vulnerabilities, default_enabled: true)
end end
params do params do
......
...@@ -33,7 +33,7 @@ module API ...@@ -33,7 +33,7 @@ module API
end end
get ':id/issue_links' do get ':id/issue_links' do
vulnerability = find_and_authorize_vulnerability!(:read_vulnerability) vulnerability = find_and_authorize_vulnerability!(:read_vulnerability)
not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project) not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project, default_enabled: true)
present vulnerability present vulnerability
.related_issues .related_issues
...@@ -51,7 +51,7 @@ module API ...@@ -51,7 +51,7 @@ module API
end end
post ':id/issue_links' do post ':id/issue_links' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability_issue_link) vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability_issue_link)
not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project) not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project, default_enabled: true)
issue = find_project_issue(params[:target_issue_iid], vulnerability.project_id) issue = find_project_issue(params[:target_issue_iid], vulnerability.project_id)
...@@ -69,7 +69,7 @@ module API ...@@ -69,7 +69,7 @@ module API
end end
delete ':id/issue_links/:issue_link_id' do delete ':id/issue_links/:issue_link_id' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability_issue_link) vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability_issue_link)
not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project) not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project, default_enabled: true)
issue_link = find_issue_link! issue_link = find_issue_link!
......
...@@ -121,14 +121,14 @@ describe ProjectsHelper do ...@@ -121,14 +121,14 @@ describe ProjectsHelper do
subject { helper.project_security_dashboard_config(project, pipeline) } subject { helper.project_security_dashboard_config(project, pipeline) }
it 'checks if first vulnerability class is enabled' do it 'checks if first vulnerability class is enabled' do
expect(::Feature).to receive(:enabled?).with(:first_class_vulnerabilities, project) expect(::Feature).to receive(:enabled?).with(:first_class_vulnerabilities, project, default_enabled: true)
subject subject
end end
context 'when first first class vulnerabilities is enabled for project' do context 'when first first class vulnerabilities is enabled for project' do
before do before do
expect(::Feature).to receive(:enabled?).with(:first_class_vulnerabilities, project).and_return(true) expect(::Feature).to receive(:enabled?).with(:first_class_vulnerabilities, project, default_enabled: true).and_return(true)
end end
it 'checks if first vulnerability class is enabled' do it 'checks if first vulnerability class is enabled' do
...@@ -141,7 +141,7 @@ describe ProjectsHelper do ...@@ -141,7 +141,7 @@ describe ProjectsHelper do
context 'when first first class vulnerabilities is disabled for project' do context 'when first first class vulnerabilities is disabled for project' do
before do before do
expect(::Feature).to receive(:enabled?).with(:first_class_vulnerabilities, project).and_return(false) expect(::Feature).to receive(:enabled?).with(:first_class_vulnerabilities, project, default_enabled: true).and_return(false)
end end
it 'checks if first vulnerability class is enabled' do it 'checks if first vulnerability class is enabled' do
......
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