← Back to Pull requests

[ZEPPELIN-6581] Match interpreter search queries literally instead of as regex #5503

Closed
unknown closed this pull request without merging on Sep 27, 2026 07:53 UTC
View on GitHub
unknown unknown commented on Sep 26, 2026 10:05 UTC
Author

What is this PR for?

The New UI interpreter page filters settings by name as the user types, but filterInterpreters() compiled the raw query with new RegExp(value, 'i'). So the search box took regular-expression syntax:

An incomplete metacharacter such as (, [, or a trailing \ threw an uncaught SyntaxError: Invalid regular expression. The list was not updated, so it kept showing the results of the previous query.
A valid metacharacter changed what matched. . matched every interpreter, and sp.rk matched spark.

This PR filters with a case-insensitive literal substring match (name.toLowerCase().includes(query.toLowerCase())). That keeps the case-insensitive behavior ZEPPELIN-6147 added, which was the only reason the RegExp was introduced. ZEPPELIN-6535 (#5320) fixed the same coercion in the Table visualization column filter. This is a separate code path.

Checked in the browser before and after the change (/#/interpreter, 22 settings, anonymous mode):

| Query | Before | After |
|---|---|---|
| ( | SyntaxError: ... /(/i: Unterminated group, list unchanged | 0 items, no error |
| [,
, \ | SyntaxError, list left on the previous query's results | 0 items, no error |
| . | all 22 | 0 items |
| sp.rk | 2 | 0 items |
| spark / SPARK | 2 | 2 |
| cleared | 22 | 22 |

A note on scope. InterpreterSettingManager rejects new setting names outside ^[-_a-zA-Z0-9]+$, and every bundled interpreter group fits that set. So in practice a metacharacter query now matches nothing, where before it threw or matched too much. The test fixtures stay inside that character set, so they do not rely on names the server would reject.

What type of PR is it?

Bug Fix

Todos

[x] Match interpreter search queries literally instead of compiling them as a RegExp
[x] Add unit tests for InterpreterComponent.filterInterpreters

What is the Jira issue?

ZEPPELIN-6581

How should this be tested?

Done:

cd zeppelin-web-angular && npm run test:shell -- src/app/pages/workspace/interpreter/: 8 passed. The new spec covers every acceptance criterion: (, , , . and \ without throwing, literal matching, case-insensitive matching, and restoring the full list when the query is cleared.
Ran the same spec against the unfixed component. The 6 tests for this bug fail for the reason the issue describes: 4 with SyntaxError: Invalid regular expression, and 2 because . and sp.rk still match as patterns. The 2 tests for existing behavior (case-insensitive matching, clearing) pass both before and after.
npm run test:shell: 21 files, 139 tests passed.
npm run lint: exit 0. interpreter.component.ts has one member-ordering warning about the constructor's position, and master has the same warning.
Manual reproduction from the issue: ran a local Zeppelin server with ng serve and drove /#/interpreter with Playwright, before and after. Results are in the table above. Typing sp(ar[k one key at a time also produces no console errors. The other console errors and warnings on page load (codicon.ttf load failure, NG8107, NG0912) appear identically on master.

Not done:

No Playwright e2e spec was added. The behavior is a pure filter function, so per zeppelin-web-angular/AGENTS.md it belongs in a unit test. The template and debounce wiring are unchanged.

Screenshots (if appropriate)

N/A. The before/after table above records the browser run.

Questions:

Does the license files need to update? No. The new spec file has the ASF header.
Is there breaking changes for older versions? Only for anyone who relied on regular-expression syntax in the interpreter search box, which was never documented. ZEPPELIN-6147 introduced the RegExp only to make the search case-insensitive.

  • Does this needs documentation? No.
  • 🤖 Generated with [Claude Code

    Diff: 496 lines (+372 / -124) across 6 files Reviewer: tbonelee Review duration: 1307m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 496 lines diff across 6 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.371
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5503"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.5% (MEDIUM) · Higher = larger blast radius
    47.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.8% · Safe to merge
    18.8%