Skip to content

fix: replace authoritative preview values so resets remove old overrides - #8

Merged
patrickleet merged 1 commit into
mainfrom
preview-values-replace
Nov 13, 2026
Merged

patrickleet merged 1 commit into
mainfrom
preview-values-replace

Conversation

@patrickleet

@patrickleet patrickleet commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

A preview reset can clear its saved values while leaving an old setting deployed. argocd-promote-helm always deep-merges previous Application runtime values back into the fresh chart render, so a removed key is resurrected. This was reproduced with a live Auth preview: reset resolved both app refs to latest, but env.PREVIEW_VALUES_SMOKE remained in the committed GitOps manifest and running process.

Add merge_existing_values: false for callers whose rendered values are authoritative. Replacement removes omitted keys and writes an empty map when resetting to chart defaults. The default remains true, preserving existing release/preview callers' merge behavior. Generic chart-values previews will opt out of merging; no existing caller changes implicitly.

Four subprocess regressions run the actual workflow step: default preservation/override, authoritative omission removal, empty replacement and default empty-map no-op. They pass locally, with a new PR CI job. Live candidate verification passed: Auth #57 promoted with replacement mode and a cleared reset overlay; Ready revision harmony-auth-00007 ran image pr-57-ba26e43c4ade957b13c967e6798b8abf095f16dd with process.env.PREVIEW_VALUES_SMOKE absent, replacing revision 6 where it was live-command-1. The four regression cases and upstream preview/release dry-run checks pass. This is a dependency of gitkb/workflows #24 and Auth #57/Site #96.

@patrickleet
patrickleet temporarily deployed to on-pr-release-promotion November 12, 2026 23:45 — with GitHub Actions Inactive
@patrickleet
patrickleet temporarily deployed to on-pr-preview-promotion-pr November 12, 2026 23:45 — with GitHub Actions Inactive
@patrickleet
patrickleet temporarily deployed to on-pr-preview-promotion November 12, 2026 23:45 — with GitHub Actions Inactive
@patrickleet
patrickleet temporarily deployed to on-pr-release-promotion-pr November 12, 2026 23:45 — with GitHub Actions Inactive
@patrickleet
patrickleet temporarily deployed to on-pr-preview-promotion November 12, 2026 23:45 — with GitHub Actions Inactive
@patrickleet
patrickleet temporarily deployed to on-pr-release-promotion-pr-merge November 12, 2026 23:45 — with GitHub Actions Inactive
@patrickleet
patrickleet temporarily deployed to on-pr-preview-promotion-pr-merge November 12, 2026 23:45 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The promotion workflow adds an optional input to select whether existing Helm values are merged with newly rendered values. A new pull-request job runs regression tests for merge, replacement, and empty-value cases.

Changes: Helm Values Merge Control

Layer / File(s) Summary
Configure and validate Helm values merging
.github/workflows/argocd-promote-helm.yaml, .github/workflows/on-pr.yaml, tests/test_values_merge.py
The promotion workflow adds merge_existing_values, which defaults to true. When enabled, new values take precedence in the merge. When disabled, the workflow uses only new values and marks them for replacement, including when the result is {}. Empty or null results become {}. The pull-request workflow runs regression tests for four persisted-values scenarios.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to e3cb2

The change adds an optional switch so callers can replace Helm values instead of merging them. The default behavior is unchanged. No concrete merge-blocking risk was identified. Live consumer verification is still pending, as the PR notes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the workflow now replaces authoritative preview values, so resets remove old overrides. The PR objectives add a merge_existing_values input that defaults to true and i…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: the workflow now replaces authoritative preview values, so resets remove old overrides. The PR objectives add a merge_existing_values input that defaults to true and is set to false for authoritative callers. The title uses a conventional fix: prefix and is specific enough for a teammate scanning history to understand the primary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c809dff5-c1bf-4cb7-a85e-66f94756a847
Commits

Reviewing files that changed from the base of the PR and between 374cdc4 and e3cb2d0.

Files selected for processing: 3

  • .github/workflows/argocd-promote-helm.yaml
  • .github/workflows/on-pr.yaml
  • tests/test_values_merge.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Your preview environment has been published! 🚀

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Dry Run: Release (Promotion)

Workflow validation completed successfully.

Settings

Setting Value
Environment Repository hops-ops/test-gitops
Project test-project
Application Name test-project-workflows-gitops
Output File environment/.gitops/deploy/helm/templates/workflows-gitops.yaml
Type Release
Method Promotion

Completed

  • Helm template generated for test-project-workflows-gitops
  • Changes detected: Yes

Skipped (dry run)

  • Commit to environment repository
  • Push to hops-ops/test-gitops
Environment Diff
diff --git a/.gitops/deploy/helm/templates/workflows-gitops.yaml b/.gitops/deploy/helm/templates/workflows-gitops.yaml
index 817af13..802b3a3 100644
--- a/.gitops/deploy/helm/templates/workflows-gitops.yaml
+++ b/.gitops/deploy/helm/templates/workflows-gitops.yaml
@@ -12,7 +12,7 @@ spec:
   source:
     path: .gitops/deploy/helm
     repoURL: https://github.com/hops-ops/workflows-gitops.git
-    targetRevision: v2.1.0
+    targetRevision: refs/pull/8/merge
     helm:
       version: v3
       values: |
@@ -20,7 +20,7 @@ spec:
           test: true
           type: release
           method: promotion
-          event: v-tag
+          event: pr
   destination:
     namespace: test-project
     server: https://kubernetes.default.svc
Generated Output File
---
# Source: promotion/templates/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: test-project-workflows-gitops
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: test-project
  source:
    path: .gitops/deploy/helm
    repoURL: https://github.com/hops-ops/workflows-gitops.git
    targetRevision: refs/pull/8/merge
    helm:
      version: v3
      values: |
        env:
          test: true
          type: release
          method: promotion
          event: pr
  destination:
    namespace: test-project
    server: https://kubernetes.default.svc
  syncPolicy:
    automated:
      selfHeal: true
      prune: true

This was a dry run. No changes were made to the environment repository.

hops-gitops Bot pushed a commit to hops-ops/test-gitops that referenced this pull request Nov 12, 2026
@patrickleet
patrickleet merged commit b38c197 into main Nov 13, 2026
14 checks passed

This branch was previously deployed

10 inactive deployments
on-pr-preview-promotion-pr — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Preview Promotion PR / argocd-promote-helm #11
on-pr-preview-promotion — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Preview Promotion / argocd-promote-helm #11
on-pr-release-promotion — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Release Promotion / argocd-promote-helm #11
on-pr-release-promotion-pr — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Release Promotion PR / argocd-promote-helm #11
on-pr-release-promotion-pr-merge — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Release Promotion PR + Merge / argocd-promote-helm #11
on-pr-preview-promotion-pr-merge — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Preview Promotion PR + Merge / argocd-promote-helm #11
on-push-preview-promotion-pr — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Preview Promotion PR / argocd-promote-helm #11
on-push-release-promotion — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Release Promotion / argocd-promote-helm #11
on-push-release-promotion-pr — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Release Promotion PR / argocd-promote-helm #11
on-push-preview-promotion — e3cb2d0e Deployed Nov 12, 2026 by patrickleet via Dry Run - Preview Promotion / argocd-promote-helm #11
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