[PR #677] [MERGED] fix: use sync waves to run migrations before app rollout #677

Closed
opened 2026-06-05 19:17:23 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/helm/pull/677
Author: @langchain-infra
Created: 4/15/2026
Status: Merged
Merged: 4/17/2026
Merged by: @langchain-infra

Base: v14-stableHead: mukil/sync-waves-migration-ordering


📝 Commits (1)

  • d5daa50 fix: use sync waves to run migrations before app rollout

📊 Changes

18 files changed (+26 additions, -4 deletions)

View changed files

📝 charts/langsmith/templates/backend/clickhouse-migrations.yaml (+5 -2)
📝 charts/langsmith/templates/backend/postgres-migrations.yaml (+5 -2)
📝 charts/langsmith/templates/clickhouse/config-map.yaml (+1 -0)
📝 charts/langsmith/templates/clickhouse/pdb.yaml (+1 -0)
📝 charts/langsmith/templates/clickhouse/secrets.yaml (+1 -0)
📝 charts/langsmith/templates/clickhouse/service-account.yaml (+1 -0)
📝 charts/langsmith/templates/clickhouse/service.yaml (+1 -0)
📝 charts/langsmith/templates/clickhouse/stateful-set.yaml (+1 -0)
📝 charts/langsmith/templates/postgres/pdb.yaml (+1 -0)
📝 charts/langsmith/templates/postgres/secrets.yaml (+1 -0)
📝 charts/langsmith/templates/postgres/service-account.yaml (+1 -0)
📝 charts/langsmith/templates/postgres/service.yaml (+1 -0)
📝 charts/langsmith/templates/postgres/stateful-set.yaml (+1 -0)
📝 charts/langsmith/templates/redis/pdb.yaml (+1 -0)
📝 charts/langsmith/templates/redis/secrets.yaml (+1 -0)
📝 charts/langsmith/templates/redis/service-account.yaml (+1 -0)
📝 charts/langsmith/templates/redis/service.yaml (+1 -0)
📝 charts/langsmith/templates/redis/stateful-set.yaml (+1 -0)

📄 Description

Summary

  • Switches DB migrations from PostSync hooks to sync-wave ordering so migrations complete before application code rolls out
  • Adds sync-wave: "-2" to all database resources (postgres, clickhouse, redis — StatefulSets, Services, Secrets, ServiceAccounts, PDBs, ConfigMaps) so they're healthy first
  • Changes migration Jobs to Sync hooks at sync-wave: "-1" (Argo CD) and post-install, pre-upgrade (Helm) so they run after DBs are up but before Deployments
  • Auth bootstrap remains as PostSync since it depends on the running application

Argo CD sync order

Phase Wave Resources
Sync -2 DB Secrets, ServiceAccounts, Services, StatefulSets
Sync -1 PG + CH migration Jobs
Sync 0 Application Deployments/Rollouts
PostSync Auth bootstrap, agent bootstrap

Helm behavior

  • First install: post-install — DBs are already deployed, migrations run after
  • Upgrades: pre-upgrade — migrations run before new app code rolls out

Test plan

  • Verify helm template renders without errors
  • Test fresh Argo CD install — DBs should come up at wave -2, migrations at -1, then app at 0
  • Test Argo CD upgrade — migrations should complete before deployments update
  • Test Helm upgrade — migrations should run as pre-upgrade hooks before new code
  • Verify auth-bootstrap still runs after app is up

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/helm/pull/677 **Author:** [@langchain-infra](https://github.com/langchain-infra) **Created:** 4/15/2026 **Status:** ✅ Merged **Merged:** 4/17/2026 **Merged by:** [@langchain-infra](https://github.com/langchain-infra) **Base:** `v14-stable` ← **Head:** `mukil/sync-waves-migration-ordering` --- ### 📝 Commits (1) - [`d5daa50`](https://github.com/langchain-ai/helm/commit/d5daa507102b73b55a5589070d6a8cb7f2662637) fix: use sync waves to run migrations before app rollout ### 📊 Changes **18 files changed** (+26 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `charts/langsmith/templates/backend/clickhouse-migrations.yaml` (+5 -2) 📝 `charts/langsmith/templates/backend/postgres-migrations.yaml` (+5 -2) 📝 `charts/langsmith/templates/clickhouse/config-map.yaml` (+1 -0) 📝 `charts/langsmith/templates/clickhouse/pdb.yaml` (+1 -0) 📝 `charts/langsmith/templates/clickhouse/secrets.yaml` (+1 -0) 📝 `charts/langsmith/templates/clickhouse/service-account.yaml` (+1 -0) 📝 `charts/langsmith/templates/clickhouse/service.yaml` (+1 -0) 📝 `charts/langsmith/templates/clickhouse/stateful-set.yaml` (+1 -0) 📝 `charts/langsmith/templates/postgres/pdb.yaml` (+1 -0) 📝 `charts/langsmith/templates/postgres/secrets.yaml` (+1 -0) 📝 `charts/langsmith/templates/postgres/service-account.yaml` (+1 -0) 📝 `charts/langsmith/templates/postgres/service.yaml` (+1 -0) 📝 `charts/langsmith/templates/postgres/stateful-set.yaml` (+1 -0) 📝 `charts/langsmith/templates/redis/pdb.yaml` (+1 -0) 📝 `charts/langsmith/templates/redis/secrets.yaml` (+1 -0) 📝 `charts/langsmith/templates/redis/service-account.yaml` (+1 -0) 📝 `charts/langsmith/templates/redis/service.yaml` (+1 -0) 📝 `charts/langsmith/templates/redis/stateful-set.yaml` (+1 -0) </details> ### 📄 Description ## Summary - Switches DB migrations from PostSync hooks to sync-wave ordering so migrations complete **before** application code rolls out - Adds `sync-wave: "-2"` to all database resources (postgres, clickhouse, redis — StatefulSets, Services, Secrets, ServiceAccounts, PDBs, ConfigMaps) so they're healthy first - Changes migration Jobs to `Sync` hooks at `sync-wave: "-1"` (Argo CD) and `post-install, pre-upgrade` (Helm) so they run after DBs are up but before Deployments - Auth bootstrap remains as PostSync since it depends on the running application ### Argo CD sync order | Phase | Wave | Resources | |-------|------|-----------| | Sync | -2 | DB Secrets, ServiceAccounts, Services, StatefulSets | | Sync | -1 | PG + CH migration Jobs | | Sync | 0 | Application Deployments/Rollouts | | PostSync | — | Auth bootstrap, agent bootstrap | ### Helm behavior - **First install:** `post-install` — DBs are already deployed, migrations run after - **Upgrades:** `pre-upgrade` — migrations run before new app code rolls out ## Test plan - [ ] Verify `helm template` renders without errors - [ ] Test fresh Argo CD install — DBs should come up at wave -2, migrations at -1, then app at 0 - [ ] Test Argo CD upgrade — migrations should complete before deployments update - [ ] Test Helm upgrade — migrations should run as pre-upgrade hooks before new code - [ ] Verify auth-bootstrap still runs after app is up 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 19:17:23 -04:00
yindo closed this issue 2026-06-05 19:17:23 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/helm#677