Repository navigation
fix(compose,agent): guard compose rewrites and agent prune, cover rollback-failed - #933
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedNext included review available in 15 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
biggest-littlest
left a comment
There was a problem hiding this comment.
Read all four fixes against the code, the compose repository guard and the prune ownership filter are the right shape and CI is green.
ALARGECOMPANY
left a comment
There was a problem hiding this comment.
ANSI ordering fix and the new lifecycle cases look right, nothing else in the diff surprised me.
* fix(compose,agent): guard compose rewrites and agent prune, cover rollback-failed (#933) * fix(compose): refuse to rewrite a service whose image repository differs * fix(agent): keep foreign container ids out of the agent prune * test(triggers): cover the rollback-failed lifecycle branch * fix(log): strip ANSI escapes before control characters * fix(auth): stop persisting sessions for header-authenticated requests (#935) * docs(readme): refresh the competitor comparison and roadmap table for 2026-08 (#936) * docs(readme): refresh the competitor comparison for 2026-08 The comparison table was dated March 2026 and ran against WUD, Diun and two archived projects, so Arcane, Komodo and Dockhand, the tools users actually weigh drydock against now, appeared nowhere in it. It is two tables now, update managers and management platforms, so neither has to carry nine columns. Every cell traces to the 2026-08-29 competitive audit. Corrections that audit forced: WUD ships threshold filtering and has 17 notification providers and 12 registries rather than 16 and 13; Diun's semver and Home Assistant support are partial, and it does have Prometheus metrics; Watchtower's Shoutrrr count is about 20. Drydock's own rows now carry the two it loses, RBAC and a real pending-approval queue, instead of only the ones it wins. A note under the first table records Watchtower's December 2025 archival, its November 2023 last release, and the unofficial community fork still shipping. Seventeen rows across the site's comparison surfaces disagreed with the audit and are fixed with it, including two that undersold somebody: the Dozzle page still called drydock's resource monitoring planned when it shipped in v1.5.0, and the homepage teaser denied Portainer a distributed agent architecture. The roadmap table moves scoped rotatable API keys from v2.0+ to v1.8.0, where the SQLite store migration gives them the persisted key table they need, and lists the per-update approval queue alongside them. Four cells were deliberately left as they were. The audit's "Webhooks (in/out)" row is broader than this table's "Webhook API for CI/CD", and its "Multi-host / agent architecture" and "Compose-file-based updates" rows are narrower than the labels here, so reading any of them straight across would have asserted more than the audit measured. Dockhand's registry count is shown as partial rather than a number because the audit gives two different ones, 4 in the feature matrix and 2 in its summary. All seven READMEs carry the same table, and the URL multiset they share is unchanged. * docs(readme): drop the shipped maturity indicator from the v1.7 roadmap row The image maturity indicator shipped in v1.4.2 and v1.5.0, so listing it as v1.7.0 scope reads as though it is still coming. Removed from the roadmap row in all seven READMEs, with the translated tables re-padded so the column widths are unchanged. * fix(v1.7): address forward-port review findings (#938) * fix(updates): serialize self-update with active lifecycles (#942) * fix(updates): serialize self-update with active lifecycles * fix(updates): release self-update gate after rollback * fix(web): reconcile WUD trigger comparison copy * perf(store): index containers by id * test(playwright): stabilize mobile and update mode checks * fix(updates): identify the active self-update container * fix(updates): serialize helper-managed lifecycles * fix(updates): bound Docker image pulls * fix(config): cap Docker pull deadline * fix(updates): resolve self identity from Docker * fix(updates): release finalized helper lifecycles * fix(updates): harden lifecycle identity and handoffs * fix(updates): harden helper lifecycle completion * fix(updates): bind helpers to the local Docker runtime * fix(updates): harden helper reconciliation * fix(watchers): isolate socket clients from ambient TLS * fix(compose): resolve images before reconciliation * fix(compose): honor env quoting and self lease errors * fix(compose): consume poisoned multiline entries * fix(compose): consume multiline environment duplicates * fix(compose): handle escaped quote parity * fix(updates): keep helper deadlines internal * test(playwright): drain routes before fixture teardown
Four findings from the rc.6 sweep. They're independent and each one is small, so they're on one branch.
The compose action picked which service to rewrite from the container's own
com.docker.compose.servicelabel and never compared the two images, so a container carrying a label for a service it isn't an instance of had that service'simage:line rewritten to its own repository, and the operator's nextdocker compose upwould run that image with the victim service's volumes and privileges. The one runtime-versus-compose comparison there was,reconciliationMode, compares full references, so it can't tell a tag drift from a different repository, and in its defaultwarnmode it only logs. A repository mismatch now throws before anything is written, in everyreconciliationModeincludingoff, because a different repository doesn't mean the file has drifted, it means the container is not that service. Tag-only drift keeps its existing warn, block and off behaviour, and the Docker Hub aliases plus digest-pinned references still compare equal to the same repository.The ownership gate that was added for agent ingestion lives in
processAuthoritativeContainer, and all four callers prune before they ingest, so a foreign container id in a sync frame still reachedpruneOldContainersunchecked. It couldn't delete or save a record on its own, since the prune only considers rows already owned by the reporting agent. What it could do is the #496 replacement match, which is keyed onagent::watcher::namewith the agent forced to the reporting agent, so naming a container owned by another agent or by the controller turned the removal of one of the reporting agent's own rows into a replacement, retaining the update policy on the incoming record and skipping the Home Assistant discovery cleanup for the one going away. The prune now filters its input through the same rule the ingest gate uses.sanitizeLogParamstripped control characters before it looked for ANSI sequences, which deletes the escape byte the ANSI pattern needs, so the pattern could never match andhello\x1b[31m worldcame out ashello[31m world. It isn't an injection hole, the escape byte was always removed and a terminal can't act on the remainder, but the module's own contract said it removed ANSI sequences and it didn't, the residue is in every log line, audit detail and close reason carrying user or registry text, and the test asserting the behaviour had the residue written into its expected value. ANSI now goes first and the pattern covers the whole CSI grammar rather than just the colour sequences, so a cursor or clear-screen sequence doesn't leave[2Jbehind either. The scanner-asset error path had grown its own local copy of the regex to work around this, with a comment explaining the ordering problem, and that copy is gone.getComposeRollbackTerminalPatchturns arollback-failedcompose outcome into{status: failed, phase: rollback-failed}, but the branch sat under av8 ignoreclaiming it was integration-covered through compose recovery, and nothing drove that status throughrunContainerUpdateLifecycle. A regression mapping it torolled-back, or letting it fall through to the duplicate-updateexpiredreclassification, would have shipped at 100% coverage. Seven new lifecycle cases cover both statuses plus the blank-reason, absent-lastError, unrecognized-status, no-container-id, no-persistence-dependency and watcher-only-identity paths, which retires seven of that file's thirteen ignore blocks.Tests cover all four: new compose resolution and mapping cases, agent prune ownership cases, the corrected ANSI expectations, and the seven lifecycle cases. Full pre-push gate passed locally (lint, 100% coverage, build, workflow and script tests, zizmor).