Skip to content

Fixes to trust service #14352

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

Merged
merged 1 commit into from
Oct 9, 2020
Merged

Conversation

DonJayamanne
Copy link

I managed to break the trust service in a previous PR.
The tests didn't catch that, I wrote some real tests to test with VS Code (super fast test, run in 192ms, i.e. using VSC isnt an issue for such tests).

Basically trust was completely broken, nothing would get trusted.

await trustService.trustNotebook(uri, contents);
assert.isTrue(await trustService.isNotebookTrusted(uri, contents), 'Notebook is not trusted');
});
test('Trusting a notebook (json saved with different formats)', async () => {
Copy link
Author

Choose a reason for hiding this comment

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

Something I should have added in the previous PR.

@DonJayamanne DonJayamanne added the no-changelog No news entry required label Oct 9, 2020
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 9, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@DonJayamanne DonJayamanne requested a review from joyceerhl October 9, 2020 21:06
Copy link

@joyceerhl joyceerhl left a comment

Choose a reason for hiding this comment

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

Oh dear, I did see that the notebook trust tests were failing, but assumed it was due to the native notebooks trust bug...

@DonJayamanne
Copy link
Author

I did see that the notebook trust tests were failing, but assumed it was due to the native notebooks trust bug

I ran the tests locally as well and it passed with the bug in t.
I.e. to my knowledge I didn't miss the PR failures.

@codecov-io
Copy link

Codecov Report

Merging #14352 into main will decrease coverage by 0.48%.
The diff coverage is 51.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14352      +/-   ##
==========================================
- Coverage   59.91%   59.43%   -0.49%     
==========================================
  Files         709      716       +7     
  Lines       39334    40009     +675     
  Branches     5698     5799     +101     
==========================================
+ Hits        23567    23779     +212     
- Misses      14529    14970     +441     
- Partials     1238     1260      +22     
Impacted Files Coverage Δ
src/client/common/application/notebook.ts 10.52% <0.00%> (-0.39%) ⬇️
src/client/common/application/types.ts 100.00% <ø> (ø)
src/client/common/process/baseDaemon.ts 21.76% <0.00%> (-0.53%) ⬇️
src/client/datascience/baseJupyterSession.ts 56.30% <0.00%> (-1.04%) ⬇️
src/client/datascience/jupyter/jupyterNotebook.ts 4.20% <0.00%> (-0.02%) ⬇️
src/client/datascience/jupyter/kernels/types.ts 25.00% <ø> (ø)
...ascience/jupyter/liveshare/guestJupyterNotebook.ts 8.96% <0.00%> (-0.33%) ⬇️
src/client/datascience/kernel-launcher/types.ts 23.07% <ø> (ø)
src/client/datascience/notebook/notebookEditor.ts 5.71% <0.00%> (ø)
...science/notebookStorage/notebookStorageProvider.ts 50.74% <0.00%> (ø)
... and 38 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a24d64a...f3abf2a. Read the comment docs.

@@ -38,7 +38,13 @@ export class TrustService implements ITrustService {
this.computeDigest(this.getFormattedContents(notebookContents))
]);

return this.digestStorage.containsDigest(uri, digest1) || this.digestStorage.containsDigest(uri, digest2);
// return this.digestStorage.containsDigest(uri, digest1) || this.digestStorage.containsDigest(uri, digest2);
Copy link
Member

Choose a reason for hiding this comment

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

Pull the old commented out code?

Copy link
Author

Choose a reason for hiding this comment

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

Will remove in next PR, as CI is slow.

@DonJayamanne DonJayamanne merged commit 66e0eca into microsoft:main Oct 9, 2020
@DonJayamanne DonJayamanne deleted the fixesToTrust branch October 9, 2020 22:49
luabud pushed a commit to luabud/vscode-python that referenced this pull request Oct 26, 2020
DonJayamanne added a commit that referenced this pull request Oct 30, 2020
* Remove cell index property and use build in prop (#14239)
* Update other cells in cell execution (#14240)
* Tests for prompting to install missing ipykernel (#14266)
* Treat Native notebook tests as VS Code tests (#14282)
* Fixes to blowing away of kernel info & not using right startup info (… …
* Default cell language for native notebooks (#14314)
* Ignore formatting in ipynb when dealing with trust (#14333)
* Fixes to trust service (#14352)
* Change `IPython kernel` to `Jupyter kernel` (#14375)
* Trust for native notebooks (#14353)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog No news entry required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants