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

Enable Web Debugging #10040

Merged
merged 13 commits into from
May 16, 2022
Merged

Enable Web Debugging #10040

merged 13 commits into from
May 16, 2022

Conversation

IanMatthewHuff
Copy link
Member

Fixes #9973

  • 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).

@IanMatthewHuff IanMatthewHuff marked this pull request as ready for review May 16, 2022 16:27
@IanMatthewHuff IanMatthewHuff requested a review from a team as a code owner May 16, 2022 16:27
@IanMatthewHuff
Copy link
Member Author

@rchiodo To make sure. Per my reading of how the web tests work, this change wouldn't need a new web test as it's not adding new web only functionality just unifying web and node. However I do think that we have a possible missing test hole checking for if the temp files are deleted. So I'll add an issue for that and add one if missing.

package.json Show resolved Hide resolved
@IanMatthewHuff
Copy link
Member Author

I think @DonJayamanne just hit some of the same files. Will pull and update (see how git handles two renames / two moves on the same file)

@codecov-commenter
Copy link

codecov-commenter commented May 16, 2022

Codecov Report

Merging #10040 (ae10ac5) into main (deeb86b) will increase coverage by 0%.
The diff coverage is 95%.

@@          Coverage Diff           @@
##            main   #10040   +/-   ##
======================================
  Coverage     63%      64%           
======================================
  Files        216      216           
  Lines      10127    10130    +3     
  Branches    1612     1613    +1     
======================================
+ Hits        6474     6485   +11     
+ Misses      3133     3123   -10     
- Partials     520      522    +2     
Impacted Files Coverage Δ
src/platform/debugger/jupyter/debugger.ts 64% <ø> (ø)
src/platform/debugger/jupyter/helper.ts 54% <ø> (ø)
...rc/platform/debugger/jupyter/kernelDebugAdapter.ts 70% <92%> (ø)
.../debugger/jupyter/notebook/debugCellControllers.ts 25% <100%> (ø)
...form/debugger/jupyter/notebook/debuggingManager.ts 53% <100%> (ø)
...m/debugger/jupyter/notebook/runByLineController.ts 66% <100%> (ø)
src/platform/serviceRegistry.node.ts 97% <100%> (ø)
...ommon/process/environmentActivationService.node.ts 70% <0%> (+<1%) ⬆️
...rc/platform/common/dataScienceSurveyBanner.node.ts 70% <0%> (+5%) ⬆️

pass
del _VSCODE_fileList`;

return executeSilently(this.jupyterSession, deleteFilesCode, {
Copy link
Member

Choose a reason for hiding this comment

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

Any idea why the execution is set to silent: false, is this intentional

silent: false,
?

Copy link
Member Author

@IanMatthewHuff IanMatthewHuff May 16, 2022

Choose a reason for hiding this comment

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

Yeah, as I recall the name is bad in terms of what silent actually means.. Silent also swallows all output and we want to see if there are errors coming in on stdout. It's actually store_history that makes it silent in terms of hiding the execution from execution count.

Copy link
Member Author

Choose a reason for hiding this comment

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

Jupyter has doc on the execute params here which detail it a bit more: https://jupyter-client.readthedocs.io/en/latest/messaging.html#execute

Copy link
Member

Choose a reason for hiding this comment

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

@IanMatthewHuff thanks for the detailed explanation, you are right store_history is the key here and our executeSilently here means skipping history and execution count.

@@ -275,6 +264,35 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID
return undefined;
}

// Use our jupyter session to delete all the cells
private async deleteDumpCells() {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this is identical to ContentsManager#delete considering that the dummy file is created by the Jupyter itself. In Export Web support, I found that I need to create temp files and delete them too so I'm experimenting with ContentsManager#newUntitled and ContentsManager#delete to see if they work as expected.

Copy link
Member Author

Choose a reason for hiding this comment

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

Part of the diff here is that this code will be working in both the web and the node version. The ContentsManager is only available when connecting to Jupyter, so that makes sense to use when working with a .web only scenario. I could consider a .web kernelDebugAdapter and use the ContentsManager delete there, but I think that I'd only go there if this cell execution option which covers both scenarios was proving to have issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

Might also be a mild diff here in that this file is actually created by ipykernel and not Jupyter:
https://github.com/ipython/ipykernel/blob/51a613d501a86073ea1cdbd8023a168646644c6a/ipykernel/compiler.py#L83
I would assume Jupyter ContentsManager would have access to the same temp location though, so I'm guessing it could be used for the delete.

@IanMatthewHuff IanMatthewHuff merged commit 584e7e1 into main May 16, 2022
@IanMatthewHuff IanMatthewHuff deleted the dev/ianhu/webDebugging branch May 16, 2022 17:57
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.

Support notebook debugging in the Jupyter web extension
5 participants