feat: drop HELM_IS_INSTALL env-var dependency#52
Conversation
The HELM_IS_INSTALL env var only branched the final start_pods() call in chartreuse_upgrade.main(). Under ArgoCD the var is always empty (every sync is an apply, with no install/upgrade distinction), and under pure Helm with upgradeBeforeDeployment=true the safe behaviour is already to skip start_pods() and let the orchestrator restart pods after the hook. Always honour that. This removes the dependency cleanly: the tool now behaves identically whether invoked by Helm or ArgoCD.
Remove the HELM_IS_INSTALL key from the shared conftest fixture and from every per-test env-setup dict in test_chartreuse_upgrade_extended.py. The test that previously covered the 'UPGRADE_BEFORE_DEPLOYMENT and not HELM_IS_INSTALL' branch is retained but its docstring updated: the assertion (start_pods is not called when UPGRADE_BEFORE_DEPLOYMENT=true) remains valid under the simplified always-upgrade behaviour.
The env var is no longer consumed by the tool. See the preceding feat commit for context.
|
Closing — not needed for the ArgoCD migration after all. The chartreuse Helm chart change in wiremind-helm-charts#859 emits Worse, dropping the conditional as this PR did introduces a regression for a documented Helm-flow configuration: with `upgradeBeforeDeployment: true` on a pure `helm install` (no prior release), `stop_pods()` scales the freshly-applied Deployments to 0, and then skipping `start_pods()` leaves them stuck at zero replicas because Helm `install` doesn't re-apply the manifests after the install completes. Wiremind has no consumers in that configuration but this repo is public and we can't see who does. If we ever want to clean up the dead code, the safer refactor is to drop the entire `UPGRADE_BEFORE_DEPLOYMENT`-conditional skip and always call `start_pods()` — the orchestrator's later re-apply (under `helm upgrade` or ArgoCD wave-0 deployments) becomes a no-op rather than an "expected restore". Not in scope for the current ArgoCD migration; deferred. |
Summary
HELM_IS_INSTALLenv-var read insrc/chartreuse/chartreuse_upgrade.py:88,105.if UPGRADE_BEFORE_DEPLOYMENT and not HELM_IS_INSTALL: return→if UPGRADE_BEFORE_DEPLOYMENT: return— always behave as upgrade.Why
The env var was a Helm-specific install-vs-upgrade signal that doesn't exist under ArgoCD (
helm templatealways reportsIsInstall=true). The branch it gated — "in upgrade-before-deployment mode + first install + we ran migrations + ENABLE_STOP_PODS, then start pods manually" — has an unreachable subcase under ArgoCD, and the orchestrator (ArgoCD or Helm) handles pod rollout via Deployment manifests in all other paths. So always returning withoutstart_pods()whenUPGRADE_BEFORE_DEPLOYMENT=trueis the correct behavior under both Helm and ArgoCD flows.Test plan
uv run pytest→ 88 passed (same as baseline).uv run ruff check+ruff format --check→ clean.grep -r HELM_IS_INSTALL src/ docs/→ only the deliberate explanatory comment remains.Coordinated with
HELM_IS_INSTALL: \"\"always under ArgoCD mode, so this drop can land independently of that PR's merge order.🤖 Generated with Claude Code