Skip to content

Conversation

@sgagniere
Copy link
Member

@sgagniere sgagniere commented Dec 5, 2025

Release Notes

Breaking Changes

  • PLACEHOLDER

New Features

  • PLACEHOLDER

Bug Fixes

  • Update the description of the --context-type flag for the Cloud confluent schema-registry exporter [create | update] commands to include the "default" option

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

Our public Cloud documentation lists "DEFAULT" as a valid context-type: https://docs.confluent.io/cloud/current/sr/schema-linking.html

The backend also accepts this value. But our flag description only listed the other three, so this PR is to correct that.

Edit: Only implemented for Cloud; the On-Prem API documentation does not list "default" as an accepted option.

Blast Radius

Zero. This is a documentation change. The underlying functionality is unchanged.

References

Test & Review

Help menu:

confluent sr exporter create -h
Create a new schema exporter.

Usage:
  confluent schema-registry exporter create <name> [flags]

Examples:
Create a new schema exporter.

  $ confluent schema-registry exporter create my-exporter --config config.txt --subjects my-subject1,my-subject2 --subject-format my-\${subject} --context-type custom --context-name my-context

Flags:
      --config strings                    A comma-separated list of "key=value" pairs, or path to a configuration file containing a newline-separated list of "key=value" pairs.
      --subjects strings                  A comma-separated list of exporter subjects. (default [*])
      --subject-format string             Exporter subject rename format. The format string can contain ${subject}, which will be replaced with the default subject name. (default "${subject}")
      --context-type string               Exporter context type. One of "auto", "custom", "default", or "none". (default "auto")
      --context-name string               Exporter context name.
      --context string                    CLI context name.
      --environment string                Environment ID.
      --schema-registry-endpoint string   The URL of the Schema Registry cluster.
  -o, --output string                     Specify the output format as "human", "json", or "yaml". (default "human")

Global Flags:
  -h, --help            Show help for this command.
      --unsafe-trace    Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets.
  -v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).

Same for update:

confluent sr exporter update -h
Update schema exporter.

Usage:
  confluent schema-registry exporter update <name> [flags]

Examples:
Update schema exporter information.

  $ confluent schema-registry exporter update my-exporter --subjects my-subject1,my-subject2 --subject-format my-\${subject} --context-type custom --context-name my-context

Update schema exporter configuration.

  $ confluent schema-registry exporter update my-exporter --config config.txt

Flags:
      --config strings                    A comma-separated list of "key=value" pairs, or path to a configuration file containing a newline-separated list of "key=value" pairs.
      --subjects strings                  A comma-separated list of exporter subjects.
      --subject-format string             Exporter subject rename format. The format string can contain ${subject}, which will be replaced with the default subject name. (default "${subject}")
      --context-type string               Exporter context type. One of "auto", "custom", "default", or "none". (default "auto")
      --context-name string               Exporter context name.
      --context string                    CLI context name.
      --environment string                Environment ID.
      --schema-registry-endpoint string   The URL of the Schema Registry cluster.
  -o, --output string                     Specify the output format as "human", "json", or "yaml". (default "human")

Global Flags:
  -h, --help            Show help for this command.
      --unsafe-trace    Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets.
  -v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).

Next, some sanity checking that this context type is accepted by the backend.

Create:

confluent sr exporter create my-exporter --subjects ":*:" --config config.txt --context-type default 
Created schema exporter "my-exporter".

Create w/ an invalid context type to double check that the backend doesn't accept arbitrary values:

confluent sr exporter create my-exporter-fail --subjects ":*:" --config config.txt --context-type invalidcontext
Error: Cannot deserialize value of type `ContextType` from String "INVALIDCONTEXT": not one of the values accepted for Enum class: [NONE, CUSTOM, AUTO, DEFAULT]

Update:

confluent sr exporter pause my-exporter
Paused schema exporter "my-exporter".
confluent sr exporter update my-exporter --context-type none
Updated schema exporter "my-exporter".
confluent sr exporter update my-exporter --context-type default
Updated schema exporter "my-exporter".
confluent sr exporter update my-exporter --context-type invalidcontext
Error: Cannot deserialize value of type `ContextType` from String "INVALIDCONTEXT": not one of the values accepted for Enum class: [NONE, CUSTOM, AUTO, DEFAULT]

Copilot AI review requested due to automatic review settings December 5, 2025 20:04
@sgagniere sgagniere requested a review from a team as a code owner December 5, 2025 20:04
@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.

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 --context-type flag description for the Cloud confluent schema-registry exporter create and update commands to include the "default" option, which is already accepted by the backend and documented publicly but was missing from the CLI help text.

Key changes:

  • Modified the addContextTypeFlag function to conditionally include "default" as a valid context type for Cloud environments
  • Updated test fixtures to reflect the new help text output

Reviewed changes

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

Show a summary per file
File Description
internal/schema-registry/command_exporter.go Updated addContextTypeFlag to conditionally add "default" option for Cloud and sort the options alphabetically
internal/schema-registry/command_exporter_create.go Updated call to addContextTypeFlag to pass cloud login status
internal/schema-registry/command_exporter_update.go Updated call to addContextTypeFlag to pass cloud login status
test/fixtures/output/schema-registry/exporter/create-help.golden Updated expected help text to include "default" option
test/fixtures/output/schema-registry/exporter/update-help.golden Updated expected help text to include "default" option

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

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

2 participants