Skip to content

fix: remove duplicate chart value and strictly validate source YAML - #534

Merged
hossain-rayhan merged 1 commit into
documentdb:mainfrom
hossain-rayhan:rhossain/reject-duplicate-chart-values
Dec 3, 2026
Merged

hossain-rayhan merged 1 commit into
documentdb:mainfrom
hossain-rayhan:rhossain/reject-duplicate-chart-values

Conversation

@hossain-rayhan

Copy link
Copy Markdown
Collaborator

Fix

Remove the duplicated sidecarInjector.namespace key from the experimental product chart values.

Why validation missed it

Helm rendering and permissive YAML decoding collapsed the duplicate key (both values were identical). Existing chart assertions validated rendered resources, not uniqueness in the source values file.

Regression test

Add TestChartValuesAreStrictYAML to the existing Go unit suite. It strictly decodes both charts source values.yaml files using the existing YAML dependency, without requiring Helm. Existing CI already runs this test on changes to either chart or Go sources.

Verified red before the fix: the test fails at values.yaml line 15 with key namespace already set in map. After removing the duplicate, the product race suite, vet, and all 132 Helm tests pass. No dependencies, rendered values or existing DocumentDB defaults change.

Remove the repeated sidecarInjector.namespace key. Strictly decode both charts source values in the existing Go unit suite so duplicates fail before Helm rendering, even without Helm installed. Reproduced the exact duplicate-key failure before the fix; product race/vet and all 132 Helm tests pass afterward.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 33b3cb3c-1b25-4ffb-bff1-ebf0f3d04058
Signed-off-by: Rayhan Hossain <hossain.rayhan@outlook.com>
Copilot AI balanced review requested due to automatic review settings December 3, 2026 16:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were reported for the duplicate YAML key cleanup and added regression coverage.

No open issues 🎉

What changed in this PR

Removes a duplicate Helm chart value and adds regression coverage to catch duplicate YAML keys before rendering.

Changes:

  • Removes the repeated sidecarInjector.namespace key without changing its value.
  • Adds strict YAML validation for both charts’ source values files, without requiring Helm.
File Description
operator/​src/​internal/​product/​chart_values_test.go Adds strict YAML validation for both charts.
operator/​product-helm-chart/​values.yaml Removes the duplicate namespace key.

Review effort: Balanced

@hossain-rayhan
hossain-rayhan merged commit 7a360bf into documentdb:main Dec 3, 2026
95 of 96 checks passed
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.

4 participants