-
Notifications
You must be signed in to change notification settings - Fork 730
fix(smus): Add status validation for space operations #8160
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
Conversation
|
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
|
|
✅ I finished the code review, and didn't find any security or code quality issues. |
**Description** Added status checks for SageMaker space operations to prevent invalid actions. **fix done** 1. The stopSpace function now validates space status before attempting to stop, showing appropriate warning messages for spaces already in Stopped/Stopping states or currently Starting. 2. Also added status refresh before open remote connect **Testing Done** code debug
| void vscode.window.showWarningMessage('This space is already in Stopped/Stopping state') | ||
| return | ||
| } else if (node.getStatus() === 'Starting') { | ||
| void vscode.window.showWarningMessage('This space is starting, please stop it later') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the text to be prescriptive? Similar to the actual API message? "Space {spaceName} is in Starting state. Wait until it is Running to attempt stop again." Same for the other one - Let's use the SpaceName instead of "this"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that would be better, let me find the spaceName variable and add it.
| node: SagemakerSpaceNode | SagemakerUnifiedStudioSpaceNode, | ||
| ctx: vscode.ExtensionContext, | ||
| sageMakerClient?: SagemakerClient | ||
| ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for making the fix! Appreciate it!
| return | ||
| } | ||
|
|
||
| await tryRefreshNode(node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, this would also change the text on the Space node to reflect state after the API call right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the text (Stopped/Running) on the space would also be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving but please address comments before merge.
Description
Added status checks for SageMaker space operations to prevent invalid actions.
Picture: When opening remote connection:
fix done
The stopSpace function now validates space status before attempting to stop, showing appropriate warning messages for spaces already in Stopped/Stopping states or currently Starting.
Also added status refresh before open remote connect
Testing Done
code debug
feature/xbranches will not be squash-merged at release time.