bcgov / cas-cif

CleanBC Industry Fund project
Apache License 2.0
6 stars 2 forks source link

As a CIF admin user, I want to hard delete attachments when I discard an entire revision, so that I'm not keeping files I don't need #1798

Open BCerki opened 1 year ago

BCerki commented 1 year ago

Description:

In https://app.zenhub.com/workspaces/climate-action-secretariat-60ca4121764d710011481ca2/issues/gh/bcgov/cas-cif/1703, we hard delete an attachment (remove from GCS) if it's part of an uncommitted project revision. This ticket is about hard deleting attachments when an entire uncommitted project revision is discarded.

We have attachment delete router middleware that:

  1. deletes an attachment's form change from form_change table (calls the discard form change mutation)
  2. deletes an attachment from attachment table (calls the delete attachment mutation)
  3. deletes an attachment from google cloud

When an entire project is discarded, discardProjectRevision is called from app/pages/cif/project-revision/[projectRevision]/index.tsx. This deletes the attachment's form change but doesn't touch the table or GCS.

Acceptance Criteria:

Given I am a CIF admin user When I discard the first version of my entire revision Then my attachments are deleted from google storage

Development Checklist:

Definition of Ready (Note: If any of these points are not applicable, mark N/A)

·Definition of Done (Note: If any of these points are not applicable, mark N/A)

Notes:

-

patriciarussellCAS commented 9 months ago

@BCerki is this still active?

BCerki commented 9 months ago

@BCerki is this still active?

The hard delete attachment card we did previously was about deleting attachments when someone clicks the "delete" button. This card is about deleting attachments when someone clicks the "discard entire revision" button. So the work in this card isn't done, but I'm not sure how much of a priority it is.