Skip to content

🐛 fix(watcher): restore only data properties after a failed watch cycle#551

Merged
scttbnsn merged 1 commit into
dev/v1.6from
feat/v1.6-543-getter-safe-restore
Jul 17, 2026
Merged

🐛 fix(watcher): restore only data properties after a failed watch cycle#551
scttbnsn merged 1 commit into
dev/v1.6from
feat/v1.6-543-getter-safe-restore

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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 assigned updateAvailable/updateKind, but validate() installs those as getter-only derived properties (no setter). On a validated container the assignment threw TypeError: Cannot set property updateAvailable of #<Object> which has only a getter, escaped watchContainer, and the container report never persisted — so start-drydock.sh's readiness gate timed out on the local_ecr_sub_sub_test fixture.

Fix: restore only the plain data properties result and currentReleaseNotes. updateAvailable/updateKind recompute 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 to validate()-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.ts at 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

  • 🐛 Fixed watchContainer error recovery for validated containers by restoring only result and currentReleaseNotes.
  • 🔧 Updated watcher tests to use validated container fixtures and cover getter-derived update state.
  • ✨ Added regression coverage for failed enrichment/write cycles and state restoration.
  • ✅ Verified with 1,313 Docker provider tests and the complete pre-push gate.

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).
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drydock-website Ready Ready Preview, Comment Jul 17, 2026 5:20am
drydockdemo-website Ready Ready Preview, Comment Jul 17, 2026 5:20am

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

watchContainer no longer snapshots or assigns updateAvailable and updateKind during error recovery. When a failed cycle produces no result, it restores only the previous result so derived properties can recompute safely. Tests now validate fixture containers before watching them and cover restoration of results, release notes, errors, and derived update state.

Possibly related issues

Possibly related PRs

  • CodesWhat/drydock#547 — Modifies the same watchContainer failure recovery and test assertions.
  • CodesWhat/drydock#550 — Changes preservation of prior comparison state in the same Docker provider code paths.
  • CodesWhat/drydock#501 — Establishes derived updateAvailable and updateKind behavior for validated containers.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/v1.6-543-getter-safe-restore

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
app/watchers/providers/docker/container-processing.test.ts (1)

104-124: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Unnecessary image override duplicates helper defaults.

The full image config at lines 105-121 duplicates createValidatedContainer's defaults (lines 38-54) with only tag.value changed from '1.3.0' to '1.2.0'. The default '1.3.0' already differs from the result tag '1.4.0', so updateAvailable would still compute true. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 51fea2c and d242894.

📒 Files selected for processing (2)
  • app/watchers/providers/docker/container-processing.test.ts
  • app/watchers/providers/docker/container-processing.ts

@scttbnsn
scttbnsn merged commit bb64ba1 into dev/v1.6 Jul 17, 2026
5 checks passed
@scttbnsn
scttbnsn deleted the feat/v1.6-543-getter-safe-restore branch July 17, 2026 05:21
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