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 config #40

Closed aaravm closed 3 weeks ago

aaravm commented 3 months ago

Here, most of the code is copied #38, only getting config is added. Please merge this after #38. Also, cargo.toml is the same as #38 except, anyhow crate is added.

Summary by Sourcery

Add a new CLI tool for managing tasks with subcommands for creating, listing, getting, checking status, and canceling tasks. Include functionality to read configuration from a JSON file and update the documentation with usage examples.

New Features:

Enhancements:

Documentation:

sourcery-ai[bot] commented 3 months ago

Reviewer's Guide by Sourcery

This pull request adds a new CLI functionality for managing tasks using the GA4GH Task Execution Service (TES) API. The main changes include the implementation of a command-line interface with various subcommands for creating, listing, getting, canceling tasks, and checking task status. The code also introduces configuration management and error handling.

File-Level Changes

Files Changes
cli/src/main.rs Implemented a new command-line interface using the clap crate for parsing command-line arguments
cli/src/main.rs Added subcommands for TES operations: create, list, get, status, and cancel
cli/src/main.rs Implemented configuration management, including loading from a JSON file and fallback to default configuration
cli/src/main.rs Added error handling and result printing for each subcommand
cli/src/main.rs Integrated with the ga4gh_sdk crate for TES API interactions
cli/src/main.rs Implemented automatic Funnel server startup for local development

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 1 month ago

Hey @pavelnikonorov @uniqueg, I have refactored the code to separate config files, as suggested by you guys. I also changed the type of input in list in #38. These were the 2 suggestions given by @pavelnikonorov. Please merge this and #38.

pavelnikonorov commented 3 weeks ago

@uniqueg

  1. Rebased this branch on the previous work in https://github.com/elixir-cloud-aai/ga4gh-sdk/pull/38 to avoid further merge conflicts.
  2. refactored the configuration reader by integrating it as a Configuration struct method.
  3. Added ./cli/README.md
  4. created an issue for multi-profile configuration https://github.com/elixir-cloud-aai/ga4gh-sdk/issues/47

I think it's good to merge.

pavelnikonorov commented 3 weeks ago

All proposed changes have been addressed in the PR, and I will proceed with merging it as discussed with @uniqueg.