You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sprout ci preview hardcoded every app and seed push to ${CI_REGISTRY_IMAGE}:${SHA}, so adopters whose registry root only held throwaway preview tags could never retire that root; this ships an optional .sprout.yamlbuild.image_repo that retargets build, deploy, reseed, reset, and teardown tag deletion to one repository while leaving unset repos byte-identical.
Special things to note
The override is manifest config (.sprout.yamlbuild.image_repo), not a component input, so preview, teardown, reseed, and reset share one source and templates/preview.yml / .github/workflows/preview.yml stay unchanged; it wins over CI_REGISTRY_IMAGE, and GitHub's existing registry/image_name inputs keep working when the key is unset.
GitLab teardown deletes through the preview project's registry API, so the override must be a repository of that project (a sub-repository such as …/dcos/product); a cross-project override only produces the existing best-effort warnings. GHCR resolves owner/package from the ref either way.
resolveCiPreviewIdentity, resolveCiPushedImageRefs, and ci reseed now read the manifest before resolving the ref; with an unreadable manifest, teardown falls back to the registry root exactly as today.
Change outline
apps/cli/src/
├── yaml.ts # SproutBuild.image_repo + parseBuildBlock validation
└── commands/
├── ci-identity.ts # resolveImageRef(env, identity, imageRepo?); preview/pushed refs read yaml first
├── ci-reseed.ts # yaml first, then resolveImageRef with the override
├── ci-preview.ts ci-deploy.ts # unchanged; consume identity.imageRef
├── ci-reset.ts seed-image.ts # unchanged; seed ref derives from the retargeted app ref
├── ci-teardown.ts image-cleanup.ts # unchanged; deletes the refs the push produced
├── yaml.test.ts # key parse + validation cases
├── ci-identity.test.ts # override set/unset, both forges, missing SHA
├── ci-preview.test.ts # build/push/deploy under the override
├── ci-reset.test.ts # reset deploys override refs, no rebuild
├── ci-teardown-reseed-logs.test.ts # reseed deploys override app image
└── ci-teardown-tags.test.ts # teardown deletes exactly the override tags
docs/ adopting-a-repo.md · ci-integration.md · cli-reference.md · troubleshooting.md
templates/README.md
typeSproutBuild=SproutDockerfileBlock&{/** Full repository (registry host + path, no tag); defaults to CI_REGISTRY_IMAGE. */image_repo?: string;};// The one seam every consumer already routes through.functionresolveImageRef(env: NodeJS.ProcessEnv,identity: Pick<CiIdentity,"forge"|"commitSha">,imageRepo?: string,// yaml.build?.image_repo): Result<string>;// `${imageRepo ?? env.CI_REGISTRY_IMAGE}:${identity.commitSha}`
Base: origin/main @ 50fd6f5. Gates run: bun install, bun run typecheck, bun run test (396 CLI tests + 135 guard tests, all green).
build.image_repo widens the single ref seam every consumer already funnels through, so preview build/push, deploy, reseed, reset and teardown tag deletion all retarget consistently while unset manifests stay byte-identical, with matching CLI/docs coverage and green gates.
Full review report
Verdict
APPROVE
Summary: build.image_repo widens the single ref seam every consumer already funnels through, so preview build/push, deploy, reseed, reset and teardown tag deletion all retarget consistently while unset manifests stay byte-identical, with matching CLI/docs coverage and green gates.
What I reviewed
Base origin/main @ 50fd6f5, head 6b38f64 (matches this worktree), 14 files, +444/−45, entirely in apps/cli/src, docs/, templates/README.md.
override pushes <override>:<SHA> (+ seed) and deploys from it — resolveCiPreviewIdentity + ci-preview/ci-deploy consume identity.imageRef; seed-image derives <repo>:<SHA>-seed from that ref, so the seed follows for free.
teardown deletes exactly those tags — resolveCiPushedImageRefs now reads the manifest first and hands the same refs to image-cleanup.
reseed and reset agree — both resolve through the widened seam (ci-reseed reads yaml first; ci-reset reuses identity.imageRef).
unset behaves as today — override || CI_REGISTRY_IMAGE and the old error string when unset; the new resolveCiPushedImageRefs fallback for an unreadable manifest preserves the previous registry-root + seed warning path.
docs where ci preview inputs are documented — manifest table, ci-integration, cli-reference, troubleshooting, component README all updated, and the new error texts are documented verbatim.
Design fit: one seam (resolveImageRef(env, identity, imageRepo?)), no duplicated ref string building, no workflow/component churn, BUILD_KEYS replaces the now-wrong DOCKERFILE_KEYS, yaml-only config so all four CI entry points agree without extra wiring. Comment added is a real invariant and follows CODE-STYLE.md (no ticket/history references, no restating code).
Gates I ran locally on 6b38f64
bun run typecheck — 5/5 packages plus docs/scripts typecheck and docs link check: pass.
bun test in apps/cli — 396 pass / 0 fail (29 files).
bun run test (turbo + guards) — including preview-db 18/18 and guards 135 pass / 0 fail; docs links OK.
New coverage is proportionate and behavioural, not tautological: yaml accept/reject cases, override set/unset/missing-SHA on both forges, preview docker argv + deploy body, reset with no rebuild, reseed deploy body, and teardown asserting the exact two override tag URLs against a GitLab repository id resolved from a nested path.
Non-blocking nits
parseImageRepoField under-validates against its own contract ("no tag or digest"). Probe results on this tree:
https://registry.gitlab.com/team/app → accepted (scheme slips through; produces a nonsense ref and an opaque docker push failure);
registry.gitlab.com/team/app:v1/extra → accepted (a tag segment containing / hides from the last-segment colon check);
registry.gitlab.com/Team/App → accepted (uppercase repository names are rejected by Docker itself);
ghcr.io//app, ghcr.io/team/app#frag → accepted.
A cheap scheme/#/uppercase guard (or reusing parseImageRef on a probe ref) would turn those into the existing one-line hint at parse time. The realistic inputs the docs show are all handled correctly, so this is robustness, not a behaviour bug.
GitLab teardown only finds the override when it is a repository registered under the preview project (templates/README.md notes the token scope; docs/adopting-a-repo.md says flatly "teardown deletes from the same repository"). A cross-project or foreign-host override degrades to the documented best-effort warnings and silently leaves the tags to the expiration policy — worth one clause in the docs so the guarantee matches the implementation.
GitHub + an override whose host is not inputs.registry will fail at the docker/login-action step, since the workflow keeps logging into registry. Fine as-is for a GHCR sub-repository (the common case) and the workflow is deliberately untouched, but the docs read as forge-agnostic ("overrides CI_REGISTRY_IMAGE") without that caveat.
Residual coupling, pre-existing in shape: teardown re-reads .sprout.yaml at teardown time to know where to delete. If teardown checks out a tree without the key (e.g. a closed-unmerged GitHub PR where the override landed only on the PR branch), deletion targets the old root and the override tags wait for the forge policy. Same class of coupling the seed-tag cleanup already had; not introduced here.
None of the above affects the accepted-path behaviour, the backwards-compatibility claim, or the issue's acceptance criteria, so this is an approve.
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
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.
Why the change
sprout ci previewhardcoded every app and seed push to${CI_REGISTRY_IMAGE}:${SHA}, so adopters whose registry root only held throwaway preview tags could never retire that root; this ships an optional.sprout.yamlbuild.image_repothat retargets build, deploy, reseed, reset, and teardown tag deletion to one repository while leaving unset repos byte-identical.Special things to note
.sprout.yamlbuild.image_repo), not a component input, so preview, teardown, reseed, and reset share one source andtemplates/preview.yml/.github/workflows/preview.ymlstay unchanged; it wins overCI_REGISTRY_IMAGE, and GitHub's existingregistry/image_nameinputs keep working when the key is unset.…/dcos/product); a cross-project override only produces the existing best-effort warnings. GHCR resolves owner/package from the ref either way.resolveCiPreviewIdentity,resolveCiPushedImageRefs, andci reseednow read the manifest before resolving the ref; with an unreadable manifest, teardown falls back to the registry root exactly as today.Change outline
Base:
origin/main@50fd6f5. Gates run:bun install,bun run typecheck,bun run test(396 CLI tests + 135 guard tests, all green).Closes #294