Skip to content

Flavor-aware rebuild triggers for resources#34

Merged
llambeau merged 3 commits intomasterfrom
brainstorm/flavor-rebuild-triggers
Apr 14, 2026
Merged

Flavor-aware rebuild triggers for resources#34
llambeau merged 3 commits intomasterfrom
brainstorm/flavor-rebuild-triggers

Conversation

@llambeau
Copy link
Copy Markdown
Contributor

No description provided.

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>
@llambeau llambeau force-pushed the brainstorm/flavor-rebuild-triggers branch from 3e55d49 to 28f348c Compare April 14, 2026 12:15
llambeau and others added 2 commits April 14, 2026 14:17
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>
@llambeau llambeau force-pushed the brainstorm/flavor-rebuild-triggers branch from 28f348c to 21ef4e3 Compare April 14, 2026 12:18
@llambeau llambeau merged commit 5f6711c into master Apr 14, 2026
1 check passed
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