Skip to content

chore: update ocm-cli to v1.0.17 - #1010

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
redhat-chai-bot:chore/update-ocm-cli-1.0.17
Oct 8, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
redhat-chai-bot:chore/update-ocm-cli-1.0.17

Conversation

@redhat-chai-bot

@redhat-chai-bot redhat-chai-bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Update github.com/openshift-online/ocm-cli from v1.0.10 to v1.0.17.
  • Align the Kubernetes and OpenShift client dependencies with the structured-merge-diff v6 module graph required by the new ocm-cli release.
  • Migrate the affected ConsolePlugin lookup to the dynamic client while preserving existing behavior.
  • Add focused coverage for dynamic lookup, filtering, API errors, and validation edge cases.

Validation

  • make test
  • Console focused and race tests
  • go vet ./...
  • make lint
  • make build
  • go mod verify
  • Repeated go mod tidy with no dependency-file diff
  • gofmt and git diff --check

AI-generated. Review for accuracy.

@feichashao requested from Slack

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility when retrieving console plugins from older clusters.
    • Invalid plugin service settings now return more specific errors identifying the affected field, such as the service name, namespace, port, or base path. This makes configuration problems easier to identify.
    • Plugin listings continue to exclude disabled plugins, and errors from either API endpoint are reported.

Update ocm-cli from 1.0.10 to 1.0.17, align the Kubernetes and OpenShift client modules, and preserve pre-4.12 ConsolePlugin support through the dynamic client.
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: openshift/backplane-cli/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: cecf1b69-f0d5-4410-b615-696ef8c4f0bd
📥 Commits

Reviewing files that changed from the base of the PR and between d4fda89 and acb85f6.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum, !**/go.sum
📒 Files selected for processing (3)
  • cmd/ocm-backplane/console/console.go
  • cmd/ocm-backplane/console/console_test.go
  • go.mod

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.


Walkthrough

The pre-4.12 console-plugin lookup now reads ConsolePlugin resources through the Kubernetes dynamic client and builds enabled plugin URLs from unstructured service fields. Missing or invalid fields return field-specific errors. Tests cover URL construction, plugin filtering, and API errors. Dependency versions are updated.

Changes

Legacy Console Plugin Lookup

Layer / File(s) Summary
Dynamic plugin lookup and URL construction
go.mod, cmd/ocm-backplane/console/console.go
The lookup lists ConsolePlugin resources through the dynamic client and constructs URLs for enabled plugins from unstructured service fields. Missing or invalid service values return field-specific errors. Dependencies are updated.
Lookup and URL validation
cmd/ocm-backplane/console/console_test.go
Tests cover service-field parsing, enabled-plugin filtering, URL generation, request counts, and errors from either API endpoint.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant Lookup as getConsolePluginFrom411Cluster
  participant KubernetesAPI as Kubernetes API
  participant OperatorAPI as Console operator API
  participant URLHelper as consolePluginV1Alpha1URL
  Lookup->>KubernetesAPI: List ConsolePlugin resources
  KubernetesAPI-->>Lookup: Return plugin list
  Lookup->>OperatorAPI: Check plugin enablement
  OperatorAPI-->>Lookup: Return enablement result
  Lookup->>URLHelper: Build URL for enabled plugin
  URLHelper-->>Lookup: Return service URL or field error
Loading

Merge Risk: ⚪ Minimal · up to acb85

The legacy plugin lookup has no identified issue blocking merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: updating the ocm-cli dependency to v1.0.17. It is concise and directly related to the dependency and ConsolePlugin compatibility changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

@openshift-ci
openshift-ci Bot requested review from bmeng and diakovnec October 8, 2026 06:28
@openshift-ci

openshift-ci Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.41%. Comparing base (d4fda89) to head (acb85f6).

Files with missing lines Patch % Lines
cmd/ocm-backplane/console/console.go 93.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1010      +/-   ##
==========================================
+ Coverage   55.86%   56.41%   +0.55%     
==========================================
  Files          78       78              
  Lines        6159     6184      +25     
