Skip to content

refactor(project): Support cache-exempt build stages - #1680

Open
RandomByte wants to merge 3 commits into
mainfrom
refactor/custom-task-cache-exemption
Open

RandomByte wants to merge 3 commits into
mainfrom
refactor/custom-task-cache-exemption

Conversation

@RandomByte

Copy link
Copy Markdown
Member

Some tasks must execute on every build because their inputs or side effects
are outside the resource model. Allow setTasks to mark their stages as
exempt with a false cacheable flag.

Custom tasks below Specification Version 5.0 may perform untracked I/O.
Run them on every build. From 5.0, allow task descriptors to opt out by
setting cache to false, and validate that the cache flag is a boolean.

Some tasks must execute on every build because their inputs or side effects
are outside the resource model. Allow setTasks to mark their stages as
exempt with a false cacheable flag.

Skip cache lookups and writes for exempt stages while retaining their
request indices and written-path accounting. Disable the project result
cache and make isFresh honor that state across repeated builds. Other
stages remain cacheable.

Cover stage lookup, persistence, and repeated validation with one cache
instance in the cache tests.
Custom tasks below Specification Version 5.0 may perform untracked I/O.
Run them on every build. From 5.0, allow task descriptors to opt out by
setting cache to false, and validate that the cache flag is a boolean.

Share the exemption rule between TaskDefinitions and TaskRunner. Apply
composeTaskList before disabling the project result cache, so excluded
tasks preserve caching. Honor wildcard selection and repeated task
configurations. Warn once per process for legacy tasks and log explicit
opt-outs at verbose level.

Include unit tests and fixtures for both exemption cases. Integration
tests verify repeated execution, cached sibling tasks, and result-cache
reuse when the exempt task is excluded.
Document the legacy-task exemption and the descriptor opt-out in the
incremental-build architecture reference. Describe stage execution,
result-cache suppression, and the warning behavior.
@RandomByte
RandomByte marked this pull request as ready for review October 27, 2026 07:37
@RandomByte
RandomByte requested a review from a team October 27, 2026 07:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant