Skip to content

feat(deployer): deploy independent components in parallel - #1746

Merged
lockwobr merged 3 commits into
mainfrom
feat/argocd-parallel-waves
Jul 15, 2026
Merged

lockwobr merged 3 commits into
mainfrom
feat/argocd-parallel-waves

Conversation

@lockwobr

@lockwobr lockwobr commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Deploy mutually independent components concurrently instead of strictly one at a time, across all four concurrent deployers, and add a --serial escape hatch. Ordering follows each component's declared dependencyRefs.

Motivation / Context

The argocd deployer assigned each component a sync-wave equal to its linear position, so components with no dependency between them still rolled out serially. Flux chained every component to the previous one, and helmfile chained every release to its predecessor via positional needs: — so independent components were serialized on all three. This makes them parallelize independent components while preserving genuine dependency gating.

Fixes: N/A (enhancement)
Related: #1466 / #1728 (topological-sort unification this builds on)

Type of Change

  • New feature (non-breaking change that adds functionality)

Component(s) Affected

  • CLI (cmd/aicr, pkg/cli) — new --serial flag
  • Bundlers (pkg/bundler, pkg/bundler/deployer/*)
  • Docs/examples (docs/)

Implementation Notes

  • argocd / argocd-helm: wave = tier*4 + phase (phase orders -pre → primary → -post → -readiness). The stride-4 band keeps consecutive tiers disjoint so a tier's readiness gate still blocks the next. argocd-helm inherits this from the delegated argocd generator.
  • flux: dependsOn projects each component's declared dependencyRefs directly onto Flux's native DAG (a true DAG, not tiers), the most faithful and most parallel rendering.
  • helmfile: needs: now chains only within a component (-pre → primary → -post); independent components in a sub-helmfile carry no edge and apply concurrently. Cross-tier ordering stays the sequential sub-helmfile layout (issue [Bug]: helmfile bundle fails on fresh cluster — CRD/CR render order between nodewright-operator and nodewright-customizations #914). Previously every release was positionally chained to its predecessor, which serialized independent components.
  • helm: unchanged (already serial deploy.sh).
  • --serial (config.Serial): reverts argocd / argocd-helm to a linear per-folder sync-wave, flux to the previous-component dependsOn chain, and helmfile to one linear needs: chain — reproducing the pre-parallelism ordering for rollback or bisecting a rollout. A no-op for helm.
  • Real recipes already declare their dependencies (base.yaml: gpu-operator depends on nfd, cert-manager, kube-prometheus-stack; etc.), so genuine ordering is preserved. Only independent components now roll out concurrently.

Testing

go test -race ./pkg/cli/... ./pkg/bundler/...     # ok (attestation pkg needs network/TUF, run outside sandbox)
golangci-lint run -c .golangci.yaml ./pkg/...     # 0 issues
chainsaw test --no-cluster --test-dir tests/chainsaw/cli/bundle-flux/       # PASS (6 roots parallel / 1 root serial)
chainsaw test --no-cluster --test-dir tests/chainsaw/cli/bundle-helmfile/   # PASS (intra-component needs / linear chain under --serial)

New Go tests cover the argocd wave arithmetic (TestWaveForFolder, TestGenerate_LevelBasedSyncWaves, TestGenerate_SerialSyncWaves), the flux DAG (TestDeclaredDependsOn, TestSerialDependsOn), the helmfile intra-component chaining (TestGenerate_IndependentComponentsCollapse, TestGenerate_SerialChainsIndependentComponents), and TestConfigSerial. argocd / argocd-helm goldens regenerated (sync-wave values only); flux and helmfile goldens unchanged. The flux and helmfile CLI e2e chainsaw tests now assert the parallel DAG by default and the linear chain under --serial.

Risk Assessment

  • Medium — Changes the default deploy ordering for argocd / argocd-helm / flux / helmfile bundles (now parallel within a tier). Mitigated: declared dependencies preserve all gating; byte-compare goldens pin the output; --serial restores the exact prior behavior.

Rollout notes: The default flips to parallel for the four concurrent deployers. Operators who hit trouble can pass --serial to get the old one-at-a-time ordering back. Helm output is unchanged.

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 cryptographically signed (git commit -S)

@lockwobr
lockwobr requested a review from a team as a code owner July 14, 2026 18:10
@lockwobr lockwobr added the theme/deployer Helm, ArgoCD, and deployment bundle generation label Jul 14, 2026
@lockwobr lockwobr self-assigned this Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@lockwobr
lockwobr marked this pull request as draft July 14, 2026 18:13
@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.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

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
📝 Walkthrough

Walkthrough

Adds a --serial bundle option and configuration plumbing for strict component sequencing. Argo CD now assigns sync waves by dependency level and folder phase, or linearly in serial mode. Argo CD Helm forwards the setting to the Argo CD generator. Flux maps declared dependencyRefs to HelmRelease dependsOn edges or creates a serial chain. Helmfile controls cross-component needs edges by serial mode. Tests, generated fixtures, and deployment-order documentation are updated accordingly.

Estimated code review effort: 4 (Complex) | ~60 minutes

Suggested reviewers: yuanchen8911, mchmarny

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: parallel deployment of independent components with deployer support.
Description check ✅ Passed The description is clearly related to the changeset and matches the implemented parallelism and --serial behavior.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/argocd-parallel-waves

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/contributor/component.md`:
- Around line 324-332: Update the Argo CD sync-wave description near
`waveForFolder` to characterize waves as coarse ordered bands or a partial
order, not a total order. Explain that resources sharing a wave may sync
together, while differing waves impose ordering, and retain the existing tier
and readiness-gate details.

In `@docs/integrator/data-flow.md`:
- Around line 495-498: Update the deployment-order diagram and later flow
example in data-flow documentation to describe Argo waves derived from
dependencyRefs rather than deploymentOrder or orderComponentsByDeployment().
Replace fixed wave values such as 1, 5, 9 and 0, 1, 2 with dependency-aware
level notation, showing independent components sharing a wave and dependent
components assigned later waves.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 70a36e4e-ada7-4e99-adec-61ae47d289b6

📥 Commits

Reviewing files that changed from the base of the PR and between 3b3e3a3 and 68f1253.

📒 Files selected for processing (25)
  • docs/contributor/component.md
  • docs/integrator/data-flow.md
  • docs/integrator/talos-integration.md
  • docs/user/cli-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/deployer/argocd/argocd.go
  • pkg/bundler/deployer/argocd/argocd_test.go
  • pkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yaml
  • pkg/bundler/deployer/argocdhelm/argocdhelm.go
  • pkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yaml
  • pkg/bundler/deployer/flux/flux.go
  • pkg/bundler/deployer/flux/flux_test.go
  • pkg/cli/bundle.go

Comment thread docs/contributor/component.md Resolved
Comment thread docs/integrator/data-flow.md Resolved
@github-actions

github-actions Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report ✅

Metric Value
Coverage 79.6%
Threshold 75%
Status Pass
Coverage Badge
![Coverage](https://img.shields.io/badge/coverage-79.6%25-green)

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/NVIDIA/aicr/pkg/bundler 79.46% (+0.10%) 👍
github.com/NVIDIA/aicr/pkg/bundler/config 95.68% (+0.04%) 👍
github.com/NVIDIA/aicr/pkg/bundler/deployer/argocd 84.00% (+1.49%) 👍
github.com/NVIDIA/aicr/pkg/bundler/deployer/argocdhelm 82.59% (ø)
github.com/NVIDIA/aicr/pkg/bundler/deployer/flux 85.65% (+0.92%) 👍
github.com/NVIDIA/aicr/pkg/bundler/deployer/helmfile 87.17% (+0.29%) 👍
github.com/NVIDIA/aicr/pkg/cli 72.21% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/NVIDIA/aicr/pkg/bundler/bundler.go 79.72% (ø) 779 621 158
github.com/NVIDIA/aicr/pkg/bundler/config/config.go 94.74% (+0.07%) 228 (+3) 216 (+3) 12 👍
github.com/NVIDIA/aicr/pkg/bundler/deployer/argocd/argocd.go 84.00% (+1.49%) 200 (+17) 168 (+17) 32 👍
github.com/NVIDIA/aicr/pkg/bundler/deployer/argocdhelm/argocdhelm.go 82.59% (ø) 471 389 82
github.com/NVIDIA/aicr/pkg/bundler/deployer/flux/flux.go 86.72% (+1.52%) 256 (+33) 222 (+32) 34 (+1) 👍
github.com/NVIDIA/aicr/pkg/bundler/deployer/helmfile/helmfile.go 81.65% (ø) 158 129 29
github.com/NVIDIA/aicr/pkg/bundler/deployer/helmfile/releases.go 100.00% (ø) 68 (+5) 68 (+5) 0
github.com/NVIDIA/aicr/pkg/bundler/handler.go 72.56% (+0.86%) 164 (+5) 119 (+5) 45 👍
github.com/NVIDIA/aicr/pkg/cli/bundle.go 77.33% (ø) 419 324 95

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@lockwobr
lockwobr force-pushed the feat/argocd-parallel-waves branch from 68f1253 to 10a095e Compare July 14, 2026 18:39
@lockwobr
lockwobr force-pushed the feat/argocd-parallel-waves branch from 10a095e to 433ebe5 Compare July 14, 2026 19:20

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/bundler/config/config.go`:
- Around line 269-276: Update the --serial documentation to reflect Helmfile’s
actual cross-component needs: chaining behavior. In pkg/bundler/config/config.go
at lines 269-276, remove the claim that Helmfile is already serial/no-op and
describe its serial chain; at lines 509-512 and 815-818, include Helmfile among
the affected deployers. Update pkg/cli/bundle.go lines 731-739 to mention
Helmfile’s needs: chaining, and revise docs/contributor/component.md lines
353-362 from three to four concurrent deployers while keeping Helm distinct as
already serial.

In `@pkg/bundler/deployer/helmfile/crd_split_test.go`:
- Around line 282-330: The readHelmfileReleases helper currently accepts
top-level helmfiles documents because yaml.Unmarshal ignores unknown keys;
update it to decode and validate the top-level shape, failing the test when
helmfiles is present instead of returning an empty Releases slice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: af1c22d1-a774-41f5-a09e-055bfdfe810e

📥 Commits

Reviewing files that changed from the base of the PR and between 10a095e and 433ebe5.

📒 Files selected for processing (31)
  • docs/contributor/component.md
  • docs/integrator/data-flow.md
  • docs/integrator/talos-integration.md
  • docs/user/cli-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/deployer/argocd/argocd.go
  • pkg/bundler/deployer/argocd/argocd_test.go
  • pkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yaml
  • pkg/bundler/deployer/argocdhelm/argocdhelm.go
  • pkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yaml
  • pkg/bundler/deployer/flux/flux.go
  • pkg/bundler/deployer/flux/flux_test.go
  • pkg/bundler/deployer/helmfile/crd_split_test.go
  • pkg/bundler/deployer/helmfile/helmfile.go
  • pkg/bundler/deployer/helmfile/helmfile_test.go
  • pkg/bundler/deployer/helmfile/releases.go
  • pkg/cli/bundle.go
  • tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml
  • tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml

Comment thread pkg/bundler/config/config.go Resolved
@lockwobr

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lockwobr

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/integrator/talos-integration.md (1)

99-102: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Stale "sync-wave N-1 / N" comments contradict the formula described right below.

This unchanged code block still implies sync-wave equals folder index minus one (N-1/N), but the paragraph you just updated (Line 112-116) states waves are computed via level*4 + phase, unrelated to the literal folder number. These two claims conflict.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/integrator/talos-integration.md` around lines 99 - 102, Update the
comments in the NNN-<component>-pre and (NNN+1)-<component> example to remove
the literal “sync-wave N-1” and “sync-wave N” claims, and describe them
consistently with the level*4 + phase formula stated below. Preserve the
namespace/PSA and chart ordering.
docs/integrator/data-flow.md (1)

603-607: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Stale wave values contradict the tier-based model just documented above.

This unchanged "Deployer Data Flow" diagram still shows wave: 0, wave: 1, wave: 2 — the old linear per-folder numbering. It directly contradicts the tier-based 1, 5, 9 example fixed a few lines earlier (Line 495-504) in this same PR, and will confuse readers about how sync-waves are actually computed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/integrator/data-flow.md` around lines 603 - 607, Update the “Deployer
Data Flow” diagram’s application examples to use the documented tier-based
sync-wave values, replacing the stale linear wave: 0, 1, and 2 values while
preserving the folder and deployment-flow structure.
♻️ Duplicate comments (1)
pkg/bundler/deployer/helmfile/crd_split_test.go (1)

316-330: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

readHelmfileReleases still doesn't guard against a top-level helmfiles: doc — only the comment was updated.

The doc comment claims the helper "Fails the test if the file is missing or is a top-level helmfiles: document," but the body only does yaml.Unmarshal(data, &doc) against a struct with just Releases. yaml.Unmarshal ignores unknown top-level keys, so an orchestrator helmfiles: document would silently decode to an empty Releases slice, and the new TestGenerate_IndependentComponentsCollapse / TestGenerate_SerialChainsIndependentComponents assertions would pass vacuously instead of failing loudly.

🐛 Proposed fix
+// helmfileDoc is used only to detect the stratified helmfiles: layout so
+// readHelmfileReleases can fail loudly instead of returning an empty slice.
+type helmfileDoc struct {
+	Helmfiles []string `yaml:"helmfiles"`
+}
+
 func readHelmfileReleases(t *testing.T, outputDir string) []Release {
 	t.Helper()
 	data, err := os.ReadFile(filepath.Join(outputDir, fileHelmfile))
 	if err != nil {
 		t.Fatalf("read helmfile.yaml: %v", err)
 	}
+	var probe helmfileDoc
+	if err := yaml.Unmarshal(data, &probe); err == nil && len(probe.Helmfiles) > 0 {
+		t.Fatalf("helmfile.yaml is a top-level helmfiles: orchestrator document, not a leaf release list")
+	}
 	var doc Helmfile
 	if err := yaml.Unmarshal(data, &doc); err != nil {
 		t.Fatalf("parse helmfile.yaml: %v", err)
 	}
 	return doc.Releases
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/bundler/deployer/helmfile/crd_split_test.go` around lines 316 - 330,
Update readHelmfileReleases to explicitly detect a top-level helmfiles key
before returning doc.Releases, and fail the test with a clear message when
present. Preserve the existing file-read and YAML-parse failures while ensuring
orchestrator documents cannot produce an empty slice that lets release
assertions pass vacuously.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/integrator/data-flow.md`:
- Around line 603-607: Update the “Deployer Data Flow” diagram’s application
examples to use the documented tier-based sync-wave values, replacing the stale
linear wave: 0, 1, and 2 values while preserving the folder and deployment-flow
structure.

In `@docs/integrator/talos-integration.md`:
- Around line 99-102: Update the comments in the NNN-<component>-pre and
(NNN+1)-<component> example to remove the literal “sync-wave N-1” and “sync-wave
N” claims, and describe them consistently with the level*4 + phase formula
stated below. Preserve the namespace/PSA and chart ordering.

---

Duplicate comments:
In `@pkg/bundler/deployer/helmfile/crd_split_test.go`:
- Around line 316-330: Update readHelmfileReleases to explicitly detect a
top-level helmfiles key before returning doc.Releases, and fail the test with a
clear message when present. Preserve the existing file-read and YAML-parse
failures while ensuring orchestrator documents cannot produce an empty slice
that lets release assertions pass vacuously.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 9f2a3f44-318a-4cf1-85c4-b32710c615c9

📥 Commits

Reviewing files that changed from the base of the PR and between 3b3e3a3 and 433ebe5.

📒 Files selected for processing (31)
  • docs/contributor/component.md
  • docs/integrator/data-flow.md
  • docs/integrator/talos-integration.md
  • docs/user/cli-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/deployer/argocd/argocd.go
  • pkg/bundler/deployer/argocd/argocd_test.go
  • pkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yaml
  • pkg/bundler/deployer/argocdhelm/argocdhelm.go
  • pkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yaml
  • pkg/bundler/deployer/flux/flux.go
  • pkg/bundler/deployer/flux/flux_test.go
  • pkg/bundler/deployer/helmfile/crd_split_test.go
  • pkg/bundler/deployer/helmfile/helmfile.go
  • pkg/bundler/deployer/helmfile/helmfile_test.go
  • pkg/bundler/deployer/helmfile/releases.go
  • pkg/cli/bundle.go
  • tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml
  • tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml

@lockwobr
lockwobr force-pushed the feat/argocd-parallel-waves branch 2 times, most recently from 0a12f70 to ee800ad Compare July 14, 2026 22:47

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/integrator/data-flow.md`:
- Line 466: Update docs/integrator/data-flow.md at lines 466-466 to distinguish
Flux’s exact dependencyRefs-based dependsOn DAG from tiered ordering. Update
docs/user/cli-reference.md at lines 1252-1252 to describe serial Flux as a
component release chain preserving pre/primary/post phases, and at lines
1409-1409 replace the claim that each HelmRelease directly mirrors
dependencyRefs with the component-level dependency and phase-chain behavior.

In `@pkg/bundler/deployer/argocd/argocd.go`:
- Around line 545-567: Update the dependency-level computation in
Generator.Generate to call ComponentRefsTopologicalLevels unconditionally, so
cycles and undeclared dependencies are validated in serial mode as well.
Preserve the existing error propagation, but only populate levelOf from the
returned levels when !g.Serial.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 0ca42292-1cce-41a1-a7a3-c7f1737b7730

📥 Commits

Reviewing files that changed from the base of the PR and between 433ebe5 and ee800ad.

📒 Files selected for processing (31)
  • docs/contributor/component.md
  • docs/integrator/data-flow.md
  • docs/integrator/talos-integration.md
  • docs/user/cli-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/deployer/argocd/argocd.go
  • pkg/bundler/deployer/argocd/argocd_test.go
  • pkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yaml
  • pkg/bundler/deployer/argocdhelm/argocdhelm.go
  • pkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yaml
  • pkg/bundler/deployer/flux/flux.go
  • pkg/bundler/deployer/flux/flux_test.go
  • pkg/bundler/deployer/helmfile/crd_split_test.go
  • pkg/bundler/deployer/helmfile/helmfile.go
  • pkg/bundler/deployer/helmfile/helmfile_test.go
  • pkg/bundler/deployer/helmfile/releases.go
  • pkg/cli/bundle.go
  • tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml
  • tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml

Comment thread docs/integrator/data-flow.md Resolved
Comment thread pkg/bundler/deployer/argocd/argocd.go Resolved
@lockwobr
lockwobr force-pushed the feat/argocd-parallel-waves branch from ee800ad to c21a65f Compare July 14, 2026 23:17

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/contributor/component.md`:
- Around line 298-306: Update the “One model, three projections” paragraph to
scope dependency-tier concurrency and gating to concurrent deployers. Clarify
that Helm and --serial intentionally follow linear DeploymentOrder, while
preserving the existing explanation that folder numbers are for readability.

In `@pkg/bundler/deployer/argocd/argocd_test.go`:
- Around line 1968-1978: The identical waveFor closures in
TestGenerate_LevelBasedSyncWaves and TestGenerate_SerialSyncWaves should be
consolidated into one file-level helper parameterized by outputDir. Remove both
local definitions and update each test to call the shared helper while
preserving its suffix matching, validation, and syncWaveOf behavior.

In `@pkg/bundler/deployer/argocd/argocd.go`:
- Around line 264-270: Replace the exported mutable Serial fields with
functional-option configuration in both generators: update
pkg/bundler/deployer/argocd/argocd.go lines 264-270 and
pkg/bundler/deployer/argocdhelm/argocdhelm.go lines 251-257, add the
corresponding option constructors, and revise all construction sites to pass
Serial through options while preserving the existing default and delegation
behavior.

In `@pkg/bundler/deployer/flux/flux.go`:
- Around line 304-322: Add the same recipe component-reference topological-level
validation used by the Argo CD and helmfile deployers at the start of Generate,
before calling declaredDependsOn or serialDependsOn. Return the validation error
immediately so cyclic RecipeResult graphs cannot be converted into Flux
dependencies; preserve the existing dependency generation for valid graphs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 5af8d2b2-0f4f-4f87-bb9b-e4d122c2512b

📥 Commits

Reviewing files that changed from the base of the PR and between ee800ad and c21a65f.

📒 Files selected for processing (31)
  • docs/contributor/component.md
  • docs/integrator/data-flow.md
  • docs/integrator/talos-integration.md
  • docs/user/cli-reference.md
  • pkg/bundler/bundler.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/deployer/argocd/argocd.go
  • pkg/bundler/deployer/argocd/argocd_test.go
  • pkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yaml
  • pkg/bundler/deployer/argocdhelm/argocdhelm.go
  • pkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yaml
  • pkg/bundler/deployer/flux/flux.go
  • pkg/bundler/deployer/flux/flux_test.go
  • pkg/bundler/deployer/helmfile/crd_split_test.go
  • pkg/bundler/deployer/helmfile/helmfile.go
  • pkg/bundler/deployer/helmfile/helmfile_test.go
  • pkg/bundler/deployer/helmfile/releases.go
  • pkg/cli/bundle.go
  • tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml
  • tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml

Comment thread docs/contributor/component.md Resolved
Comment thread pkg/bundler/deployer/argocd/argocd.go Resolved
Comment thread pkg/bundler/deployer/flux/flux.go Resolved
@lockwobr
lockwobr force-pushed the feat/argocd-parallel-waves branch 2 times, most recently from 9abf585 to ef44660 Compare July 15, 2026 04:04
@lockwobr
lockwobr marked this pull request as ready for review July 15, 2026 04:05
mchmarny
mchmarny previously approved these changes Jul 15, 2026

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

Well-executed change: parallelism is derived from declared dependencyRefs and projected onto each deployer's native mechanism (flux exact DAG via dependsOn, argocd tier-banded sync-waves with stride-4 phase offsets, helmfile intra-component needs within sequential sub-helmfiles), with a --serial escape hatch reproducing the prior linear ordering. Importantly, no Go-level concurrency is introduced — generation stays sequential and deterministic (sorted tiers/targets), so AICR remains an output adapter rather than a deployment engine. Test coverage is strong: cycle rejection in both modes, wave arithmetic pinned, DAG/serial chainsaw asserts, and goldens byte-pin the output. CI is fully green including the entire Tier-1 deployer matrix.

One medium inconsistency inline on the flux graph-validation placement (fail-closed direction, direct-caller-only) plus two nits; nothing blocking.

Comment thread pkg/bundler/deployer/flux/flux.go Resolved
Comment thread pkg/bundler/config/config.go Resolved
lockwobr added 3 commits July 15, 2026 10:23
Order components by their declared dependencyRefs instead of linear
position, so mutually independent components deploy together while real
dependencies still gate. Each concurrent deployer expresses this in its
native mechanism:

- argocd / argocd-helm: sync-wave assigned by dependency depth
  (wave = tier*4 + phase, phase ordering -pre, primary, -post,
  -readiness within a component). The stride-4 band keeps consecutive
  tiers disjoint so a tier's readiness gate still blocks the next.
  argocd-helm inherits this from the delegated argocd generator.
- flux: HelmRelease dependsOn projects the declared dependencyRefs
  directly onto Flux's native DAG (a component gates only on its own
  dependencies' terminal releases), replacing the old linear chain.
- helmfile: needs: chains only within a component (-pre -> primary ->
  -post); independent components in a sub-helmfile carry no edge and
  apply concurrently. Cross-tier ordering stays the sequential
  sub-helmfile layout. Previously every release was positionally chained
  to its predecessor, serializing independent components.
- helm deploy.sh stays serial by design (unchanged).

Real recipes already declare their dependencies (base.yaml: gpu-operator
depends on nfd, cert-manager, kube-prometheus-stack, etc.), so ordering
is preserved; only genuinely independent components now roll out
concurrently.

Adds a --serial bundle flag (config.Serial) as an operator escape hatch:
argocd/argocd-helm fall back to a linear per-folder sync-wave, flux to
the previous-component dependsOn chain, and helmfile to one linear needs
chain — reproducing the pre-parallelism ordering for rollback or
bisecting a rollout. helm is already serial, so the flag is a no-op there.

Adds unit and end-to-end tests for the argocd wave arithmetic, the flux
dependsOn projection, the helmfile intra-component chaining, and all
serial paths; updates the flux and helmfile chainsaw CLI e2e tests to
assert the parallel DAG by default and the linear chain under --serial.
Documents the shared ordering model and the --serial flag in
docs/contributor/component.md and docs/user/cli-reference.md.

Signed-off-by: Brian Lockwood <[email protected]>
…eeds

- flux: validate the UNFILTERED RecipeResult.ComponentRefs (not the
  enabled-filtered sortedRefs) so a declared-but-disabled dependency is
  treated as externally satisfied instead of being mistaken for an
  undeclared one and rejected as a false cycle. argocd/helmfile already
  validate the unfiltered refs. Adds TestGenerate_DisabledDependencyNotACycle.
- helmfile: key the mandatory intra-component needs: edge on the last
  release seen per parent (lastByParent) rather than on folder adjacency,
  so the -pre -> primary -> -post ordering is correct even if folder order
  ever interleaved another component's folder. No output change.

Signed-off-by: Brian Lockwood <[email protected]>
Mirrors the CLI --serial flag on the HTTP bundle API, matching the
vendor-charts / app-name precedent: the serial query param (bool,
default false) flows through parseQueryParams -> config.WithSerial and
reaches the argocd/argocd-helm/flux/helmfile deployers. Updates the
OpenAPI contract (api/aicr/v1/server.yaml) and docs/user/api-reference.md,
and adds TestParseBundleConfig_Serial. Addresses the review note that
--serial was CLI-only.

Signed-off-by: Brian Lockwood <[email protected]>
@lockwobr
lockwobr force-pushed the feat/argocd-parallel-waves branch from 69faaaa to de2f83e Compare July 15, 2026 17:23
@lockwobr
lockwobr requested a review from mchmarny July 15, 2026 17:23
@lockwobr
lockwobr enabled auto-merge (squash) July 15, 2026 17:31

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

Careful, complete work. The "one model, three projections" framing (exact DAG for flux, tier bands for argocd, sequential sub-helmfiles for helmfile) is the right decomposition, and the details hold up: unconditional cycle validation on both paths, component-keyed intra-component chaining in helmfile, a chainsaw DAG check with a real acyclicity pass, a test helper that fails loudly instead of passing vacuously on stratified layouts, and full doc/API-spec parity for the new flag. --serial reproducing the exact pre-parallelism ordering is the right escape hatch for a default-behavior flip.

One non-blocking question inline about transitive ordering through disabled components. Please squash the 3 commits before merge per repo policy.

for _, dep := range c.DependencyRefs {
depRef, ok := refByName[dep]
if !ok {
// Disabled, externally provided, or undeclared: no release to

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.

Dropping the edge to a disabled component also drops transitive ordering: with A → B → C and B disabled, A ends up with no dependsOn at all and reconciles concurrently with C. Before this PR the linear chain still installed one component at a time, so a latent mis-order like this was masked; now it can surface as a race. The "satisfied externally" semantic is pre-existing (edgeSatisfiedExternally in pkg/recipe) and arguably correct — an external B carries its own dependency on C — but the same collapse happens in the argocd/helmfile level computation (A falls to tier 0 beside C). Worth a sentence in the component.md ordering section ("disabling a mid-graph component removes its dependents' transitive ordering; use --serial if unsure"), or contracting edges through disabled nodes if you want the stronger guarantee. Not blocking.

@lockwobr
lockwobr merged commit 76cdb46 into main Jul 15, 2026
166 checks passed
@lockwobr
lockwobr deleted the feat/argocd-parallel-waves branch July 15, 2026 17:54
mohityadav8 pushed a commit to mohityadav8/aicr that referenced this pull request Jul 21, 2026
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.

2 participants