From 7b6e6df3684965c7d67f96eff4a0643299c0da8e Mon Sep 17 00:00:00 2001 From: Jesper Terkelsen Date: Thu, 12 Nov 2026 13:19:19 +0100 Subject: [PATCH] docs: correct the argocd-wait-sync-multi parallel polling note Measured on production deploys after the change: the gain is the parallel refresh (~47s -> 7-11s for 18 apps). Sequential polls only took 1-2s per sweep, so the parallel polls barely change the tick. Co-Authored-By: Claude Opus 5.5 (1M context) --- CLAUDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index b8a76af..95ae53d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ - **Changes**: new `pnpm-dependency-submission.yml` and `pnpm-dependency-graph` action for pnpm 12 lockfiles ## Recent Changes (2026-11-12) -1. **`argocd-wait-sync-multi` refreshes and polls apps in parallel**: the initial refresh and each poll ran `argocd app get` once per app, one after another (~2.6 s each). With monorepo-typescript's 18 apps the refresh took ~47 s before the first poll, and a poll sweep 15-25 s, so an app's `end` was late by up to a sweep. Both now run every app's call in the background and `wait`; the per-app state machine then reads the fetched status from a temp dir, unchanged. Against a 1 s fake `argocd` with 10 already-healthy apps the script went from 23 s to 3 s. Offline tests unchanged and passing. +1. **`argocd-wait-sync-multi` refreshes and polls apps in parallel**: the initial refresh ran `argocd app get --refresh` once per app, one after another (~2.6 s each), so with monorepo-typescript's 18 apps the first poll came ~47 s after the wait started and an app that became healthy in that window got a late `end`. The refreshes now run in the background and the script `wait`s for them; on 18-app production deploys the first poll comes after 7-11 s (one 19-app run took 29 s, bounded by its slowest app). Each poll's `argocd app get` calls are also parallel, but a sequential sweep only took 1-2 s, so that barely changes the ~6 s tick. The per-app state machine is unchanged. ## Recent Changes (2026-11-09) 1. **Recovery pull request after a failed Terraform apply**: `terraform-stack.yml` takes an optional `recovery-token` secret. When an apply fails, it pushes `terraform-recover/` with the failed run's URL in `/recover.tf` and opens a draft pull request, so the leftover gets a normal reviewed plan and applies on merge. `command: recover` plans and applies unreviewed, which is what this replaces (monta-app/terraform#440). The branch is cut from the default branch only when no recovery pull request is open; otherwise the file is updated on the open one, so a fix pushed there is never reset. Commits go through the contents API, so no git credentials are needed on the runner. The token cannot be `GITHUB_TOKEN`: pull requests it opens never trigger workflows. Any successful apply of the stack closes the open recovery pull request. A missing reviewed plan fails before the apply step and still needs `recover`.