==========================================
+ Hits         3441     3489      +48     
+ Misses       2311     2286      -25     
- Partials      407      409       +2     
Files with missing lines Coverage Δ
cmd/ocm-backplane/console/console.go 60.39% <93.33%> (+5.79%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +837 to +873
func consolePluginV1Alpha1URL(consolePlugin unstructured.Unstructured) (string, error) {
serviceName, found, err := unstructured.NestedString(consolePlugin.Object, "spec", "service", "name")
if err != nil {
return "", fmt.Errorf("failed to read spec.service.name from console plugin %q: %w", consolePlugin.GetName(), err)
}
if !found {
return "", fmt.Errorf("console plugin %q is missing spec.service.name", consolePlugin.GetName())
}

serviceNamespace, found, err := unstructured.NestedString(consolePlugin.Object, "spec", "service", "namespace")
if err != nil {
return "", fmt.Errorf("failed to read spec.service.namespace from console plugin %q: %w", consolePlugin.GetName(), err)
}
if !found {
return "", fmt.Errorf("console plugin %q is missing spec.service.namespace", consolePlugin.GetName())
}

servicePort, found, err := unstructured.NestedInt64(consolePlugin.Object, "spec", "service", "port")
if err != nil {
return "", fmt.Errorf("failed to read spec.service.port from console plugin %q: %w", consolePlugin.GetName(), err)
}
if !found {
return "", fmt.Errorf("console plugin %q is missing spec.service.port", consolePlugin.GetName())
}

basePath, found, err := unstructured.NestedString(consolePlugin.Object, "spec", "service", "basePath")
if err != nil {
return "", fmt.Errorf("failed to read spec.service.basePath from console plugin %q: %w", consolePlugin.GetName(), err)
}
if !found {
return "", fmt.Errorf("console plugin %q is missing spec.service.basePath", consolePlugin.GetName())
}

return fmt.Sprintf("%s=https://%s.%s.svc.cluster.local:%d%s",
consolePlugin.GetName(), serviceName, serviceNamespace, servicePort, basePath), nil
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@redhat-chai-bot this is a large implementation for a resource which is simple originally. Is there a way to simplify it? Is implementing it in dynamic a must? instead of using the original client-go one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising this. I checked the exact client revisions in this PR:

  • The older github.com/openshift/client-go revision contains the typed console/.../v1alpha1 client, but the compatible revision selected for the ocm-cli v1.0.17 dependency graph no longer contains that package; it retains the typed ConsolePlugin client under console/.../v1.
  • ocm-cli v1.0.17 requires k8s.io/apimachinery v0.34.3. The older OpenShift client-go module is tied to Kubernetes 0.25 and structured-merge-diff/v4, while the compatible graph uses Kubernetes 0.34 and structured-merge-diff/v6. Restoring the older typed client would reintroduce the incompatibility that caused the original dependency-update build to fail.
  • The legacy cluster resource is still console.openshift.io/v1alpha1, so this path uses the dynamic client with an explicit GVR and a small helper to read the four service fields. The tests cover the GVR, JSON decoding, enabled/disabled filtering, API errors, and invalid fields.

For this dependency set, the dynamic client is necessary; reverting to the old typed client is not viable without reverting the compatible client dependency graph. The helper can still be simplified structurally if there is a preferred local pattern, but the client choice is driven by the API/module change.


AI-generated. Review for accuracy.

@feichashao

Copy link
Copy Markdown
Contributor

/hold

I need to run a local test to validate e2e.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 2026
@feichashao

Copy link
Copy Markdown
Contributor

/hold cancel

I built this PR locally and the monitoring console plugin can still work.

Although this PR adds a big implementation for the plugin itself, the logic is clear, I accept it.

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 2026
@feichashao

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Oct 8, 2026
@openshift-ci

openshift-ci Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feichashao, redhat-chai-bot

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 8, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 39c75c5 into openshift:main Oct 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants