-
Notifications
You must be signed in to change notification settings - Fork 293
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
More progress indicator when starting a kernel #8584
Conversation
await Promise.race([cachedInfo, latestInfo]); | ||
if (cachedInfo.completed && cachedInfo.value?.version) { | ||
return (this._version = cachedInfo.value.version); | ||
if (this._previousVersionCall) { |
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.
Ensure we make these calls only once
const title = DataScience.activatingPythonEnvironment().format( | ||
interpreter.displayName || getDisplayPath(interpreter.path) | ||
); | ||
return KernelProgressReporter.wrapAndReportProgress(resource, title, () => |
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.
Display progress message
traceInfo(`Waiting for idle on (kernel): ${session.kernel.id} -> ${session.kernel.status}`); | ||
const progress = isRestartSession | ||
? undefined | ||
: KernelProgressReporter.reportProgress( |
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.
Display progress messages
@@ -242,7 +243,7 @@ export class JupyterKernelService { | |||
// Get the activated environment variables (as a work around for `conda run` and similar). | |||
// This ensures the code runs within the context of an activated environment. | |||
specModel.env = await this.activationHelper | |||
.getActivatedEnvironmentVariables(undefined, interpreter, true) | |||
.getActivatedEnvironmentVariables(resource, interpreter, true) |
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.
Pass resource so we can display progress message
// It could look as though the same operation is being performed multiple times (when in fact its possible we have caching in place). | ||
// Eg. we could be attempting to start a python process, which requires activation, thats cached, however calling it multiple times | ||
// could result in multiple messages being displayed. | ||
// Perhaps its the right thing to do and display the message multiple times, but for now, we'll just not display it. |
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.
We can change this if required, felt weird to display the messages a number of times.
E.g. we have messages displayed as follows:
- Activating Python environment abc
- Validating kernel dependencies
- Activating Python environment abc (again)
This change ensures we display it just once.
Codecov Report
@@ Coverage Diff @@
## main #8584 +/- ##
=====================================
Coverage 71% 71%
=====================================
Files 381 381
Lines 24392 24424 +32
Branches 3745 3749 +4
=====================================
+ Hits 17384 17424 +40
+ Misses 5503 5491 -12
- Partials 1505 1509 +4
|
…scode-jupyter into addProgressIndicator * 'addProgressIndicator' of https://github.com/microsoft/vscode-jupyter: COMMIT_PERF_RESULTS
For #8583