Merged
Conversation
This commit refactors the CLI to align with the new API and database terminology, replacing "session" with "run".
Key changes:
- In `weco/api.py`:
- Renamed API client functions (e.g., start_optimization_session -> start_optimization_run).
- Updated API endpoint URLs and parameter names (session_id -> run_id).
- In `weco/cli.py`:
- Renamed variables (e.g., session_id -> run_id, current_session_id_for_heartbeat -> current_run_id_for_heartbeat).
- Updated log directory structure to use `run_id`.
- Updated calls to renamed functions in `weco/api.py`.
- Changed user-facing text and internal logic.
- Corrected initialization of the tree panel for the first node.
- Added defensive handling for the 'nodes' list from API responses.
- In `weco/panels.py`:
- Updated `SummaryPanel` to use `run_id` instead of `session_id`.
These changes ensure the CLI consistently uses the new "run" terminology.
Previously, the `report_termination` call in the signal handler used the default API timeout (30 seconds). This could lead to significant delays when terminating the CLI (Ctrl+C) if the network was slow or the server unresponsive. This commit reduces the timeout for this specific call to 3 seconds, prioritizing a faster exit for the user over guaranteed delivery of the termination report in adverse network conditions.
DhruvSrikanth
requested changes
May 20, 2025
Member
DhruvSrikanth
left a comment
There was a problem hiding this comment.
The changes to variable names make sense.
Requested Changes:
- Keep all comments that have been removed
Member
There was a problem hiding this comment.
I think most (if not all) comments in this file are helpful since theres quite a bit going on in this file. I think its better to keep all of the comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.