← Back to Pull requests

[ZEPPELIN-5989] Resolve a local notebook dir as a file path instead of parsing it as a URI #5518

Closed
unknown closed this pull request without merging on Oct 05, 2026 05:01 UTC
View on GitHub
unknown unknown commented on Sep 30, 2026 09:34 UTC
Author

What is this PR for?

VFSNotebookRepo.setNotebookDirectory() parses the notebook dir with new URI() unless it is a Windows absolute path like C:\.... A local path is not a URI and can contain characters that a URI does not allow:

On Windows the default dir is built as ./ + \ + notebook, so the server fails to start with URISyntaxException: Illegal character in path at index 2: ./\notebook.
On any OS, a dir with a space, like /home/me/My Notebooks, fails the same way.

The issue suggests joining the dir with Paths.get, but on Windows that gives .\notebook, which new URI() rejects too.

This PR:

Resolves a notebook dir without a scheme as a file path, new File(getAbsoluteDir(path)).toURI(), and parses only a dir with a scheme as a URI. The branch that handled a URI without a scheme is removed, since that case no longer reaches it.
Keeps rootNotebookFolder as a decoded path for a local dir. It was the root's URI with file:/// replaced, so it kept %20 for a space. list() strips it from note file names that are decoded since ZEPPELIN-6202, which would shift note paths by two characters per space, and GitNotebookRepo opens the repository at rootNotebookFolder/.git, which would be a different directory. list() now resolves the root by its URI instead of by this path. A dir with another scheme keeps its current value.

For a local dir without such characters, both values are the same as before.

I could not run it on Windows. On other systems the same code path is reached with a space, and Commons VFS treats a backslash in the file URI as a separator. It would help if someone on Windows could start the server from this branch without a configuration file, which is how the issue reproduces it.

What type of PR is it?


Bug Fix

What is the Jira issue?


https://issues.apache.org/jira/browse/ZEPPELIN-5989

How should this be tested?

VFSNotebookRepoTest.testNotebookDirWithCharactersThatAUriDoesNotAllow uses a dir with a space and one with a backslash, saves and lists a note, and checks its path.

  • GitNotebookRepoTest.notebookDirWithSpace checks that .git is created in the dir with a space and that a checkpoint is recorded.
  • Without the first change both tests fail with the URISyntaxException above; without the second the path and .git checks fail.

    Run locally: VFSNotebookRepoTest (8), GitNotebookRepoTest (12), NotebookRepoSyncTest (10), NotebookServiceTest (13), NotebookServiceRaceConditionTest (1), NoteManagerMoveResaveRaceTest (1), NotebookTest (42). testSchedule, testScheduleDisabledWithName and testSchedulePoolUsage fail locally with and without this change: they wait five seconds for the cron run, and the interpreter process here takes about six seconds to sync its libraries and register.

    Diff: 353 lines (+264 / -89) across 4 files Reviewer: jongyoul Review duration: 6926m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 353 lines diff across 4 files
    0.42
    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.351
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5518"
    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: 42.5% (MEDIUM) · Higher = larger blast radius
    42.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: 16.8% · Safe to merge
    16.8%