-
Suggestion
-
Resolution: Unresolved
-
None
Problem Definition
Some customers have a setup as follows:
- step: name: Generate cache cache: custom-cache script: - yarn install - parallel: - step: cache: custom-cache script: - <...> - step: cache: custom-cache script: - <...> - step: cache: custom-cache script: - <...>
The first step is only generating a cache. This cache is needed by the next 3 parallel steps, which do not include the yarn install command to generate the cache.
This is a cache with file-based cache keys based on the yarn.lock file.
The problem in this case is that the first step gets executed even when the cache with the correct hash exists, and this takes time.
A condition could be added in the first step with changesets - includePaths for the yarn.lock file, so that this step gets executed only when the yarn.lock file changes. However, since caches get cleared after a week, if the yarn.lock file doesn't get updated every week, then the rest of the steps will fail since they don't generate the cache.
Suggested Solution
The suggested solution is the ability to skip a step if a cache with the correct hash exists; have a condition to only run the step if the cache with the correct hash doesn't exist.