feat(produce): schema-aware Produce Record UI (UX-1292)#2462
Open
c-julin wants to merge 3 commits into
Open
Conversation
Frontend half of the schema-aware Produce Record flow (stacked on the backend PR). - topic-produce: subject + version selection, encoding-aware schema picker, Protobuf message-type dropdown reading off the new messageTypes field on subject details, sample-JSON generation via GenerateSchemaSample. - backend-api / rest-interfaces: new SchemaMessageType type + messageTypes field on SchemaRegistryVersionedSchema; supporting REST bindings for the schemas / subject-types endpoints.
A subject's compatible schema set is encoding-specific (Avro vs Protobuf vs JSON Schema), so any pre-selected subject/version becomes stale the moment the user changes encoding. Reset key/value schemaName, schemaVersion, and protobufIndexPath on encoding change so the dropdown re-populates from the encoding-filtered subject list.
Addresses adversarial code review findings on PR #2462: - Stale refreshSchemaDetails-response guard on both schemaName onChange handlers: if the user switches subject while a fetch is in flight, drop the response instead of overwriting the new selection's version and message-type. - Submit-time validation: block publish when the encoding requires a schema but schemaName/schemaVersion are missing or schemaId hasn't resolved yet. Without this the form silently submitted with encoding=PROTOBUF and no schema_id, producing a confusing backend error. - Auto-detect on mount no longer clobbers user edits: a getValues() check bails out if the user has already changed encoding or picked a subject/version while the detection fetch was in flight. - Auto-detect now calls applyDefaultMessageType for Protobuf subjects so the message-type picker isn't left blank after a successful detection. - generateSchemaSample errors surface as toasts via formatToastErrorMessageGRPC instead of being silently swallowed.
97ae5d7 to
034fabe
Compare
| if (t === SchemaType.PROTOBUF) { | ||
| return PayloadEncoding.PROTOBUF; | ||
| } | ||
| if (t === SchemaType.AVRO) { |
Contributor
There was a problem hiding this comment.
I could try to add support for avro to use proto form hook or auto form component if that helps, then we could indeed use it here E2E, WDYT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Frontend half of the schema-aware Produce Record flow. Stacked on #2461 — review/merge the backend PR first; this branch's diff against master collapses to just the UI changes once that lands.
topic-produce.tsx— subject + version selection, encoding-aware schema picker, Protobuf message-type dropdown reading off the newmessageTypesfield on subject details, sample-JSON generation viaGenerateSchemaSample.backend-api/rest-interfaces— newSchemaMessageTypetype +messageTypesfield onSchemaRegistryVersionedSchema; supporting REST bindings for the schemas / subject-types endpoints.useEffectadded.Test plan