Skip to content

Conversation

@nishithakbhaskaran
Copy link

No description provided.

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 6, 2025

Reviewer's Guide

Refactors launcher CLI by separating process handling from option parsing, introduces a centralized command dispatcher and simpler argument parsing, updates Jetty resolver method signature, and adjusts dependency versions.

Sequence diagram for centralized command dispatch in launcher

sequenceDiagram
    participant User
    participant Launcher
    participant Process
    User->>Launcher: Provide command and options
    Launcher->>Launcher: Parse arguments
    Launcher->>Process: Instantiate Process with pid_file
    alt run/start
        Launcher->>Process: run()/start()
    else stop/kill/status
        Launcher->>Process: stop()/kill()/status()
    end
Loading

Class diagram for refactored launcher command handling

classDiagram
    class Options {
        +verbose
        +install_path
        +launcher_config
        +etc_dir
        +node_config
        +jvm_config
        +config_path
        +log_levels
        +log_levels_set
        +data_dir
        +pid_file
        +launcher_log
        +server_log
        +properties
        +arguments
    }
    class Process {
        +pid_file
        +alive()
        +read_pid()
        +write_pid(pid)
    }
    class Launcher {
        +main()
        +handle_command(command, options)
        +run(process, options)
        +start(process, options)
        +stop(process)
        +kill(process)
        +restart(process, options)
        +status(process)
    }
    Options <.. Launcher : uses
    Process <.. Launcher : uses
Loading

Class diagram for updated JettyAsyncSocketAddressResolver method signature

classDiagram
    class JettyAsyncSocketAddressResolver {
        +resolve(host, port, promise)
    }
    class BaseResolver {
        +resolve(host, port, promise)
    }
    JettyAsyncSocketAddressResolver --|> BaseResolver
Loading

File-Level Changes

Change Details Files
Decouple process management and unify command dispatch in launcher.py
  • Extracted COMMANDS list
  • Changed run/start functions to accept process parameter
  • Renamed _terminate to terminate and reused in stop/kill
  • Added handle_command to dispatch based on command
  • Replaced subparsers with OptionParser and manual command validation
launcher.py
Adjust JettyAsyncSocketAddressResolver.resolve signature
  • Removed unused context parameter
  • Updated super.resolve invocation accordingly
JettyAsyncSocketAddressResolver.java
Update dependency versions in pom.xml
  • Downgraded Jetty from 12.1.1 to 12.0.18
  • Downgraded slf4j-api from 2.0.17 to 2.0.16
pom.xml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant