danmayer / coverband

Ruby production code coverage collection and reporting (line of code usage)
https://github.com/danmayer/coverband
MIT License
2.5k stars 161 forks source link

Build generic Active Support Cache adapter #533

Open danmayer opened 6 months ago

danmayer commented 6 months ago

We now have a number of adapters 2 redis, memcached, file, etc... If we built a good active support cache adapter it would work for all the traditional cache stores and AS::Cache has a file store as well as SolidCache which is a DB adapter so we would work for postgres, mysql, and sqlite (eventually).

This could reduce the number of custom adapters we need to maintain and possibly reduce the complexity.

It might not work for the HashRedisStore adapter which relies on LUA, so I would need to figure something out for that use case or rework how we use our cache store to not need the two very different methods coverband currently uses for coverage and storage.

harm-matthias-harms commented 2 months ago

I explored this for an hour. I'm not able and not sure how to proceed, here are my findings:

danmayer commented 2 months ago

yeah it would definitely take some effort which is why I haven't had time for it. You are likely correct that it would end up being a breaking change... instead of raw_store with sets it would likely need to just serialize into JSON and use simple gets and sets so it might also be a bit slower....

Thanks for looking at it, I do hope to get back to this sometime.