Skip to content

🐛 fix(v1.6): forward-port recreate rollback and MAC safety - #514

Merged
scttbnsn merged 4 commits into
dev/v1.6from
codex/v1.6-recreate-rollback-forward-port
Jul 13, 2026
Merged

scttbnsn merged 4 commits into
dev/v1.6from
codex/v1.6-recreate-rollback-forward-port

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Forward-ports the reviewed functional code and documentation from #503 onto dev/v1.6 while the consolidated v1.5.2-rc.5 patch finishes review and soak.

  • reclaims orphaned replacement containers across update, self-update, health-monitor, backup, and Compose rollback paths
  • blocks nested rollback-name cascades
  • preserves explicit primary-network MAC configuration without re-pinning daemon-assigned MACs
  • skips registry checks for local images and fixes Docker Hub throttle attribution
  • excludes all v1.5.2 package/version metadata and every .planning path

v1.6 integration

  • preserves the v1.6 sanitized backup API error contract; three imported tests were aligned to the existing public response while cleanup assertions remain unchanged
  • does not reintroduce the legacy trigger-label warning set removed on v1.6
  • adds the release note under Unreleased

Verification

  • focused backend integration: 871/871 tests
  • backend TypeScript build: pass
  • full pre-push gate: backend and UI 100% coverage, both builds, Biome, accepted Qlty baseline, 83 maintenance tests, 31 workflow tests, 37 website script tests, UI typecheck, and zizmor

Review now; merge after #503 clears branch protection and lands on the consolidated v1.5.2 line.

Changelog

  • ✨ Added orphaned-container candidate tracking and best-effort stop/force-remove cleanup across rollback, self-update, health-monitor, and Compose paths.
  • ✨ Added rollback-cascade detection and canonical name resolution for nested -old-<timestamp> names.
  • ✨ Added local-image detection to skip unnecessary registry lookups.
  • ✨ Added primary-network MAC address preservation with Docker API compatibility handling.
  • ✨ Added rollback recovery documentation, socket-proxy guidance, regression tests, and an Unreleased release note.
  • 🔧 Changed Docker Hub throttle warnings to attribute missing domains to docker.io.
  • 🔧 Preserved v1.6 backup API errors and removed trigger-label behavior.
  • 🗑️ Excluded v1.5.2 metadata and .planning paths.

Concerns

  • Confirm socket-proxy and sockguard permissions are deployed for multi-network, static-IP, and MAC-address recreations.
  • Review the new rollback-cascade refusal for intentionally user-named containers matching Drydock’s rollback pattern.
  • Verify local-image detection remains synchronized after image refresh and repair flows.

@vercel

vercel Bot commented Jul 13, 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 13, 2026 5:56pm
drydockdemo-website Ready Ready Preview, Comment Jul 13, 2026 5:56pm

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b675b749-03fd-4306-89f7-cc38861d5cdc

📥 Commits

Reviewing files that changed from the base of the PR and between 029bf8a and 034063d.

📒 Files selected for processing (5)
  • app/triggers/providers/docker/created-container-candidate.test.ts
  • app/triggers/providers/docker/created-container-candidate.ts
  • app/triggers/providers/dockercompose/Dockercompose.compose-exec-and-hooks.test.ts
  • app/triggers/providers/dockercompose/Dockercompose.ts
  • content/docs/current/faq/index.mdx
🚧 Files skipped from review as they are similar to previous changes (4)
  • app/triggers/providers/docker/created-container-candidate.ts
  • app/triggers/providers/docker/created-container-candidate.test.ts
  • content/docs/current/faq/index.mdx
  • app/triggers/providers/dockercompose/Dockercompose.ts

📝 Walkthrough

Walkthrough

Adds shared Docker created-container candidate propagation and best-effort stop/remove cleanup across rollback paths. Updates rollback naming logic to canonicalize nested suffixes and reject rollback cascades. Adjusts Docker MAC address cloning for explicit legacy intent, primary-network selection, and default bridge mode. Tracks locally built images and skips registry lookups for them. Adds related tests and documentation for recovery and socket-proxy permissions.

🚥 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 codex/v1.6-recreate-rollback-forward-port

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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
app/triggers/providers/docker/created-container-candidate.ts (1)

40-72: 🩺 Stability & Availability | 🔵 Trivial

No timeout on stop/remove — cleanup can hang the whole rollback path.

cleanupCreatedContainerCandidate awaits candidate.stop() and candidate.remove({force:true}) with no bound. This helper is now on every critical rollback recovery path (HealthMonitor.performRollback, SelfUpdateTransitionShared, ContainerUpdateExecutor, Dockercompose); if the Docker daemon is unresponsive (the exact class of failure this feature exists to recover from), the cleanup call itself can hang indefinitely and block rollback/restore from ever completing.

