betterer icon indicating copy to clipboard operation
betterer copied to clipboard

Empty cache created in CI mode

Open kuhelbeher opened this issue 2 years ago • 1 comments
trafficstars

Describe the bug When running betterer ci command with --cache option it creates empty cache file if it there wasn't cache file before.

To Reproduce

  • run betterer ci --cache command without .betterer.cache file created
  • check that .betterer.cache file doesn't have list of the files although it was created

Content of the cache file after running betterer ci --cache command:

{
  "version": 2,
  "testCache": {}
}

Expected behavior A .betterer.cache file created with list of files

Versions (please complete the following information):

  • OS: Windows, Linux
  • Betterer Version: 5.4.0
  • Node Version: 18.16.0

Additional context In our project we don't want to keep cache file in our git repo. Instead we want to generate it on CI, upload it on server and reuse it. But with this issue it's impossible to implement.

kuhelbeher avatar Jul 14 '23 11:07 kuhelbeher

The initial design was that the cache would always be disabled in ci (based on the infra I was working with!) but I can see how this would be wanted. If I make this change, any existing config with ci --cache would start having caching which would probably be unexpected (or they just didn't know it wasn't working), so this will have to be a breaking change.

phenomnomnominal avatar Jul 16 '23 04:07 phenomnomnominal