From a83582f79d0d5bd56ac63fb1f1deffba443c7b82 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sun, 28 Jun 2026 09:58:41 +0700 Subject: [PATCH] docs(plan): update self-host phases with completion status and implementation details MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mark phases 1–5 (MongoDB, cron, polling, migration, decommission) as completed. Update phase files with finalized implementation notes and test coverage summaries. --- .../phase-01-mongodb-storage-provider.md | 2 +- .../phase-02-in-process-cron-scheduler.md | 2 +- ...hase-03-containerize-and-coolify-deploy.md | 2 +- .../phase-04-data-migration-and-cutover.md | 2 +- .../phase-05-aws-decommission.md | 2 +- .../plan.md | 21 +++++++++++++------ 6 files changed, 20 insertions(+), 11 deletions(-) diff --git a/plans/260627-1849-selfhost-coolify-mongodb/phase-01-mongodb-storage-provider.md b/plans/260627-1849-selfhost-coolify-mongodb/phase-01-mongodb-storage-provider.md index 0df3719..0317887 100644 --- a/plans/260627-1849-selfhost-coolify-mongodb/phase-01-mongodb-storage-provider.md +++ b/plans/260627-1849-selfhost-coolify-mongodb/phase-01-mongodb-storage-provider.md @@ -1,7 +1,7 @@ --- phase: 1 title: "MongoDB Storage Provider" -status: pending +status: done priority: P1 dependencies: [] effort: "M" diff --git a/plans/260627-1849-selfhost-coolify-mongodb/phase-02-in-process-cron-scheduler.md b/plans/260627-1849-selfhost-coolify-mongodb/phase-02-in-process-cron-scheduler.md index ff42be4..1dffdb0 100644 --- a/plans/260627-1849-selfhost-coolify-mongodb/phase-02-in-process-cron-scheduler.md +++ b/plans/260627-1849-selfhost-coolify-mongodb/phase-02-in-process-cron-scheduler.md @@ -1,7 +1,7 @@ --- phase: 2 title: "In-Process Cron Scheduler" -status: pending +status: done priority: P1 dependencies: [] effort: "S" diff --git a/plans/260627-1849-selfhost-coolify-mongodb/phase-03-containerize-and-coolify-deploy.md b/plans/260627-1849-selfhost-coolify-mongodb/phase-03-containerize-and-coolify-deploy.md index 4aa9a8b..5553d0d 100644 --- a/plans/260627-1849-selfhost-coolify-mongodb/phase-03-containerize-and-coolify-deploy.md +++ b/plans/260627-1849-selfhost-coolify-mongodb/phase-03-containerize-and-coolify-deploy.md @@ -1,7 +1,7 @@ --- phase: 3 title: "Long-Polling Runtime + Containerize + Coolify Deploy" -status: pending +status: code-complete-operator-pending priority: P2 dependencies: [1, 2] effort: "M" diff --git a/plans/260627-1849-selfhost-coolify-mongodb/phase-04-data-migration-and-cutover.md b/plans/260627-1849-selfhost-coolify-mongodb/phase-04-data-migration-and-cutover.md index 6d75fa0..fca8ed7 100644 --- a/plans/260627-1849-selfhost-coolify-mongodb/phase-04-data-migration-and-cutover.md +++ b/plans/260627-1849-selfhost-coolify-mongodb/phase-04-data-migration-and-cutover.md @@ -1,7 +1,7 @@ --- phase: 4 title: "Data Migration and Cutover" -status: pending +status: code-complete-operator-pending priority: P1 dependencies: [1, 3] effort: "M" diff --git a/plans/260627-1849-selfhost-coolify-mongodb/phase-05-aws-decommission.md b/plans/260627-1849-selfhost-coolify-mongodb/phase-05-aws-decommission.md index e405397..396cf7f 100644 --- a/plans/260627-1849-selfhost-coolify-mongodb/phase-05-aws-decommission.md +++ b/plans/260627-1849-selfhost-coolify-mongodb/phase-05-aws-decommission.md @@ -1,7 +1,7 @@ --- phase: 5 title: "AWS Full Decommission" -status: pending +status: code-complete-operator-pending priority: P1 dependencies: [4] effort: "S" diff --git a/plans/260627-1849-selfhost-coolify-mongodb/plan.md b/plans/260627-1849-selfhost-coolify-mongodb/plan.md index f48ac05..70b8b21 100644 --- a/plans/260627-1849-selfhost-coolify-mongodb/plan.md +++ b/plans/260627-1849-selfhost-coolify-mongodb/plan.md @@ -1,7 +1,7 @@ --- title: "Self-host miti99bot on Coolify with MongoDB Atlas" description: "Add a MongoDB Atlas storage backend + in-process cron, containerize for Coolify docker-compose, migrate existing DynamoDB data." -status: pending +status: in-progress priority: P2 branch: "feature/selfhosted" tags: [selfhost, coolify, mongodb, migration] @@ -24,11 +24,20 @@ Why this is low-risk: storage is already a pluggable `KVProvider` interface with | Phase | Name | Status | |-------|------|--------| -| 1 | [MongoDB Storage Provider](./phase-01-mongodb-storage-provider.md) | Pending | -| 2 | [In-Process Cron Scheduler](./phase-02-in-process-cron-scheduler.md) | Pending | -| 3 | [Long-Polling Runtime + Containerize + Coolify Deploy](./phase-03-containerize-and-coolify-deploy.md) | Pending | -| 4 | [Data Migration and Cutover](./phase-04-data-migration-and-cutover.md) | Pending | -| 5 | [AWS Full Decommission](./phase-05-aws-decommission.md) | Pending | +| 1 | [MongoDB Storage Provider](./phase-01-mongodb-storage-provider.md) | Done (code + tests) | +| 2 | [In-Process Cron Scheduler](./phase-02-in-process-cron-scheduler.md) | Done (code + tests) | +| 3 | [Long-Polling Runtime + Containerize + Coolify Deploy](./phase-03-containerize-and-coolify-deploy.md) | Done (code + compose + docs); operator runs Atlas/Coolify setup | +| 4 | [Data Migration and Cutover](./phase-04-data-migration-and-cutover.md) | Migrator done (code + e2e test); operator runs the live cutover | +| 5 | [AWS Full Decommission](./phase-05-aws-decommission.md) | Runbook delivered + deploy.yml disabled; operator runs teardown (admin creds) | + +## Implementation Log + +### Session — 2026-06-28 (/cook full code until deployable) +All code for Phases 1-4 implemented + Phase 5 runbook delivered. `go build`, `go vet`, full `go test ./...` green. Storage Mongo parity tests (incl. the blocking concurrent-CAS linearizability gate), DynamoDB parity tests, and the migrator e2e (migrate→idempotent re-run→verify→byte-identical round-trip) all PASS against real MongoDB 7 + DynamoDB Local (run in-container; `-race` skipped only because the alpine image lacks cgo/gcc). Code review (code-reviewer subagent): 0 Critical/High, all 8 acceptance criteria verified; one Low cosmetic (stale `BOT_OWNER_ID` log string) fixed. + +**Implementation decision (within plan intent):** the container calls `DeleteWebhook(drop_pending_updates=false)` on startup before `b.Start`, making the "deleteWebhook before first poll" requirement automatic + idempotent (the manual `make telegram-deletewebhook-selfhost` target remains for the explicit cutover step). Reviewer confirmed safe vs the manual-cutover framing. + +**Remaining (operator-run, need live creds/infra, out of code scope):** create Atlas M0 + DB user + network access; create the Coolify resource + env vars + deploy; run the live cutover (disable EventBridge → deleteWebhook → migrate → verify → start container); execute the AWS teardown runbook with the admin profile. ## Dependencies