Skip to content

[ZEPPELIN-6663] Mark CompletionItem.meta optional to match completion payloads - #5519

Merged
tbonelee merged 1 commit into
apache:masterfrom
JangAyeon:ZEPPELIN-6663
Oct 2, 2026
Merged

tbonelee merged 1 commit into
apache:masterfrom
JangAyeon:ZEPPELIN-6663

Conversation

@JangAyeon

Copy link
Copy Markdown
Contributor

What is this PR for?

CompletionItem.meta is declared as required in the SDK, but real completion payloads from the Spark and Flink interpreters omit the meta key. This PR makes only meta optional, keeps name and value required, 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 meta is absent on the wire

  • The following interpreters construct new InterpreterCompletion(name, value, null):
    • SparkScala212Interpreter.scala:117
    • SparkScala213Interpreter.scala:142
    • FlinkScala212Interpreter.scala:39
  • NotebookServer.java:142-146 builds Gson without serializeNulls(), so null fields are dropped.
  • serializeMessage() uses that Gson (NotebookServer.java:633-635). The completion reply is sent through it at NotebookServer.java:1372-1374, so these payloads contain no meta key at all (not meta: null).
  • The Jupyter path supplies an empty string (JupyterKernelInterpreter.java:367), so this PR does not claim every payload omits meta. It only makes the shared type accept the proven Spark/Flink shape.

Why name and value stay required

  • All current production construction sites supply both fields.
  • The New UI reads name without a fallback (completion.service.ts:82-83).

What type of PR is it?

Improvement

Todos

  • Make CompletionItem.meta optional (meta?: string)
  • Add projects/zeppelin-sdk/type-tests/completion-item-meta.ts
  • Include type-tests/**/*.ts in projects/zeppelin-sdk/tsconfig.spec.json

What 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-contract
  • The fixture assigns a literal with name and value but no meta to CompletionItem without a type assertion.
  • @ts-expect-error cases reject literals missing name or value, so neither field can become optional by accident.
  • The issue suggests a new tsconfig.type-tests.json and a new script. Instead, this PR adds type-tests/**/*.ts to the existing projects/zeppelin-sdk/tsconfig.spec.json.
    • The existing typecheck:sdk-contracts script already type-checks that config.
    • zeppelin-web-angular/pom.xml already runs npm run typecheck:sdk-contracts in the Maven test phase (npm typecheck sdk contracts execution).
    • So the regression runs in the existing Maven/frontend build path without changing package.json, and without running the same typecheck twice through build-project:sdk.
  • check:websocket-contract does not inspect field optionality. It is only a guard against unrelated operation-map regressions.

Screenshots (if appropriate)

N/A

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

@tbonelee
tbonelee merged commit 1dc3d4f into apache:master Oct 2, 2026
24 checks passed
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