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

feat: session get command now supports multiple ids #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AncientPatata
Copy link
Contributor

Motivation

Other get commands for the CLI support multiple ids, it makes sense to homogonize them.

Description

session get now supports multiple ids.

Testing

Unit tests pass.

Impact

None.

Additional Information

@qdelamea-aneo With the nature of sessions being a less prevalent entity in ArmoniK in comparison to tasks and results, it feels to me like it wouldn't make sense to allow the user to cancel or delete multiple sessions at once. There is no "performance benefit" to it too since the session commands only take in one argument. What do you think ?

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have thoroughly tested my modifications and added tests when necessary.
  • Tests pass locally and in the CI.
  • I have assessed the performance impact of my modifications.

Copy link

github-actions bot commented Jan 23, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
648 594 92% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 1777fb2 by action🐍

Copy link
Contributor

@qdelamea-aneo qdelamea-aneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see why you think it's better for canceling, deleting, etc. to support only one session at a time. However, in order to maintain some form of cli unity I would prefer this to be the case.

@AncientPatata AncientPatata force-pushed the ad/session_multiple_ids branch from 5967b6a to 1777fb2 Compare January 29, 2025 12:33
@AncientPatata
Copy link
Contributor Author

I can see why you think it's better for canceling, deleting, etc. to support only one session at a time. However, in order to maintain some form of cli unity I would prefer this to be the case.

Made said changes.

@base_command
def session_cancel(endpoint: str, output: str, session_id: str, debug: bool) -> None:
"""Cancel a session."""
def session_cancel(endpoint: str, output: str, session_ids: List[str], debug: bool) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implement the same logic as the one for delete result data with confirmation for each session.

@base_command
def session_close(endpoint: str, output: str, session_id: str, debug: bool) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here again implement the confirmation logic.

@base_command
def session_purge(endpoint: str, output: str, session_id: str, debug: bool) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here again implement the confirmation logic.

@base_command
def session_delete(endpoint: str, output: str, session_id: str, debug: bool) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here again implement the confirmation logic.

Copy link
Contributor

@qdelamea-aneo qdelamea-aneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove session_argument at the beginning of the file and rename the list command function.

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

Successfully merging this pull request may close these issues.

2 participants