Skip to content
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

AQUA CLI: Improve handling error and Add new flags #810

Merged
merged 5 commits into from
May 3, 2024

Conversation

mingkang111
Copy link
Member

@mingkang111 mingkang111 commented Apr 27, 2024

Description

This PR aims to:

  • provide the --verbose and --debug flag to set aqua logging level to INFO and DEBUG respectively.
  • Improve CLI error handling: gracefully exit when encounter error.
  • Improve CLI test

User experience

ads aqua model get <ocid> --verbose
ads aqua model get <ocid> --debug

If user provide two flags together, it will no proceed. e.g.:

ads aqua model get <ocid> --debug --verbose

>>> ERROR:ads:Cannot use `--debug` and `--verbose` at the same time. Please select either `--debug` for `DEBUG` level logging or `--verbose` for `INFO` level logging.

Priority betweem --verbose/--debug and --log-level

When user explicitly use --verbose/--debug flag, CLI will take the flag to set the logging level. --log-level can be use without --verbose/--debug.

Test

Screenshot 2024-04-29 at 18 30 18

Future work

Define exit_code for each AquaError. We need to have a table to show the mapping for AquaError with Http status code and cli exit code.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 27, 2024
@mingkang111 mingkang111 changed the title AQUA CLI: Add flag --verbose and --debug [WIP]AQUA CLI: Add flag --verbose and --debug Apr 27, 2024
@mingkang111 mingkang111 changed the title [WIP]AQUA CLI: Add flag --verbose and --debug AQUA CLI: Improve handling error and Add flag --verbose and --debug Apr 29, 2024
@mingkang111 mingkang111 changed the title AQUA CLI: Improve handling error and Add flag --verbose and --debug AQUA CLI: Improve handling error and Add new flags Apr 29, 2024
@mingkang111 mingkang111 merged commit 89863db into feature/aquav1.0.2 May 3, 2024
1 of 2 checks passed
@mingkang111 mingkang111 deleted the ODSC-56350/cli_logging_options branch May 3, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement. ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants