drone-cache icon indicating copy to clipboard operation
drone-cache copied to clipboard

Add cache clear

Open cdvv7788 opened this issue 6 years ago • 6 comments

Expected Behavior

When I add [CLEAR CACHE] to a commit, the cache is not restored. Instead it is removed so the rebuild step can generate a new one.

Actual Behavior

Directive is ignored

Steps to Reproduce the Problem

  1. Create cache
  2. Push commit with [CLEAR CACHE] directive
  3. Cache is restored normally

Specifications

  • Version: dev
  • Platform: Ubuntu 18
  • Subsystem:

According to http://plugins.drone.io/drillster/drone-volume-cache/ this is the default cache's behavior. This same API should be used and documented. I did not find information in this package about how to clear the cache.

cdvv7788 avatar Jul 25 '19 14:07 cdvv7788

@cdvv7788 Thanks a lot for reporting this issue. We will work on a remedy.

seandtaber avatar Jul 26 '19 19:07 seandtaber

Hey @cdvv7788, this is not a feature that drone-cache has right now. It's on our road map though.

kakkoyun avatar Jul 31 '19 15:07 kakkoyun

Depends on #76 (as we should reuse whatever cache clearing mechanism that go-cloud lib offers).

spier avatar Oct 21 '19 15:10 spier

@limayekaiwalya How about jumping on this issue? We have a partial implementation in place. You can finish it up to onboard on project. I can help you to push through it. What do you think?

kakkoyun avatar Jul 30 '20 16:07 kakkoyun

@kakkoyun Hey 👋

I would like to look into this, but I have a question regarding correct behaviour and implementation:

a) we could make [CLEAR CACHE] behave so it skips restore step, but it is confusing as it doesn't actually clear cache in defined storage, it will work as new cache will overwrite old one tho, b) if we want to really purge cache from the storage I could potentially use defined flusher interface but there is a problem as by default it is configured to flush cache older than defined TTL which is one hour. One solution to this problem could be that Flusher.Flush could potentially take a bool param indicating to force the flush.

Let me know what do you think :)

melkorm avatar Oct 03 '20 17:10 melkorm

@kakkoyun SOrry I missed your ping. I actually started on https://github.com/meltwater/drone-cache/issues/70

limayekaiwalya avatar Oct 04 '20 09:10 limayekaiwalya