Skip to content

Conversation

@thllwg
Copy link
Contributor

@thllwg thllwg commented Sep 3, 2025

Release Notes

New Features

  • Add new optional --display-name gives an alias for the self-managed key
  • Add new confluent byok update command that allows to alter the display-name of the self-managed key
  • Add new key validation related object fields Phase, Since, Message and Region
  • Add new confluent byok list filter options --key, --phase, --region, --display-name.

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 CC
  • Updates the BYOK API SDK to deliver UX improvements
  • Updates the golang version due to API SDK requirements

Blast Radius

References

Test & Review

https://confluentinc.atlassian.net/wiki/spaces/~61d01fe07aa7ac0070ff9ad0/pages/edit-v2/4822008075

@confluent-cla-assistant
Copy link

🎉 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.

@thllwg thllwg changed the title SP-990: Update BYOK CLI SP-990: Update BYOK CLI; Update go version to 1.24.7 Oct 2, 2025
Copy link
Member

@sgagniere sgagniere left a comment

Choose a reason for hiding this comment

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

Thanks! Here's some comments:

@thllwg thllwg marked this pull request as ready for review October 9, 2025 10:39
@thllwg thllwg requested a review from a team as a code owner October 9, 2025 10:39
Copilot AI review requested due to automatic review settings October 9, 2025 10:39
Copy link

Copilot AI left a comment

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 the BYOK (Bring Your Own Key) CLI functionality to support new user experience improvements and updates the Go version to 1.24.7 to meet API SDK requirements.

  • Adds new confluent byok update command for modifying display names of self-managed keys
  • Introduces optional --display-name flag for key creation and new filtering options for the list command
  • Adds validation-related fields (Phase, Since, Message, Region) to key objects and output

Reviewed Changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
go.mod Updates Go version to 1.24.7 and BYOK SDK to v0.0.9
.go-version Updates Go version specification
internal/byok/command_update.go Implements new update command for modifying key display names
internal/byok/command_list.go Adds new filtering options (region, validation-phase, display-name, key)
internal/byok/command_describe.go Adds validation fields to key description output
internal/byok/command_create.go Adds optional display-name parameter to key creation
internal/byok/command.go Adds update command and new validation output fields
pkg/ccloudv2/byok.go Updates API client to support new filtering and update operations
pkg/cmd/flags.go Adds validation phase flag support
test/test-server/*.go Updates test server with new validation fields and update handler
test/fixtures/output/byok/*.golden Updates expected output with new fields and commands
test/byok_test.go Adds tests for new filtering options and update command

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cmd.Flags().String("display-name", "", "A human-readable name for the self-managed key.")
pcmd.AddOutputFlag(cmd)

cobra.CheckErr(cmd.MarkFlagRequired("display-name"))
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

Using cobra.CheckErr for flag validation is not the recommended pattern. Consider handling the error directly: cmd.MarkFlagRequired(\"display-name\") or if err := cmd.MarkFlagRequired(\"display-name\"); err != nil { return err }

Suggested change
cobra.CheckErr(cmd.MarkFlagRequired("display-name"))
if err := cmd.MarkFlagRequired("display-name"); err != nil {
return nil
}

Copilot uses AI. Check for mistakes.
$ confluent byok update cck-12345 --display-name "My production key"

Flags:
--display-name string REQUIRED: A human-readable name for the self-managed key.
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The flag description shows 'REQUIRED:' but this is redundant since Cobra automatically indicates required flags. The description should focus on what the flag does rather than its requirement status.

Suggested change
--display-name string REQUIRED: A human-readable name for the self-managed key.
--display-name string A human-readable name for the self-managed key.

Copilot uses AI. Check for mistakes.
@sonarqube-confluent
Copy link

Passed

Analysis Details

1 Issue

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 1 Code Smell

Coverage and Duplications

  • Coverage 90.60% Coverage (78.20% Estimated after merge)
  • Duplications No duplication information (0.00% Estimated after merge)

Project ID: cli

View in SonarQube

Copy link
Member

@cqin-confluent cqin-confluent left a comment

Choose a reason for hiding this comment

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

Looks good overall, just a couple of questions:

  • Could you elaborate on what scenarios would cause an update display-name operation to fail? I see the test case below, but I’m a bit unclear on what “Non-existent Key” refers to.
    "byok update cck-404 --display-name \"Non-existent Key\""

  • Also, could you populate the Test & Review section of the PR description with the outputs from your manual verification of the new operations?

@thllwg thllwg requested a review from cqin-confluent November 3, 2025 10:39
cqin-confluent
cqin-confluent previously approved these changes Nov 6, 2025
@sonarqube-confluent
Copy link

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.

4 participants