Skip to content

Email delivery for dependency list export

Why are we doing this work

The workflow for downloading a dependency list export is currently synchronous, even though the export is generated asynchronously. The user is shown a spinner and must remain on the page until the export completes, otherwise they lose the ability to download the export. For large data sets, it may take up to 30 minutes or more to complete the export, which makes this workflow painful. We would like to make the workflow asynchronous by emailing the user when the export completes.

Relevant links

Non-functional requirements

  • Documentation:
  • Feature flag:
  • Performance:
  • Testing:

Implementation plan

  1. database Add an expires_at column to the dependency_list_exports table
  2. backend Create a feature flag named asynchronous_dependency_export_delivery
  3. backend Create app/mailers/emails/dependencies.rb and include it in app/mailers/notify.rb to render and send the email.
  4. backend On export completion, if the feature flag is enabled:
    1. Set expires_at to 7 days in the future
    2. Send an email to the export author.notification_email_for(group) containing the export download link
  5. backend Create a cron worker that runs daily if the feature flag is enabled which deletes all expired exports
  6. frontend If the feature flag is enabled, change the behavior of the export button. Instead of polling /api/v4/dependency_list_exports/:id, create the export using the existing API and then show a message saying that the export will be delivered via email.

Verification steps

Edited by Brian Williams