Wire the imageID parameter (returned from docker build) through createAndStartContainer and buildContainerOptions instead of reconstructing a mutable tag via fmt.Sprintf.
This ensures containers reference the immutable image digest, avoiding tag-reuse races when deploys overlap.
Changes
Rename _ string to imageID string in createAndStartContainer
Change buildContainerOptions to accept imageID string instead of deploymentID int64
Use imageID directly as the Image field in container options
Update rollback path to pass previousImageID directly (removing redundant override)
Add test verifying imageID flows through to container options
Add database.NewTestDatabase and logger.NewForTest test helpers
make check
==> All checks passed!
Wire the `imageID` parameter (returned from docker build) through `createAndStartContainer` and `buildContainerOptions` instead of reconstructing a mutable tag via `fmt.Sprintf`.
This ensures containers reference the immutable image digest, avoiding tag-reuse races when deploys overlap.
## Changes
- Rename `_ string` to `imageID string` in `createAndStartContainer`
- Change `buildContainerOptions` to accept `imageID string` instead of `deploymentID int64`
- Use `imageID` directly as the `Image` field in container options
- Update rollback path to pass `previousImageID` directly (removing redundant override)
- Add test verifying imageID flows through to container options
- Add `database.NewTestDatabase` and `logger.NewForTest` test helpers
## make check
```
==> All checks passed!
```
sneak
was assigned by clawbot2026-02-21 11:25:01 +01:00
Wire the imageID parameter (returned from docker build) through
createAndStartContainer and buildContainerOptions instead of
reconstructing a mutable tag via fmt.Sprintf.
This ensures containers reference the immutable image digest,
avoiding tag-reuse races when deploys overlap.
Changes:
- Rename _ string to imageID string in createAndStartContainer
- Change buildContainerOptions to accept imageID string instead of deploymentID int64
- Use imageID directly as the Image field in container options
- Update rollback path to pass previousImageID directly
- Add test verifying imageID flows through to container options
- Add database.NewTestDatabase and logger.NewForTest test helpers
Summary: Fixes buildContainerOptions to use the actual Docker image ID instead of constructing a tag from deploymentID. Also fixes rollback to pass imageID correctly.
Changes reviewed:
buildContainerOptions now accepts imageID string instead of deploymentID int64 — correct
createAndStartContainer passes imageID through properly — correct
Rollback path now passes previousImageID directly to buildContainerOptions instead of overwriting opts.Image after the fact — cleaner
New test (TestBuildContainerOptionsUsesImageID) validates the fix
Test helpers (database/testing.go, logger/testing.go, export_test.go) are clean
make check: PASS — all tests pass, build succeeds.
## Code Review: ✅ LGTM
**Summary:** Fixes `buildContainerOptions` to use the actual Docker image ID instead of constructing a tag from `deploymentID`. Also fixes rollback to pass `imageID` correctly.
**Changes reviewed:**
- `buildContainerOptions` now accepts `imageID string` instead of `deploymentID int64` — correct
- `createAndStartContainer` passes `imageID` through properly — correct
- Rollback path now passes `previousImageID` directly to `buildContainerOptions` instead of overwriting `opts.Image` after the fact — cleaner
- New test (`TestBuildContainerOptionsUsesImageID`) validates the fix
- Test helpers (`database/testing.go`, `logger/testing.go`, `export_test.go`) are clean
**`make check`: PASS** — all tests pass, build succeeds.
Labeled `merge-ready`, assigned to @sneak.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Wire the
imageIDparameter (returned from docker build) throughcreateAndStartContainerandbuildContainerOptionsinstead of reconstructing a mutable tag viafmt.Sprintf.This ensures containers reference the immutable image digest, avoiding tag-reuse races when deploys overlap.
Changes
_ stringtoimageID stringincreateAndStartContainerbuildContainerOptionsto acceptimageID stringinstead ofdeploymentID int64imageIDdirectly as theImagefield in container optionspreviousImageIDdirectly (removing redundant override)database.NewTestDatabaseandlogger.NewForTesttest helpersmake check
Code Review: ✅ LGTM
Summary: Fixes
buildContainerOptionsto use the actual Docker image ID instead of constructing a tag fromdeploymentID. Also fixes rollback to passimageIDcorrectly.Changes reviewed:
buildContainerOptionsnow acceptsimageID stringinstead ofdeploymentID int64— correctcreateAndStartContainerpassesimageIDthrough properly — correctpreviousImageIDdirectly tobuildContainerOptionsinstead of overwritingopts.Imageafter the fact — cleanerTestBuildContainerOptionsUsesImageID) validates the fixdatabase/testing.go,logger/testing.go,export_test.go) are cleanmake check: PASS — all tests pass, build succeeds.Labeled
merge-ready, assigned to @sneak.