Fixes #25434: Preserve empty string for Kafka schemaRegistryTopicSuffixName#27015
Conversation
…stryTopicSuffixName
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
There was a problem hiding this comment.
Pull request overview
This PR fixes an OpenMetadata UI bug where clearing schemaRegistryTopicSuffixName in Kafka/Redpanda connections could not be persisted because RJSF converted an empty string input to undefined, causing the backend update merge to retain the prior/default value.
Changes:
- Add an RJSF
ui:emptyValue: ''override forschemaRegistryTopicSuffixNamein Kafka and Redpanda messaging connection UI schemas. - Add unit tests to verify the override is present for Kafka/Redpanda, absent for non-broker services, and that invalid service types return only the common UI schema.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.ts | Extends Kafka/Redpanda uiSchema to preserve empty string values for schemaRegistryTopicSuffixName via ui:emptyValue. |
| openmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.test.ts | Adds focused unit tests validating the new uiSchema behavior across service types and default handling. |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Bug #25434 — Kafka schemaRegistryTopicSuffixName cannot be cleared Running vanilla OpenMetadata 1.11.7 in Docker (docker.getcollate.io/openmetadata/server:1.11.7). I create a Kafka messaging service with schemaRegistryTopicSuffixName = -value, then edit the connection, clear the field, and save. On re-opening the Edit Connection dialog, the field still shows -value — the clear silently failed. Root cause: the RJSF uiSchema for Kafka/Redpanda has no ui:emptyValue hint, so RJSF treats the empty string as undefined and omits the field from the PATCH payload. The backend never receives the update and keeps the stale value. kafkabug.mp4 |
|
Same Docker backend (OpenMetadata 1.11.7) — only the UI layer is swapped for the Vite dev server running this branch. The fix adds { 'ui:emptyValue': '' } to the uiSchema for schemaRegistryTopicSuffixName on both Kafka and Redpanda messaging services ( I repeat the same flow from Video 1: open the existing Kafka service, clear the field, save, and re-open. The field is now correctly empty — RJSF submits "" instead of dropping the property, so the backend persists the clear. Coverage: 4 new Jest tests in MessagingServiceUtils.test.ts — 2 positive (Kafka + Redpanda get the emptyValue hint) and 2 negative regression guards (Kinesis and invalid types don't). All 4 pass. kafkafix.mp4 |
|
Hey @RajdeepKushwaha5, Awesome work. Can we also add playwright coverage for the same? I think you can just add the test case in existing ServiceForm.spec.ts. |
…xName (open-metadata#25434) Adds a regression test in ServiceForm.spec.ts that creates a Kafka messaging service with schemaRegistryTopicSuffixName='-value', clears the field in the edit-connection form, and asserts the PATCH payload carries an explicit empty string and that the cleared value persists on reload. Addresses review feedback on PR open-metadata#27015 requesting Playwright coverage.
Thanks for the review, @aniketkatkar97! I've pushed The test covers the exact user flow from the bug report: Creates a Kafka messaging service via API with |
| // Regression coverage for issue #25434 (PR #27015): | ||
| // Clearing `schemaRegistryTopicSuffixName` on a Kafka connection must | ||
| // send an empty string to the backend instead of dropping the field, | ||
| // so the cleared value is persisted on reload. | ||
| test.describe('Kafka', () => { |
There was a problem hiding this comment.
The PR description’s “Files changed” list omits this Playwright spec update. Please update the PR description to include openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/ServiceForm.spec.ts so reviewers/maintainers can see the added E2E regression coverage at a glance.
…a.constant per Copilot review
Code Review ✅ ApprovedExplicitly preserves empty strings for the Kafka schemaRegistryTopicSuffixName configuration. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
…ixName (#27015) * Fixes #25434: Preserve empty string for Kafka schemaRegistryTopicSuffixName * test(e2e): add Playwright coverage for empty schemaRegistryTopicSuffixName (#25434) Adds a regression test in ServiceForm.spec.ts that creates a Kafka messaging service with schemaRegistryTopicSuffixName='-value', clears the field in the edit-connection form, and asserts the PATCH payload carries an explicit empty string and that the cleared value persists on reload. Addresses review feedback on PR #27015 requesting Playwright coverage. * style: apply prettier formatting to ServiceForm.spec.ts * style: drop PR number from regression comment per Copilot review * fix(test): import COMMON_UI_SCHEMA from non-deprecated ServiceUISchema.constant per Copilot review
|
Cherry-picked to 1.13 |



Describe your changes:
Fixes #25434
What changes did you make?
When editing a Kafka or Redpanda connection, clearing the
schemaRegistryTopicSuffixNamefield to an empty string reverts it to the schema default"-value"after saving. This prevents users whose Kafka schema registry does not use topic suffixes from configuring the connection correctly.Root cause: RJSF (React JSON Schema Form) converts empty text inputs to
undefined, which removes the field fromformData. During the connection update merge, the old value ("-value") is preserved via object spread from the existing config. The backend never receives the empty string.Fix: Added
'ui:emptyValue': ''to the RJSFuiSchemafor theschemaRegistryTopicSuffixNamefield in both Kafka and Redpanda connection configs. This instructs RJSF to use an empty string ("") instead ofundefinedwhen the user clears the field, so the empty value is properly included in the form data and sent to the backend.How did you test your changes?
MessagingServiceUtils.test.tsverifying:ui:emptyValue: ""forschemaRegistryTopicSuffixNameui:emptyValue: ""forschemaRegistryTopicSuffixNameFiles changed:
openmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.ts— AddedSCHEMA_REGISTRY_SUFFIX_UI_SCHEMAconstant withui:emptyValueand applied it to Kafka/Redpanda casesopenmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.test.ts— New test file covering the fixType of change:
Checklist:
Fixes <issue-number>: <short explanation>Summary by Gitar
COMMON_UI_SCHEMAto point toServiceUISchema.constant.retValreturn logic inMessagingServiceUtils.tsto handle undefined checks more explicitly.This will update automatically on new commits.