feat: rename --container scan flag to --image (keep --container alias)#205
Conversation
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (27)
📝 WalkthroughWalkthroughThe PR switches container-image scanning and diffing from ChangesContainer image flag migration
Sequence Diagram(s)sequenceDiagram
participant User
participant newRootCmd
participant warnDeprecatedContainerFlag
participant cmd.ErrOrStderr
participant resolveExecutionTarget
User->>newRootCmd: run bomly with --container or --image
newRootCmd->>warnDeprecatedContainerFlag: inspect hidden container flag
warnDeprecatedContainerFlag->>cmd.ErrOrStderr: write deprecation warning
newRootCmd->>resolveExecutionTarget: resolve target from ResolvedConfig.Image
resolveExecutionTarget-->>User: return container-image execution target
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
Bomly Diff SummaryCompared Overview
Dependency Changes✅ No dependency changes. Vulnerabilities✅ No vulnerability changes. License Changes✅ No license changes. Project Posture✅ No project posture changes ( Policy Findings✅ No policy differences were identified. |
`--image` is the more accurate, conventional term for scanning container images (matching docker/syft/grype). Rename the primary surface to `--image` across the CLI flag, env var (`BOMLY_IMAGE`), YAML key (`target.image`), and MCP `image` argument, while keeping every old "container" form working as a backwards-compatible alias so existing scripts, CI, config files, env vars, and MCP clients keep working. - CLI: `--container` is hidden from help and bound to the same field; a deprecation notice is emitted to stderr (never stdout) so machine-readable `--json`/`--format` output stays uncorrupted for existing callers. - Config: new `envalias` struct tag lets `BOMLY_CONTAINER` fall back to the canonical `BOMLY_IMAGE`; a deprecated `target.container` YAML leaf resolves to the same field with the canonical `target.image` winning when both set. - MCP: `bomly_scan`/`bomly_diff` expose `image` (with `container` as a deprecated fallback argument). - Regenerated docs/CONFIG_REFERENCE.md and component docs via `make generate`. - Added unit tests for env/YAML alias precedence; kept one smoke test and one root-cmd diff test on `--container` as backwards-compat guards. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
89f79bd to
e49e414
Compare
What & why
--imageis the more accurate, conventional term for scanning container images (matchingdocker,syft,grype). This renames the primary surface to--imageeverywhere a user touches it, while keeping every old "container" form working as a backwards-compatible alias — so existing scripts, CI, config files, env vars, and MCP clients keep working unchanged.Surfaces renamed (all four), with aliases kept
--image--container(hidden from--help)BOMLY_IMAGEBOMLY_CONTAINERtarget.imagetarget.containerimagecontainerImplementation notes for reviewers
MarkDeprecated: it prints viaOutOrStderr(), which returns the out writer when one is set, so it can corrupt machine-readable--json/--formatoutput for existing--containerusers. Instead the flag isMarkHiddenand a one-line notice is emitted tocmd.ErrOrStderr()fromPersistentPreRunE(warnDeprecatedContainerFlag). Verifiedbomly scan --container alpine:3.20 --jsonwrites the warning to stderr and clean JSON to stdout.envaliasstruct tag (internal/config/load.go) letsBOMLY_CONTAINERfall back to canonicalBOMLY_IMAGE(primary wins).target.containerleaf resolves to the sameImagefield; field order makes the canonicaltarget.imagewin when both are present.KnownFields(true)still accepts both keys.sdk.ExecutionTargetContainerImage(value"container-image", appears in JSON/SBOM output + goldens) and internal helper names are unchanged — they accurately describe the concept and avoid golden churn.docs/CONFIG_REFERENCE.mdand component docs viamake generate.Tests
internal/config/load_test.go).container-scan-debian) and one root-cmd diff test on--containeras backwards-compat guards; switched the rest to--image.make build,make test(full suite), andmake lint(0 issues) pass. Smoke tests (make smoke) need network and were not run; goldens are unaffected since the flag name doesn't appear in output.Release
feat:→ minor bump. New flag is additive; no breaking change (all old forms still work).🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
--imageas the primary flag.--containerremains available as a deprecated alias for compatibility.Bug Fixes
Documentation
--imagethroughout.