Skip to content

test(bundler): pin argocd, flux, and argocd-helm READMEs with goldens - #4052

Merged
mchmarny merged 6 commits into
NVIDIA:mainfrom
shuseng8:issue-4039-golden-readmes
Nov 30, 2026
Merged

mchmarny merged 6 commits into
NVIDIA:mainfrom
shuseng8:issue-4039-golden-readmes

Conversation

@shuseng8

Copy link
Copy Markdown
Contributor

Summary

Pin the argocd, flux, and argocd-helm bundle READMEs with byte-for-byte goldens, so a change to their commands or wording shows up as a reviewable diff.

Motivation / Context

These three READMEs were covered only by substring checks, so a change like #4036 passed CI without anyone seeing the rendered result.

Fixes: #4039
Related: N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Build/CI/tooling

Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)
  • API server (cmd/aicrd, pkg/server)
  • Recipe engine / data (pkg/recipe)
  • Bundler and deployers (pkg/bundler, pkg/component)
  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)
  • Validator (pkg/validator)
  • Core libraries (pkg/errors, pkg/k8s)
  • Docs/examples (docs/, examples/)
  • Other: ____________

Implementation Notes

README.md is added to the existing TestBundleGolden_* fixtures, using each package's assertGolden and -update flag:

  • argocd: helm_and_manifest_only (Helm and local-chart rows) and mixed_with_pre (pre, primary, and post folders in sync-wave order)
  • flux: helm_components (the Depends On column)
  • argocd-helm: helm_and_manifest_only and mixed_component (install commands, dynamic --set flags, and the Dynamic Values section)

The comment in argocd's TestGenerate_Success said the README couldn't be golden-tested because of TempDir paths. The rendered README has no such paths, so I updated that comment and the TestGenerate_UpgradeNotice comments. No generator code changed, and no existing golden changed.

Regenerate with:

go test ./pkg/bundler/deployer/{argocd,flux,argocdhelm}/... -run TestBundleGolden -args -update

Testing

go test -race -count=1 ./pkg/bundler/deployer/argocd/... ./pkg/bundler/deployer/flux/... ./pkg/bundler/deployer/argocdhelm/...   # ok
go test -count=1 ./pkg/bundler/...                                   # all ok
go vet ./pkg/bundler/... && go build ./...                           # ok
golangci-lint v2.15.0 -c .golangci.yaml on the three packages        # 0 issues

The goldens are stable when the tests are re-run without -update. As a check, I edited each README source (both templates and the inline argocdhelm builder). All five new golden assertions failed, then passed again after I reverted the edits.

Risk Assessment

  • Low: test-only change, easy to revert

Rollout notes: N/A

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are signed off and cryptographically signed (git commit -s -S)

@shuseng8
shuseng8 requested a review from a team as a code owner November 25, 2026 12:36
@copy-pr-bot

copy-pr-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown
Contributor

Welcome to AICR, @shuseng8! Thanks for your first pull request.

Before review, please ensure:

  • All commits are signed off per the DCO
  • CI checks pass (tests, lint, security scan)
  • The PR description explains the why behind your changes

A maintainer will review this soon.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

README documentation was added for selected Argo CD, Argo CD Helm, and Flux bundle fixtures. Golden tests now compare the generated README files. Test comments were updated to describe README golden coverage.

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

Change: Other

Suggested reviewers: lockwobr, yuanchen8911

Merge Risk: Minimal · previous review 3bd10

This change adds test coverage that pins generated README output for the Argo CD, Argo CD Helm, and Flux bundles. It does not change runtime behavior, and no merge-blocking risk is identified.

Security architecture risk: Minimal · up to 3bd10

The change makes generated README differences visible in tests without changing what bundles generate, how they deploy, or who can use them.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: adding README golden tests for the argocd, flux, and argocd-helm bundlers. It uses the conventional test(bundler) prefix and matches the changeset and objectives.
Description check Passed The description states the purpose (byte-for-byte goldens for three bundle READMEs), the fixtures touched, the comment updates, the regeneration command, and the test results. It matches the changeset…
Linked Issues check Passed Issue #4039 requires byte-for-byte golden READMEs for the argocd, flux, and argocd-helm bundles, regenerated with the existing -update pattern. At head, the diff adds "README.md" to five existing gold…
Out of Scope Changes check Passed All changes support the README golden objective of #4039. They consist of the added golden README files under each deployer's testdata directory, the added README.md entries in the argocd, flux, and a…
Full details: Description check

Explanation

The description states the purpose (byte-for-byte goldens for three bundle READMEs), the fixtures touched, the comment updates, the regeneration command, and the test results. It matches the changeset.

Full details: Linked Issues check

Explanation

Issue #4039 requires byte-for-byte golden READMEs for the argocd, flux, and argocd-helm bundles, regenerated with the existing -update pattern. At head, the diff adds "README.md" to five existing golden assertions: argocd TestBundleGolden_HelmAndManifestOnly and TestBundleGolden_MixedWithPre, flux TestBundleGolden_HelmComponents, and argocdhelm TestBundleGolden_HelmAndManifestOnly and TestBundleGolden_MixedComponent. Each README is compared against a committed file under testdata/. The whole-PR summary lists those golden README files. The diffs for argocd_test.go and flux_test.go confirm the assertion changes. The changes since the previous review are comment and wording updates in test files, and they do not affect this conclusion. The author reports that editing each README source fails the assertions and that reruns without -update are stable. The requirement is test-only and coding-related, and the evidence supports compliance. Remaining gap: none against the issue text.

