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
-
database Add an
expires_at
column to thedependency_list_exports
table -
backend Create a feature flag named
asynchronous_dependency_export_delivery
-
backend Create
app/mailers/emails/dependencies.rb
and include it inapp/mailers/notify.rb
to render and send the email. -
backend On export completion, if the feature flag is enabled:
- Set
expires_at
to 7 days in the future - Send an email to the export
author.notification_email_for(group)
containing the export download link
- Set
- backend Create a cron worker that runs daily if the feature flag is enabled which deletes all expired exports
-
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