Flavor-aware rebuild triggers for resources#34
Merged
Conversation
Each docker/image resource can now opt into one of three rebuild
strategies beyond today's git-scan default:
auto (default) newest-mtime across git-tracked files in context
always rebuild every invocation (e.g. images fetching external
content at build time)
watch-paths rebuild only when one of the listed paths has changed —
docker-context-relative, with a leading / escaping to the
monorepo root
Configurable per resource under rebuildTrigger, or as a flavor-wide
default under flavors.<flavor>.defaults.rebuildPolicy['docker/image'].
Precedence: resource > flavor default > builtin auto. Dep-cascade and
--force invariants are preserved.
The selected strategy, source, reason, and watched paths are surfaced
in build output via Listr task.output — auto stays silent to keep the
default UX compact.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3e55d49 to
28f348c
Compare
Adds examples/rebuild-triggers/ — a two-component monorepo showing the dev-flavor watch-paths default applying to api and a resource-level always override winning on docs-scraper — plus a docker-compose.devel.yml overlay that mounts only each component's src/ folder so the image-installed /app/node_modules stays intact. Extends the configuration reference with a Rebuild triggers subsection under docker/image and adds a Rebuild Policies section to the Flavors guide, covering strategies, glob semantics, and precedence. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two lightweight tests exercise the CLI path end-to-end via resources build --dry-run --json: that --flavor reaches the new rebuildPolicy field so api inherits the dev flavor's watch-paths default, and that a resource-level rebuildTrigger on docs-scraper still wins with source=resource when a flavor default is in play. Neither test needs Docker. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28f348c to
21ef4e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.