elixir-cloud-aai / ga4gh-sdk

Generic SDK and CLI for GA4GH API services
Apache License 2.0
13 stars 2 forks source link

feat(cli): add TES support #38

Closed aaravm closed 3 weeks ago

aaravm commented 3 months ago

This PR contains code for the CLI and Instructions on how to use them. It is inspired from https://github.com/vemonet/nanopub-rs/blob/main/cli/src/main.rs

Summary by Sourcery

Add a new CLI tool for TES task management with commands for creating, listing, retrieving, checking the status of, and canceling tasks, along with usage documentation.

New Features:

Documentation:

sourcery-ai[bot] commented 3 months ago

Reviewer's Guide by Sourcery

This pull request adds a Command Line Interface (CLI) for Task Execution Service (TES) operations. The implementation is inspired by the nanopub-rs project and uses the Clap library for command-line argument parsing. The CLI supports various TES operations including creating tasks, listing tasks, getting task details, checking task status, and canceling tasks. The code is structured to handle different subcommands and their respective arguments, making API calls to a TES server (specifically Funnel) to perform the requested operations.

File-Level Changes

Files Changes
cli/src/main.rs Implemented a main function that sets up the CLI structure using Clap, defining subcommands for various TES operations
cli/src/main.rs Added a 'create' subcommand to create new tasks, supporting both JSON input and file-based task definitions
cli/src/main.rs Implemented a 'list' subcommand to retrieve and display a list of tasks with customizable parameters
cli/src/main.rs Added 'get' and 'status' subcommands to retrieve task details and status respectively
cli/src/main.rs Implemented a 'cancel' subcommand to cancel running tasks
cli/src/main.rs Integrated with the ga4gh_sdk crate to interact with the TES API, including configuration setup and API calls
cli/src/main.rs Added error handling and result printing for each subcommand execution

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
aaravm commented 3 months ago

@pavelnikonorov, I have addressed all of your concerns. Please let me know if you think any other changes should be made.

uniqueg commented 2 months ago

@aaravm: Can you please merge #37 (after updating the PR description) and then update this PR so that it only contains the changes relative to the updated main? I will give it a closer review then.

For now: Please make sure all modules have docstrings for the module, class, function level etc., as well as comprehensive doctests. Same thing as for the other PRs... And +1 on Pavel's & Sourcery's comments.

aaravm commented 1 month ago

Hi @uniqueg @pavelnikonorov, I have changed the list CLI, to take input in the form of

ga4gh-cli tes list --name_prefix <NAME_PREFIX> --state <STATE> --tag_key <TAG_KEY> --tag_value <TAG_VALUE> --page_size <PAGE_SIZE> --page_token <PAGE_TOKEN> --view <VIEW>

instead of dictionary, as suggested by @pavelnikonorov . Please look into this PR and merge it

pavelnikonorov commented 3 weeks ago

all suggestions addressed, merging as discussed with @uniqueg