[ZEPPELIN-6495] Use URLSearchParams in terminal getParams helper #5294
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 287 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.339
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5294"
general
weight: 0.35
ParkGyeongTae
What is this PR for?
The
%sh.terminalfrontend helpergetParams(key)inshell/src/main/resources/html/js/index.jsparsed the query string by hand: it built aRegExpoverlocation.search, sliced it withsubstr(1), and decoded matches with the deprecated globalunescape(...). This is harder to read than the platform API and can diverge from standard URL parsing for encoded/repeated/special characters.This PR replaces that logic with the standard
URLSearchParamsAPI.URLSearchParams.get(key)returnsnullfor missing keys, so the existing behavior for thenoteId/paragraphIdparameters consumed by the terminal page is preserved, while relying on standard URL decoding instead of the deprecatedunescape.The
noteId/paragraphId/tvalues the server generates (seeTerminalInterpreter#createTerminalDashboard) are plain alphanumeric IDs and a numeric timestamp, so decoded values are identical to the previous implementation for all real inputs.What type of PR is it?
Refactoring
Todos
[x] - Replace
substr(...)/unescape(...)ingetParamswithURLSearchParamsWhat is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6495
How should this be tested?
The changed file is a static, vendored frontend resource (
index.js); theshellmodule has no JavaScript test harness (nopackage.json, and the existingTerminalInterpreterTestcovers the Java interpreter, not this script), so no automated JS test is added.Behavior was verified equivalent to the previous implementation:
encoded value (e.g.
%2F) → decoded (/)missing key →
nullempty value (
key=) →""Optional manual check: open a
%sh.terminalparagraph so the terminal dashboard loads...?noteId=<id>¶graphId=<id>&t=<ts>, and confirm the terminal connects andTERMINAL_READYcarries the correctnoteId/paragraphId.Screenshots (if appropriate)
N/A
Questions:
Does the license files need to update? No — the file already carries the Apache License 2.0 header and no new file is added.
Is there breaking changes for older versions? No.