Add cache clear
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
- Create cache
- Push commit with [CLEAR CACHE] directive
- 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 Thanks a lot for reporting this issue. We will work on a remedy.
Hey @cdvv7788, this is not a feature that drone-cache has right now. It's on our road map though.
Depends on #76 (as we should reuse whatever cache clearing mechanism that go-cloud lib offers).
@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 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 :)
@kakkoyun SOrry I missed your ping. I actually started on https://github.com/meltwater/drone-cache/issues/70