Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Handle jmp-client exceptions and introduce a exception handling module#293

Merged
NickCao merged 1 commit intomainfrom
exception-handling-cli-client
Feb 19, 2025
Merged

Handle jmp-client exceptions and introduce a exception handling module#293
NickCao merged 1 commit intomainfrom
exception-handling-cli-client

Conversation

@mangelajo
Copy link
Copy Markdown
Member

@mangelajo mangelajo commented Feb 19, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new client_lease command in the CLI, replacing the previous lease command for a streamlined experience.
  • Bug Fixes / Improvements

    • Enhanced error reporting across client operations for clearer, more actionable messages.
    • Improved error handling for gRPC-related exceptions, providing more specific feedback during connection issues.
    • Upgraded feedback mechanisms during lease and client configuration operations for better guidance.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 19, 2025

Warning

Rate limit exceeded

@mangelajo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 22 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c9a14c7 and d18554f.

📒 Files selected for processing (12)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/__init__.py (2 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py (4 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_lease.py (4 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_login.py (2 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_shell.py (2 hunks)
  • packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py (1 hunks)
  • packages/jumpstarter/jumpstarter/client/exceptions.py (1 hunks)
  • packages/jumpstarter/jumpstarter/client/lease.py (3 hunks)
  • packages/jumpstarter/jumpstarter/common/exceptions.py (1 hunks)
  • packages/jumpstarter/jumpstarter/common/grpc.py (2 hunks)
  • packages/jumpstarter/jumpstarter/config/client.py (2 hunks)
  • packages/jumpstarter/jumpstarter/config/client_config_test.py (1 hunks)

Walkthrough

This pull request introduces a new command client_lease to replace the existing lease command in the Jumpstarter CLI tool. Additionally, several functions across various modules now utilize the @handle_exceptions decorator to standardize error handling. New exception classes and decorators have been implemented to enhance error reporting, particularly for gRPC-related exceptions. The updates also include improvements to logging and environment configuration for gRPC communications, as well as enhanced asynchronous error handling in client configuration.

Changes

File(s) Change Summary
packages/jumpstarter-cli-client/.../__init__.py
packages/jumpstarter-cli-client/.../client_lease.py
packages/jumpstarter-cli-client/.../client_config.py
packages/jumpstarter-cli-client/.../client_shell.py
Renamed the lease command to client_lease in the CLI; added @handle_exceptions decorators to command functions; updated error messages from generic ValueError to more descriptive click.BadParameter errors.
packages/jumpstarter-cli-common/.../exceptions.py Introduced a new exception module with ClickExceptionRed and decorators (handle_exceptions and async_handle_exceptions) to standardize error handling for CLI commands.
packages/jumpstarter/.../client/exceptions.py
packages/jumpstarter/.../client/lease.py
Added the LeaseError exception and updated lease-related methods to use LeaseError instead of ValueError, including wrapping calls with exception translators.
packages/jumpstarter/.../common/exceptions.py
packages/jumpstarter/.../common/grpc.py
Added a new hierarchy of Jumpstarter exceptions and integrated gRPC utilities; updates include configuring gRPC environments and a context manager (translate_grpc_exceptions) to re-map gRPC errors.
packages/jumpstarter/.../config/client.py Enhanced asynchronous client configuration error handling by integrating the translate_grpc_exceptions context manager and improved file handling with FileNotFoundError.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant CLI as Jumpstarter CLI
    participant Cmd as Command Handler (client_lease, client_config, etc.)
    participant EH as Exception Handler (@handle_exceptions)

    U->>CLI: Execute "client_lease list"/"release"/"request"
    CLI->>Cmd: Dispatch command
    Cmd->>EH: Process command (wrapped in @handle_exceptions)
    EH-->>Cmd: Return result or formatted error
    Cmd-->>CLI: Respond with output/error message
    CLI-->>U: Display final output
Loading
sequenceDiagram
    participant C as ClientConfig
    participant gRPC as gRPC Service
    participant TE as Exception Translator (translate_grpc_exceptions)

    C->>TE: Wrap gRPC call with exception translator
    TE->>gRPC: Make lease/config request
    gRPC-->>TE: Return result or throw gRPC error
    TE-->>C: Relay translated ConnectionError/ConfigurationError
Loading

Suggested reviewers

  • NickCao
  • bennyz

Poem

I'm a rabbit in a code field so bright,
Hopping through commands, making error handling light.
client_lease is my new playful tune,
With decorators to catch bugs by noon.
Debugs and leaps, I celebrate at high sight!
🐇💻
Happy coding, day and night!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mangelajo mangelajo force-pushed the exception-handling-cli-client branch from 1ae4d8a to 0e06e4d Compare February 19, 2025 14:26
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 19, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit d18554f
🔍 Latest deploy log https://app.netlify.com/sites/jumpstarter-docs/deploys/67b5fc9e5509020008e434df
😎 Deploy Preview https://deploy-preview-293--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

"""Raised when a file is not found."""
pass

async def async_exception_handling(func):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async def async_exception_handling(func):
async def async_handle_exception(func):

@mangelajo mangelajo changed the title Handle jmp-xlient exceptions and introduce a exception handling module Handle jmp-client exceptions and introduce a exception handling module Feb 19, 2025
@mangelajo mangelajo force-pushed the exception-handling-cli-client branch from 0e06e4d to 78154a7 Compare February 19, 2025 15:20
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🔭 Outside diff range comments (1)
packages/jumpstarter-cli-client/jumpstarter_cli_client/client_lease.py (1)

18-28: 🛠️ Refactor suggestion

Use click.BadParameter for consistent error handling.

For consistency with other commands, replace ValueError with click.BadParameter.

     if not config:
-        raise ValueError("no client specified")
+        raise click.BadParameter(
+            "no client specified, and no default client set: specify a client name, or use jmp client use-config",
+            param_hint="name"
+        )
🧹 Nitpick comments (7)
packages/jumpstarter/jumpstarter/common/grpc.py (1)

49-68: Comprehensive translation of gRPC exceptions
Consider expanding to handle other gRPC status codes (like PERMISSION_DENIED or DEADLINE_EXCEEDED) if they are relevant.

packages/jumpstarter-cli-client/jumpstarter_cli_client/client_shell.py (1)

24-25: Use f-string for better readability.

Consider using an f-string instead of string concatenation for better readability.

-       raise click.BadParameter("no client specified, and no default client set:" +
-                                 "specify a client name, or use jmp client use-config ", param_hint="name")
+       raise click.BadParameter(
+           f"no client specified, and no default client set: specify a client name, or use jmp client use-config",
+           param_hint="name"
+       )
packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py (1)

26-38: Rename for consistency with async version.

For consistency with the async version, consider renaming this decorator to handle_exception (singular).

-def handle_exceptions(func):
+def handle_exception(func):
packages/jumpstarter/jumpstarter/common/exceptions.py (1)

4-26: Extract ANSI color codes as module-level constants.

Consider moving the ANSI color codes to module-level constants for better maintainability and reusability.

+# At the top of the file
+ANSI_RED = "\033[91m"
+ANSI_CLEAR = "\033[0m"
+
 class JumpstarterException(Exception):
     # ... existing code ...
     def print(self, message:str|None = None):
-        ANSI_RED = "\033[91m"
-        ANSI_CLEAR = "\033[0m"
         print(f"{ANSI_RED}{self}{ANSI_CLEAR}", file=sys.stderr)
packages/jumpstarter-cli-client/jumpstarter_cli_client/client_lease.py (3)

12-15: Align command group name with function name.

The command group name ('lease') is inconsistent with the function name ('client_lease'). Consider aligning them for better clarity.

-@click.group(name="lease", cls=AliasedGroup, short_help="")
+@click.group(name="client-lease", cls=AliasedGroup, short_help="")
 def client_lease():

44-45: Use f-strings for better readability.

Replace string concatenation with f-strings for better readability.

-        raise click.BadParameter("no client specified, and no default client set:" +
-                                 "specify a client name, or use jmp client use-config ", param_hint="name")
+        raise click.BadParameter(
+            f"no client specified, and no default client set: specify a client name, or use jmp client use-config",
+            param_hint="name"
+        )

-            raise click.BadParameter("no lease specified, provide one or use --all to release all leases",
-                                    param_hint="lease")
+            raise click.BadParameter(
+                "no lease specified, provide one or use --all to release all leases",
+                param_hint="lease"
+            )

Also applies to: 52-53


88-89: Use f-strings for better readability.

Replace string concatenation with f-strings for better readability.

-        raise click.BadParameter("no client specified, and no default client set:" +
-                                 "specify a client name, or use jmp client use-config ", param_hint="name")
+        raise click.BadParameter(
+            f"no client specified, and no default client set: specify a client name, or use jmp client use-config",
+            param_hint="name"
+        )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ebfd8e and 78154a7.

📒 Files selected for processing (10)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/__init__.py (2 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py (4 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_lease.py (4 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_shell.py (2 hunks)
  • packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py (1 hunks)
  • packages/jumpstarter/jumpstarter/client/exceptions.py (1 hunks)
  • packages/jumpstarter/jumpstarter/client/lease.py (3 hunks)
  • packages/jumpstarter/jumpstarter/common/exceptions.py (1 hunks)
  • packages/jumpstarter/jumpstarter/common/grpc.py (2 hunks)
  • packages/jumpstarter/jumpstarter/config/client.py (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: e2e
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (24)
packages/jumpstarter/jumpstarter/common/grpc.py (4)

3-5: Imports look good
No issues found with adding socket and contextmanager.


10-14: Centralized exception usage and environment configuration
Invoking configure_grpc_env() early ensures consistent logging behavior for all gRPC calls, which is good for debugging and maintenance.


16-29: Robust error handling for insecure connections
Covers parsing errors, DNS resolution failures, and connection refusals with specific exceptions, which is a clear and maintainable approach.


40-48: Well-structured environment configuration
Conditionally setting GRPC_VERBOSITY and GLOG_minloglevel prevents excessive output, benefiting readability of logs.

packages/jumpstarter/jumpstarter/client/exceptions.py (2)

1-2: Base exception import
Properly imports the shared exceptions module to extend its base exception class.


4-5: Specialized exception for lease operations
Clearly indicates lease-related failures and improves error clarity across the codebase.

packages/jumpstarter-cli-client/jumpstarter_cli_client/__init__.py (2)

8-8: Imported client_lease
Successfully replaces the old lease command reference with the new client_lease command.


33-33: Registered the client_lease command
Ensures that the refactored command is now fully integrated into the CLI tool.

packages/jumpstarter-cli-client/jumpstarter_cli_client/client_shell.py (2)

2-2: LGTM!

The import statement is correctly placed and follows Python import conventions.


16-16: LGTM!

The addition of the @handle_exceptions decorator aligns with the PR's objective of standardizing error handling across CLI commands.

packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py (2)

8-10: LGTM!

The ClickExceptionRed class provides a clear visual distinction for errors by formatting messages in red.


12-24: Fix typo in decorator name.

Based on previous review comments, the decorator name should be async_handle_exception (singular) instead of async_handle_exceptions (plural).

-async def async_handle_exceptions(func):
+async def async_handle_exception(func):
packages/jumpstarter/jumpstarter/common/exceptions.py (1)

27-45: LGTM!

The specific exception classes are well-organized, consistently structured, and have clear docstrings explaining their purpose.

packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py (4)

54-54: LGTM! Good error handling improvement.

The @handle_exceptions decorator will ensure consistent error handling for this command.


103-103: LGTM! Good error handling improvement.

The @handle_exceptions decorator will ensure consistent error handling for this command, including any exceptions from set_next_client.


111-111: LGTM! Good error handling improvement.

The @handle_exceptions decorator will ensure consistent error handling for this command, including any file access or user config related exceptions.


137-137: LGTM! Good error handling improvement.

The @handle_exceptions decorator will ensure consistent error handling for this command, including any exceptions from loading or saving user config.

packages/jumpstarter/jumpstarter/client/lease.py (4)

48-56: LGTM! Good gRPC error handling improvement.

The translate_grpc_exceptions context manager will ensure that gRPC exceptions are properly translated into domain-specific exceptions.


60-67: LGTM! Good docstring update.

The docstring now accurately reflects the new exception types that can be raised by the method.


75-77: LGTM! Good docstring update.

The docstring now accurately reflects the new exception types that can be raised by the method.


93-114: LGTM! Good error handling improvements.

The changes improve error handling in multiple ways:

  1. Added translate_grpc_exceptions for gRPC calls
  2. Updated to use domain-specific LeaseError
  3. Enhanced error messages for better clarity
packages/jumpstarter/jumpstarter/config/client.py (3)

93-94: LGTM! Good gRPC error handling improvement.

The translate_grpc_exceptions context manager will ensure that gRPC exceptions are properly translated into domain-specific exceptions.


98-99: LGTM! Good gRPC error handling improvement.

The translate_grpc_exceptions context manager will ensure that gRPC exceptions are properly translated into domain-specific exceptions.


103-104: LGTM! Good gRPC error handling improvement.

The translate_grpc_exceptions context manager will ensure that gRPC exceptions are properly translated into domain-specific exceptions.

@mangelajo mangelajo force-pushed the exception-handling-cli-client branch from 78154a7 to c9a14c7 Compare February 19, 2025 15:28
except JumpstarterException as e:
raise ClickExceptionRed(str(e)) from None
except click.ClickException:
raise # if it was already a click exception from the cli commands, just re-raise it
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just being explicit here (as I could be leaving this to the "except Exception", but I want to make it clear that if we do the Exception later in time, we need to keep raising the ClickExceptions cleanly.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🔭 Outside diff range comments (2)
packages/jumpstarter-cli-client/jumpstarter_cli_client/client_lease.py (2)

27-27: 🛠️ Refactor suggestion

Use click.BadParameter for consistent error handling.

For consistency with other error handling in the codebase, use click.BadParameter instead of ValueError.

-        raise ValueError("no client specified")
+        raise click.BadParameter(
+            "no client specified, and no default client set: specify a client name, or use jmp client use-config",
+            param_hint="name"
+        )

76-80: 🛠️ Refactor suggestion

Update example code in docstring.

The example code in the docstring still uses the old lease command instead of client_lease.

-        $ JMP_LEASE=$(jmp lease request -l label match)
+        $ JMP_LEASE=$(jmp client-lease request -l label match)
         $ jmp shell
         $$ j --help
         $$ exit
-        $ jmp lease release -l "${JMP_LEASE}"
+        $ jmp client-lease release -l "${JMP_LEASE}"
🧹 Nitpick comments (6)
packages/jumpstarter/jumpstarter/common/grpc.py (2)

40-48: Enhance function documentation.

Consider adding a docstring to explain:

  • The purpose of the function
  • The meaning of each environment variable
  • How to enable verbose logging if needed

Example docstring:

 def configure_grpc_env():
+    """Configure gRPC logging environment.
+
+    Sets GRPC_VERBOSITY and GLOG_minloglevel to suppress informative logs
+    by default. To enable verbose logging, set:
+    - GRPC_VERBOSITY to INFO, DEBUG, etc.
+    - GLOG_minloglevel to 0 or 1
+    """

49-68: Improve exception handling.

Two suggestions for improvement:

  1. The catch-all Exception handler is redundant as it simply re-raises the exception.
  2. Consider adding more specific error messages for different gRPC error codes.

Apply this diff to improve the error handling:

 @contextmanager
 def translate_grpc_exceptions():
     """Translate grpc exceptions to JumpstarterExceptions."""
     try:
         yield
     except grpc.aio.AioRpcError as e:
         if e.code().name == "UNAVAILABLE":
             # tls or other connection errors
             raise ConnectionError(f"grpc error: {e.details()}") from None
         if e.code().name == "UNKNOWN":
             # an error returned from our functions
             raise ConnectionError(f"grpc controller responded: {e.details()}") from None
+        if e.code().name == "DEADLINE_EXCEEDED":
+            raise ConnectionError("grpc request timed out") from None
+        if e.code().name == "PERMISSION_DENIED":
+            raise ConnectionError("grpc authentication failed") from None
         else:
-            raise ConnectionError("grpc error") from e
+            raise ConnectionError(f"grpc error: {e.code().name}") from e
     except grpc.RpcError as e:
         raise ConnectionError("grpc error") from e
     except ValueError as e:
         raise ConfigurationError("grpc error") from e
-    except Exception as e:
-        raise e
packages/jumpstarter-cli-client/jumpstarter_cli_client/client_shell.py (1)

24-25: Use f-strings for better readability.

Instead of string concatenation with +, consider using f-strings for better readability.

-       raise click.BadParameter("no client specified, and no default client set:" +
-                                 "specify a client name, or use jmp client use-config ", param_hint="name")
+       raise click.BadParameter(
+           f"no client specified, and no default client set: specify a client name, or use jmp client use-config",
+           param_hint="name"
+       )
packages/jumpstarter-cli-client/jumpstarter_cli_client/client_lease.py (3)

12-13: Update command group name for consistency.

The command group name should be updated to match the function name for consistency.

-@click.group(name="lease", cls=AliasedGroup, short_help="")
+@click.group(name="client-lease", cls=AliasedGroup, short_help="Manage leases held by the current client")
 def client_lease():

44-45: Use f-strings for better readability.

Instead of string concatenation with +, consider using f-strings for better readability.

-        raise click.BadParameter("no client specified, and no default client set:" +
-                                 "specify a client name, or use jmp client use-config ", param_hint="name")
+        raise click.BadParameter(
+            f"no client specified, and no default client set: specify a client name, or use jmp client use-config",
+            param_hint="name"
+        )

88-89: Use f-strings for better readability.

Instead of string concatenation with +, consider using f-strings for better readability.

-        raise click.BadParameter("no client specified, and no default client set:" +
-                                 "specify a client name, or use jmp client use-config ", param_hint="name")
+        raise click.BadParameter(
+            f"no client specified, and no default client set: specify a client name, or use jmp client use-config",
+            param_hint="name"
+        )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78154a7 and c9a14c7.

📒 Files selected for processing (10)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/__init__.py (2 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py (4 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_lease.py (4 hunks)
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_shell.py (2 hunks)
  • packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py (1 hunks)
  • packages/jumpstarter/jumpstarter/client/exceptions.py (1 hunks)
  • packages/jumpstarter/jumpstarter/client/lease.py (3 hunks)
  • packages/jumpstarter/jumpstarter/common/exceptions.py (1 hunks)
  • packages/jumpstarter/jumpstarter/common/grpc.py (2 hunks)
  • packages/jumpstarter/jumpstarter/config/client.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • packages/jumpstarter/jumpstarter/client/exceptions.py
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/init.py
  • packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py
  • packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py
  • packages/jumpstarter/jumpstarter/config/client.py
  • packages/jumpstarter/jumpstarter/client/lease.py
  • packages/jumpstarter/jumpstarter/common/exceptions.py
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: e2e
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
  • GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (5)
packages/jumpstarter/jumpstarter/common/grpc.py (1)

15-29: Review the insecure flag logic.

The code attempts to get the server's SSL certificate even when tls_config.insecure is true. This seems counterintuitive as the "insecure" flag typically implies skipping certificate verification.

Consider if this is the intended behavior. If not, you might want to use grpc.insecure_channel_credentials() instead when insecure is true.

packages/jumpstarter-cli-client/jumpstarter_cli_client/client_shell.py (1)

16-17: LGTM! Good addition of consistent error handling.

The @handle_exceptions decorator ensures consistent error handling across the CLI commands.

packages/jumpstarter-cli-client/jumpstarter_cli_client/client_lease.py (3)

20-21: LGTM! Good addition of consistent error handling.

The @handle_exceptions decorator ensures consistent error handling across the CLI commands.


37-38: LGTM! Good addition of consistent error handling.

The @handle_exceptions decorator ensures consistent error handling across the CLI commands.


60-61: LGTM! Good addition of consistent error handling.

The @handle_exceptions decorator ensures consistent error handling across the CLI commands.

@mangelajo mangelajo force-pushed the exception-handling-cli-client branch 2 times, most recently from 43f17bf to cb4f26c Compare February 19, 2025 15:43
@mangelajo mangelajo requested a review from NickCao February 19, 2025 15:43
@mangelajo mangelajo force-pushed the exception-handling-cli-client branch from cb4f26c to d18554f Compare February 19, 2025 15:45
@NickCao NickCao merged commit 38543ce into main Feb 19, 2025
@NickCao NickCao deleted the exception-handling-cli-client branch February 19, 2025 20:11
@mangelajo mangelajo added this to the 0.6.0 milestone May 8, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Jul 8, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Oct 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants