-
Notifications
You must be signed in to change notification settings - Fork 6
Enhance CLI command structure and output options #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added aliases for existing commands in the CLI for improved usability, allowing commands like `project`, `profiles`, and `property` to be recognized alongside their original names. - Introduced an `--output-mode` option in the `init` and `status` commands to support both table and JSON formats, enhancing user experience and data accessibility. - Implemented validation to ensure JSON output mode is only used in non-interactive mode, providing clear error messages for incorrect usage. - Updated error handling in the `init` command to return structured JSON responses for various validation errors, improving consistency in user feedback. - Enhanced unit tests to cover new output modes and validation scenarios, ensuring robust functionality and error handling across commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances the CLI command structure and output options by adding aliases for commands and introducing JSON output support with proper validation. The main purpose is to improve usability through command aliases and provide structured JSON responses for automation and scripting scenarios.
- Added aliases for existing CLI commands (
project,profiles,property, etc.) to improve discoverability - Introduced
--output-modeoption supporting both table and JSON formats forinitandstatuscommands - Implemented validation ensuring JSON output only works in non-interactive mode with clear error handling
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/workato_platform/cli/init.py | Added command aliases for better usability |
| src/workato_platform/cli/commands/init.py | Enhanced init command with JSON output mode and validation |
| src/workato_platform/cli/commands/profiles.py | Added status command with JSON output support |
| src/workato_platform/cli/utils/exception_handler.py | Updated exception handling to support JSON output mode |
| src/workato_platform/cli/utils/config/manager.py | Updated configuration manager with SSL certificate validation |
| src/workato_platform/cli/commands/pull.py | Modified pull command to support non-interactive mode |
| tests/unit/commands/test_init.py | Added comprehensive tests for new init command features |
| tests/unit/commands/test_profiles.py | Added tests for status command JSON output |
| tests/unit/utils/test_exception_handler.py | Added tests for JSON exception handling |
| tests/unit/config/test_manager.py | Updated configuration manager tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- Eliminated unnecessary imports of `json` and `StringIO` in the `test_init.py` file, streamlining the test code and improving readability. - Updated test functions to maintain functionality while enhancing clarity and maintainability.
oalami
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/workato_platform/cli/utils/config/manager.py:1
- Using
model_construct()instead of the default constructor may bypass validation. Consider usingConfigData()unless there's a specific reason to skip validation.
"""Main configuration manager with simplified workspace rules."""
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
project,profiles, andpropertyto be recognized alongside their original names.--output-modeoption in theinitandstatuscommands to support both table and JSON formats, enhancing user experience and data accessibility.initcommand to return structured JSON responses for various validation errors, improving consistency in user feedback.