Commit e08eb4c2 authored by Mark Florian's avatar Mark Florian

Remove sast_configuration_by_click feature flag

This removes the sast_configration_by_click feature flag, added in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36432, and updates
the relevant documentation.

Part of https://gitlab.com/gitlab-org/gitlab/-/issues/220573, which
itself is part of [Configuration UI for SAST][1].

[1]: https://gitlab.com/groups/gitlab-org/-/epics/3262
parent 7ce7a8a3
...@@ -25,6 +25,11 @@ all security features will be configured by default. ...@@ -25,6 +25,11 @@ all security features will be configured by default.
## Limitations ## Limitations
It is not possible to enable or disable a feature using the configuration page. It is not yet possible to enable or disable most features using the
However, instructions on how to enable or disable a feature can be found through configuration page. However, instructions on how to enable or disable a feature
the links next to each feature on that page. can be found through the links next to each feature on that page.
If a project does not have an existing CI configuration, then the SAST feature
can be enabled by clicking on the "Enable with Merge Request" button under the
"Manage" column. Future work will expand this to editing _existing_ CI
configurations, and to other security features.
...@@ -101,12 +101,7 @@ export default { ...@@ -101,12 +101,7 @@ export default {
]; ];
}, },
shouldShowAutoDevopsAlert() { shouldShowAutoDevopsAlert() {
return Boolean( return Boolean(!this.autoDevopsEnabled && !this.gitlabCiPresent && this.canEnableAutoDevops);
this.glFeatures.sastConfigurationByClick &&
!this.autoDevopsEnabled &&
!this.gitlabCiPresent &&
this.canEnableAutoDevops,
);
}, },
}, },
methods: { methods: {
...@@ -127,10 +122,7 @@ export default { ...@@ -127,10 +122,7 @@ export default {
// TODO: Remove as part of https://gitlab.com/gitlab-org/gitlab/-/issues/227575 // TODO: Remove as part of https://gitlab.com/gitlab-org/gitlab/-/issues/227575
canCreateSASTMergeRequest(feature) { canCreateSASTMergeRequest(feature) {
return Boolean( return Boolean(
this.glFeatures.sastConfigurationByClick && feature.type === 'sast' && this.createSastMergeRequestPath && !this.gitlabCiPresent,
feature.type === 'sast' &&
this.createSastMergeRequestPath &&
!this.gitlabCiPresent,
); );
}, },
}, },
......
...@@ -9,7 +9,6 @@ module Projects ...@@ -9,7 +9,6 @@ module Projects
before_action only: [:show] do before_action only: [:show] do
push_frontend_feature_flag(:security_auto_fix, project, default_enabled: false) push_frontend_feature_flag(:security_auto_fix, project, default_enabled: false)
push_frontend_feature_flag(:sast_configuration_by_click, project, default_enabled: false)
end end
before_action only: [:auto_fix] do before_action only: [:auto_fix] do
......
---
title: Add button to Security Configuration page to enable SAST, and Auto DevOps prompt
merge_request: 36796
author:
type: added
...@@ -80,21 +80,14 @@ describe('Security Configuration App', () => { ...@@ -80,21 +80,14 @@ describe('Security Configuration App', () => {
describe('Auto DevOps alert', () => { describe('Auto DevOps alert', () => {
describe.each` describe.each`
gitlabCiPresent | autoDevopsEnabled | canEnableAutoDevops | sastConfigurationByClick | shouldShowAlert gitlabCiPresent | autoDevopsEnabled | canEnableAutoDevops | shouldShowAlert
${false} | ${false} | ${true} | ${true} | ${true} ${false} | ${false} | ${true} | ${true}
${true} | ${false} | ${true} | ${true} | ${false} ${true} | ${false} | ${true} | ${false}
${false} | ${true} | ${true} | ${true} | ${false} ${false} | ${true} | ${true} | ${false}
${false} | ${false} | ${false} | ${true} | ${false} ${false} | ${false} | ${false} | ${false}
${false} | ${false} | ${true} | ${false} | ${false}
`( `(
'given gitlabCiPresent is $gitlabCiPresent, autoDevopsEnabled is $autoDevopsEnabled, canEnableAutoDevops is $canEnableAutoDevops, sastConfigurationByClick is $sastConfigurationByClick', 'given gitlabCiPresent is $gitlabCiPresent, autoDevopsEnabled is $autoDevopsEnabled, canEnableAutoDevops is $canEnableAutoDevops',
({ ({ gitlabCiPresent, autoDevopsEnabled, canEnableAutoDevops, shouldShowAlert }) => {
gitlabCiPresent,
autoDevopsEnabled,
canEnableAutoDevops,
sastConfigurationByClick,
shouldShowAlert,
}) => {
beforeEach(() => { beforeEach(() => {
createComponent({ createComponent({
propsData: { propsData: {
...@@ -102,7 +95,6 @@ describe('Security Configuration App', () => { ...@@ -102,7 +95,6 @@ describe('Security Configuration App', () => {
autoDevopsEnabled, autoDevopsEnabled,
canEnableAutoDevops, canEnableAutoDevops,
}, },
provide: { glFeatures: { sastConfigurationByClick } },
}); });
}); });
...@@ -168,20 +160,18 @@ describe('Security Configuration App', () => { ...@@ -168,20 +160,18 @@ describe('Security Configuration App', () => {
describe('enabling SAST by merge request', () => { describe('enabling SAST by merge request', () => {
describe.each` describe.each`
sastConfigurationByClick | gitlabCiPresent | autoDevopsEnabled | buttonExpected gitlabCiPresent | autoDevopsEnabled | buttonExpected
${true} | ${false} | ${false} | ${true} ${false} | ${false} | ${true}
${true} | ${false} | ${true} | ${true} ${false} | ${true} | ${true}
${true} | ${true} | ${false} | ${false} ${true} | ${false} | ${false}
${false} | ${false} | ${false} | ${false}
`( `(
'given sastConfigurationByClick is $sastConfigurationByClick, gitlabCiPresent is $gitlabCiPresent, autoDevopsEnabled is $autoDevopsEnabled', 'given gitlabCiPresent is $gitlabCiPresent, autoDevopsEnabled is $autoDevopsEnabled',
({ sastConfigurationByClick, gitlabCiPresent, autoDevopsEnabled, buttonExpected }) => { ({ gitlabCiPresent, autoDevopsEnabled, buttonExpected }) => {
beforeEach(() => { beforeEach(() => {
const features = generateFeatures(1, { type: 'sast', configured: false }); const features = generateFeatures(1, { type: 'sast', configured: false });
createComponent({ createComponent({
propsData: { features, gitlabCiPresent, autoDevopsEnabled }, propsData: { features, gitlabCiPresent, autoDevopsEnabled },
provide: { glFeatures: { sastConfigurationByClick } },
}); });
}); });
......
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