Repository navigation
🐛 fix(v1.6): forward-port recreate rollback and MAC safety - #514
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughAdds 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)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
app/triggers/providers/docker/created-container-candidate.ts (1)
40-72: 🩺 Stability & Availability | 🔵 TrivialNo timeout on
stop/remove— cleanup can hang the whole rollback path.
cleanupCreatedContainerCandidateawaitscandidate.stop()andcandidate.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 winCompose-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 sharedcreatedContainerCandidatemechanism used elsewhere. As a direct consequence, no test currently exercises that fallback path.
app/triggers/providers/dockercompose/Dockercompose.ts#L2327-L2338: reuse the sharedcreatedContainerCandidateattach helper in Dockercompose'screateContaineroverride 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 owncreateContaineroverride fails (e.g. network-connect rejection) during the rollback-restore attempt, so thecomposeCreatedContainerCandidatefallback branch inattemptRollbackRestoreOldContainergets 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
⛔ Files ignored due to path filters (1)
CHANGELOG.mdis excluded by!CHANGELOG.md
📒 Files selected for processing (29)
app/api/backup.test.tsapp/api/backup.tsapp/model/container.test.tsapp/model/container.tsapp/triggers/providers/docker/ContainerRuntimeConfigManager.test.tsapp/triggers/providers/docker/ContainerRuntimeConfigManager.tsapp/triggers/providers/docker/ContainerUpdateExecutor.test.tsapp/triggers/providers/docker/ContainerUpdateExecutor.tsapp/triggers/providers/docker/Docker.configuration-container-ops.test.tsapp/triggers/providers/docker/Docker.test.tsapp/triggers/providers/docker/Docker.tsapp/triggers/providers/docker/HealthMonitor.test.tsapp/triggers/providers/docker/HealthMonitor.tsapp/triggers/providers/docker/SelfUpdateTransitionShared.test.tsapp/triggers/providers/docker/SelfUpdateTransitionShared.tsapp/triggers/providers/docker/created-container-candidate.test.tsapp/triggers/providers/docker/created-container-candidate.tsapp/triggers/providers/docker/rollback-cascade-guard.test.tsapp/triggers/providers/docker/rollback-cascade-guard.tsapp/triggers/providers/dockercompose/Dockercompose.compose-exec-and-hooks.test.tsapp/triggers/providers/dockercompose/Dockercompose.tsapp/watchers/providers/docker/docker-helpers.test.tsapp/watchers/providers/docker/docker-helpers.tsapp/watchers/providers/docker/docker-image-details-orchestration.test.tsapp/watchers/providers/docker/docker-image-details-orchestration.tsapp/watchers/providers/docker/image-comparison.test.tsapp/watchers/providers/docker/image-comparison.tscontent/docs/current/configuration/watchers/index.mdxcontent/docs/current/faq/index.mdx
|
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. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
## 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 -->
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.
v1.6 integration
Verification
Review now; merge after #503 clears branch protection and lands on the consolidated v1.5.2 line.
Changelog
-old-<timestamp>names.docker.io..planningpaths.Concerns