Skip to content

feat: remove compref package from cli #1941

Merged
jakobmoellerdev merged 2 commits into
open-component-model:mainfrom
chrisbleyerSAP:main
Mar 10, 2026
Merged

feat: remove compref package from cli #1941
jakobmoellerdev merged 2 commits into
open-component-model:mainfrom
chrisbleyerSAP:main

Conversation

@chrisbleyerSAP

@chrisbleyerSAP chrisbleyerSAP commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it

Follow up for: #1908. Removes compref from cli.

Verification
  • I have tested the changes locally by running task test

Summary by CodeRabbit

  • Refactor
    • Component reference handling moved to the public OCI bindings, consolidating parsing/resolution into a shared implementation.
    • Legacy internal reference parser and its option surface were removed; CLI commands use the unified binding with no functional change.
    • Tests updated to the new bindings; some legacy internal tests were removed.

@chrisbleyerSAP chrisbleyerSAP requested a review from a team as a code owner March 10, 2026 10:22
@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/l Large labels Mar 10, 2026
@coderabbitai

coderabbitai Bot commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 671a72b7-d43b-4696-811b-ec83838174bc

📥 Commits

Reviewing files that changed from the base of the PR and between 8df74fa and 6928a76.

📒 Files selected for processing (17)
  • cli/cmd/add/component-version/cmd.go
  • cli/cmd/cmd_test.go
  • cli/cmd/download/plugin/cmd.go
  • cli/cmd/download/resource/cmd.go
  • cli/cmd/get/component-version/cmd.go
  • cli/cmd/plugins/get/cmd.go
  • cli/cmd/plugins/list/cmd.go
  • cli/cmd/sign/component-version/cmd.go
  • cli/cmd/transfer/component-version/cmd.go
  • cli/cmd/transfer/component-version/cmd_test.go
  • cli/cmd/transfer/component-version/internal/graph.go
  • cli/cmd/verify/component-version/cmd.go
  • cli/internal/reference/compref/compref.go
  • cli/internal/reference/compref/compref_test.go
  • cli/internal/reference/compref/options.go
  • cli/internal/repository/ocm/compatibility.go
  • cli/internal/repository/ocm/compatibility_test.go
💤 Files with no reviewable changes (3)
  • cli/internal/reference/compref/options.go
  • cli/internal/reference/compref/compref_test.go
  • cli/internal/reference/compref/compref.go
🚧 Files skipped from review as they are similar to previous changes (7)
  • cli/cmd/verify/component-version/cmd.go
  • cli/cmd/add/component-version/cmd.go
  • cli/cmd/plugins/get/cmd.go
  • cli/cmd/cmd_test.go
  • cli/cmd/download/plugin/cmd.go
  • cli/cmd/transfer/component-version/cmd_test.go
  • cli/internal/repository/ocm/compatibility.go

📝 Walkthrough

Walkthrough

This PR replaces the CLI's internal component-reference parser with the external OCI bindings implementation. The internal cli/internal/reference/compref package (implementation, options, tests) is removed and all callers/imports are updated to ocm.software/open-component-model/bindings/go/oci/compref.

Changes

Cohort / File(s) Summary
CLI Command Imports
cli/cmd/add/component-version/cmd.go, cli/cmd/download/plugin/cmd.go, cli/cmd/download/resource/cmd.go, cli/cmd/get/component-version/cmd.go, cli/cmd/plugins/get/cmd.go, cli/cmd/plugins/list/cmd.go, cli/cmd/sign/component-version/cmd.go, cli/cmd/transfer/component-version/cmd.go, cli/cmd/verify/component-version/cmd.go
Replaced import of internal cli/internal/reference/compref with bindings/go/oci/compref; no other logic changes.
CLI Command Tests
cli/cmd/cmd_test.go, cli/cmd/transfer/component-version/cmd_test.go
Test imports updated to use bindings/go/oci/compref instead of internal package.
CLI Transfer Graph Logic
cli/cmd/transfer/component-version/internal/graph.go
Signature and usages updated to reference *compref.Ref from OCI bindings package (import path changed).
Repository Compatibility Layer
cli/internal/repository/ocm/compatibility.go, cli/internal/repository/ocm/compatibility_test.go
Switched imports to OCI compref package for component-ref-related types/usages.
Deleted Internal Implementation
cli/internal/reference/compref/compref.go, cli/internal/reference/compref/compref_test.go, cli/internal/reference/compref/options.go
Removed entire internal component-reference parser, its options API, and all associated tests (large deletion of parsing, repository-guessing, Ref type and helpers).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • fabianburth
  • jakobmoellerdev

Poem

🐰 I hopped through imports, swift and fleet,

Left an old parser in a tidy heap,
Now OCI bindings guide each ref,
CLI strides on, light and deft,
A tiny hop, a cleaner leap.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the compref package from the CLI codebase, which aligns with the substantial refactoring shown across multiple files.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Signed-off-by: Christoph Bleyer <christoph.bleyer@sap.com>
@jakobmoellerdev jakobmoellerdev merged commit 4a07684 into open-component-model:main Mar 10, 2026
21 checks passed
frewilhelm pushed a commit to frewilhelm/open-component-model that referenced this pull request Mar 12, 2026
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it

Follow up for:
open-component-model#1908.
Removes compref from cli.

##### Verification

- [x] I have tested the changes locally by running `task test`

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Component reference handling moved to the public OCI bindings,
consolidating parsing/resolution into a shared implementation.
* Legacy internal reference parser and its option surface were removed;
CLI commands use the unified binding with no functional change.
* Tests updated to the new bindings; some legacy internal tests were
removed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Christoph Bleyer <christoph.bleyer@sap.com>
morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Mar 18, 2026
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it

Follow up for:
open-component-model#1908.
Removes compref from cli.

##### Verification

- [x] I have tested the changes locally by running `task test`

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Component reference handling moved to the public OCI bindings,
consolidating parsing/resolution into a shared implementation.
* Legacy internal reference parser and its option surface were removed;
CLI commands use the unified binding with no functional change.
* Tests updated to the new bindings; some legacy internal tests were
removed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Christoph Bleyer <christoph.bleyer@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
@coderabbitai coderabbitai Bot mentioned this pull request Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature new feature, enhancement, improvement, extension size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants