Loading
Add advanced configuration to profile drawer
What does this MR do and why?
Add advanced configuration to profile drawer
Show the profile's configured settings in AdvancedConfigurationTable
under the Advanced configuration heading in the scan profile drawer's
read-only view. Show "None of this profile's triggers use analyzer
settings, so there is nothing to configure." when no enabled trigger
takes settings, and "No advanced configuration is set for this
profile." when triggers could take settings but none are set. Hide the
section for GitLab-recommended profiles and for profiles with no
enabled triggers.
Build the rows with classifyConfigurationVariables and reuse the table,
caption and nothing-to-configure text from ScanProfileDetailsModal, so
both views describe settings the same way. Check gitlabRecommended
directly rather than through canManage, which decides edit and delete
access.
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/624191References
- related to #624191 (closed)
- follows up the empty section left by Add advanced configuration variable modal and header
Screenshots or screen recordings
| Profile | Before | After |
|---|---|---|
| custom, with settings | ![]() |
![]() |
| custom, no settings | ![]() |
![]() |
| custom, no trigger takes settings | heading and subtext only, as in the row above | ![]() |
| GitLab-recommended | ![]() |
![]() |
How to set up and validate locally
-
git checkout 624191-add-empty-state-to-scan-profile-drawer-advanced-configuration echo "Feature.enable(:custom_scan_profiles_ui, Group.find(ID))" | gdk rails c -
have a GitLab Ultimate licence
-
in the GraphQL explorer at
/-/graphql-explorer, run this with<group id>set to a top-level group's ID. Variables cannot be added in the UI yet, so it creates one profile with variables, one without, and one whose only trigger takes no variables:expand for mutation
mutation { withVariables: securityScanProfileCreate(input: { namespaceId: "gid://gitlab/Group/<group id>" scanType: SECRET_DETECTION name: "Secret detection with variables" description: "Sets analyzer variables" triggers: [ { triggerType: GIT_PUSH_EVENT } { triggerType: DEFAULT_BRANCH_PIPELINE, configuration: { secretDetection: { imageSuffix: FIPS, excludedPaths: ["spec/fixtures/**"] } } } { triggerType: MERGE_REQUEST_PIPELINE, configuration: { secretDetection: { imageSuffix: FIPS, excludedPaths: ["spec/fixtures/**"] } } } ] }) { scanProfile { id name } errors } withoutVariables: securityScanProfileCreate(input: { namespaceId: "gid://gitlab/Group/<group id>" scanType: SECRET_DETECTION name: "Secret detection without variables" description: "Sets no analyzer variables" triggers: [{ triggerType: GIT_PUSH_EVENT }, { triggerType: DEFAULT_BRANCH_PIPELINE }] }) { scanProfile { id name } errors } pushTriggerOnly: securityScanProfileCreate(input: { namespaceId: "gid://gitlab/Group/<group id>" scanType: SECRET_DETECTION name: "Secret detection push trigger only" description: "Only the push trigger, which takes no analyzer variables" triggers: [{ triggerType: GIT_PUSH_EVENT }] }) { scanProfile { id name } errors } } -
go to that group =>
Secure=>Security configuration -
next to
Secret detection, selectManage profiles
to check each profile state
- select
Secret Detection (default), and check that there is noAdvanced configurationsection underScan triggers - select
Secret detection with variables, and check thatAdvanced configurationshows:- a table with
VariableandValuecolumns - rows for
imageSuffixandexcludedPaths
- a table with
- select
Secret detection without variables, and check thatAdvanced configurationshowsNo advanced configuration is set for this profile. - select
Secret detection push trigger only, and check thatAdvanced configurationshowsNone of this profile's triggers use analyzer settings, so there is nothing to configure.
to run tests
yarn jest ee/spec/frontend/security_configuration/components/scan_profiles/scan_profile_detail_spec.jsMR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Miranda Fluharty






