-
Notifications
You must be signed in to change notification settings - Fork 12
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
Cleanup cli #536
base: master
Are you sure you want to change the base?
Cleanup cli #536
Conversation
The app commands use the Rich.Table to make pretty tables as the output from various commands. This makes it impossible to use unix tools to perform tasks, such as getting a list of all of the transform ids to perform a batch delete of all transforms. Add a switch to the table construction to drop formatting if not a tty. The datasets get command outputs nested data, so that becomes a json document.
Now all of the CLI has unit tests. Migrated the existing tests to different scripts in a new tests/app module. The way cache delete was handled after deleting the transform from the server made it hard to write a meaningful test. Migrated that code to teh servicex_client class and added a test there.
Test ocassionally fail due to google auth library reporting google.auth.exceptions.MalformedError. The test token we were using really didn't look like a jwt. Picked up a random test JWT to pass into the library call during tests.
…forms that are currently running.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #536 +/- ##
==========================================
+ Coverage 87.70% 92.25% +4.55%
==========================================
Files 26 27 +1
Lines 1683 1744 +61
==========================================
+ Hits 1476 1609 +133
+ Misses 207 135 -72
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
It's fine to have a ServiceXSpec
-wide ignore local cache flag. I see how you use that parameter in other places but would it be okay to set it up as a part of ServiceXSpec
? E.g. General.IgnoreLocalCache
?
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.
Thanks a lot for the nice PR! It looks great. I have one comment :)
This pull request introduces several new features and improvements to the ServiceX CLI. The most notable changes include the addition of new commands, enhancements to the output formatting, and the implementation of new functionalities for managing transforms. Also completed the unit tests for the CLI code. Below is a summary of the most important changes:
New CLI Commands
deliver
command to submit a YAML configuration file to the ServiceX backend and print the resulting file paths. (docs/command_line.rst
,servicex/app/main.py
) [1] [2]cancel
command to cancel a running transform. (docs/command_line.rst
,servicex/app/transforms.py
) [1] [2]Output Formatting Enhancements
pipeable_table
function to create tables that adapt based on the output destination (terminal or pipe). Applied this function to various commands to improve output formatting. (servicex/app/__init__.py
,servicex/app/cache.py
,servicex/app/datasets.py
,servicex/app/transforms.py
) [1] [2] [3] [4]Transform Management Improvements
cancel_transform
method inServiceXClient
andServiceXAdapter
to support the new cancel command. (servicex/servicex_adapter.py
,servicex/servicex_client.py
) [1] [2]Configuration File Support
config_path
) in various commands to allow more flexible configuration management. (servicex/app/datasets.py
,servicex/app/transforms.py
) [1] [2]Tests
deliver
command and version output. (tests/app/test_app.py
)servicex/app/cache.py
,servicex/servicex_client.py
) [1] [2]Ignore Local Cache
deliver
function to force IgnoreLocalCache setting. Accessible from the CLI too