[ZEPPELIN-6663] Mark CompletionItem.meta optional to match completion payloads - #5519
Merged
Merged
Conversation
tbonelee
approved these changes
Oct 2, 2026
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.
What is this PR for?
CompletionItem.metais declared as required in the SDK, but real completion payloads from the Spark and Flink interpreters omit themetakey. This PR makes onlymetaoptional, keepsnameandvaluerequired, and adds a compile-time regression fixture that runs as part of the existing SDK contract typecheck (typecheck:sdk-contracts).Part of ZEPPELIN-6627.
Why
metais absent on the wirenew InterpreterCompletion(name, value, null):SparkScala212Interpreter.scala:117SparkScala213Interpreter.scala:142FlinkScala212Interpreter.scala:39NotebookServer.java:142-146builds Gson withoutserializeNulls(), so null fields are dropped.serializeMessage()uses that Gson (NotebookServer.java:633-635). The completion reply is sent through it atNotebookServer.java:1372-1374, so these payloads contain nometakey at all (notmeta: null).JupyterKernelInterpreter.java:367), so this PR does not claim every payload omitsmeta. It only makes the shared type accept the proven Spark/Flink shape.Why
nameandvaluestay requirednamewithout a fallback (completion.service.ts:82-83).What type of PR is it?
Improvement
Todos
CompletionItem.metaoptional (meta?: string)projects/zeppelin-sdk/type-tests/completion-item-meta.tstype-tests/**/*.tsinprojects/zeppelin-sdk/tsconfig.spec.jsonWhat is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6663
How should this be tested?
cd zeppelin-web-angular npm run typecheck:sdk-contracts npm run build-project:sdk npm run check:websocket-contractnameandvaluebut nometatoCompletionItemwithout a type assertion.@ts-expect-errorcases reject literals missingnameorvalue, so neither field can become optional by accident.tsconfig.type-tests.jsonand a new script. Instead, this PR addstype-tests/**/*.tsto the existingprojects/zeppelin-sdk/tsconfig.spec.json.typecheck:sdk-contractsscript already type-checks that config.zeppelin-web-angular/pom.xmlalready runsnpm run typecheck:sdk-contractsin the Maventestphase (npm typecheck sdk contractsexecution).package.json, and without running the same typecheck twice throughbuild-project:sdk.check:websocket-contractdoes not inspect field optionality. It is only a guard against unrelated operation-map regressions.Screenshots (if appropriate)
N/A
Questions: