Skip to content

Feature Request: Add soft-fail option to prevent cache failures from blocking builds #131

@dansamsara

Description

@dansamsara

Problem

Currently, if cache operations fail (missing cache path, S3 network issues, permission errors, compression failures,
etc.), the entire build step fails. This is problematic when caching is purely an optimization - a cache failure
shouldn't block the build pipeline for mission critical operations.

For example:

  • A missing cache directory causes the save operation to fail and blocks the build
  • Transient S3 network errors prevent builds from completing
  • Permission issues or disk space problems fail the entire job

Proposed Solution

Add a new boolean configuration option soft-fail (default: false) that:

  • Allows all operational failures during restore/save to emit warnings and continue
  • Still fails immediately on configuration errors (missing required options, invalid cache levels) to catch
    misconfigurations early
  • Applies to both restore and save operations

Example Usage

steps:
  - label: ':nodejs: Install dependencies'
    command: npm ci
    plugins:
      - cache#v1.7.0:
          path: node_modules
          manifest: package-lock.json
          restore: file
          save: file
          soft-fail: true  # Cache failures won't block the build

Benefits

  • Treat caching as an optimization, not a requirement
  • More resilient builds that don't fail due to transient cache issues
  • Opt-in feature that maintains backward compatibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions