fix(bundler): layer-neutral dynamic declaration errors#703
Conversation
Bundler-core error messages referenced CLI flags (--dynamic, --deployer) which surfaced verbatim through the API, confusing API consumers. Reworded to layer-neutral phrasing so both CLI and API produce the same non-CLI-centric messages.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughUpdates error messages and test strings across the bundler package to replace CLI-specific phrasing with layer-neutral terminology. Changes include replacing Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Coverage Report ✅
Coverage BadgeCoverage unchanged by this PR. |
Summary
Reword four CLI-centric error messages in the bundler core to layer-neutral phrasing so both CLI and API consumers see the same non-CLI-centric text.
Motivation / Context
When
POST /v1/bundle?dynamic=nonexistent:foonames an unknown component, the API returns"in --dynamic flag"— confusing for API consumers who never use the CLI. The bundler is shared by both CLI and API, so its error text should be surface-agnostic.Fixes: #680
Related: N/A
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
Four string-only changes (no logic changes):
bundler.go:954in --dynamic flagin dynamic declarationbundler.go:945for --dynamic resolutionfor dynamic resolutionbundler.go:301--dynamic is not supported with --deployer argocd; use --deployer argocd-helm insteaddynamic declarations are not supported with deployer "argocd"; use deployer "argocd-helm" insteadconfig/config.go:525--dynamic does not accept '=value'dynamic declaration does not accept '=value'Test comments updated to match. No assertions changed — existing assertions check for component names and
argocd-helm, not for the CLI-specific phrasing.Testing
All bundler and config tests pass. Lint clean. Two pre-existing sandbox failures (pkg/trust TUF write, deployer/helm mktemp) unrelated to this change.
Risk Assessment
Rollout notes: N/A — error message text only, no API contract change.
Checklist
make testwith-race)make lint)git commit -S)