Add jsonb column to vulnerability_exports model

Context

We are building a PDF reporting feature in tandem with the new vulnerability dashboard.

We are adding many different data visualizations to the web. You can adjust the data with various filters, such as time range.

We want to show those same visualization, with the same filter states, in the PDF.

To do this without having two maintain 2 separate UI component libraries (web and pdf), and keeping them in sync, we are going to send the SVGs in the body of the pdf export request, and render them in the pdf.

This issue

During a spike, where we tested out the feasibility of this approach, we realized we would need to store the svg data until the pdf export worker is running.1

Some notes about the exports:

  • exports are scheduled for deletion after the file is generated, so this change should not result in too much DB pressure
  • This jsonb data does not need to be queried or indexed
  1. You can see a recording of demo of using the SVGs to create the pdf report in this thread on the spike issue.

Edited by Michael Becker