Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,070
    • Issues 44,070
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,376
    • Merge requests 1,376
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #18969
Closed
Open
Created Aug 01, 2017 by Damian Nowak@NowakerContributor0 of 3 checklist items completed0/3 checklist items

Allow optional caching in failed builds

Description

It's possible that you have a configuration where the outcome of the pipeline has nothing really to do with the quality of the cache. For example, you may be syncing quite a lot of NPM dependencies that are otherwise unchanged by your code. Throwing this valuable cache away because your own code failed to build is not an efficient use of time and resources.

This is particularly exacerbated when getting an initial pipeline working and nothing is ever cached until your first green checkbox shows up.

Proposal

Just like it's possible to specify artifacts:when = always, it should be possible to specify cache:when = always.

Links / references

Documentation blurb

In the documentation we should highlight this as a way to speed up pipelines when you're caching external dependencies, and also mention it in the efficiency docs.

Overview

What is it? cache:when in gitlab-ci.yml Why should someone use this feature? To save time on failed builds. What is the underlying (business) problem? Productivity. How do you use this feature? Add cache:when = always to gitlab-ci.yml

Use cases

Save time on subsequent failed builds.

Feature checklist

Make sure these are completed before closing the issue, with a link to the relevant commit.

  • Feature assurance
  • Documentation
  • Added to features.yml
Edited Sep 28, 2020 by Jason Yavorska
Assignee
Assign to
Time tracking