CircleCI Ideas

Add ability to skip entire job if cache key exists

I have several jobs that are prerequisites for other jobs. These jobs are used to set up baseline caches for the all of the following jobs, such as installing/updating dependencies. 99% of the time none of the dependencies have changed, so running the job is not necessary at all. However, there is overhead every time the job is run:

  1. "Spin up environment" can take 30-60s+ as the Docker image cache is not always consistent.

  2. Restoring a large cache can take 10s+

That is 40-70s+ wasted when a simple presence check on the cache would allow the entire job to be skipped.


I suggest adding a skip_if_cache_exists or similar entry to the job configuration. Example:

skip_if_cache_exists: source-v1-{{ .Branch }}-{{ .Revision }}

This would allow the job to be skipped entirely, avoiding any unnecessary overhead of spinning up the container and restoring caches.

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Apr 7 2020
  • Taking votes
  • Attach files
  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    25 Apr 03:42pm

    Nr.: /bin/bash

    Nr.: /bin/bash

    circleci config pack src > orb.yml

    circleci orb publish orb.yml circleci/gcp-cli@dev:alpha

    rm -rf orb.yml