deis / builder

Git server and application builder for Deis Workflow
https://deis.com
MIT License
40 stars 41 forks source link

feat(cleaner): delete from object store #445

Closed Joshua-Anderson closed 7 years ago

Joshua-Anderson commented 8 years ago

The cleaner now deletes slug and cache files from object storage as well as locally. I didn't write any tests I'm not sure the best way to attempt to mock the object store driver and the cleaner function is untested.

I'm happy to write tests if you have pointers to ways to go about mocking the storage driver.

Fixes #214

deis-bot commented 8 years ago

@kmala, @arschles and @jeroenvisser101 are potential reviewers of this pull request based on my analysis of git blame information. Thanks @Joshua-Anderson!

codecov-io commented 8 years ago

Current coverage is 56.19% (diff: 14.28%)

Merging #445 into master will decrease coverage by 0.93%

@@             master       #445   diff @@
==========================================
  Files            29         29          
  Lines          1199       1219    +20   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits            685        685          
- Misses          476        496    +20   
  Partials         38         38          

Powered by Codecov. Last update 5233911...bd97e3e

Joshua-Anderson commented 7 years ago

Rebased this, anything else needed to get this merged?

bacongobbler commented 7 years ago

I think we just need a core maintainer to manually test this doesn't break backwards compatibility and it's good to go. 👍

mboersma commented 7 years ago

I tested this change on top of Workflow v2.10.0 with S3 and an existing buildpack app, and also with multiple apps with multiple revisions to ensure it doesn't delete too much. Works as advertised--I kept checking the bucket contents as well.

Cleaner deleting cache home/walkup-zirconia/cache for app walkup-zirconia
Cleaner deleting slug /home/walkup-zirconia:git-e91bdc46 for app walkup-zirconia
Cleaner deleting cache home/jangly-tailbone/cache for app jangly-tailbone
Cleaner deleting slug /home/jangly-tailbone:git-11241b3a for app jangly-tailbone
Cleaner deleting slug /home/jangly-tailbone:git-d57c638a for app jangly-tailbone

Thanks a ton @Joshua-Anderson!