🐛 fix(watcher): restore only data properties after a failed watch cycle#551
Conversation
The #543 error-restore assigned updateAvailable/updateKind, but validate() installs those as getter-only derived properties — on a validated container the assignment threw TypeError, escaped watchContainer, and the container report never persisted (caught by the Cucumber E2E readiness gate on the rc.2 release PR #550). Restore only the plain data properties result and currentReleaseNotes; the getters recompute from the restored result. 🧪 Regression tests now build containers through the real validate() so the model's getter-only property shape is exercised; the pre-existing tests were migrated off plain object fixtures for the same reason (TDD: 2 failed with the exact getter TypeError pre-fix, 5/5 pass post-fix).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthrough
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/watchers/providers/docker/container-processing.test.ts (1)
104-124: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUnnecessary image override duplicates helper defaults.
The full image config at lines 105-121 duplicates
createValidatedContainer's defaults (lines 38-54) with onlytag.valuechanged from'1.3.0'to'1.2.0'. The default'1.3.0'already differs from the result tag'1.4.0', soupdateAvailablewould still computetrue. Drop the image override entirely.♻️ Remove redundant image override
const container = createValidatedContainer({ - image: { - id: 'image-123456789', - registry: { - name: 'registry', - url: 'https://hub', - }, - name: 'organization/image', - tag: { - value: '1.2.0', - semver: true, - }, - digest: { - watch: false, - }, - architecture: 'amd64', - os: 'linux', - }, result: previousResult, currentReleaseNotes: previousCurrentReleaseNotes, });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/watchers/providers/docker/container-processing.test.ts` around lines 104 - 124, Remove the redundant image override from the createValidatedContainer call in the affected test, allowing the helper’s default image configuration to apply while preserving result, currentReleaseNotes, and the expected updateAvailable behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/watchers/providers/docker/container-processing.test.ts`:
- Around line 104-124: Remove the redundant image override from the
createValidatedContainer call in the affected test, allowing the helper’s
default image configuration to apply while preserving result,
currentReleaseNotes, and the expected updateAvailable behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: cc566100-cb5e-4a9e-bc14-5f476fa29a93
📒 Files selected for processing (2)
app/watchers/providers/docker/container-processing.test.tsapp/watchers/providers/docker/container-processing.ts
Fixes the real regression the 🥒 Cucumber E2E gate caught on release PR #550 (details in this comment).
Root cause: the #543 error-restore in
watchContainer's catch assignedupdateAvailable/updateKind, butvalidate()installs those as getter-only derived properties (no setter). On a validated container the assignment threwTypeError: Cannot set property updateAvailable of #<Object> which has only a getter, escapedwatchContainer, and the container report never persisted — sostart-drydock.sh's readiness gate timed out on thelocal_ecr_sub_sub_testfixture.Fix: restore only the plain data properties
resultandcurrentReleaseNotes.updateAvailable/updateKindrecompute from the restored result via the getters, which also makes the restore inherently consistent (no way to restore a stale flag against a fresh result).Why unit tests missed it: the container fixtures were plain object literals without the model's getters. TDD round (Codex tests first): a new regression test builds its container through the real
validate()and failed pre-fix with the exact getter TypeError; the four pre-existing tests were migrated off plain literals tovalidate()-built containers so the file exercises real model object shapes from now on. 2 failed pre-fix → 5/5 post-fix.Verification: full docker provider suite 34 files / 1313 tests green;
container-processing.tsat 100/100/100/100; complete pre-push gate green from a worktree (coverage 100% app+ui, builds, biome, qlty).No CHANGELOG entry: this corrects the unreleased #543 implementation already covered by the rc.2 bullet.
Changelog
watchContainererror recovery for validated containers by restoring onlyresultandcurrentReleaseNotes.