Skip to content

Conversation

@astitv-sh
Copy link

Issue #, if available:

Description of changes:
When the post startup script is executed, it can result in errors due to multiple reasons. At present, there is no functionality to surface these failure/success scenarios to inform the users and prompt them to take the necessary action.

This extension monitors the post-startup-status.json file generated during the course of the post startup script execution and shows pop-up notifications to users based on the status of the execution. The possible status set can be ['in-progress','error','success']. In case of errors, the potential cause is also written to the post-startup-status.json file which can be surfaced to the user.

Related post startup script changes PR: https://github.com/aws/private-sagemaker-distribution-staging/pull/237

Testing

The extension was tested for the different cases in Code Editor by manually executing the post startup script which writes to the post-startup-status.json file throughout its workflow. Based on the different test cases, the toast notification shown and the contents of the notification are as follows:

  1. Success case:
    Screenshot 2025-03-25 at 11 05 01 PM

  2. Error case (domain metadata fetch issue):
    Screenshot 2025-03-25 at 11 05 29 PM

  3. Unexpected error:
    Screenshot 2025-03-25 at 11 08 11 PM

Note: This is new PR raised following the changes from this PR:#109

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

@bharathGuntamadugu bharathGuntamadugu left a comment

Choose a reason for hiding this comment

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

Empty file at patched-vscode/extensions/post-startup-notifications/mocks/vscode.js?

// cwd: extensionsPath,
// ignore: ['**/out/**', '**/node_modules/**']
// });
const compilations = [

Choose a reason for hiding this comment

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

Whats with this spacing changes? Automated changes? If not - lets not disturb this.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed. It shows the entire diff due to comparison from previous commit but the lines are correctly spaced now

const fs = require('fs');

// Complete list of directories where yarn should be executed to install node modules
const dirs = [

Choose a reason for hiding this comment

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

Confusing to understand what is added and what is not added here.

Copy link
Author

Choose a reason for hiding this comment

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

Only the lines in dirs.js and gulpfile.extensions.js containing post-startup-notifications has been added.

@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "Node16",

Choose a reason for hiding this comment

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

How do we ensure to have Node16 here? How easy is it to udpate it? Since this is an extension running in client browser - curious what is node16 is not supported?

Copy link
Author

Choose a reason for hiding this comment

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

These config options are only required during compilation steps, which will be utilized as part of the code editor build process, before it runs on the client end

@aws-asolidu
Copy link
Contributor

Do we have an answer for this #109 (comment)

@astitv-sh
Copy link
Author

Empty file at patched-vscode/extensions/post-startup-notifications/mocks/vscode.js?

This is required to import a mock version of the vscode module dependency to run the unit tests.

@astitv-sh
Copy link
Author

Do we have an answer for this #109 (comment)

The post startup script changes added as part of earlier PR add api endpoint. The purpose of this extension is to surface and notify any errors to users during post startup script execution. This requires the changes on code editor end.

@@ -0,0 +1,3 @@
export const POST_START_UP_STATUS_FILE = '/tmp/.post-startup-status.json';
export const SERVICE_NAME_ENV_VALUE = 'SageMakerUnifiedStudio';

Choose a reason for hiding this comment

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

nit: SERVICE_NAME_ENV_VALUE -> SAGEMAKER_UNIFIED_STUDIO

@aws-asolidu aws-asolidu merged commit b3f3325 into aws:feature/smus Mar 31, 2025
austinjang2 pushed a commit to austinjang2/sagemaker-code-editor that referenced this pull request Sep 11, 2025
Post startup script notifications extension for Code Editor
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.

3 participants