refactor(deployer): unify deployer interface across helm, argocd, argocd-helm (#571)#575
refactor(deployer): unify deployer interface across helm, argocd, argocd-helm (#571)#575
Conversation
Coverage Report ✅
Coverage BadgeMerging this branch changes the coverage (2 decrease, 3 increase)
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. |
2e18aba to
8bc90f9
Compare
Open Questions
|
8bc90f9 to
8e9c264
Compare
8e9c264 to
c93bfd9
Compare
ArangoGutierrez
left a comment
There was a problem hiding this comment.
The unification is a net improvement (-189 lines). The buildDeployer / runDeployer split is clean. Two things to address:
-
getDataFileListvscopyDataFilessplit -- In the Helm path,buildDeployerpassesgetDataFileList()to the Generator for checksum tracking, andrunDeployercallscopyDataFiles()for the actual filesystem copy + attestation list. This is functionally correct but the two functions compute the same list independently. If they ever diverge, the Helm generator would reference files that attestation does not. Consider havingcopyDataFilesreturn the list and pass it to the Generator, or document the coupling. -
Reviewer questions about deleted methods -- @ayuskauskas asked about the removed
DeploymentInfo()in deployer.go and argocdhelm.go. lockwobr confirmed they were unused. That checks out -- deployment info is now built inrunDeployerfromdeployer.Outputfields directly.
Ayuskauskas's questions are resolved. The getDataFileList/copyDataFiles coupling is the remaining design point.
c93bfd9 to
fa30a50
Compare
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAll three deployers (helm, argocd, argocd-helm) migrated to a unified Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
fa30a50 to
ec451a2
Compare
yuanchen8911
left a comment
There was a problem hiding this comment.
/lgtm
Re-checked the current PR head and the two originally flagged issues are addressed:
- Helm no longer re-copies external --data files after Generate(), so the file-exists regression is gone.
- recipe.yaml is now Helm-only, so ArgoCD and argocd-helm no longer add a post-checksum unchecked recipe file.
There is still a pre-existing ArgoCD external-data checksum gap, but it is not introduced by this PR and should be tracked separately as follow-up work.
|
Follow-up detail on the pre-existing ArgoCD external-data issue: With This is not introduced by #575; the old flow also copied ArgoCD data files after Suggested follow-up: add |
Summary
Migrate all three deployers (helm, argocd, argocd-helm) to the
deployer.Deployerinterface and unify bundler routing through a singleGenerate(ctx, outputDir)contract.Motivation / Context
PR #527 introduced
deployer.Deployeranddeployer.Outputbut onlyargocdhelmimplemented the interface. Thehelmandargocddeployers still used their ownGeneratorInput/GeneratorOutputtypes and were called via concrete methods inbundler.go. This meant deployers weren't mockable, each had redundant output types, and theshared/sub-package added unnecessary indirection.Fixes: #571
Related: #527, #515
Fixes:
Related:
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/api,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)Implementation Notes
deployer/shared/utilities intodeployer/packageGeneratorInputfields intoGeneratorstructs for helm and argocd ("Generator IS the input" pattern matching argocdhelm)GeneratorInput,GeneratorOutput, andNewGeneratorfrom helm and argocd packagesmakeHelmBundle/makeArgoCD/makeArgoCDHelmChartmethods withbuildDeployer(factory) +runDeployer(common post-generation)HasDynamicValues()from the interface — it was never called through the interface; dynamic value checks usebundler.ConfigdirectlyGenerate(ctx, outputDir) (*Output, error)Make()API is unchangedTesting
# Commands run (prefer `make qualify` for non-trivial changes) make qualifyRisk Assessment
Rollout notes:
Checklist
make testwith-race)make lint)git commit -S) — GPG signing infoSummary by CodeRabbit
Release Notes