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: Broken session CLI commands due to invalid initialization of ComputeSession #3222

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

jopemachine
Copy link
Member

@jopemachine jopemachine commented Dec 8, 2024

Fix #3202 (BA-19)

This PR fixes following broken session CLI commands.

  • session rename
  • session set-priority
  • session events
  • session commit

About milestone (24.09)

Starting from version 24.09, the code uses session_id (UUID) as an argument to create a ComputeSession object by calling from_session_id. However, this approach does not populate the ComputeSession.name field. As a result, it sends API calls like /session/None (session_id_or_name)/rename?name=new-name, leading to incorrect behavior.

So this PR only needs to be backported to version 24.09.


Checklist: (if applicable)

  • Milestone metadata specifying the target backport version
  • Mention to the original issue
  • Test case(s) to:
    • Demonstrate the difference of before/after
    • Demonstrate the flow of abstract/conceptual models with a concrete implementation

@github-actions github-actions bot added comp:client Related to Client component comp:cli Related to CLI component size:XS ~10 LoC type:bug Reports about that are not working labels Dec 8, 2024
@github-actions github-actions bot added size:M 30~100 LoC and removed size:XS ~10 LoC labels Dec 27, 2024
@jopemachine jopemachine changed the title fix: Broken session rename command fix: Broken session rename, commit command Dec 27, 2024
@jopemachine jopemachine changed the title fix: Broken session rename, commit command fix: Broken session rename, commit command Dec 27, 2024
@jopemachine jopemachine added this to the 24.09 milestone Dec 27, 2024
@jopemachine jopemachine marked this pull request as ready for review December 27, 2024 02:47
@jopemachine jopemachine marked this pull request as draft December 27, 2024 02:52
@jopemachine jopemachine changed the title fix: Broken session rename, commit command fix: Broken session CLI commands due to invalid initialization of ComputeSession Dec 27, 2024
@jopemachine jopemachine marked this pull request as ready for review December 27, 2024 03:36
@jopemachine jopemachine force-pushed the fix/broken-session-rename-command branch from dd8e2c3 to 8d8e412 Compare December 27, 2024 03:42
@github-actions github-actions bot added size:L 100~500 LoC and removed size:M 30~100 LoC labels Dec 27, 2024
Comment on lines -1268 to -1272
try:
session_id = uuid.UUID(session_name_or_id)
compute_session = session.ComputeSession.from_session_id(session_id)
except ValueError:
compute_session = session.ComputeSession(session_name_or_id, owner_access_key)
Copy link
Member Author

Choose a reason for hiding this comment

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

The intention of the code appears to be to raise a ValueError if session_name_or_id is a str that is not a UUID, and to call from_session_id if it is a session ID. Otherwise, the default constructor is intended to be called.

However, when from_session_id is called, the name field is not populated, which causes the code to not function correctly.

Additionally, it seems to be a mistake that owner_access_key is not set when session_id is of UUID type.

Copy link

@HyeockJinKim HyeockJinKim left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:cli Related to CLI component comp:client Related to Client component size:L 100~500 LoC type:bug Reports about that are not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Session rename, commit, set-priority CLI commands not working due to invalid initialization
2 participants