Skip to content

Set and Get functions for code flow tab

Chen Charnolevsky requested to merge 489760-get-set-tab-index-for-code-flow into master

What does this MR do and why?

We change the code flow tab index in three different places:

  • from the view code flow button
  • from the code flow tab
  • and from the sticky code flow tab

This MR generates generic functions for that operation.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screen_Recording_2024-09-16_at_11.48.14 Screen_Recording_2024-09-16_at_11.49.41

How to set up and validate locally

  1. Upload a GitLab Ultimate license
  2. Enable the feature flag (echo "Feature.enable(:vulnerability_code_flow)" | rails c)
  3. Clone the code flow project and run his pipeline to display vulnerabilities
  4. If the pipeline is failed, do those steps:
  • Go to your locally project and edit with web IDE
  • Create a new file called: gl-sast-report.json and copy the content from here: gl-sast-report.json
  • Edit .gitlab-ci.yml and pasted this content: gitlab-ci.yml
  • Create an MR and merge him
  • Then the pipeline will be successful and you will see two more vulnerabilities in the vulnerability report page because this pipeline is simulates the artifact
  1. Navigate to the project => Secure => Vulnerability report => Select the first vulnerability to navigate to the vulnerability details page
  2. Go through the tabs (using all three options written above) and check that it works well
Patch
diff --git a/ee/app/assets/javascripts/vulnerabilities/components/vulnerability.vue b/ee/app/assets/javascripts/vulnerabilities/components/vulnerability.vue
index ca4110274476..319e8f7180ae 100644
--- a/ee/app/assets/javascripts/vulnerabilities/components/vulnerability.vue
+++ b/ee/app/assets/javascripts/vulnerabilities/components/vulnerability.vue
@@ -56,6 +56,7 @@ export default {
       },
     },
     showCodeFlowTabs() {
+      return true
       return (
         this.glFeatures.vulnerabilityCodeFlow && !isEmpty(this.vulnerability.details.codeFlows)
       );
diff --git a/ee/app/assets/javascripts/vulnerabilities/components/vulnerability_details.vue b/ee/app/assets/javascripts/vulnerabilities/components/vulnerability_details.vue
index bfbc47e4c041..72fd47398163 100644
--- a/ee/app/assets/javascripts/vulnerabilities/components/vulnerability_details.vue
+++ b/ee/app/assets/javascripts/vulnerabilities/components/vulnerability_details.vue
@@ -221,6 +221,7 @@ export default {
       return this.vulnerability.location?.file && this.vulnerability.location?.startLine;
     },
     showCodeFlowButton() {
+      return true
       return (
         this.glFeatures.vulnerabilityCodeFlow && !isEmpty(this.vulnerability.details.codeFlows)
       );
  1. Make sure all the styling is looks as needs to according to the issue.

Numbered steps to set up and validate the change are strongly suggested.

Related to #489760 (closed)

Merge request reports

Loading