Commit d90364dd authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch...

Merge branch '220573-frontend-modify-secure-configuration-page-to-provide-button-to-create-sast-scanning-mr' into 'master'

Remove sast_configuration_by_click feature flag

See merge request gitlab-org/gitlab!36796
parents 5221f81a e08eb4c2
......@@ -26,6 +26,11 @@ all security features will be configured by default.
## Limitations
It is not possible to enable or disable a feature using the configuration page.
However, instructions on how to enable or disable a feature can be found through
the links next to each feature on that page.
It is not yet possible to enable or disable most features using the
configuration page. However, instructions on how to enable or disable a feature
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 {
];
},
shouldShowAutoDevopsAlert() {
return Boolean(
this.glFeatures.sastConfigurationByClick &&
!this.autoDevopsEnabled &&
!this.gitlabCiPresent &&
this.canEnableAutoDevops,
);
return Boolean(!this.autoDevopsEnabled && !this.gitlabCiPresent && this.canEnableAutoDevops);
},
},
methods: {
......@@ -127,10 +122,7 @@ export default {
// TODO: Remove as part of https://gitlab.com/gitlab-org/gitlab/-/issues/227575
canCreateSASTMergeRequest(feature) {
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
before_action only: [:show] do
push_frontend_feature_flag(:security_auto_fix, project, default_enabled: false)
push_frontend_feature_flag(:sast_configuration_by_click, project, default_enabled: false)
end
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', () => {
describe('Auto DevOps alert', () => {
describe.each`
gitlabCiPresent | autoDevopsEnabled | canEnableAutoDevops | sastConfigurationByClick | shouldShowAlert
${false} | ${false} | ${true} | ${true} | ${true}
${true} | ${false} | ${true} | ${true} | ${false}
${false} | ${true} | ${true} | ${true} | ${false}
${false} | ${false} | ${false} | ${true} | ${false}
${false} | ${false} | ${true} | ${false} | ${false}
gitlabCiPresent | autoDevopsEnabled | canEnableAutoDevops | shouldShowAlert
${false} | ${false} | ${true} | ${true}
${true} | ${false} | ${true} | ${false}
${false} | ${true} | ${true} | ${false}
${false} | ${false} | ${false} | ${false}
`(
'given gitlabCiPresent is $gitlabCiPresent, autoDevopsEnabled is $autoDevopsEnabled, canEnableAutoDevops is $canEnableAutoDevops, sastConfigurationByClick is $sastConfigurationByClick',
({
gitlabCiPresent,
autoDevopsEnabled,
canEnableAutoDevops,
sastConfigurationByClick,
shouldShowAlert,
}) => {
'given gitlabCiPresent is $gitlabCiPresent, autoDevopsEnabled is $autoDevopsEnabled, canEnableAutoDevops is $canEnableAutoDevops',
({ gitlabCiPresent, autoDevopsEnabled, canEnableAutoDevops, shouldShowAlert }) => {
beforeEach(() => {
createComponent({
propsData: {
......@@ -102,7 +95,6 @@ describe('Security Configuration App', () => {
autoDevopsEnabled,
canEnableAutoDevops,
},
provide: { glFeatures: { sastConfigurationByClick } },
});
});
......@@ -168,20 +160,18 @@ describe('Security Configuration App', () => {
describe('enabling SAST by merge request', () => {
describe.each`
sastConfigurationByClick | gitlabCiPresent | autoDevopsEnabled | buttonExpected
${true} | ${false} | ${false} | ${true}
${true} | ${false} | ${true} | ${true}
${true} | ${true} | ${false} | ${false}
${false} | ${false} | ${false} | ${false}
gitlabCiPresent | autoDevopsEnabled | buttonExpected
${false} | ${false} | ${true}
${false} | ${true} | ${true}
${true} | ${false} | ${false}
`(
'given sastConfigurationByClick is $sastConfigurationByClick, gitlabCiPresent is $gitlabCiPresent, autoDevopsEnabled is $autoDevopsEnabled',
({ sastConfigurationByClick, gitlabCiPresent, autoDevopsEnabled, buttonExpected }) => {
'given gitlabCiPresent is $gitlabCiPresent, autoDevopsEnabled is $autoDevopsEnabled',
({ gitlabCiPresent, autoDevopsEnabled, buttonExpected }) => {
beforeEach(() => {
const features = generateFeatures(1, { type: 'sast', configured: false });
createComponent({
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