Skip to content

Remove newlines from vulnerability export CSV

What does this MR do and why?

The export finalization process expects that each CSV entry is on a newline. As a quick fix, this change replaces newline characters with literal "\n" values.

Initially, we tried to change the export finalization process so that it could be RFC 4180-compliant, but this was challenging due to us relying on a custom IO implementation.

Fixes: #472930 (closed)

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

How to set up and validate locally

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

  1. Enable segmented_vulnerability_report_export: echo 'Feature.enable(:segmented_vulnerability_report_export)' | bundle exec rails c
  2. Go to http://gdk.local:3000/flightjs/Flight/-/security/vulnerability_report
  3. Click on a vulnerability
  4. Change the status (ex: dismiss it)
  5. Add a comment on the status change with multiple lines
  6. Go to http://gdk.local:3000/groups/flightjs/-/security/vulnerabilities
  7. Click export
  8. Observe that the CSV has one line per vulnerability
Edited by Brian Williams

Merge request reports

Loading