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

Only show the "restart required" message if kernels are actually active after installing python extension #10829

Merged
merged 5 commits into from
Jul 15, 2022

Conversation

IanMatthewHuff
Copy link
Member

Fixes #10697

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • Has sufficient logging.
  • Has telemetry for feature-requests.
  • Unit tests & system/integration tests are added/updated.
  • Test plan is updated as appropriate.
  • package-lock.json has been regenerated by running npm install (if dependencies have changed).

// This class is responsible for watching if the Python Extension installation status changes, and if it does
// update the users if any notebooks are running and need to be restarted.
@injectable()
export class PythonExtensionRestartNotification implements IExtensionSyncActivationService {
Copy link
Member Author

Choose a reason for hiding this comment

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

Since the checker is in platform and our workflow here involved being able to look at kernels added the event to the checker to indicate installation and a new standalone service to look at the kernels and surface the message as needed.

});

// Create an instance of the restart notification with the stubbed checker
const notifier = createService(api.serviceContainer);
Copy link
Member Author

Choose a reason for hiding this comment

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

Test was a little bit hard to write, since I didn't want to actually install / uninstall python. Poked around at a few of Don's bag of tricks and I think this works. Stub out the extension installed event from the checker, create a new instance of the class (which picks up the stubbed event), and see if that notifies or not.

@IanMatthewHuff IanMatthewHuff marked this pull request as ready for review July 15, 2022 17:58
@IanMatthewHuff IanMatthewHuff requested a review from a team as a code owner July 15, 2022 17:58
@IanMatthewHuff IanMatthewHuff merged commit 9afdb5b into main Jul 15, 2022
@IanMatthewHuff IanMatthewHuff deleted the dev/ianhu/pythonRestartMessage branch July 15, 2022 20:30
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.

Don't show the "Notebooks might need to be restarted" prompt after Python Extension is installed (or at all?)
2 participants