Skip to content

feat: drop HELM_IS_INSTALL env-var dependency#52

Closed
arthlr wants to merge 3 commits into
mainfrom
feat/drop-helm-is-install
Closed

feat: drop HELM_IS_INSTALL env-var dependency#52
arthlr wants to merge 3 commits into
mainfrom
feat/drop-helm-is-install

Conversation

@arthlr

@arthlr arthlr commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes the HELM_IS_INSTALL env-var read in src/chartreuse/chartreuse_upgrade.py:88,105.
  • Simplifies if UPGRADE_BEFORE_DEPLOYMENT and not HELM_IS_INSTALL: returnif UPGRADE_BEFORE_DEPLOYMENT: return — always behave as upgrade.
  • Drops the env var from 8 test fixtures + docs.

Why

The env var was a Helm-specific install-vs-upgrade signal that doesn't exist under ArgoCD (helm template always reports IsInstall=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 without start_pods() when UPGRADE_BEFORE_DEPLOYMENT=true is 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.
  • Reviewer to confirm no internal consumer relies on the env var.

Coordinated with

🤖 Generated with Claude Code

arthlr added 3 commits May 21, 2026 11:06
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.
@arthlr

arthlr commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

Closing — not needed for the ArgoCD migration after all.

The chartreuse Helm chart change in wiremind-helm-charts#859 emits HELM_IS_INSTALL: \"\" (empty string) into the ConfigMap when its new ArgoCD mode is enabled. The unmodified Python tool reads that with os.environ.get(\"HELM_IS_INSTALL\", \"false\").lower() not in (\"\", \"false\", \"0\") which treats empty as `False`, so the existing branch `if UPGRADE_BEFORE_DEPLOYMENT and not HELM_IS_INSTALL: return` already fires correctly under ArgoCD. The Python tool change here was strictly cosmetic — removing dead-looking code.

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.

@arthlr arthlr closed this May 21, 2026
@arthlr arthlr deleted the feat/drop-helm-is-install branch May 21, 2026 11:07
@arthlr arthlr restored the feat/drop-helm-is-install branch May 26, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant