Skip to content

support ignore cache option for workflow task execution#4635

Closed
huanghongbo-hhb wants to merge 4 commits into
koderover:mainfrom
huanghongbo-hhb:feat/workflow-ignore-cache-v1
Closed

support ignore cache option for workflow task execution#4635
huanghongbo-hhb wants to merge 4 commits into
koderover:mainfrom
huanghongbo-hhb:feat/workflow-ignore-cache-v1

Conversation

@huanghongbo-hhb
Copy link
Copy Markdown
Contributor

@huanghongbo-hhb huanghongbo-hhb commented Apr 15, 2026

Background

Workflow task execution already supports using ignore_cache to control whether object storage cache restores historical cache content. However, shared storage cache did not support the same behavior.

This change aligns the behavior of the two cache backends:

  • ignore_cache=false: restore previous cache and publish new cache
  • ignore_cache=true: skip restoring previous cache, but still publish new cache

Changes

1. Object storage cache

Add full ignore_cache support for object storage cache in workflow task execution:

  • when ignore_cache=true, skip download archive
  • still keep the later tar archive / cache upload logic

Covered job types:

  • build job
  • testing job
  • scanning job

2. Shared storage cache

Add dedicated restore/publish logic for shared storage cache:

  • add shared_cache_restore step
  • add shared_cache_publish step

Behavior:

  • ignore_cache=false
    • run shared_cache_restore
    • run shared_cache_publish
  • ignore_cache=true
    • skip shared_cache_restore
    • still run shared_cache_publish

Implementation details:

  • shared cache is mounted to /zadig/cache-store
  • each task writes its local cache into its own task directory:
    • .../tasks/task-<taskID>-<jobName>
  • then merges that task directory into:
    • .../merged
  • later tasks restore cache content from merged

Covered job types:

  • build job
  • testing job
  • scanning job

Design Notes

This shared storage implementation uses a straightforward approach:

  • use tasks/ + merged/ directory layout to support cache restore and cache publish

The goal of this version is to support the basic ignore_cache semantics for shared storage cache:

  • do not use historical cache for the current run
  • still publish the current run result for later tasks

Validation

Object storage cache

Validation result:

  • when ignore_cache=false, logs contain both download archive and tar archive
  • when ignore_cache=true, logs no longer contain download archive
  • tar archive is still preserved

Conclusion:

  • object storage cache now supports “skip cache read, keep cache write”

Shared storage cache

Validation result:

ignore_cache=true:

  • shared_cache_restore is not executed
  • shared_cache_publish is executed

This change is Reviewable

Signed-off-by: huanghongbo <huanghongbo@koderover.com>
Signed-off-by: huanghongbo <huanghongbo@koderover.com>
@huanghongbo-hhb huanghongbo-hhb force-pushed the feat/workflow-ignore-cache-v1 branch from 32e8d37 to 5988fbf Compare April 17, 2026 02:15
@github-actions github-actions Bot removed the common label Apr 17, 2026
@huanghongbo-hhb huanghongbo-hhb force-pushed the feat/workflow-ignore-cache-v1 branch from 4208a8c to 5988fbf Compare April 17, 2026 06:34
Signed-off-by: huanghongbo <huanghongbo@koderover.com>
Signed-off-by: huanghongbo <huanghongbo@koderover.com>
@lilianzhu lilianzhu closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants