Skip to content

feat(builds): reuse the image of an unchanged build #404

Open

Description

@PiquelChips

Problem

Every deployment builds every Git source again, even when its commit and build settings haven't changed: app deploy, an edit that deploys, a push and a preview all resolve their sources from scratch. Changing a variable costs a full build, and once builds run on a build machine (#403) that may be off, it can't deploy at all.

Proposed solution

A build is identified by its BuildInputs: the repository, the commit, and the rendered source.build.* settings, build arguments included.

  • Reuse: the deployment checks the repository out as today, which resolves the commit. If a build of this installation succeeded with the same inputs and its image is still present, the deployment uses that image instead of building.
  • The build history shows it: a reused build is recorded as one, naming the build it reuses, so the Builds page and piquelctl builds list explain why nothing was built.
  • Forcing a build: --rebuild on the commands that deploy, and the same choice in the dashboard's deploy dialog. A rebuild pulls base images again.

Reuse applies across environments of an installation, so a preview and production building the same commit build it once.

Changes in behaviour

A redeployment of an unchanged commit no longer refreshes base images. docs/user/applications/git-builds.md ("How it builds") says it does, and needs updating.

Related: #329 (services sharing one build) needs the same lookup. Part of #403.


Written with Claude Fable 5.2 in Claude Code (via T3 Code).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions