Skip to content

[Feature Request] Compare diff against live environments #321

@jgautheron

Description

@jgautheron

Problem Statement

When ArgoCD manages critical system Helm charts (Istio, AWS Load Balancer Controller, etc.), enabling auto-sync means a merge deploys to production immediately. If that upgrade contains a bug, production is impacted right away.

At the scale of dozens of system services, issues are inevitable. Helm charts introduce bugs all the time—that's why there are constant patch releases. Auto-syncing production on every merge is simply not safe for infrastructure-critical components.

Some upgrades also require manual intervention. Keeping production sync manual ensures an infra engineer is actively watching the rollout and can intervene while the upgrade is ongoing.

To mitigate this risk, I follow a staged rollout process:

  1. Merge deploys to non-production environments first
  2. Evaluate stability of the upgrade in staging
  3. Manually sync to production only after validation

The problem: The current argocd-diff-preview tool compares the PR branch against the base branch (e.g., main). This shows what would change if merged, but doesn't show what's actually deployed in a given environment. Since I don't auto-sync production, there can be different diff between main and what's live in production—making the base-vs-target diff misleading for production impact assessment.

Proposed Solution

Add a live comparison mode that compares the PR's rendered manifests against the actual live state fetched from a remote ArgoCD instance via its API.

New CLI flags:

  • --compare-live - Enable live comparison mode (compare PR against remote ArgoCD instead of base branch)
  • --live-argocd-url - URL of the remote ArgoCD instance (e.g., https://argocd-staging.example.com)
  • --live-argocd-token - API token for authentication
  • --live-argocd-insecure - Skip TLS verification (for self-signed certs)

Workflow:

  1. Tool renders the PR branch manifests locally (as it does today)
  2. Tool queries the remote ArgoCD API to fetch currently deployed manifests
  3. Tool generates a diff between PR manifests and live state

Benefits:

  • See exactly what will change relative to what's currently running in production
  • Validate upgrades against actual deployed state, not just the Git base branch
  • Support staged rollout workflows where production lags behind main

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions