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

Fix the output of tdp browse commands #424

Closed
sergkudinov opened this issue Sep 1, 2023 · 1 comment · Fixed by #503
Closed

Fix the output of tdp browse commands #424

sergkudinov opened this issue Sep 1, 2023 · 1 comment · Fixed by #503

Comments

@sergkudinov
Copy link
Contributor

Multiple related issues with tdp browse:

  1. It shouldn't print the traceback when a deployment doesn't exist.

Currently:

➜ tdp browse 1
2023-09-01 12:04:25,570 - DEBUG - tdp.<module> - Logger initialized
Traceback (most recent call last):
  File ".../tdp-lib/tdp/cli/queries.py", line 141, in get_deployment
    return session.query(DeploymentLog).filter_by(id=deployment_id).one()
 ...
sqlalchemy.exc.NoResultFound: No row was found when one was required

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File ".../venv/bin/tdp", line 6, in <module>
    sys.exit(tdp())
...
  File ".../tdp-lib/tdp/cli/queries.py", line 143, in get_deployment
    raise Exception(f"Deployment id {deployment_id} does not exist.") from e
Exception: Deployment id 1 does not exist.

Must be (slightly changing the wording):

➜ tdp browse 1
Deployment with ID 1 does not exist.
  1. When [DEPLOYMENT_ID] and [OPERATION] are provided, and DEPLOYMENT_ID doesn't exists, it must print this deployment doesn't exist, but no the operation.

Currently:

➜ tdp browse 1 my_operation    
2023-09-01 12:19:33,694 - DEBUG - tdp.<module> - Logger initialized
Traceback (most recent call last):
  File ".../tdp-lib/tdp/cli/queries.py", line 199, in get_operation_log
    session.query(OperationLog)
 
sqlalchemy.exc.NoResultFound: No row was found when one was required

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File ".../tdp-getting-started/venv/bin/tdp", line 6, in <module>
    sys.exit(tdp())
  ...
Exception: Operation my_operation does not exist in deployment 1.

Must be (slightly changing the wording):

➜ tdp browse 1 my_operation
Deployment with ID 1 does not exist.
  1. It shouldn't print the traceback when an operation of existing an deployment doesn't exist.

Currently:

➜ tdp browse 1 not_found    
2023-09-01 12:19:33,694 - DEBUG - tdp.<module> - Logger initialized
Traceback (most recent call last):
  File ".../tdp-lib/tdp/cli/queries.py", line 199, in get_operation_log
    session.query(OperationLog)
 
sqlalchemy.exc.NoResultFound: No row was found when one was required

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File ".../tdp-getting-started/venv/bin/tdp", line 6, in <module>
    sys.exit(tdp())
  ...
Exception: Operation not_found does not exist in deployment 1.

Must be:

➜ tdp browse 1 not_found    
Operation not_found does not exist in deployment 1.
@PaulFarault
Copy link
Contributor

PaulFarault commented Oct 30, 2023

Partially fixed by #482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants