#1790  Build cache: option to always upload cache
jbauer opened 2 months ago

Currently the logic is

  1. cache hit with exact cache key match
  2. if no cache hit, try search an alternative cache using some prefix search of available cache keys
  3. upload cache if cache did not hit in 1.

While I can understand the intention it fully ignores the fact that a build can produce cacheable data. But that data is produced after the cache key has been computed so it is impossible to cache that produced data. One example would be a project that has SNAPSHOT dependencies. In that case the project does not change but the build downloads new versions of dependencies regularly and stores them in the build tool cache. These downloaded dependencies can not be cached using the above logic. Other examples might be specialized build tool plugins that need to compute something and store it in the build tools cache. These things cannot be cached as well.

Maybe it might be good to provide an alternative logic that simply always uploads the cache using the cache key. That would mimic the previous OneDev behavior of just having a folder being cached without any logic.

Could be as easy as providing a configuration switch that disables the "if not previously hit" upload logic.

Robin Shen changed state to 'Closed' 2 weeks ago
Previous Value Current Value
Robin Shen commented 2 weeks ago

This improvement is covered via #1836

issue 1 of 1
No labels
Issue Votes (0)
Watchers (3)
Please wait...
Page is in error, reload to recover