Add 'details' object to ruby files

What does this MR do and why?

According to this task, this MR is one of the development stages.

When gitlab found a vulnerability in 'mr changes page' there is a GraphQL query that brings all the details of the vulnerability.

In this MR:

  1. I have added a details object to ruby files.
  2. moving ee/app/assets/javascripts/security_dashboard/graphql/fragments/vulnerability_detail.fragment.graphql to a shared folder: app/assets/javascripts/graphql_shared/fragments/vulnerability_detail.fragment.graphql.

Note: Because of backward compatibility issue, in the next MR (that will be in the next milestone) I will add details to GraphQL file.

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
Screenshot_2024-09-05_at_9.18.23 Screenshot_2024-09-05_at_9.15.47

How to set up and validate locally

  1. Upload a GitLab Ultimate license
  2. Create an empty project
  3. Go to your locally project and edit with web IDE
  4. Create a new file called: gl-sast-report.json and copy the content from here: gl-sast-report.json
  5. Create a new file .gitlab-ci.yml and pasted this content: gitlab-ci.yml
  6. Create a new folder called app and a new file inside called app.py and pasted this content: app.py
  7. Create a new MR
  8. Go into 'Changes' in your MR and you will see the detected vulnerability using shapes next to the specific rows.
  9. Open Inspect element -> Network -> find graphql API request with operationName: "getMRCodequalityAndSecurityReports" -> Preview -> Check that details object exist in data.project.mergeRequest.sastReport.report.added[0]

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

Related to #482849 (closed) and #478469 (closed)

Edited by Chen Charnolevsky

Merge request reports

Loading