← Back to Pull requests

[ZEPPELIN-6285] Refactor getNotesInfo to improve readability and immutability #5033

Merged
eunaverse merged 1 files (23 lines) on Aug 22, 2025 13:47 UTC
View on GitHub
eunaverse eunaverse commented on Aug 20, 2025 14:51 UTC
Author

What is this PR for?


This PR refactors the getNotesInfo method in NotebookService to improve readability and enforce immutability.
The functional behavior remains unchanged, but the code is now more concise and safer for multi-threaded access.
  • Use Comparator.comparing for cleaner sorting logic

  • Return an unmodifiable list to emphasize immutability

  • Remove redundant condition for improved readability

  • Refactored getNotesInfo to use inline return, eliminating intermediate variables.
  • This change is internal-only and does not affect any runtime behavior or public APIs.

    What type of PR is it?


    Refactoring

    Todos


    [ ] - Task

    What is the Jira issue?


    Zeppelin-6285

    How should this be tested?


    No functional changes; existing tests should pass as-is.

    Screenshots (if appropriate)

    Questions:


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

    Diff: 23 lines (+6 / -17) across 1 files Reviewer: jongyoul Review duration: 2816m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.22) × (1 − Review Confidence (0.78)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.22 · 23 lines diff across 1 files
    0.22
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.66 · 3 substantive comment(s)
    0.66
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    77%
    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.190
    Real PR Conversation Timeline
    7 items
    jongyoul jongyoul approved these changes on Aug 21, 2025 02:58 UTC
    Approved Reviewer

    LGTM. Thank you. looks simple :-) By the way, is there any reason to make the result as immutable list?

    Reamer Reamer commented on Aug 21, 2025 05:54 UTC
    Contributor

    LGTM. Thank you. looks simple :-) By the way, is there any reason to make the result as immutable list?

    Immutable objects offer greater security when working with multiple threads on a list.
    Furthermore, only the NoteManager should be allowed to modify the NoteList.

    Reamer Reamer approved these changes on Aug 21, 2025 05:54 UTC
    Approved Reviewer

    LGTM

    eunaverse eunaverse commented on Aug 21, 2025 13:24 UTC
    Author

    > LGTM. Thank you. looks simple :-) By the way, is there any reason to make the result as immutable list?

    > Immutable objects offer greater security when working with multiple threads on a list. Furthermore, only the NoteManager should be allowed to modify the NoteList.

    Exactly, that was the idea. 😃 Returning an immutable list prevents unintended side effects with ensuring thread-safety and keeps modification logic centralized in NoteManager.

    ParkGyeongTae ParkGyeongTae approved these changes on Aug 22, 2025 13:12 UTC
    Approved Reviewer

    👍 LGTM

    Reamer Reamer commented on Aug 22, 2025 13:48 UTC
    Contributor

    Merged into master and branch-0.12
    Thank you for your contribution.

    Reviewers
    Assignees
    eunaverse eunaverse
    Labels
    risk: low confidence: 77.9% 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: 22% (LOW) · Higher = larger blast radius
    22%
    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: 77.9% · Lower = rushed or shallow review
    77.9%
    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: 4.9% · Safe to merge
    4.9%