Skip to content

Update USM commands to remove on-prem to cloud Kafka ID mapping and simplify connect operations - #3416

Open
Karan Singh Khati (karanskhati) wants to merge 2 commits into
mainfrom
USM-Connect-CLI-Update
Open

Update USM commands to remove on-prem to cloud Kafka ID mapping and simplify connect operations#3416
Karan Singh Khati (karanskhati) wants to merge 2 commits into
mainfrom
USM-Connect-CLI-Update

Conversation

@karanskhati

@karanskhati Karan Singh Khati (karanskhati) commented Jul 28, 2026

Copy link
Copy Markdown
Member

Release Notes

New Features

  • confluent usm connect register, describe, and list now display the USM Kafka Cluster ID for every Connect cluster; including those backed by native Confluent Cloud (lkc-) Kafka clusters sourced directly from the API response.

Checklist

  • I have successfully built and used a custom CLI binary, without linter issues from this PR.
  • I have clearly specified in the What section below whether this PR applies to Confluent Cloud, Confluent Platform, or both.
  • I have verified this PR in Confluent Cloud pre-prod or production environment, if applicable.
  • I have verified this PR in Confluent Platform on-premises environment, if applicable.
  • I have attached manual CLI verification results or screenshots in the Test & Review section below.
  • I have added appropriate CLI integration or unit tests for any new or updated commands and functionality.
  • I confirm that this PR introduces no breaking changes or backward compatibility issues.
  • I have indicated the potential customer impact if something goes wrong in the Blast Radius section below.
  • I have put checkmarks below confirming that the feature associated with this PR is enabled in:
    • Confluent Cloud prod
    • Confluent Cloud stag
    • Confluent Platform
    • Check this box if the feature is enabled for certain organizations only

What

Applies to: Confluent Cloud (USM).

This updates the usm connect commands to consume the new read-only usm_kafka_cluster_id field added to the public USM SDK in ccloud-sdk-go-v2/usm v0.2.0 (confluentinc/ccloud-sdk-go-v2#367).

Previously the CLI derived the USM Kafka Cluster ID client-side: it listed all USM Kafka clusters (ListUsmKafkaClusters) and mapped the Confluent Platform Kafka cluster ID → USM Kafka cluster ID. That extra call could not resolve Connect clusters backed by native Confluent Cloud (lkc-) Kafka clusters (which are not USM Kafka clusters), so the field rendered empty and logged a spurious error.

Now register, describe, and list read usm_kafka_cluster_id straight from the API response (the USM control plane already returns it on all three paths), and the client-side mapping (getOnPremToCloudKafkaIdMap) is removed. This also drops one redundant API round-trip per command.

  • Bumps ccloud-sdk-go-v2/usm v0.1.0 → v0.2.0.
  • Updates the integration test-server mock to return usm_kafka_cluster_id (golden fixtures unchanged).

Blast Radius

Confluent Cloud customers using confluent usm connect register, describe, or list. Worst case, if the API response omits usm_kafka_cluster_id, the column renders empty — no error, no crash. deregister and all usm kafka commands are unaffected.

References

Test & Review

  • make test (unit + integration): updated the usm connect test-server mock to populate usm_kafka_cluster_id; all TestUsmConnect / TestUsmKafka cases pass with the golden fixtures unchanged.
  • Manual verification:
Screenshot 2026-07-29 at 5 05 17 AM Screenshot 2026-07-29 at 5 04 57 AM Screenshot 2026-07-29 at 5 04 35 AM

@karanskhati
Karan Singh Khati (karanskhati) requested a review from a team as a code owner July 28, 2026 23:11
Copilot AI review requested due to automatic review settings July 28, 2026 23:11
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Unified Stream Manager (USM) Connect commands to stop deriving the USM Kafka cluster ID via an on-prem (Confluent Platform) Kafka cluster ID mapping, instead attempting to read the USM Kafka cluster ID directly from the Connect cluster API response. It also bumps the USM SDK dependency version to align with the updated API surface.

Changes:

  • Remove the helper that built a Confluent Platform Kafka ID → USM Kafka ID map and stop logging “cluster not found” errors during Connect operations.
  • Update connect register, connect describe, and connect list output to use GetUsmKafkaClusterId() from the Connect cluster object.
  • Upgrade github.com/confluentinc/ccloud-sdk-go-v2/usm from v0.1.0 to v0.2.0 (with corresponding go.sum changes).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/unified-stream-manager/command_connect.go Simplifies Connect table printing and removes the on-prem→USM Kafka ID mapping helper.
internal/unified-stream-manager/command_connect_register.go Removes mapping lookup/logging and prints Connect output using the returned cluster object only.
internal/unified-stream-manager/command_connect_list.go Stops mapping lookup/logging and uses GetUsmKafkaClusterId() for list output.
internal/unified-stream-manager/command_connect_describe.go Removes mapping lookup/logging and prints describe output via printConnectTable.
go.mod Bumps USM SDK dependency to v0.2.0.
go.sum Updates module sums due to the dependency bump.
Comments suppressed due to low confidence (2)

internal/unified-stream-manager/command_connect.go:80

  • USMKafkaClusterId is now sourced from connect.GetUsmKafkaClusterId(), but the USM Connect cluster API responses (and the integration test server) do not populate that field today (see test/test-server/usm_handlers.go:160-177 and :204-211, which only set KafkaClusterId). This will result in an empty "USM Kafka Cluster ID" column/JSON field for connect register, connect list, and connect describe, and breaks the existing golden fixtures that expect usmkc-... values.

To avoid this regression, either (a) keep a fallback lookup from Confluent Platform Kafka cluster ID -> USM Kafka cluster ID when GetUsmKafkaClusterId() is empty, or (b) ensure the backend/test server responses include usm_kafka_cluster_id and update fixtures accordingly.

	out := &connectOut{
		Id:                              connect.GetId(),
		ConfluentPlatformConnectCluster: connect.GetConfluentPlatformConnectClusterId(),
		USMKafkaClusterId:               connect.GetUsmKafkaClusterId(),
		ConfluentPlatformKafkaClusterId: connect.GetKafkaClusterId(),
		Cloud:                           connect.GetCloud(),
		Region:                          connect.GetRegion(),
		Environment:                     connect.Environment.GetId(),
	}

internal/unified-stream-manager/command_connect_list.go:53

  • listConnect now prints USMKafkaClusterId from cluster.GetUsmKafkaClusterId(), but the USM Connect cluster list response in the integration test server does not set this field (it only sets KafkaClusterId; see test/test-server/usm_handlers.go:160-178). As a result, the "USM Kafka Cluster ID" column/JSON field will be empty and the existing test/fixtures/output/unified-stream-manager/connect/list*.golden expectations will no longer match.

Consider restoring the previous ID-derivation (or a fallback when GetUsmKafkaClusterId() is empty), or update the backend/test server contract and goldens to include the USM Kafka cluster ID in connect-cluster responses.

		out := &connectOut{
			Id:                              cluster.GetId(),
			ConfluentPlatformConnectCluster: cluster.GetConfluentPlatformConnectClusterId(),
			USMKafkaClusterId:               cluster.GetUsmKafkaClusterId(),
			ConfluentPlatformKafkaClusterId: cluster.GetKafkaClusterId(),
			Cloud:                           cluster.GetCloud(),
			Region:                          cluster.GetRegion(),
			Environment:                     cluster.Environment.GetId(),
		}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqube-confluent

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants