Clone
Stefan Wolf
committed
on 20 Jan 17
Report reasons for not caching (#1187)
We report the reasons why caching is disabled for a task. To that end you can call `cacheIf` and `doN… Show more
Report reasons for not caching (#1187)

We report the reasons why caching is disabled for a task. To that end you can call `cacheIf` and `doNotCacheIf` providing a description for the `Spec`.

It looks like it makes sense to call `cacheIf(Spec)` without providing a description when unconditionally enabling caching (e.g. `cacheIf { true }`).

For `doNotCacheIf` it always makes sense to provide a description why caching would be disabled. This is why we deprecate calling `doNotCacheIf` without providing any description while we do not deprecate calling `cacheIf` without providing a description.

Moreover, we moved resolving of task output caching state to an own executer. By this we know even for an up to date task if it is cacheable or not.

We evaluate cacheability of a task only if caching is enabled. If caching is disabled we use `DISABLED` as `TaskOutputCaching` in TaskStateInternal and do not log any message for each task.

+review REVIEW-6426 Show less

master + 484 more