tbonelee opened a new pull request, #5265: URL: https://github.com/apache/zeppelin/pull/5265
### What is this PR for? Numeric interpreter properties edited in the new Angular UI are sent to the server as JSON numbers. Gson deserializes untyped JSON numbers as `Double`, so a value like `60000` is stored and later stringified as `"60000.0"`, which breaks `Long`/`Integer` parsing in interpreters such as JDBC (`java.lang.NumberFormatException: For input string: "60000.0"`, see ZEPPELIN-6395). The server-side mitigation added in ZEPPELIN-6131 (`UpdateInterpreterSettingRequest#getProperties` converting whole-number Doubles back to Int) only covers the update path — creating a new interpreter (`NewInterpreterSettingRequest`) is still affected, so the bug is fixed here on the client side, covering both POST and PUT. The root cause is that `InterpreterItemComponent` still uses `UntypedFormBuilder` (a leftover from the Angular 21 migration in ZEPPELIN-6424), so nothing constrains what type each property value has when the form is serialized. This PR converts the component to Angular typed reactive forms and fixes the serialization at the boundary: - Non-checkbox property values are sent as strings (`60000` → `"60000"`), matching what the classic UI has always done with its text-based number widget. - Checkbox properties keep real booleans, also matching the classic UI (`editable-checkbox` binds a boolean). Values previously persisted as `"true"`/`"false"` strings by corrupted round-trips are normalized back to booleans on the next save. - New request DTOs (`InterpreterSettingRequest` / `InterpreterPropertyValue` / `InterpreterSettingOption`) mirror exactly the fields the server reads in `InterpreterOption.java`. The UI-only `session`/`process` fields — leftovers from the pre-0.7 boolean isolation model replaced by `perNote`/`perUser` in ZEPPELIN-1210, which the server has silently dropped ever since — are no longer sent (a TODO is left to remove the dead form controls in a follow-up). - The `Properties` interface had incorrect types (`value: boolean`, `type: string`); they are corrected to the actual union, and response option fields that Gson omits when `null` (`host`, `owners`, `perNote`, `perUser`) are marked optional. Gson serialization of `InterpreterOption` was verified empirically: primitive `boolean`/`int` fields are always present, `String`/`List` fields are omitted when null, and a `port: null` in the request safely keeps the server default `-1`. This is an alternative to #5147, which stringifies all property values including checkbox booleans. Persisting `false` as the string `"false"` causes a regression on reload: the non-empty string is truthy, so a saved-unchecked checkbox renders as checked, and it also diverges from the classic UI which keeps checkbox values as booleans. This PR fixes the same `NumberFormatException` while keeping checkbox round-trips correct. Credit to @kevinjmh for the original diagnosis in ZEPPELIN-6395. ### What type of PR is it? Improvement ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-6427 (fixes https://issues.apache.org/jira/browse/ZEPPELIN-6395) ### How should this be tested? `zeppelin-web-angular` currently has no unit test infrastructure (no spec files or test runner; only Playwright e2e), so the change is verified by `ng build` (strict + strictTemplates, 0 errors), `eslint`/`prettier` (clean), and the following manual flows against a running server: 1. Edit a JDBC interpreter, set `zeppelin.jdbc.maxConnLifetime = 60000`, save → the PUT payload and `conf/interpreter.json` contain `"value": "60000"` (not `60000.0`), and running a JDBC paragraph no longer throws `NumberFormatException`. 2. Create a new interpreter with a numeric property → the POST payload contains the string value (the path not covered by ZEPPELIN-6131). 3. Save a checkbox property as unchecked, reload the page → the checkbox is still unchecked, and the payload contains boolean `false` (with #5147's approach it would be the string `"false"` and render as checked). 4. Manually corrupt a checkbox value in `conf/interpreter.json` to `"value": "false"` (string), restart, open and save the interpreter → the value is normalized back to boolean `false`. 5. Regression pass over the form flows: create with group switching (default properties reload), duplicate-name validation, property add/update/remove, dependency add with exclusions (`a:b,c:d` → `["a:b","c:d"]`), Globally/Per Note/Per User option switching, edit/cancel restoring previous values, and view-mode rendering (password masking, URL links). ### Screenshots (if appropriate) N/A ### Questions: * Does the license files need to update? No * Is there breaking changes for older versions? No — numeric property values are now sent as strings exactly like the classic UI, and the dropped `session`/`process` request keys were never read by the server. * Does this needs documentation? No -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
