Problem/Motivation

After #3232263: Cleanup file artefacts at the end of deployment instead of the start deleting or decommissioning a preview site build doesn't do anything because we no longer keep track of the atrifacts.

Proposed resolution

Delete everything under a preview site's prefix instead.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acbramley created an issue. See original summary.

acbramley’s picture

Assigned: Unassigned » acbramley
acbramley’s picture

Status: Active » Needs review
FileSize
3.37 KB

This swaps to an approach where we first list all objects under a prefix and then delete them all. There's no way I could find to delete everything under a "folder" or wildcarded delete.

larowlan’s picture

+++ b/modules/preview_site_s3/tests/src/Kernel/S3DeployPluginTest.php
@@ -171,21 +171,28 @@ class S3DeployPluginTest extends PreviewSiteKernelTestBase {
-      'artifacts' => $files,
+      'artifacts' => [$file1, $file2],

I think this should be empty here to reflect the actual state of the build at this point.

This is why we didn't pick this up earlier, because I'm artificially ensuring there are artifacts

acbramley’s picture

FileSize
3.3 KB
1.77 KB
larowlan’s picture

Status: Needs review » Reviewed & tested by the community
larowlan’s picture

Status: Reviewed & tested by the community » Fixed

  • larowlan committed 0ca108e on 1.x authored by acbramley
    Issue #3236174 by acbramley, larowlan: Delete/decommission no longer...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.