Full details: Out of Scope Changes check

Explanation

All changes support the README golden objective of #4039. They consist of the added golden README files under each deployer's testdata directory, the added README.md entries in the argocd, flux, and argocdhelm golden tests, and comment updates in TestGenerate_Success, TestGenerate_UpgradeNotice, and the flux upgrade-notice test. The author reports that no generator code and no existing golden file changed. The diffs inspected at head for argocd_test.go and flux_test.go show only these kinds of changes, and no unrelated change appears in the whole-PR summary.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: NVIDIA/aicr
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: ef97a2b
  • Layers: Repository YAML
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: bcceb1a8-ae17-45b7-a19f-0dbb4eaa1e40
Commits

Reviewing files that changed from the base of the PR and between 295f33b and 3bd10c8.

Files selected for processing: 1

  • pkg/bundler/deployer/argocdhelm/argocdhelm_test.go

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

@lockwobr lockwobr 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.

Thanks for contributing to AICR!

No blocking issues; 2 non-blocking comments. Address them and this is ready to approve.

}

for _, rel := range []string{
"README.md", // -post dynamic paths resolve through the parent's override key

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.

issue (non-blocking): The README.md comment says the golden pins -post override-key routing, but the README never goes through the -post folder.

writeReadme builds the --set flags and the Dynamic Values list from g.DynamicValues, which this fixture keys by "gpu-operator" (the parent). It never calls the suffix-stripping path through findComponentByName. If -post routing regresses, only templates/gpu-operator-post.yaml fails, yet a reader of this line expects the README golden to catch it too.

Reword the comment to say what the README golden actually pins.

Suggested change
"README.md", // -post dynamic paths resolve through the parent's override key
"README.md", // inline README: --set flag and Dynamic Values for a nested path

Comment on lines +323 to +325
// TestGenerate_UpgradeNotice covers a non-empty notice. The README goldens
// pin only the empty-notice render, so the empty case also asserts the
// Components table still runs straight into Prerequisites.

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.

nit (non-blocking): The "so the empty case also asserts" reason no longer follows, because the new goldens pin the empty-notice render.

Before this PR, the empty case stood in for a missing golden. Now the golden pins that render, so the clause gives a reader the wrong reason for the assertion. The same sentence is at pkg/bundler/deployer/flux/flux_test.go:1496-1498.

In both files, drop the "so" clause, for example: "TestGenerate_UpgradeNotice covers both the empty and non-empty notice renders; the README golden(s) pin only the empty one."

@github-actions

Copy link
Copy Markdown
Contributor

Recipe evidence check

No leaf overlays affected by this PR.

This gate is warning-only and never blocks merge.

@shuseng8

Copy link
Copy Markdown
Contributor Author

Thanks @lockwobr — updated the argocdhelm README golden comment and dropped the stale "so" clause in the argocd and flux UpgradeNotice comments.

@shuseng8
shuseng8 force-pushed the issue-4039-golden-readmes branch 2 times, most recently from 35b8510 to 3d995b3 Compare November 30, 2026 09:49
@shuseng8

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main (dependency updates only) so the branch is no longer behind.

@mchmarny mchmarny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Welcome to the project, and thank you for your contribution!

Request changes: 1 MAJOR against 3d995b3. CI has not run at the reviewed SHA because this fork PR's workflows are awaiting maintainer approval.

MAJOR: The base branch main requires signed commits, and GitHub reports 2 commits in this PR as unverified: 5e7aaf7 (unknown_key), 3d995b3 (unknown_key).

Minimum correction: re-sign every listed commit and force-push:

git fetch origin main
git rebase --exec 'git commit --amend -s -S --no-edit' origin/main
git push --force-with-lease --force-if-includes origin <branch>

See CONTRIBUTING.md — Developer Certificate of Origin for key setup, the fresh-clone fallback, and safe force-push details. Please note the old and new SHAs here after rewriting.

The argocd, flux, and argocd-helm bundle READMEs were covered only by
substring checks, so a change to their commands or wording passed CI
unseen. Add README.md to the existing TestBundleGolden_* fixtures so
template changes surface as a reviewable golden diff:

- argocd: helm_and_manifest_only (Helm and local-chart rows) and
  mixed_with_pre (pre, primary, and post folders by sync wave)
- flux: helm_components (dependsOn column)
- argocd-helm: helm_and_manifest_only and mixed_component (install
  commands, dynamic --set flags, and the Dynamic Values section)

Regenerate with:

  go test ./pkg/bundler/deployer/{argocd,flux,argocdhelm}/... -run TestBundleGolden -args -update

Fixes: NVIDIA#4039
Signed-off-by: Shubham <[email protected]>
Reword the argocdhelm mixed_component README golden comment so it
describes the --set flags and Dynamic Values the README actually pins,
not -post override-key routing.

Drop the stale "so the empty case also asserts" clause from the
TestGenerate_UpgradeNotice comments in argocd and flux.

Signed-off-by: Shubham <[email protected]>
@shuseng8
shuseng8 force-pushed the issue-4039-golden-readmes branch from 3d995b3 to 477364c Compare November 30, 2026 13:52
@shuseng8

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main (dependency updates only) so the branch is no longer behind.

@mchmarny
mchmarny enabled auto-merge (squash) November 30, 2026 14:34
@mchmarny
mchmarny merged commit 5b2cc9c into NVIDIA:main Nov 30, 2026
92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add golden READMEs for the argocd, flux, and argocd-helm bundles

3 participants