This mirrors the existing lack of timeouts on other dockerode calls in these files, so it's not a regression unique to this PR, but since it's now centralized in one shared helper, it's a good point to add a bound once for all four call sites.

Optional: bound the stop/remove calls
+async function withTimeout<T>(promise: Promise<T>, ms: number, onTimeout: string): Promise<T> {
+  return Promise.race([
+    promise,
+    new Promise<never>((_, reject) => setTimeout(() => reject(new Error(onTimeout)), ms)),
+  ]);
+}
+
 export async function cleanupCreatedContainerCandidate(
   candidateContainer: unknown,
   containerName: string,
   logContainer: { warn: (message: string) => void },
 ): Promise<void> {
   ...
   if (typeof candidate.stop === 'function') {
     try {
-      await candidate.stop();
+      await withTimeout(candidate.stop(), 10_000, 'stop timed out');
     } catch (stopError: unknown) {
🤖 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/triggers/providers/docker/created-container-candidate.ts` around lines 40
- 72, Update cleanupCreatedContainerCandidate so candidate.stop() and
candidate.remove({ force: true }) each have a finite timeout, ensuring an
unresponsive Docker daemon cannot block rollback indefinitely. Preserve the
existing warning logs and continue attempting removal when stopping times out or
fails.
app/triggers/providers/dockercompose/Dockercompose.ts (1)

2327-2338: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Compose-specific candidate fallback is untested, following from the pattern divergence.

The Dockercompose.getComposeCreatedContainerCandidate(rollbackError) fallback exists only because Dockercompose keeps its own parallel candidate field (composeCreatedContainerCandidate) instead of the shared createdContainerCandidate mechanism used elsewhere. As a direct consequence, no test currently exercises that fallback path.

  • app/triggers/providers/dockercompose/Dockercompose.ts#L2327-L2338: reuse the shared createdContainerCandidate attach helper in Dockercompose's createContainer override so this ?? fallback (and the parallel field) can be removed entirely.
  • app/triggers/providers/dockercompose/Dockercompose.compose-exec-and-hooks.test.ts#L384-L424: until that consolidation happens, add a test where Dockercompose's own createContainer override fails (e.g. network-connect rejection) during the rollback-restore attempt, so the composeCreatedContainerCandidate fallback branch in attemptRollbackRestoreOldContainer gets coverage.
🤖 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/triggers/providers/dockercompose/Dockercompose.ts` around lines 2327 -
2338, Consolidate candidate tracking in Dockercompose.createContainer by using
the shared createdContainerCandidate attach helper, then remove
composeCreatedContainerCandidate and the
Dockercompose.getComposeCreatedContainerCandidate fallback from
attemptRollbackRestoreOldContainer at
app/triggers/providers/dockercompose/Dockercompose.ts#2327-2338. At
app/triggers/providers/dockercompose/Dockercompose.compose-exec-and-hooks.test.ts#384-424,
no separate fallback test is required after this consolidation; retain or adjust
existing coverage only as needed for the shared candidate path.

Source: Path instructions

🤖 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.

Inline comments:
In `@content/docs/current/faq/index.mdx`:
- Around line 449-450: Correct the version-specific behavior described in the
pre-1.5.2 FAQ paragraph: state that subsequent updates could perform another
rollback rename and compound the suffix, rather than failing cleanly. Reserve
the clean failure behavior for the 1.5.2+ cascade guard, and keep the existing
orphaned-container context intact.

---

Nitpick comments:
In `@app/triggers/providers/docker/created-container-candidate.ts`:
- Around line 40-72: Update cleanupCreatedContainerCandidate so candidate.stop()
and candidate.remove({ force: true }) each have a finite timeout, ensuring an
unresponsive Docker daemon cannot block rollback indefinitely. Preserve the
existing warning logs and continue attempting removal when stopping times out or
fails.

In `@app/triggers/providers/dockercompose/Dockercompose.ts`:
- Around line 2327-2338: Consolidate candidate tracking in
Dockercompose.createContainer by using the shared createdContainerCandidate
attach helper, then remove composeCreatedContainerCandidate and the
Dockercompose.getComposeCreatedContainerCandidate fallback from
attemptRollbackRestoreOldContainer at
app/triggers/providers/dockercompose/Dockercompose.ts#2327-2338. At
app/triggers/providers/dockercompose/Dockercompose.compose-exec-and-hooks.test.ts#384-424,
no separate fallback test is required after this consolidation; retain or adjust
existing coverage only as needed for the shared candidate path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a3224534-8c59-402d-abbb-fe832087d432

📥 Commits

Reviewing files that changed from the base of the PR and between 7002437 and 029bf8a.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (29)
  • app/api/backup.test.ts
  • app/api/backup.ts
  • app/model/container.test.ts
  • app/model/container.ts
  • app/triggers/providers/docker/ContainerRuntimeConfigManager.test.ts
  • app/triggers/providers/docker/ContainerRuntimeConfigManager.ts
  • app/triggers/providers/docker/ContainerUpdateExecutor.test.ts
  • app/triggers/providers/docker/ContainerUpdateExecutor.ts
  • app/triggers/providers/docker/Docker.configuration-container-ops.test.ts
  • app/triggers/providers/docker/Docker.test.ts
  • app/triggers/providers/docker/Docker.ts
  • app/triggers/providers/docker/HealthMonitor.test.ts
  • app/triggers/providers/docker/HealthMonitor.ts
  • app/triggers/providers/docker/SelfUpdateTransitionShared.test.ts
  • app/triggers/providers/docker/SelfUpdateTransitionShared.ts
  • app/triggers/providers/docker/created-container-candidate.test.ts
  • app/triggers/providers/docker/created-container-candidate.ts
  • app/triggers/providers/docker/rollback-cascade-guard.test.ts
  • app/triggers/providers/docker/rollback-cascade-guard.ts
  • app/triggers/providers/dockercompose/Dockercompose.compose-exec-and-hooks.test.ts
  • app/triggers/providers/dockercompose/Dockercompose.ts
  • app/watchers/providers/docker/docker-helpers.test.ts
  • app/watchers/providers/docker/docker-helpers.ts
  • app/watchers/providers/docker/docker-image-details-orchestration.test.ts
  • app/watchers/providers/docker/docker-image-details-orchestration.ts
  • app/watchers/providers/docker/image-comparison.test.ts
  • app/watchers/providers/docker/image-comparison.ts
  • content/docs/current/configuration/watchers/index.mdx
  • content/docs/current/faq/index.mdx

Comment thread content/docs/current/faq/index.mdx Resolved
@scttbnsn

Copy link
Copy Markdown
Contributor Author

Addressed the complete CodeRabbit review set in three logical commits: 57cf948 consolidates Docker Compose onto the shared created-container candidate channel, 2eab046 bounds stop/remove cleanup while preserving best-effort rollback, and 034063d corrects the versioned FAQ behavior plus ID-safe recovery guidance. Verification: 598 relevant backend tests, backend TypeScript build, Biome, docs script tests, and diff checks pass. The same FAQ content also completed the full 260-page production website build on #503.

@scttbnsn

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@scttbnsn
scttbnsn merged commit 6258570 into dev/v1.6 Jul 13, 2026
5 checks passed
@scttbnsn
scttbnsn deleted the codex/v1.6-recreate-rollback-forward-port branch July 13, 2026 23:59
scttbnsn added a commit that referenced this pull request Jul 14, 2026
## Summary

Finalizes the release-facing v1.6 RC documentation from the published
`v1.5.2` tag and post-#514 `dev/v1.6` tree.

- publishes exact `1.6.0-rc.1` identity across README, website,
Quickstart, and API examples
- preserves the published `145K+` GHCR pull badge
- initializes the complete v1.5 documentation archive from `v1.5.2`,
with an explicit reviewed-errata ledger
- advances website docs routing to `v1.6 → current` while retaining
`v1.5 → v1.5`
- carries the exact v1.5.2 GA/RC changelog history and the v1.6 RC
comparison chain
- records v1.5.2 as released in the README and website timeline

## Release-content checklist

- [x] Initialize `content/docs/v1.5` from exact
`v1.5.2:content/docs/current`
- [x] Generate the archived v1.5 changelog with the canonical MDX
generator against `v1.5.2:CHANGELOG.md`
- [x] Sanitize unsafe credential examples and correct reviewed v1.5
documentation errata without changing archived product behavior
- [x] Document the versioned-doc correction policy and explicit v1.5
exception ledger
- [x] Map `v1.6 → current` and `v1.5 → v1.5` in the website docs
versions
- [x] Update the README prior-release panel and website release timeline
for v1.5.2 GA
- [ ] Confirm the planned July 14, 2026 RC cut date before merge; update
all enforced surfaces if the cut slips
- [x] Add `1.6.0-rc.1` changelog heading and exact
`v1.5.2...v1.6.0-rc.1` / `v1.6.0-rc.1...HEAD` links
- [x] Extend release-date, changelog, archive-routing, 145K+,
credential, copy/paste-safety, and behavior-accuracy regressions

The date is intentionally a visible merge gate. This PR must not merge
unless the release is still scheduled for July 14; otherwise update the
date and rerun review/checks.

## Review remediation

CodeRabbit's 15 inline findings and two review-body nitpicks were
verified against the implementation. Valid issues are corrected in both
current and v1.5 docs. Two proposed changes were rejected with evidence:
source links are version-scoped by the sync pipeline, and the Delete
endpoint removes Drydock's tracking record rather than deleting the
runtime container. The self-update and infrastructure-update wording
follows the persisted recovery states and target-container socket
derivation in code.

## Verification

- 97/97 maintenance-script tests
- 31/31 workflow tests
- 37/37 website script tests
- website typecheck and 348-page production build
- repository-wide Biome and blocking Qlty gate
- backend/UI 100% coverage
- backend/UI builds
- Zizmor
- generated v1.5/v1.6 link-scope verification
- no `.planning` changes


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Changelog

- ✨ Archived v1.5 documentation + changelog history into versioned docs
(`content/docs/v1.5/**`), including the v1.5 correction policy relative
to v1.5.2
- ✨ Published the `1.6.0-rc.1` release identity across README + site
config/content (v1.6 “Highlights” and other RC headings), and ensured
the RC display date is “July 15, 2026” in both documentation and
`scripts/release-docs-identity.test.mjs`
- 🔧 Updated website/docs routing + version mapping (`v1.6 → current`,
`v1.5 → v1.5`) including version defaults and docs sync mapping (current
served as v1.6; seeded v1.5 stable directory from v1.5.2)
- 🔧 Marked milestone/package states so `v1.5.2` is released and
`v1.6.0-rc.1` is the active “next” RC; aligned v1.6 RC date to July 15,
2026 in the “Updates” highlights heading
- 🔧 Updated `1.6.0-rc.1`-specific documentation details (README release
tags table, current updates/highlights content, API/agent/app/portwing
payload example version strings, Quickstart “immutable release
candidate” row)
- 🐛 Added `.gitattributes` whitespace-suppression rule for
`content/docs/v1.5/**` to avoid whitespace handling/validation issues in
the archived snapshot
- 🐛 Seeded/added the v1.5 versioned documentation tree
(`content/docs/v1.5/**`), including new/expanded MDX for
API/config/triggers/security/etc., plus v1.5 changelog docs
- 🐛 Updated documentation examples/payloads for accuracy and copy/paste
safety across `content/docs/current` and `content/docs/v1.5` (version
strings/timestamps, anchors, regex escaping, curl quoting/line
continuations, SBOM `{format}` query formatting, SSE/WebSocket payload
wording)
- 🔒 Hardened credential + placeholder handling in docs (redacted/removed
real tokens/IDs, normalized safe `{REGISTRY_NAME}` placeholder
formatting rules, corrected registry example redactions)
- 🔒 Clarified webhook/security semantics in docs and aligned examples:
  - Bearer token authentication for `/api/v1/webhook/*`
- HMAC-SHA256 raw-body verification for `POST /api/v1/webhooks/registry`
- ✨ Added/expanded regression coverage:
- `scripts/release-docs-identity.test.mjs` (RC identity/date/highlights,
routing/version mapping, changelog/compare-link scope, GHCR badge
presence, copy/paste safety + placeholder correctness, and
example/payload invariants)
- `scripts/changelog-links.test.mjs` (CHANGELOG label uniqueness +
`/compare/...` reference chain/order validation)
- 🐛 Updated targeted “current” doc example fixes (webhook token/secret
requirements and curl safety, trigger/curl JSON quoting, Log API
component + WS frame payload, SBOM `{format}` query placeholder, and
multiple registry/auth trigger docs for placeholder correctness and
formatting consistency)

## Concerns

- Verify `CHANGELOG.md` RC headings/dates and all `/compare/...`
reference-chain/order constraints required by
`scripts/changelog-links.test.mjs`
- Confirm routing/version mapping completeness so all published pages +
referenced anchors resolve correctly for both `v1.6 → current` and `v1.5
→ v1.5`
- Ensure the v1.5 versioned-doc correction policy text matches the
v1.5↔current mirroring/sync behavior in the docs pipeline
- Re-validate copy/paste safety tests: reject unsafe/raw secret patterns
while allowing only intended safe placeholders/formatting rules
- Re-validate webhook/security doc semantics and examples (Bearer vs
HMAC; required token/secret pairing; curl quoting/escaping) against
documented behavior contracts
- Ensure no remaining unsafe credential material or disallowed
placeholder patterns (including `{REGISTRY_NAME}` presence/format rules)
exist in the scanned doc trees
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
scttbnsn added a commit that referenced this pull request Aug 23, 2026