Skip to content

fix(bundler): layer-neutral dynamic declaration errors#703

Merged
mchmarny merged 1 commit into
mainfrom
fix/680-layer-neutral-dynamic-errors
Apr 28, 2026
Merged

fix(bundler): layer-neutral dynamic declaration errors#703
mchmarny merged 1 commit into
mainfrom
fix/680-layer-neutral-dynamic-errors

Conversation

@mchmarny

Copy link
Copy Markdown
Member

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:foo names 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

  • 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/api, pkg/server)
  • Recipe engine / data (pkg/recipe)
  • Bundlers (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

Four string-only changes (no logic changes):

File Old phrasing New phrasing
bundler.go:954 in --dynamic flag in dynamic declaration
bundler.go:945 for --dynamic resolution for dynamic resolution
bundler.go:301 --dynamic is not supported with --deployer argocd; use --deployer argocd-helm instead dynamic declarations are not supported with deployer "argocd"; use deployer "argocd-helm" instead
config/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

make qualify

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

  • Low — Isolated change, well-tested, easy to revert
  • Medium — Touches multiple components or has broader impact
  • High — Breaking change, affects critical paths, or complex rollout

Rollout notes: N/A — error message text only, no API contract change.

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)

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.
@mchmarny mchmarny requested a review from a team as a code owner April 28, 2026 14:43
@mchmarny mchmarny added the bug label Apr 28, 2026
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: a3e728b3-89c8-4e3c-92f3-056165b22ed9

📥 Commits

Reviewing files that changed from the base of the PR and between 2fb1719 and 90f76c1.

📒 Files selected for processing (3)
  • pkg/bundler/bundler.go
  • pkg/bundler/bundler_test.go
  • pkg/bundler/config/config.go

📝 Walkthrough

Walkthrough

Updates error messages and test strings across the bundler package to replace CLI-specific phrasing with layer-neutral terminology. Changes include replacing "--dynamic flag" with "dynamic declaration", "--dynamic" with "dynamic", and updating deployer value references in error messages. No logic, control flow, or error codes are altered; only human-readable strings are modified across three files.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: making error messages layer-neutral by removing CLI-specific terminology from bundler core.
Description check ✅ Passed The description is well-related to the changeset, providing clear motivation, implementation details, testing evidence, and risk assessment for the four string-only error message updates.
Linked Issues check ✅ Passed All requirements from #680 are met: four CLI-centric error strings replaced with layer-neutral phrasing in bundler.go and config.go, error codes preserved, and both CLI and API consumers now see consistent non-CLI-centric messages.
Out of Scope Changes check ✅ Passed All changes are strictly within scope: four targeted error message rewording updates in bundler core plus aligned test comment updates, with no logic changes or unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/680-layer-neutral-dynamic-errors

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

@mchmarny mchmarny self-assigned this Apr 28, 2026
@mchmarny mchmarny enabled auto-merge (squash) April 28, 2026 14:47
@mchmarny mchmarny merged commit 67ea746 into main Apr 28, 2026
38 of 39 checks passed
@mchmarny mchmarny deleted the fix/680-layer-neutral-dynamic-errors branch April 28, 2026 14:54
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report ✅

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

Coverage unchanged by this PR.

@mchmarny mchmarny restored the fix/680-layer-neutral-dynamic-errors branch May 1, 2026 16:30
@mchmarny mchmarny deleted the fix/680-layer-neutral-dynamic-errors branch May 1, 2026 16:32
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.

API /v1/bundle?dynamic=... error surfaces CLI-flag phrasing ("--dynamic flag")

2 participants