Skip to content

Fixes #25434: allow empty Kafka schema registry suffix#27496

Open
himanshu748 wants to merge 3 commits intoopen-metadata:mainfrom
himanshu748:hackathon/fixes-25434-kafka-empty-suffix
Open

Fixes #25434: allow empty Kafka schema registry suffix#27496
himanshu748 wants to merge 3 commits intoopen-metadata:mainfrom
himanshu748:hackathon/fixes-25434-kafka-empty-suffix

Conversation

@himanshu748
Copy link
Copy Markdown

Describe your changes:

Fixes #25434

Kafka schema registries sometimes do not use a topic suffix (e.g. -value). The UI connection form currently restores the schema default (-value) when the field is cleared, making it impossible to persist an explicitly empty suffix.

This change sets ui:emptyValue for schemaRegistryTopicSuffixName on the Kafka connection form so a cleared input is submitted as an explicit empty string.

Testing

  • Unit: MessagingServiceUtils config includes ui:emptyValue override for Kafka.

Type of change:

  • Bug fix

Checklist:

Hackathon / AI disclosure

Built with Cursor (AI-assisted) and manually reviewed.

Made with Cursor

Allow saving an explicit empty schemaRegistryTopicSuffixName in the Kafka connection form by using rjsf ui:emptyValue, preventing the schema default (-value) from being restored.

Made-with: Cursor
@himanshu748 himanshu748 requested a review from a team as a code owner April 17, 2026 18:27
Copilot AI review requested due to automatic review settings April 17, 2026 18:27
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copy link
Copy Markdown
Contributor

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

Enables Kafka connection forms to persist an explicitly empty schemaRegistryTopicSuffixName by configuring the RJSF UI schema to submit an empty string (instead of omitting the field and re-applying the schema default).

Changes:

  • Add a Kafka-specific uiSchema override setting ui:emptyValue for schemaRegistryTopicSuffixName.
  • Add unit tests for getMessagingConfig covering Kafka and other messaging connector types.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
openmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.ts Adds ui:emptyValue override for Kafka so clearing the suffix field persists as ''.
openmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.test.ts Adds unit coverage asserting the Kafka config includes the ui:emptyValue override.
Comments suppressed due to low confidence (1)

openmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.ts:60

  • schemaRegistryTopicSuffixName also exists in the Redpanda connection schema with the same default of "-value" (see openmetadata-spec/.../redpandaConnection.json). With the current change, Redpanda users will likely still be unable to persist an explicitly empty suffix for the same reason Kafka was affected. Consider applying the same ui:emptyValue: '' override for MessagingServiceType.Redpanda (and updating the corresponding test expectation) so behavior is consistent across messaging connectors that expose this field.
  switch (type) {
    case MessagingServiceType.Kafka:
      schema = kafkaConnection;
      /**
       * By default, rjsf may treat an empty text input as `undefined` and omit the field
       * from the submitted payload. Since the Kafka connection schema has a default
       * `schemaRegistryTopicSuffixName` of "-value", omitting the field causes the
       * value to be restored to the default after saving.
       *
       * Setting `ui:emptyValue` ensures a cleared input is persisted as an explicit
       * empty string.
       */
      Object.assign(uiSchema, {
        schemaRegistryTopicSuffixName: { 'ui:emptyValue': '' },
      });

      break;

    case MessagingServiceType.Redpanda:
      schema = redpandaConnection;

Comment on lines +36 to +41
it('getMessagingConfig should return correct config for Redpanda connector', () => {
const config = getMessagingConfig(MessagingServiceType.Redpanda);

expect(config).toEqual({
schema: { ...redpandaConnection },
uiSchema: { ...COMMON_UI_SCHEMA },
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

This test currently asserts Redpanda returns the unmodified COMMON_UI_SCHEMA. If you extend the ui:emptyValue fix to MessagingServiceType.Redpanda (recommended since Redpanda also defaults schemaRegistryTopicSuffixName to "-value"), update this expectation to include the override as well; otherwise the test will lock in the inconsistent behavior.

Suggested change
it('getMessagingConfig should return correct config for Redpanda connector', () => {
const config = getMessagingConfig(MessagingServiceType.Redpanda);
expect(config).toEqual({
schema: { ...redpandaConnection },
uiSchema: { ...COMMON_UI_SCHEMA },
it('getMessagingConfig should return correct config for Redpanda connector and preserve empty schema suffix', () => {
const config = getMessagingConfig(MessagingServiceType.Redpanda);
expect(config).toEqual({
schema: { ...redpandaConnection },
uiSchema: {
...COMMON_UI_SCHEMA,
schemaRegistryTopicSuffixName: { 'ui:emptyValue': '' },
},

Copilot uses AI. Check for mistakes.
@himanshu748
Copy link
Copy Markdown
Author

Hi! This PR is ready for CI. Could a maintainer please add the label so the workflows can run? (Currently failing at the label gate.) Thanks!

@himanshu748
Copy link
Copy Markdown
Author

Hi! This PR is ready for CI. Could a maintainer please add the safe to test label so the workflows can run? (They currently fail at the PR-label gate.) Thanks!

Apply the same rjsf ui:emptyValue override used for Kafka to Redpanda, since the connection schema defines the same default (-value).

Made-with: Cursor
@himanshu748
Copy link
Copy Markdown
Author

Addressed Copilot review suggestion: applied the same override to Redpanda as well (schema has the same default ).

@himanshu748
Copy link
Copy Markdown
Author

Addressed Copilot review suggestion: applied the same ui:emptyValue: '' override to Redpanda as well (schema has the same default -value).

@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI review requested due to automatic review settings April 17, 2026 18:47
@himanshu748
Copy link
Copy Markdown
Author

Gitar suggestion addressed: added a brief comment explaining why the Redpanda override exists (same rationale as Kafka).

@himanshu748
Copy link
Copy Markdown
Author

Gitar suggestion addressed: added a brief comment explaining why the Redpanda ui:emptyValue override exists (same rationale as Kafka).

@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 17, 2026

Code Review ✅ Approved 1 resolved / 1 findings

Allows an empty Kafka schema registry suffix to resolve configuration constraints. Added an explanatory comment to the Redpanda case to match existing documentation.

✅ 1 resolved
Quality: Redpanda case missing explanatory comment unlike Kafka case

📄 openmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.ts:61-63
The Kafka case (lines 44-55) has a detailed comment explaining why ui:emptyValue is needed, but the identical Redpanda case (lines 61-63) added in this commit has no comment. Since the rationale is the same, a brief comment (or extracting the shared logic) would help future maintainers understand why this override exists for Redpanda too.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

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

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

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.

Cannot set Kafka connection schemaRegistryTopicSuffixName parameter to an empty string

2 participants