Repository navigation
feat(deployer): deploy independent components in parallel - #1746
Conversation
Recipe evidence checkNo leaf overlays affected by this PR. This gate is warning-only and never blocks merge. |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a Estimated code review effort: 4 (Complex) | ~60 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (25)
docs/contributor/component.mddocs/integrator/data-flow.mddocs/integrator/talos-integration.mddocs/user/cli-reference.mdpkg/bundler/bundler.gopkg/bundler/config/config.gopkg/bundler/config/config_test.gopkg/bundler/deployer/argocd/argocd.gopkg/bundler/deployer/argocd/argocd_test.gopkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yamlpkg/bundler/deployer/argocdhelm/argocdhelm.gopkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yamlpkg/bundler/deployer/flux/flux.gopkg/bundler/deployer/flux/flux_test.gopkg/cli/bundle.go
Coverage Report ✅
Coverage BadgeMerging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
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. |
68f1253 to
10a095e
Compare
10a095e to
433ebe5
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (31)
docs/contributor/component.mddocs/integrator/data-flow.mddocs/integrator/talos-integration.mddocs/user/cli-reference.mdpkg/bundler/bundler.gopkg/bundler/config/config.gopkg/bundler/config/config_test.gopkg/bundler/deployer/argocd/argocd.gopkg/bundler/deployer/argocd/argocd_test.gopkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yamlpkg/bundler/deployer/argocdhelm/argocdhelm.gopkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yamlpkg/bundler/deployer/flux/flux.gopkg/bundler/deployer/flux/flux_test.gopkg/bundler/deployer/helmfile/crd_split_test.gopkg/bundler/deployer/helmfile/helmfile.gopkg/bundler/deployer/helmfile/helmfile_test.gopkg/bundler/deployer/helmfile/releases.gopkg/cli/bundle.gotests/chainsaw/cli/bundle-flux/chainsaw-test.yamltests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
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 winStale "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 vialevel*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 winStale 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-based1, 5, 9example 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
readHelmfileReleasesstill doesn't guard against a top-levelhelmfiles: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 doesyaml.Unmarshal(data, &doc)against a struct with justReleases.yaml.Unmarshalignores unknown top-level keys, so an orchestratorhelmfiles:document would silently decode to an emptyReleasesslice, and the newTestGenerate_IndependentComponentsCollapse/TestGenerate_SerialChainsIndependentComponentsassertions 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
📒 Files selected for processing (31)
docs/contributor/component.mddocs/integrator/data-flow.mddocs/integrator/talos-integration.mddocs/user/cli-reference.mdpkg/bundler/bundler.gopkg/bundler/config/config.gopkg/bundler/config/config_test.gopkg/bundler/deployer/argocd/argocd.gopkg/bundler/deployer/argocd/argocd_test.gopkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yamlpkg/bundler/deployer/argocdhelm/argocdhelm.gopkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yamlpkg/bundler/deployer/flux/flux.gopkg/bundler/deployer/flux/flux_test.gopkg/bundler/deployer/helmfile/crd_split_test.gopkg/bundler/deployer/helmfile/helmfile.gopkg/bundler/deployer/helmfile/helmfile_test.gopkg/bundler/deployer/helmfile/releases.gopkg/cli/bundle.gotests/chainsaw/cli/bundle-flux/chainsaw-test.yamltests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml
0a12f70 to
ee800ad
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (31)
docs/contributor/component.mddocs/integrator/data-flow.mddocs/integrator/talos-integration.mddocs/user/cli-reference.mdpkg/bundler/bundler.gopkg/bundler/config/config.gopkg/bundler/config/config_test.gopkg/bundler/deployer/argocd/argocd.gopkg/bundler/deployer/argocd/argocd_test.gopkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yamlpkg/bundler/deployer/argocdhelm/argocdhelm.gopkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yamlpkg/bundler/deployer/flux/flux.gopkg/bundler/deployer/flux/flux_test.gopkg/bundler/deployer/helmfile/crd_split_test.gopkg/bundler/deployer/helmfile/helmfile.gopkg/bundler/deployer/helmfile/helmfile_test.gopkg/bundler/deployer/helmfile/releases.gopkg/cli/bundle.gotests/chainsaw/cli/bundle-flux/chainsaw-test.yamltests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml
ee800ad to
c21a65f
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (31)
docs/contributor/component.mddocs/integrator/data-flow.mddocs/integrator/talos-integration.mddocs/user/cli-reference.mdpkg/bundler/bundler.gopkg/bundler/config/config.gopkg/bundler/config/config_test.gopkg/bundler/deployer/argocd/argocd.gopkg/bundler/deployer/argocd/argocd_test.gopkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yamlpkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yamlpkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yamlpkg/bundler/deployer/argocdhelm/argocdhelm.gopkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yamlpkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yamlpkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yamlpkg/bundler/deployer/flux/flux.gopkg/bundler/deployer/flux/flux_test.gopkg/bundler/deployer/helmfile/crd_split_test.gopkg/bundler/deployer/helmfile/helmfile.gopkg/bundler/deployer/helmfile/helmfile_test.gopkg/bundler/deployer/helmfile/releases.gopkg/cli/bundle.gotests/chainsaw/cli/bundle-flux/chainsaw-test.yamltests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml
9abf585 to
ef44660
Compare
mchmarny
left a comment
There was a problem hiding this comment.
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.
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]>
69faaaa to
de2f83e
Compare
mchmarny
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Signed-off-by: Brian Lockwood <[email protected]>
Summary
Deploy mutually independent components concurrently instead of strictly one at a time, across all four concurrent deployers, and add a
--serialescape hatch. Ordering follows each component's declareddependencyRefs.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
Component(s) Affected
cmd/aicr,pkg/cli) — new--serialflagpkg/bundler,pkg/bundler/deployer/*)docs/)Implementation Notes
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.dependsOnprojects each component's declareddependencyRefsdirectly onto Flux's native DAG (a true DAG, not tiers), the most faithful and most parallel rendering.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.deploy.sh).--serial(config.Serial): reverts argocd / argocd-helm to a linear per-folder sync-wave, flux to the previous-componentdependsOnchain, and helmfile to one linearneeds:chain — reproducing the pre-parallelism ordering for rollback or bisecting a rollout. A no-op for helm.base.yaml:gpu-operatordepends onnfd,cert-manager,kube-prometheus-stack; etc.), so genuine ordering is preserved. Only independent components now roll out concurrently.Testing
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), andTestConfigSerial. 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
--serialrestores the exact prior behavior.Rollout notes: The default flips to parallel for the four concurrent deployers. Operators who hit trouble can pass
--serialto get the old one-at-a-time ordering back. Helm output is unchanged.Checklist
make testwith-race)make lint)git commit -S)