Change CDN files to download locally#11286
Conversation
src/client/datascience/ipywidgets/cdnWidgetScriptSourceProvider.ts
Outdated
Show resolved
Hide resolved
src/client/datascience/ipywidgets/cdnWidgetScriptSourceProvider.ts
Outdated
Show resolved
Hide resolved
src/client/datascience/ipywidgets/cdnWidgetScriptSourceProvider.ts
Outdated
Show resolved
Hide resolved
| // May have already been validated. | ||
| const url = moduleNameToCDNUrl(cdnBaseUrl, moduleName, moduleVersion); | ||
| if (CDNWidgetScriptSourceProvider.validUrls.has(url)) { | ||
| return url; |
There was a problem hiding this comment.
This won't work.
If the url does't exist, then we store a value into this map with a flag of false.
Its possible that httpClient.exists returns false due to 429 status code.
We might want to throw an exception when status code != 200 & !== 404, so we can retry or similar. #Resolved
There was a problem hiding this comment.
src/client/datascience/ipywidgets/cdnWidgetScriptSourceProvider.ts
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #11286 +/- ##
==========================================
- Coverage 61.13% 60.95% -0.18%
==========================================
Files 602 603 +1
Lines 33151 33369 +218
Branches 4685 4724 +39
==========================================
+ Hits 20266 20340 +74
- Misses 11864 12000 +136
- Partials 1021 1029 +8
Continue to review full report at Codecov.
|
src/client/datascience/ipywidgets/cdnWidgetScriptSourceProvider.ts
Outdated
Show resolved
Hide resolved
|
@DonJayamanne did you have any more changes? |
DonJayamanne
left a comment
There was a problem hiding this comment.
Not sure whether you have completed the pending work or not.
I think we need just one more piece of work.
| // May have already been validated. | ||
| const url = moduleNameToCDNUrl(cdnBaseUrl, moduleName, moduleVersion); | ||
| if (CDNWidgetScriptSourceProvider.validUrls.has(url)) { | ||
| return url; |
|
No that part is done. It looks like this now: |
|
Kudos, SonarCloud Quality Gate passed!
|
* Working downloader * Tests passing * Add more tests * Add retry test * Fix build errors. Not sure why not happening locally. * Fix unit tests * Fix azure ml on windows Rework error checking to use status * Fix sonar error * Add some more descriptive comments * More comments * Refactor some code * Make sure to not use exists as we're downloading anyway
* Change CDN files to download locally (#11286) * Working downloader * Tests passing * Add more tests * Add retry test * Fix build errors. Not sure why not happening locally. * Fix unit tests * Fix azure ml on windows Rework error checking to use status * Fix sonar error * Add some more descriptive comments * More comments * Refactor some code * Make sure to not use exists as we're downloading anyway * Fix container timeout from firing unnecessarily (#11336) * Fix container timeout from firing unnecessarily * Check for undefined for timer * Update changelog
* Fix background (again) for ipywidgets (#11062) (#11064) * Fix arrowing down through cells (#11095) * Fix scrolling in the monaco editor (#11089) * Fix monaco editor scrolling and line height * Add news entry * Fixes for UI issues (#11130) * Cherry pick commits from master into April release (#11138) * Load widget scripts from CDN and/or local python interpreter (#10987) * Address sonar issues * Fix linter * Fixes * Better way to pas array buffer * Added comments * Oops * Copy widget scripts to extension folder (#11082) * Copy widget scripts to extension folder * Fix test * Remove aml scripts from extension (#11085) * Validate python when nb opened not on extension activates (#11087) For #10893 * Support workspace images in markdown cells (#11086) For #10893 * Fix functional tests for ipywidgets and download just chrome b… (#11093) For #11092 playwright downloads other browsers, we need just one chrome (as this is closest to what VSCode is built upon) * Added tests for k3d widget (#11133) For #10799, #11096 * Fix failing ipywidget tests (#11132) For #11099 * Update change log * Port perf fix to release branch (#11144) * Fix code lens perf for interactive window (#11142) * Eliminate first level of redundancy * Working with a cache * Add test to verify no more generating cell ranges * Add news entry * Clean up on closing * Make sure close and reopen works * Fix sonar errors * Fix restart * Fix wrong IDisposable type * Rename restartedKernel to onKernelRestarted * Recompute when changing settings * Clear out document close event when document closes * Update changelog * Fix build error from missing file * Port fix for transient data in notebooks. (#11168) * Remove unwanted elements from cells when saving. (#11164) * Remove unwanted elements from cells when saving. * Fix a sonar warning * FIx another sonar warning * Update changelog * Port undo fix to release branch (#11181) * Fix undo in notebooks (#11167) * Put back ctrl+z and 'z' for undo. Refactor to use one value to compute custom editor support * Add news entry * Update change log * Ensure save works after saving untitled notebooks (#11190) * Ensure save works after saving untitled notebooks * Remove old document * Port fix for PDF saving to release (#11194) * Fix pdf viewer so that we just ship the standalone version. (#11192) * Update changelog * Fix scrolling when don't have focus (#11246) * Account for scenarios where module name is undefined (#11248) For #11241 * Add message when widget script is not found on CDN (#11249) For #11247 * Add message * Add tests * Fix typo * Fix failing unit tests on windows (#11191) (#11277) Co-authored-by: Rich Chiodo <[email protected]> * Display error message when fetching script source timesout (#11276) For #11242 * Add error for timeout * Add imports * Update version and change log for release (#11279) * Update version * Update change logs * Port two fixes to the release branch (#11337) * Change CDN files to download locally (#11286) * Working downloader * Tests passing * Add more tests * Add retry test * Fix build errors. Not sure why not happening locally. * Fix unit tests * Fix azure ml on windows Rework error checking to use status * Fix sonar error * Add some more descriptive comments * More comments * Refactor some code * Make sure to not use exists as we're downloading anyway * Fix container timeout from firing unnecessarily (#11336) * Fix container timeout from firing unnecessarily * Check for undefined for timer * Update changelog * Wire unhandled widget messages to the jupyter output (#11273) * Update changelog * Cherry-pick fixes from master (#11367) * Temporarily switch to node FS apis in KnownPathsService (#11340) * Make sure user modules can be imported (#11353) * Port fixes into April point release (#11392) Cherry pick the following PRs: #11248 #11276 #11249 #11280 #11364 * Remove isolate script when running unittest (#11378) (#11407) * Ensure env gets used when running unittest * Fix tests * Move runStartupCommand to global location (#11409) * Move startup to global (#11402) * Update change log * Update version and change logs (#11408) * Fix widget tests (#11406) Tests are broken in Release branch * Disable CDN unit tests. Don't seem to pass on azure (#11441) * Disable CDN unit tests. Don't seem to pass on azure * Need to skip in other suite setup too. * only close interactive session on interactive window close (#11405) (#11437) * only close interactive session on interactive window close (#11405) * Fix merge problems Co-authored-by: Rich Chiodo <[email protected]> Co-authored-by: Don Jayamanne <[email protected]> Co-authored-by: Rich Chiodo <[email protected]> Co-authored-by: Ian Huff <[email protected]>
For #11274
Download the index files ourselves to our temp folder. As part of this, realized we weren't actually working with jsdelivr.