From 3c578aa2b0a8cb6b291231888cf2741de47471f6 Mon Sep 17 00:00:00 2001 From: Kartik Gupta <88345179+kartikgupta-db@users.noreply.github.com> Date: Tue, 9 Jan 2024 14:47:42 +0100 Subject: [PATCH] Merge branch 'main' of github.com:databricks/databricks-vscode into bundle-integ (#991) ## Changes ## Tests --------- Co-authored-by: Ilia Babanov Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: releasebot Co-authored-by: eng-dev-ecosystem-bot Co-authored-by: eng-dev-ecosystem-bot <110475461+eng-dev-ecosystem-bot@users.noreply.github.com> Co-authored-by: Serge Smertin <259697+nfx@users.noreply.github.com> --- .github/workflows/tests.yml | 8 +- .github/workflows/update-cli-version.yml | 38 ++++ LICENSE | 74 +++++-- README.md | 16 +- package.json | 2 +- packages/databricks-vscode-types/CHANGELOG.md | 12 ++ packages/databricks-vscode-types/LICENSE | 74 +++++-- packages/databricks-vscode-types/package.json | 2 +- packages/databricks-vscode/CHANGELOG.md | 20 ++ .../DATABRICKS.quickstart.md | 1 - packages/databricks-vscode/LICENSE | 74 +++++-- packages/databricks-vscode/NOTICE.md | 190 +++++++----------- packages/databricks-vscode/package.json | 9 +- .../resources/python/file.workflow-wrapper.py | 22 +- .../python/notebook.workflow-wrapper.py | 24 +-- .../src/cli/CliWrapper.test.ts | 136 +++++++++---- .../databricks-vscode/src/cli/CliWrapper.ts | 90 ++++++--- .../src/cli/DatabricksCliSyncParser.ts | 27 --- .../configuration/configureWorkspaceWizard.ts | 2 + .../models/BundleFileConfigModel.ts | 138 ------------- packages/databricks-vscode/src/extension.ts | 12 +- .../src/logger/LoggerManager.test.ts | 18 +- .../src/logger/LoggerManager.ts | 32 +-- .../src/run/WorkflowRunner.ts | 23 +-- packages/databricks-vscode/src/ui/wizard.ts | 6 + .../src/vscode-objs/StateStorage.ts | 2 +- .../src/vscode-objs/WorkspaceConfigs.ts | 14 -- .../WorkspaceFsWorkflowWrapper.test.ts | 77 ++++--- .../WorkspaceFsWorkflowWrapper.ts | 94 +++++---- yarn.lock | 36 ++-- 30 files changed, 676 insertions(+), 597 deletions(-) create mode 100644 .github/workflows/update-cli-version.yml delete mode 100644 packages/databricks-vscode/src/configuration/models/BundleFileConfigModel.ts diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 43634841a..7cc3c1cd0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,8 +76,12 @@ jobs: run: yarn run test:cov working-directory: packages/databricks-vscode - - name: Integration Tests - run: yarn run test:integ + # - name: Integration Tests + # run: yarn run test:integ + # working-directory: packages/databricks-vscode + + - name: Integration Tests SDK wrappers + run: yarn run test:integ:sdk working-directory: packages/databricks-vscode - name: Upload test logs diff --git a/.github/workflows/update-cli-version.yml b/.github/workflows/update-cli-version.yml new file mode 100644 index 000000000..419da55db --- /dev/null +++ b/.github/workflows/update-cli-version.yml @@ -0,0 +1,38 @@ +name: update-cli-version + +on: + workflow_dispatch: + inputs: + version: + type: string + required: true + +jobs: + update-cli-version: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install JQ + run: sudo apt-get install jq + + - name: Update CLI version + run: jq '.cli.version = "${{ github.event.inputs.version }}"' packages/databricks-vscode/package.json --indent 4 > tmp.json && mv tmp.json packages/databricks-vscode/package.json + + - name: Create a pull request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.DECO_GITHUB_TOKEN }} + commit-message: Update Databricks CLI to v${{ github.event.inputs.version }} + body: Update Databricks CLI to v${{ github.event.inputs.version }} + committer: GitHub + branch: update-cli-v${{ github.event.inputs.version }} + title: 'Update Databricks CLI to v${{ github.event.inputs.version }}' + draft: false diff --git a/LICENSE b/LICENSE index 21db58bb9..9878fb474 100644 --- a/LICENSE +++ b/LICENSE @@ -1,25 +1,69 @@ -DB license + Databricks License + Copyright (2022) Databricks, Inc. -Copyright (2022) Databricks, Inc. + Definitions. -Definitions. + Agreement: The agreement between Databricks, Inc., and you governing + the use of the Databricks Services, as that term is defined in + the Master Cloud Services Agreement (MCSA) located at + www.databricks.com/legal/mcsa. -Agreement: The agreement between Databricks, Inc., and you governing the use of the Databricks Services, which shall be, with respect to Databricks, the Databricks Terms of Service located at www.databricks.com/termsofservice, and with respect to Databricks Community Edition, the Community Edition Terms of Service located at www.databricks.com/ce-termsofuse, in each case unless you have entered into a separate written agreement with Databricks governing the use of the applicable Databricks Services. + Licensed Materials: The source code, object code, data, and/or other + works to which this license applies. -Software: The source code and object code to which this license applies. + Scope of Use. You may not use the Licensed Materials except in + connection with your use of the Databricks Services pursuant to + the Agreement. Your use of the Licensed Materials must comply at all + times with any restrictions applicable to the Databricks Services, + generally, and must be used in accordance with any applicable + documentation. You may view, use, copy, modify, publish, and/or + distribute the Licensed Materials solely for the purposes of using + the Licensed Materials within or connecting to the Databricks Services. + If you do not agree to these terms, you may not view, use, copy, + modify, publish, and/or distribute the Licensed Materials. -Scope of Use. You may not use this Software except in connection with your use of the Databricks Services pursuant to the Agreement. Your use of the Software must comply at all times with any restrictions applicable to the Databricks Services, generally, and must be used in accordance with any applicable documentation. You may view, use, copy, modify, publish, and/or distribute the Software solely for the purposes of using the code within or connecting to the Databricks Services. If you do not agree to these terms, you may not view, use, copy, modify, publish, and/or distribute the Software. + Redistribution. You may redistribute and sublicense the Licensed + Materials so long as all use is in compliance with these terms. + In addition: -Redistribution. You may redistribute and sublicense the Software so long as all use is in compliance with these terms. In addition: + - You must give any other recipients a copy of this License; + - You must cause any modified files to carry prominent notices + stating that you changed the files; + - You must retain, in any derivative works that you distribute, + all copyright, patent, trademark, and attribution notices, + excluding those notices that do not pertain to any part of + the derivative works; and + - If a "NOTICE" text file is provided as part of its + distribution, then any derivative works that you distribute + must include a readable copy of the attribution notices + contained within such NOTICE file, excluding those notices + that do not pertain to any part of the derivative works. -You must give any other recipients a copy of this License; -You must cause any modified files to carry prominent notices stating that you changed the files; -You must retain, in the source code form of any derivative works that you distribute, all copyright, patent, trademark, and attribution notices from the source code form, excluding those notices that do not pertain to any part of the derivative works; and -If the source code form includes a "NOTICE" text file as part of its distribution, then any derivative works that you distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the derivative works. -You may add your own copyright statement to your modifications and may provide additional license terms and conditions for use, reproduction, or distribution of your modifications, or for any such derivative works as a whole, provided your use, reproduction, and distribution of the Software otherwise complies with the conditions stated in this License. + You may add your own copyright statement to your modifications and may + provide additional license terms and conditions for use, reproduction, + or distribution of your modifications, or for any such derivative works + as a whole, provided your use, reproduction, and distribution of + the Licensed Materials otherwise complies with the conditions stated + in this License. -Termination. This license terminates automatically upon your breach of these terms or upon the termination of your Agreement. Additionally, Databricks may terminate this license at any time on notice. Upon termination, you must permanently delete the Software and all copies thereof. + Termination. This license terminates automatically upon your breach of + these terms or upon the termination of your Agreement. Additionally, + Databricks may terminate this license at any time on notice. Upon + termination, you must permanently delete the Licensed Materials and + all copies thereof. -DISCLAIMER; LIMITATION OF LIABILITY. + DISCLAIMER; LIMITATION OF LIABILITY. -THE SOFTWARE IS PROVIDED “AS-IS” AND WITH ALL FAULTS. DATABRICKS, ON BEHALF OF ITSELF AND ITS LICENSORS, SPECIFICALLY DISCLAIMS ALL WARRANTIES RELATING TO THE SOURCE CODE, EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES, CONDITIONS AND OTHER TERMS OF MERCHANTABILITY, SATISFACTORY QUALITY OR FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. DATABRICKS AND ITS LICENSORS TOTAL AGGREGATE LIABILITY RELATING TO OR ARISING OUT OF YOUR USE OF OR DATABRICKS’ PROVISIONING OF THE SOURCE CODE SHALL BE LIMITED TO ONE THOUSAND ($1,000) DOLLARS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE LICENSED MATERIALS ARE PROVIDED “AS-IS” AND WITH ALL FAULTS. + DATABRICKS, ON BEHALF OF ITSELF AND ITS LICENSORS, SPECIFICALLY + DISCLAIMS ALL WARRANTIES RELATING TO THE LICENSED MATERIALS, EXPRESS + AND IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES, + CONDITIONS AND OTHER TERMS OF MERCHANTABILITY, SATISFACTORY QUALITY OR + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. DATABRICKS AND + ITS LICENSORS TOTAL AGGREGATE LIABILITY RELATING TO OR ARISING OUT OF + YOUR USE OF OR DATABRICKS’ PROVISIONING OF THE LICENSED MATERIALS SHALL + BE LIMITED TO ONE THOUSAND ($1,000) DOLLARS. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE LICENSED MATERIALS OR + THE USE OR OTHER DEALINGS IN THE LICENSED MATERIALS. diff --git a/README.md b/README.md index 45ed10735..6a7ca464d 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,6 @@ Currently, we have the following packages: The VSCode extension for Databricks published to the VSCode marketplace. - [databricks-vscode-types](https://github.com/databricks/databricks-vscode/tree/main/packages/databricks-vscode-types) Type definition of the public API of the VSCode extension. -- [databricks-sdk-js](https://github.com/databricks/databricks-vscode/tree/main/packages/databricks-sdk-js) - JavaScript and TypeScript SDK for the Databricks REST API. ### Getting Started @@ -27,6 +25,20 @@ npm install -g yarn@2 yarn install ``` +Prepare Databricks JavaScript SDK: + +``` +yarn run install:sdk +``` + +Prepare Databricks CLI: + +``` +yarn workspace databricks run package:cli:fetch +``` + +After that you are ready to build and test the `databricks-vscode` extension. + ### Found an issue? If you find an issue/bug or have a feature request, please file an issue here: https://github.com/databricks/databricks-vscode/issues/new diff --git a/package.json b/package.json index 9a7cea952..c088d6e2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@databricks/databricks-vscode", - "version": "1.2.2", + "version": "1.2.4", "private": true, "workspaces": [ "packages/*" diff --git a/packages/databricks-vscode-types/CHANGELOG.md b/packages/databricks-vscode-types/CHANGELOG.md index 4e18d1ae4..f3e9480de 100644 --- a/packages/databricks-vscode-types/CHANGELOG.md +++ b/packages/databricks-vscode-types/CHANGELOG.md @@ -1,3 +1,15 @@ +# Release: v1.2.4 + +## packages/databricks-vscode-types + +## 1.2.4 (2023-12-05) + +# Release: v1.2.3 + +## packages/databricks-vscode-types + +## 1.2.3 (2023-11-06) + # Release: v1.2.2 ## packages/databricks-vscode-types diff --git a/packages/databricks-vscode-types/LICENSE b/packages/databricks-vscode-types/LICENSE index 21db58bb9..93a5b5f1d 100644 --- a/packages/databricks-vscode-types/LICENSE +++ b/packages/databricks-vscode-types/LICENSE @@ -1,25 +1,69 @@ -DB license + Databricks License + Copyright (2022) Databricks, Inc. -Copyright (2022) Databricks, Inc. + Definitions. -Definitions. + Agreement: The agreement between Databricks, Inc., and you governing + the use of the Databricks Services, as that term is defined in + the Master Cloud Services Agreement (MCSA) located at + www.databricks.com/legal/mcsa. -Agreement: The agreement between Databricks, Inc., and you governing the use of the Databricks Services, which shall be, with respect to Databricks, the Databricks Terms of Service located at www.databricks.com/termsofservice, and with respect to Databricks Community Edition, the Community Edition Terms of Service located at www.databricks.com/ce-termsofuse, in each case unless you have entered into a separate written agreement with Databricks governing the use of the applicable Databricks Services. + Licensed Materials: The source code, object code, data, and/or other + works to which this license applies. -Software: The source code and object code to which this license applies. + Scope of Use. You may not use the Licensed Materials except in + connection with your use of the Databricks Services pursuant to + the Agreement. Your use of the Licensed Materials must comply at all + times with any restrictions applicable to the Databricks Services, + generally, and must be used in accordance with any applicable + documentation. You may view, use, copy, modify, publish, and/or + distribute the Licensed Materials solely for the purposes of using + the Licensed Materials within or connecting to the Databricks Services. + If you do not agree to these terms, you may not view, use, copy, + modify, publish, and/or distribute the Licensed Materials. -Scope of Use. You may not use this Software except in connection with your use of the Databricks Services pursuant to the Agreement. Your use of the Software must comply at all times with any restrictions applicable to the Databricks Services, generally, and must be used in accordance with any applicable documentation. You may view, use, copy, modify, publish, and/or distribute the Software solely for the purposes of using the code within or connecting to the Databricks Services. If you do not agree to these terms, you may not view, use, copy, modify, publish, and/or distribute the Software. + Redistribution. You may redistribute and sublicense the Licensed + Materials so long as all use is in compliance with these terms. + In addition: -Redistribution. You may redistribute and sublicense the Software so long as all use is in compliance with these terms. In addition: + - You must give any other recipients a copy of this License; + - You must cause any modified files to carry prominent notices + stating that you changed the files; + - You must retain, in any derivative works that you distribute, + all copyright, patent, trademark, and attribution notices, + excluding those notices that do not pertain to any part of + the derivative works; and + - If a "NOTICE" text file is provided as part of its + distribution, then any derivative works that you distribute + must include a readable copy of the attribution notices + contained within such NOTICE file, excluding those notices + that do not pertain to any part of the derivative works. -You must give any other recipients a copy of this License; -You must cause any modified files to carry prominent notices stating that you changed the files; -You must retain, in the source code form of any derivative works that you distribute, all copyright, patent, trademark, and attribution notices from the source code form, excluding those notices that do not pertain to any part of the derivative works; and -If the source code form includes a "NOTICE" text file as part of its distribution, then any derivative works that you distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the derivative works. -You may add your own copyright statement to your modifications and may provide additional license terms and conditions for use, reproduction, or distribution of your modifications, or for any such derivative works as a whole, provided your use, reproduction, and distribution of the Software otherwise complies with the conditions stated in this License. + You may add your own copyright statement to your modifications and may + provide additional license terms and conditions for use, reproduction, + or distribution of your modifications, or for any such derivative works + as a whole, provided your use, reproduction, and distribution of + the Licensed Materials otherwise complies with the conditions stated + in this License. -Termination. This license terminates automatically upon your breach of these terms or upon the termination of your Agreement. Additionally, Databricks may terminate this license at any time on notice. Upon termination, you must permanently delete the Software and all copies thereof. + Termination. This license terminates automatically upon your breach of + these terms or upon the termination of your Agreement. Additionally, + Databricks may terminate this license at any time on notice. Upon + termination, you must permanently delete the Licensed Materials and + all copies thereof. -DISCLAIMER; LIMITATION OF LIABILITY. + DISCLAIMER; LIMITATION OF LIABILITY. -THE SOFTWARE IS PROVIDED “AS-IS” AND WITH ALL FAULTS. DATABRICKS, ON BEHALF OF ITSELF AND ITS LICENSORS, SPECIFICALLY DISCLAIMS ALL WARRANTIES RELATING TO THE SOURCE CODE, EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES, CONDITIONS AND OTHER TERMS OF MERCHANTABILITY, SATISFACTORY QUALITY OR FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. DATABRICKS AND ITS LICENSORS TOTAL AGGREGATE LIABILITY RELATING TO OR ARISING OUT OF YOUR USE OF OR DATABRICKS’ PROVISIONING OF THE SOURCE CODE SHALL BE LIMITED TO ONE THOUSAND ($1,000) DOLLARS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE LICENSED MATERIALS ARE PROVIDED “AS-IS” AND WITH ALL FAULTS. + DATABRICKS, ON BEHALF OF ITSELF AND ITS LICENSORS, SPECIFICALLY + DISCLAIMS ALL WARRANTIES RELATING TO THE LICENSED MATERIALS, EXPRESS + AND IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES, + CONDITIONS AND OTHER TERMS OF MERCHANTABILITY, SATISFACTORY QUALITY OR + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. DATABRICKS AND + ITS LICENSORS TOTAL AGGREGATE LIABILITY RELATING TO OR ARISING OUT OF + YOUR USE OF OR DATABRICKS’ PROVISIONING OF THE LICENSED MATERIALS SHALL + BE LIMITED TO ONE THOUSAND ($1,000) DOLLARS. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE LICENSED MATERIALS OR + THE USE OR OTHER DEALINGS IN THE LICENSED MATERIALS. \ No newline at end of file diff --git a/packages/databricks-vscode-types/package.json b/packages/databricks-vscode-types/package.json index 44089a270..8b6820391 100644 --- a/packages/databricks-vscode-types/package.json +++ b/packages/databricks-vscode-types/package.json @@ -1,6 +1,6 @@ { "name": "@databricks/databricks-vscode-types", - "version": "1.2.2", + "version": "1.2.4", "description": "Package with types and interfaces to develop extensions to the Databricks VSCode plugin", "main": "index.js", "types": "index.d.ts", diff --git a/packages/databricks-vscode/CHANGELOG.md b/packages/databricks-vscode/CHANGELOG.md index 79cc86f83..16d5ca366 100644 --- a/packages/databricks-vscode/CHANGELOG.md +++ b/packages/databricks-vscode/CHANGELOG.md @@ -1,3 +1,23 @@ +# Release: v1.2.4 + +## packages/databricks-vscode + +## 1.2.4 (2023-12-05) + +- Fix: set notebook directory as current directory for pip installs from workspace fs, closes [#958](https://github.com/databricks/databricks-vscode/issues/958) +- Fix: show error for a corrupted config file +- Feature: update Databricks CLI to v0.210.1 + +# Release: v1.2.3 + +## packages/databricks-vscode + +## 1.2.3 (2023-11-06) + +- Fix: Make configuration wizard sticky +- Feature: Use databricks CLI log-file option to capture the logs. This deprecates the `databricks.cli.verboseMode` option. +- Feature: Upgrade databricks cli to `v0.209.0`. + # Release: v1.2.2 ## packages/databricks-vscode diff --git a/packages/databricks-vscode/DATABRICKS.quickstart.md b/packages/databricks-vscode/DATABRICKS.quickstart.md index c7a848a0b..cb746fd82 100644 --- a/packages/databricks-vscode/DATABRICKS.quickstart.md +++ b/packages/databricks-vscode/DATABRICKS.quickstart.md @@ -75,7 +75,6 @@ This extension contributes the following settings: - `databricks.logs.maxArrayLength`: The maximum number of items to show for array fields - `databricks.logs.enabled`: Enable/disable logging. Reload window for changes to take effect - `databricks.clusters.onlyShowAccessibleClusters`: Only show clusters that the user has access to -- `databricks.cli.verboseMode`: Show debug logs for the sync command ## `Databricks:` Commands diff --git a/packages/databricks-vscode/LICENSE b/packages/databricks-vscode/LICENSE index 21db58bb9..93a5b5f1d 100644 --- a/packages/databricks-vscode/LICENSE +++ b/packages/databricks-vscode/LICENSE @@ -1,25 +1,69 @@ -DB license + Databricks License + Copyright (2022) Databricks, Inc. -Copyright (2022) Databricks, Inc. + Definitions. -Definitions. + Agreement: The agreement between Databricks, Inc., and you governing + the use of the Databricks Services, as that term is defined in + the Master Cloud Services Agreement (MCSA) located at + www.databricks.com/legal/mcsa. -Agreement: The agreement between Databricks, Inc., and you governing the use of the Databricks Services, which shall be, with respect to Databricks, the Databricks Terms of Service located at www.databricks.com/termsofservice, and with respect to Databricks Community Edition, the Community Edition Terms of Service located at www.databricks.com/ce-termsofuse, in each case unless you have entered into a separate written agreement with Databricks governing the use of the applicable Databricks Services. + Licensed Materials: The source code, object code, data, and/or other + works to which this license applies. -Software: The source code and object code to which this license applies. + Scope of Use. You may not use the Licensed Materials except in + connection with your use of the Databricks Services pursuant to + the Agreement. Your use of the Licensed Materials must comply at all + times with any restrictions applicable to the Databricks Services, + generally, and must be used in accordance with any applicable + documentation. You may view, use, copy, modify, publish, and/or + distribute the Licensed Materials solely for the purposes of using + the Licensed Materials within or connecting to the Databricks Services. + If you do not agree to these terms, you may not view, use, copy, + modify, publish, and/or distribute the Licensed Materials. -Scope of Use. You may not use this Software except in connection with your use of the Databricks Services pursuant to the Agreement. Your use of the Software must comply at all times with any restrictions applicable to the Databricks Services, generally, and must be used in accordance with any applicable documentation. You may view, use, copy, modify, publish, and/or distribute the Software solely for the purposes of using the code within or connecting to the Databricks Services. If you do not agree to these terms, you may not view, use, copy, modify, publish, and/or distribute the Software. + Redistribution. You may redistribute and sublicense the Licensed + Materials so long as all use is in compliance with these terms. + In addition: -Redistribution. You may redistribute and sublicense the Software so long as all use is in compliance with these terms. In addition: + - You must give any other recipients a copy of this License; + - You must cause any modified files to carry prominent notices + stating that you changed the files; + - You must retain, in any derivative works that you distribute, + all copyright, patent, trademark, and attribution notices, + excluding those notices that do not pertain to any part of + the derivative works; and + - If a "NOTICE" text file is provided as part of its + distribution, then any derivative works that you distribute + must include a readable copy of the attribution notices + contained within such NOTICE file, excluding those notices + that do not pertain to any part of the derivative works. -You must give any other recipients a copy of this License; -You must cause any modified files to carry prominent notices stating that you changed the files; -You must retain, in the source code form of any derivative works that you distribute, all copyright, patent, trademark, and attribution notices from the source code form, excluding those notices that do not pertain to any part of the derivative works; and -If the source code form includes a "NOTICE" text file as part of its distribution, then any derivative works that you distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the derivative works. -You may add your own copyright statement to your modifications and may provide additional license terms and conditions for use, reproduction, or distribution of your modifications, or for any such derivative works as a whole, provided your use, reproduction, and distribution of the Software otherwise complies with the conditions stated in this License. + You may add your own copyright statement to your modifications and may + provide additional license terms and conditions for use, reproduction, + or distribution of your modifications, or for any such derivative works + as a whole, provided your use, reproduction, and distribution of + the Licensed Materials otherwise complies with the conditions stated + in this License. -Termination. This license terminates automatically upon your breach of these terms or upon the termination of your Agreement. Additionally, Databricks may terminate this license at any time on notice. Upon termination, you must permanently delete the Software and all copies thereof. + Termination. This license terminates automatically upon your breach of + these terms or upon the termination of your Agreement. Additionally, + Databricks may terminate this license at any time on notice. Upon + termination, you must permanently delete the Licensed Materials and + all copies thereof. -DISCLAIMER; LIMITATION OF LIABILITY. + DISCLAIMER; LIMITATION OF LIABILITY. -THE SOFTWARE IS PROVIDED “AS-IS” AND WITH ALL FAULTS. DATABRICKS, ON BEHALF OF ITSELF AND ITS LICENSORS, SPECIFICALLY DISCLAIMS ALL WARRANTIES RELATING TO THE SOURCE CODE, EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES, CONDITIONS AND OTHER TERMS OF MERCHANTABILITY, SATISFACTORY QUALITY OR FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. DATABRICKS AND ITS LICENSORS TOTAL AGGREGATE LIABILITY RELATING TO OR ARISING OUT OF YOUR USE OF OR DATABRICKS’ PROVISIONING OF THE SOURCE CODE SHALL BE LIMITED TO ONE THOUSAND ($1,000) DOLLARS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + THE LICENSED MATERIALS ARE PROVIDED “AS-IS” AND WITH ALL FAULTS. + DATABRICKS, ON BEHALF OF ITSELF AND ITS LICENSORS, SPECIFICALLY + DISCLAIMS ALL WARRANTIES RELATING TO THE LICENSED MATERIALS, EXPRESS + AND IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES, + CONDITIONS AND OTHER TERMS OF MERCHANTABILITY, SATISFACTORY QUALITY OR + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. DATABRICKS AND + ITS LICENSORS TOTAL AGGREGATE LIABILITY RELATING TO OR ARISING OUT OF + YOUR USE OF OR DATABRICKS’ PROVISIONING OF THE LICENSED MATERIALS SHALL + BE LIMITED TO ONE THOUSAND ($1,000) DOLLARS. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE LICENSED MATERIALS OR + THE USE OR OTHER DEALINGS IN THE LICENSED MATERIALS. \ No newline at end of file diff --git a/packages/databricks-vscode/NOTICE.md b/packages/databricks-vscode/NOTICE.md index d1067091f..15e90a89d 100644 --- a/packages/databricks-vscode/NOTICE.md +++ b/packages/databricks-vscode/NOTICE.md @@ -6,123 +6,73 @@ This Software includes software developed at Databricks (https://www.databricks. This Software contains code from the following open source projects: -| Name | Installed version | License | Code | -| :----------------------------------------------------------------------------------------------------------------------------- | :---------------- | :----------- | :--------------------------------------------------------------------------------------------------------- | -| [@azure/abort-controller](https://www.npmjs.com/package/@azure/abort-controller) | 1.1.0 | MIT | github:Azure/azure-sdk-for-js | -| [@azure/core-auth](https://www.npmjs.com/package/@azure/core-auth) | 1.4.0 | MIT | github:Azure/azure-sdk-for-js | -| [@azure/core-rest-pipeline](https://www.npmjs.com/package/@azure/core-rest-pipeline) | 1.10.1 | MIT | github:Azure/azure-sdk-for-js | -| [@azure/core-tracing](https://www.npmjs.com/package/@azure/core-tracing) | 1.0.1 | MIT | github:Azure/azure-sdk-for-js | -| [@azure/core-util](https://www.npmjs.com/package/@azure/core-util) | 1.2.0 | MIT | github:Azure/azure-sdk-for-js | -| [@azure/core-util](https://www.npmjs.com/package/@azure/core-util) | 1.3.2 | MIT | github:Azure/azure-sdk-for-js | -| [@azure/logger](https://www.npmjs.com/package/@azure/logger) | 1.0.4 | MIT | github:Azure/azure-sdk-for-js | -| [@azure/opentelemetry-instrumentation-azure-sdk](https://www.npmjs.com/package/@azure/opentelemetry-instrumentation-azure-sdk) | 1.0.0-beta.3 | MIT | github:Azure/azure-sdk-for-js | -| [@colors/colors](https://www.npmjs.com/package/@colors/colors) | 1.5.0 | MIT | http://github.com/DABH/colors.js.git | -| [@dabh/diagnostics](https://www.npmjs.com/package/@dabh/diagnostics) | 2.0.3 | MIT | git://github.com/3rd-Eden/diagnostics.git | -| [@microsoft/1ds-core-js](https://www.npmjs.com/package/@microsoft/1ds-core-js) | 3.2.11 | MIT | https://github.com/microsoft/ApplicationInsights-JS | -| [@microsoft/1ds-post-js](https://www.npmjs.com/package/@microsoft/1ds-post-js) | 3.2.11 | MIT | https://github.com/microsoft/ApplicationInsights-JS | -| [@microsoft/applicationinsights-channel-js](https://www.npmjs.com/package/@microsoft/applicationinsights-channel-js) | 3.0.1 | MIT | github:Microsoft/applicationinsights-js | -| [@microsoft/applicationinsights-common](https://www.npmjs.com/package/@microsoft/applicationinsights-common) | 3.0.1 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/main/shared/AppInsightsCommon | -| [@microsoft/applicationinsights-core-js](https://www.npmjs.com/package/@microsoft/applicationinsights-core-js) | 2.8.13 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/master/shared/AppInsightsCore | -| [@microsoft/applicationinsights-core-js](https://www.npmjs.com/package/@microsoft/applicationinsights-core-js) | 3.0.1 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/main/shared/AppInsightsCore | -| [@microsoft/applicationinsights-shims](https://www.npmjs.com/package/@microsoft/applicationinsights-shims) | 2.0.2 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/master/tools/shims | -| [@microsoft/applicationinsights-shims](https://www.npmjs.com/package/@microsoft/applicationinsights-shims) | 3.0.1 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/main/tools/shims | -| [@microsoft/applicationinsights-web-basic](https://www.npmjs.com/package/@microsoft/applicationinsights-web-basic) | 3.0.1 | MIT | https://github.com/microsoft/ApplicationInsights-JS.git | -| [@microsoft/applicationinsights-web-snippet](https://www.npmjs.com/package/@microsoft/applicationinsights-web-snippet) | 1.0.1 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-web-snippet | -| [@microsoft/dynamicproto-js](https://www.npmjs.com/package/@microsoft/dynamicproto-js) | 1.1.9 | MIT | git+https://github.com/microsoft/DynamicProto-JS.git | -| [@microsoft/dynamicproto-js](https://www.npmjs.com/package/@microsoft/dynamicproto-js) | 2.0.2 | MIT | git+https://github.com/microsoft/DynamicProto-JS.git | -| [@microsoft/fast-element](https://www.npmjs.com/package/@microsoft/fast-element) | 1.11.0 | MIT | git+https://github.com/Microsoft/fast.git | -| [@microsoft/fast-foundation](https://www.npmjs.com/package/@microsoft/fast-foundation) | 2.48.0 | MIT | git+https://github.com/Microsoft/fast.git | -| [@microsoft/fast-react-wrapper](https://www.npmjs.com/package/@microsoft/fast-react-wrapper) | 0.1.48 | MIT | git+https://github.com/Microsoft/fast.git | -| [@microsoft/fast-web-utilities](https://www.npmjs.com/package/@microsoft/fast-web-utilities) | 5.4.1 | MIT | git+https://github.com/Microsoft/fast.git | -| [@nevware21/ts-async](https://www.npmjs.com/package/@nevware21/ts-async) | 0.2.4 | MIT | https://github.com/nevware21/ts-async.git | -| [@nevware21/ts-utils](https://www.npmjs.com/package/@nevware21/ts-utils) | 0.9.5 | MIT | https://github.com/nevware21/ts-utils.git | -| [@opentelemetry/api](https://www.npmjs.com/package/@opentelemetry/api) | 1.4.1 | Apache-2.0 | open-telemetry/opentelemetry-js | -| [@opentelemetry/core](https://www.npmjs.com/package/@opentelemetry/core) | 1.13.0 | Apache-2.0 | open-telemetry/opentelemetry-js | -| [@opentelemetry/instrumentation](https://www.npmjs.com/package/@opentelemetry/instrumentation) | 0.35.1 | Apache-2.0 | git+https://github.com/open-telemetry/opentelemetry-js.git | -| [@opentelemetry/resources](https://www.npmjs.com/package/@opentelemetry/resources) | 1.13.0 | Apache-2.0 | open-telemetry/opentelemetry-js | -| [@opentelemetry/sdk-trace-base](https://www.npmjs.com/package/@opentelemetry/sdk-trace-base) | 1.13.0 | Apache-2.0 | open-telemetry/opentelemetry-js | -| [@opentelemetry/semantic-conventions](https://www.npmjs.com/package/@opentelemetry/semantic-conventions) | 1.13.0 | Apache-2.0 | open-telemetry/opentelemetry-js | -| [@tootallnate/once](https://www.npmjs.com/package/@tootallnate/once) | 2.0.0 | MIT | git://github.com/TooTallNate/once.git | -| [@types/ini](https://www.npmjs.com/package/@types/ini) | 1.3.32 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | -| [@types/node](https://www.npmjs.com/package/@types/node) | 20.8.7 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | -| [@types/semver](https://www.npmjs.com/package/@types/semver) | 7.5.4 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | -| [@types/triple-beam](https://www.npmjs.com/package/@types/triple-beam) | 1.3.2 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | -| [@vscode/debugadapter](https://www.npmjs.com/package/@vscode/debugadapter) | 1.61.0 | MIT | https://github.com/microsoft/vscode-debugadapter-node.git | -| [@vscode/debugprotocol](https://www.npmjs.com/package/@vscode/debugprotocol) | 1.61.0 | MIT | https://github.com/microsoft/vscode-debugadapter-node.git | -| [@vscode/extension-telemetry](https://www.npmjs.com/package/@vscode/extension-telemetry) | 0.8.1 | MIT | https://github.com/Microsoft/vscode-extension-telemetry.git | -| [@vscode/webview-ui-toolkit](https://www.npmjs.com/package/@vscode/webview-ui-toolkit) | 1.2.2 | MIT | git+https://github.com/microsoft/vscode-webview-ui-toolkit.git | -| [add](https://www.npmjs.com/package/add) | 2.0.6 | MIT | https://github.com/ben-ng/add.git | -| [agent-base](https://www.npmjs.com/package/agent-base) | 6.0.2 | MIT | git://github.com/TooTallNate/node-agent-base.git | -| [ansi-to-html](https://www.npmjs.com/package/ansi-to-html) | 0.7.2 | MIT | https://github.com/rburns/ansi-to-html.git | -| [applicationinsights](https://www.npmjs.com/package/applicationinsights) | 2.7.0 | MIT | https://github.com/microsoft/ApplicationInsights-node.js | -| [async-hook-jl](https://www.npmjs.com/package/async-hook-jl) | 1.7.6 | MIT | git://github.com/jeff-lewis/async-hook-jl.git | -| [async-listener](https://www.npmjs.com/package/async-listener) | 0.6.10 | BSD-2-Clause | https://github.com/othiym23/async-listener.git | -| [async](https://www.npmjs.com/package/async) | 3.2.4 | MIT | https://github.com/caolan/async.git | -| [asynckit](https://www.npmjs.com/package/asynckit) | 0.4.0 | MIT | git+https://github.com/alexindigo/asynckit.git | -| [bcryptjs](https://www.npmjs.com/package/bcryptjs) | 2.4.3 | MIT | https://github.com/dcodeIO/bcrypt.js.git | -| [cls-hooked](https://www.npmjs.com/package/cls-hooked) | 4.2.2 | BSD-2-Clause | https://github.com/jeff-lewis/cls-hooked.git | -| [color-convert](https://www.npmjs.com/package/color-convert) | 1.9.3 | MIT | Qix-/color-convert | -| [color-name](https://www.npmjs.com/package/color-name) | 1.1.3 | MIT | git@github.com:dfcreative/color-name.git | -| [color-name](https://www.npmjs.com/package/color-name) | 1.1.4 | MIT | git@github.com:colorjs/color-name.git | -| [color-string](https://www.npmjs.com/package/color-string) | 1.9.1 | MIT | Qix-/color-string | -| [color](https://www.npmjs.com/package/color) | 3.2.1 | MIT | Qix-/color | -| [colorspace](https://www.npmjs.com/package/colorspace) | 1.1.4 | MIT | https://github.com/3rd-Eden/colorspace | -| [combined-stream](https://www.npmjs.com/package/combined-stream) | 1.0.8 | MIT | git://github.com/felixge/node-combined-stream.git | -| [continuation-local-storage](https://www.npmjs.com/package/continuation-local-storage) | 3.2.1 | BSD-2-Clause | https://github.com/othiym23/node-continuation-local-storage.git | -| [debug](https://www.npmjs.com/package/debug) | 4.3.4 | MIT | git://github.com/debug-js/debug.git | -| [delayed-stream](https://www.npmjs.com/package/delayed-stream) | 1.0.0 | MIT | git://github.com/felixge/node-delayed-stream.git | -| [diagnostic-channel-publishers](https://www.npmjs.com/package/diagnostic-channel-publishers) | 1.0.6 | MIT | https://github.com/Microsoft/node-diagnostic-channel.git | -| [diagnostic-channel](https://www.npmjs.com/package/diagnostic-channel) | 1.1.0 | MIT | https://github.com/Microsoft/node-diagnostic-channel.git | -| [emitter-listener](https://www.npmjs.com/package/emitter-listener) | 1.1.2 | BSD-2-Clause | https://github.com/othiym23/emitter-listener | -| [enabled](https://www.npmjs.com/package/enabled) | 2.0.0 | MIT | git://github.com/3rd-Eden/enabled.git | -| [entities](https://www.npmjs.com/package/entities) | 2.2.0 | BSD-2-Clause | git://github.com/fb55/entities.git | -| [exenv-es6](https://www.npmjs.com/package/exenv-es6) | 1.1.1 | MIT | git+https://github.com/chrisdholt/exenv-es6.git | -| [fecha](https://www.npmjs.com/package/fecha) | 4.2.3 | MIT | https://taylorhakes@github.com/taylorhakes/fecha.git | -| [fn.name](https://www.npmjs.com/package/fn.name) | 1.1.0 | MIT | https://github.com/3rd-Eden/fn.name | -| [form-data](https://www.npmjs.com/package/form-data) | 4.0.0 | MIT | git://github.com/form-data/form-data.git | -| [function-bind](https://www.npmjs.com/package/function-bind) | 1.1.1 | MIT | git://github.com/Raynos/function-bind.git | -| [has](https://www.npmjs.com/package/has) | 1.0.3 | MIT | git://github.com/tarruda/has.git | -| [http-proxy-agent](https://www.npmjs.com/package/http-proxy-agent) | 5.0.0 | MIT | git://github.com/TooTallNate/node-http-proxy-agent.git | -| [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent) | 5.0.1 | MIT | git://github.com/TooTallNate/node-https-proxy-agent.git | -| [inherits](https://www.npmjs.com/package/inherits) | 2.0.4 | ISC | git://github.com/isaacs/inherits | -| [ini](https://www.npmjs.com/package/ini) | 4.1.1 | ISC | https://github.com/npm/ini.git | -| [is-arrayish](https://www.npmjs.com/package/is-arrayish) | 0.3.2 | MIT | https://github.com/qix-/node-is-arrayish.git | -| [is-core-module](https://www.npmjs.com/package/is-core-module) | 2.12.1 | MIT | git+https://github.com/inspect-js/is-core-module.git | -| [is-stream](https://www.npmjs.com/package/is-stream) | 2.0.1 | MIT | sindresorhus/is-stream | -| [kuler](https://www.npmjs.com/package/kuler) | 2.0.0 | MIT | https://github.com/3rd-Eden/kuler | -| [logform](https://www.npmjs.com/package/logform) | 2.5.1 | MIT | git+https://github.com/winstonjs/logform.git | -| [lru-cache](https://www.npmjs.com/package/lru-cache) | 6.0.0 | ISC | git://github.com/isaacs/node-lru-cache.git | -| [mime-db](https://www.npmjs.com/package/mime-db) | 1.52.0 | MIT | jshttp/mime-db | -| [mime-types](https://www.npmjs.com/package/mime-types) | 2.1.35 | MIT | jshttp/mime-types | -| [module-details-from-path](https://www.npmjs.com/package/module-details-from-path) | 1.0.3 | MIT | git+https://github.com/watson/module-details-from-path.git | -| [ms](https://www.npmjs.com/package/ms) | 2.1.2 | MIT | zeit/ms | -| [ms](https://www.npmjs.com/package/ms) | 2.1.3 | MIT | vercel/ms | -| [one-time](https://www.npmjs.com/package/one-time) | 1.0.0 | MIT | https://github.com/3rd-Eden/one-time.git | -| [path-parse](https://www.npmjs.com/package/path-parse) | 1.0.7 | MIT | https://github.com/jbgutierrez/path-parse.git | -| [readable-stream](https://www.npmjs.com/package/readable-stream) | 3.6.2 | MIT | git://github.com/nodejs/readable-stream | -| [reflect-metadata](https://www.npmjs.com/package/reflect-metadata) | 0.1.13 | Apache-2.0 | https://github.com/rbuckton/reflect-metadata.git | -| [require-in-the-middle](https://www.npmjs.com/package/require-in-the-middle) | 5.2.0 | MIT | git+https://github.com/elastic/require-in-the-middle.git | -| [resolve](https://www.npmjs.com/package/resolve) | 1.22.3 | MIT | git://github.com/browserify/resolve.git | -| [safe-buffer](https://www.npmjs.com/package/safe-buffer) | 5.2.1 | MIT | git://github.com/feross/safe-buffer.git | -| [safe-stable-stringify](https://www.npmjs.com/package/safe-stable-stringify) | 2.4.3 | MIT | git+https://github.com/BridgeAR/safe-stable-stringify.git | -| [semver](https://www.npmjs.com/package/semver) | 5.7.1 | ISC | https://github.com/npm/node-semver | -| [semver](https://www.npmjs.com/package/semver) | 7.5.1 | ISC | https://github.com/npm/node-semver.git | -| [shimmer](https://www.npmjs.com/package/shimmer) | 1.2.1 | BSD-2-Clause | https://github.com/othiym23/shimmer.git | -| [simple-swizzle](https://www.npmjs.com/package/simple-swizzle) | 0.2.2 | MIT | qix-/node-simple-swizzle | -| [stack-chain](https://www.npmjs.com/package/stack-chain) | 1.3.7 | MIT | git://github.com/AndreasMadsen/stack-chain.git | -| [stack-trace](https://www.npmjs.com/package/stack-trace) | 0.0.10 | MIT | git://github.com/felixge/node-stack-trace.git | -| [string_decoder](https://www.npmjs.com/package/string_decoder) | 1.3.0 | MIT | git://github.com/nodejs/string_decoder.git | -| [supports-preserve-symlinks-flag](https://www.npmjs.com/package/supports-preserve-symlinks-flag) | 1.0.0 | MIT | git+https://github.com/inspect-js/node-supports-preserve-symlinks-flag.git | -| [tabbable](https://www.npmjs.com/package/tabbable) | 5.3.3 | MIT | git+https://github.com/focus-trap/tabbable.git | -| [text-hex](https://www.npmjs.com/package/text-hex) | 1.0.0 | MIT | https://github.com/3rd-Eden/text-hex | -| [triple-beam](https://www.npmjs.com/package/triple-beam) | 1.3.0 | MIT | git+https://github.com/winstonjs/triple-beam.git | -| [triple-beam](https://www.npmjs.com/package/triple-beam) | 1.4.1 | MIT | git+https://github.com/winstonjs/triple-beam.git | -| [tslib](https://www.npmjs.com/package/tslib) | 1.14.1 | 0BSD | https://github.com/Microsoft/tslib.git | -| [tslib](https://www.npmjs.com/package/tslib) | 2.5.0 | 0BSD | https://github.com/Microsoft/tslib.git | -| [undici-types](https://www.npmjs.com/package/undici-types) | 5.25.3 | MIT | git+https://github.com/nodejs/undici.git | -| [util-deprecate](https://www.npmjs.com/package/util-deprecate) | 1.0.2 | MIT | git://github.com/TooTallNate/util-deprecate.git | -| [uuid](https://www.npmjs.com/package/uuid) | 8.3.2 | MIT | https://github.com/uuidjs/uuid.git | -| [winston-transport](https://www.npmjs.com/package/winston-transport) | 4.5.0 | MIT | git@github.com:winstonjs/winston-transport.git | -| [winston](https://www.npmjs.com/package/winston) | 3.10.0 | MIT | https://github.com/winstonjs/winston.git | -| [yallist](https://www.npmjs.com/package/yallist) | 4.0.0 | ISC | git+https://github.com/isaacs/yallist.git | -| [yaml](https://www.npmjs.com/package/yaml) | 2.3.2 | ISC | github:eemeli/yaml | +| Name | Installed version | License | Code | +| :------------------------------------------------------------------------------------------------------------------- | :---------------- | :----------- | :------------------------------------------------------------------------------------- | +| [@colors/colors](https://www.npmjs.com/package/@colors/colors) | 1.5.0 | MIT | http://github.com/DABH/colors.js.git | +| [@dabh/diagnostics](https://www.npmjs.com/package/@dabh/diagnostics) | 2.0.3 | MIT | git://github.com/3rd-Eden/diagnostics.git | +| [@microsoft/1ds-core-js](https://www.npmjs.com/package/@microsoft/1ds-core-js) | 4.0.4 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/main/shared/1ds-core-js | +| [@microsoft/1ds-post-js](https://www.npmjs.com/package/@microsoft/1ds-post-js) | 4.0.4 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/main/channels/1ds-post-js | +| [@microsoft/applicationinsights-channel-js](https://www.npmjs.com/package/@microsoft/applicationinsights-channel-js) | 3.0.5 | MIT | github:Microsoft/applicationinsights-js | +| [@microsoft/applicationinsights-common](https://www.npmjs.com/package/@microsoft/applicationinsights-common) | 3.0.5 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/main/shared/AppInsightsCommon | +| [@microsoft/applicationinsights-core-js](https://www.npmjs.com/package/@microsoft/applicationinsights-core-js) | 3.0.5 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/main/shared/AppInsightsCore | +| [@microsoft/applicationinsights-shims](https://www.npmjs.com/package/@microsoft/applicationinsights-shims) | 3.0.1 | MIT | https://github.com/microsoft/ApplicationInsights-JS/tree/main/tools/shims | +| [@microsoft/applicationinsights-web-basic](https://www.npmjs.com/package/@microsoft/applicationinsights-web-basic) | 3.0.5 | MIT | https://github.com/microsoft/ApplicationInsights-JS.git | +| [@microsoft/dynamicproto-js](https://www.npmjs.com/package/@microsoft/dynamicproto-js) | 2.0.2 | MIT | git+https://github.com/microsoft/DynamicProto-JS.git | +| [@microsoft/fast-element](https://www.npmjs.com/package/@microsoft/fast-element) | 1.11.0 | MIT | git+https://github.com/Microsoft/fast.git | +| [@microsoft/fast-foundation](https://www.npmjs.com/package/@microsoft/fast-foundation) | 2.48.0 | MIT | git+https://github.com/Microsoft/fast.git | +| [@microsoft/fast-react-wrapper](https://www.npmjs.com/package/@microsoft/fast-react-wrapper) | 0.1.48 | MIT | git+https://github.com/Microsoft/fast.git | +| [@microsoft/fast-web-utilities](https://www.npmjs.com/package/@microsoft/fast-web-utilities) | 5.4.1 | MIT | git+https://github.com/Microsoft/fast.git | +| [@nevware21/ts-async](https://www.npmjs.com/package/@nevware21/ts-async) | 0.3.0 | MIT | https://github.com/nevware21/ts-async.git | +| [@nevware21/ts-utils](https://www.npmjs.com/package/@nevware21/ts-utils) | 0.10.1 | MIT | https://github.com/nevware21/ts-utils.git | +| [@nevware21/ts-utils](https://www.npmjs.com/package/@nevware21/ts-utils) | 0.9.5 | MIT | https://github.com/nevware21/ts-utils.git | +| [@types/ini](https://www.npmjs.com/package/@types/ini) | 1.3.32 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | +| [@types/node](https://www.npmjs.com/package/@types/node) | 20.8.7 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | +| [@types/semver](https://www.npmjs.com/package/@types/semver) | 7.5.4 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | +| [@types/triple-beam](https://www.npmjs.com/package/@types/triple-beam) | 1.3.2 | MIT | https://github.com/DefinitelyTyped/DefinitelyTyped.git | +| [@vscode/debugadapter](https://www.npmjs.com/package/@vscode/debugadapter) | 1.61.0 | MIT | https://github.com/microsoft/vscode-debugadapter-node.git | +| [@vscode/debugprotocol](https://www.npmjs.com/package/@vscode/debugprotocol) | 1.61.0 | MIT | https://github.com/microsoft/vscode-debugadapter-node.git | +| [@vscode/extension-telemetry](https://www.npmjs.com/package/@vscode/extension-telemetry) | 0.9.0 | MIT | https://github.com/Microsoft/vscode-extension-telemetry.git | +| [@vscode/webview-ui-toolkit](https://www.npmjs.com/package/@vscode/webview-ui-toolkit) | 1.2.2 | MIT | git+https://github.com/microsoft/vscode-webview-ui-toolkit.git | +| [add](https://www.npmjs.com/package/add) | 2.0.6 | MIT | https://github.com/ben-ng/add.git | +| [ansi-to-html](https://www.npmjs.com/package/ansi-to-html) | 0.7.2 | MIT | https://github.com/rburns/ansi-to-html.git | +| [async](https://www.npmjs.com/package/async) | 3.2.4 | MIT | https://github.com/caolan/async.git | +| [bcryptjs](https://www.npmjs.com/package/bcryptjs) | 2.4.3 | MIT | https://github.com/dcodeIO/bcrypt.js.git | +| [color-convert](https://www.npmjs.com/package/color-convert) | 1.9.3 | MIT | Qix-/color-convert | +| [color-name](https://www.npmjs.com/package/color-name) | 1.1.3 | MIT | git@github.com:dfcreative/color-name.git | +| [color-name](https://www.npmjs.com/package/color-name) | 1.1.4 | MIT | git@github.com:colorjs/color-name.git | +| [color-string](https://www.npmjs.com/package/color-string) | 1.9.1 | MIT | Qix-/color-string | +| [color](https://www.npmjs.com/package/color) | 3.2.1 | MIT | Qix-/color | +| [colorspace](https://www.npmjs.com/package/colorspace) | 1.1.4 | MIT | https://github.com/3rd-Eden/colorspace | +| [enabled](https://www.npmjs.com/package/enabled) | 2.0.0 | MIT | git://github.com/3rd-Eden/enabled.git | +| [entities](https://www.npmjs.com/package/entities) | 2.2.0 | BSD-2-Clause | git://github.com/fb55/entities.git | +| [exenv-es6](https://www.npmjs.com/package/exenv-es6) | 1.1.1 | MIT | git+https://github.com/chrisdholt/exenv-es6.git | +| [fecha](https://www.npmjs.com/package/fecha) | 4.2.3 | MIT | https://taylorhakes@github.com/taylorhakes/fecha.git | +| [fn.name](https://www.npmjs.com/package/fn.name) | 1.1.0 | MIT | https://github.com/3rd-Eden/fn.name | +| [inherits](https://www.npmjs.com/package/inherits) | 2.0.4 | ISC | git://github.com/isaacs/inherits | +| [ini](https://www.npmjs.com/package/ini) | 4.1.1 | ISC | https://github.com/npm/ini.git | +| [is-arrayish](https://www.npmjs.com/package/is-arrayish) | 0.3.2 | MIT | https://github.com/qix-/node-is-arrayish.git | +| [is-stream](https://www.npmjs.com/package/is-stream) | 2.0.1 | MIT | sindresorhus/is-stream | +| [kuler](https://www.npmjs.com/package/kuler) | 2.0.0 | MIT | https://github.com/3rd-Eden/kuler | +| [logform](https://www.npmjs.com/package/logform) | 2.5.1 | MIT | git+https://github.com/winstonjs/logform.git | +| [lru-cache](https://www.npmjs.com/package/lru-cache) | 6.0.0 | ISC | git://github.com/isaacs/node-lru-cache.git | +| [ms](https://www.npmjs.com/package/ms) | 2.1.3 | MIT | vercel/ms | +| [one-time](https://www.npmjs.com/package/one-time) | 1.0.0 | MIT | https://github.com/3rd-Eden/one-time.git | +| [readable-stream](https://www.npmjs.com/package/readable-stream) | 3.6.2 | MIT | git://github.com/nodejs/readable-stream | +| [reflect-metadata](https://www.npmjs.com/package/reflect-metadata) | 0.1.13 | Apache-2.0 | https://github.com/rbuckton/reflect-metadata.git | +| [safe-buffer](https://www.npmjs.com/package/safe-buffer) | 5.2.1 | MIT | git://github.com/feross/safe-buffer.git | +| [safe-stable-stringify](https://www.npmjs.com/package/safe-stable-stringify) | 2.4.3 | MIT | git+https://github.com/BridgeAR/safe-stable-stringify.git | +| [semver](https://www.npmjs.com/package/semver) | 7.5.4 | ISC | https://github.com/npm/node-semver.git | +| [simple-swizzle](https://www.npmjs.com/package/simple-swizzle) | 0.2.2 | MIT | qix-/node-simple-swizzle | +| [stack-trace](https://www.npmjs.com/package/stack-trace) | 0.0.10 | MIT | git://github.com/felixge/node-stack-trace.git | +| [string_decoder](https://www.npmjs.com/package/string_decoder) | 1.3.0 | MIT | git://github.com/nodejs/string_decoder.git | +| [tabbable](https://www.npmjs.com/package/tabbable) | 5.3.3 | MIT | git+https://github.com/focus-trap/tabbable.git | +| [text-hex](https://www.npmjs.com/package/text-hex) | 1.0.0 | MIT | https://github.com/3rd-Eden/text-hex | +| [triple-beam](https://www.npmjs.com/package/triple-beam) | 1.3.0 | MIT | git+https://github.com/winstonjs/triple-beam.git | +| [triple-beam](https://www.npmjs.com/package/triple-beam) | 1.4.1 | MIT | git+https://github.com/winstonjs/triple-beam.git | +| [tslib](https://www.npmjs.com/package/tslib) | 1.14.1 | 0BSD | https://github.com/Microsoft/tslib.git | +| [undici-types](https://www.npmjs.com/package/undici-types) | 5.25.3 | MIT | git+https://github.com/nodejs/undici.git | +| [util-deprecate](https://www.npmjs.com/package/util-deprecate) | 1.0.2 | MIT | git://github.com/TooTallNate/util-deprecate.git | +| [winston-transport](https://www.npmjs.com/package/winston-transport) | 4.5.0 | MIT | git@github.com:winstonjs/winston-transport.git | +| [winston](https://www.npmjs.com/package/winston) | 3.10.0 | MIT | https://github.com/winstonjs/winston.git | +| [yallist](https://www.npmjs.com/package/yallist) | 4.0.0 | ISC | git+https://github.com/isaacs/yallist.git | +| [yaml](https://www.npmjs.com/package/yaml) | 2.3.2 | ISC | github:eemeli/yaml | diff --git a/packages/databricks-vscode/package.json b/packages/databricks-vscode/package.json index 79cf15e89..6f86a2b97 100644 --- a/packages/databricks-vscode/package.json +++ b/packages/databricks-vscode/package.json @@ -4,7 +4,7 @@ "description": "IDE support for Databricks", "publisher": "databricks", "license": "LicenseRef-LICENSE", - "version": "1.2.2", + "version": "1.2.4", "engines": { "vscode": "^1.83.0" }, @@ -602,11 +602,6 @@ "default": false, "description": "Enable/disable filtering for only accessible clusters (clusters on which the current user can run code)" }, - "databricks.cli.verboseMode": { - "type": "boolean", - "default": false, - "description": "Enable verbose logging for databricks CLI (sync mode)." - }, "databricks.sync.destinationType": { "type": "string", "default": "workspace", @@ -671,7 +666,7 @@ "useYarn": false }, "cli": { - "version": "0.208.2" + "version": "0.210.3" }, "scripts": { "vscode:prepublish": "rm -rf out && yarn run package:compile && yarn run package:wrappers:write && yarn run package:jupyter-init-script:write && yarn run package:copy-webview-toolkit && yarn run generate-telemetry", diff --git a/packages/databricks-vscode/resources/python/file.workflow-wrapper.py b/packages/databricks-vscode/resources/python/file.workflow-wrapper.py index fcade5657..27d2a20d3 100644 --- a/packages/databricks-vscode/resources/python/file.workflow-wrapper.py +++ b/packages/databricks-vscode/resources/python/file.workflow-wrapper.py @@ -4,26 +4,8 @@ import sys import os -databricks_arg_idx = [] -for i, arg in enumerate(sys.argv): - if i == 0: - continue - if sys.argv[i-1] == "--databricks-source-file": - python_file = arg - elif sys.argv[i-1] == "--databricks-project-root": - project_root = arg - else: - continue - databricks_arg_idx.extend([i, i-1]) - -if python_file is None: - raise Exception("--databricks-source-file argument not specified") - -if project_root is None: - raise Exception("--databricks-project-root argument not specified") - -#remove databricks args from argv -sys.argv = [value for i,value in enumerate(sys.argv) if i not in databricks_arg_idx] +python_file = '{{DATABRICKS_SOURCE_FILE}}' +project_root = '{{DATABRICKS_PROJECT_ROOT}}' # change working directory os.chdir(os.path.dirname(python_file)) diff --git a/packages/databricks-vscode/resources/python/notebook.workflow-wrapper.py b/packages/databricks-vscode/resources/python/notebook.workflow-wrapper.py index d622e32e3..9909f2272 100644 --- a/packages/databricks-vscode/resources/python/notebook.workflow-wrapper.py +++ b/packages/databricks-vscode/resources/python/notebook.workflow-wrapper.py @@ -3,27 +3,17 @@ def databricks_preamble(): from IPython import get_ipython from typing import List from shlex import quote + import os + import sys - dbutils.widgets.text("DATABRICKS_SOURCE_FILE", - "{{DATABRICKS_SOURCE_FILE}}") - dbutils.widgets.text("DATABRICKS_PROJECT_ROOT", - "{{DATABRICKS_PROJECT_ROOT}}") - src_file_dir = None - project_root_dir = None + src_file_dir = os.path.dirname("{{DATABRICKS_SOURCE_FILE}}") + os.chdir(src_file_dir) - if dbutils.widgets.get("DATABRICKS_SOURCE_FILE") != "": - import os - src_file_dir = os.path.dirname( - dbutils.widgets.get("DATABRICKS_SOURCE_FILE")) - os.chdir(src_file_dir) - - if dbutils.widgets.get("DATABRICKS_PROJECT_ROOT") != "": - import sys - project_root_dir = dbutils.widgets.get("DATABRICKS_PROJECT_ROOT") - sys.path.insert(0, project_root_dir) + project_root_dir = "{{DATABRICKS_PROJECT_ROOT}}" + sys.path.insert(0, project_root_dir) def parse_databricks_magic_lines(lines: List[str]): - if len(lines) == 0 or src_file_dir is None: + if len(lines) == 0: return lines first = "" diff --git a/packages/databricks-vscode/src/cli/CliWrapper.test.ts b/packages/databricks-vscode/src/cli/CliWrapper.test.ts index cfa57db57..07b54181e 100644 --- a/packages/databricks-vscode/src/cli/CliWrapper.test.ts +++ b/packages/databricks-vscode/src/cli/CliWrapper.test.ts @@ -5,62 +5,100 @@ import { RemoteUri, SyncDestinationMapper, } from "../sync/SyncDestination"; +import {workspaceConfigs} from "../vscode-objs/WorkspaceConfigs"; import {promisify} from "node:util"; import {execFile as execFileCb} from "node:child_process"; import {withFile} from "tmp-promise"; -import {writeFile} from "node:fs/promises"; - +import {writeFile, readFile} from "node:fs/promises"; +import {when, spy, reset} from "ts-mockito"; import {CliWrapper} from "./CliWrapper"; import path from "node:path"; +import os from "node:os"; +import crypto from "node:crypto"; import {Context} from "@databricks/databricks-sdk/dist/context"; import {logging} from "@databricks/databricks-sdk"; const execFile = promisify(execFileCb); +const cliPath = path.join(__dirname, "../../bin/databricks"); + +function getTempLogFilePath() { + return path.join( + os.tmpdir(), + `databricks-cli-logs-${crypto.randomUUID()}.json` + ); +} + +function createCliWrapper(logFilePath?: string) { + return new CliWrapper( + { + asAbsolutePath(relativePath: string) { + return path.join(__dirname, "../..", relativePath); + }, + } as any, + logFilePath + ); +} describe(__filename, () => { it("should embed a working databricks CLI", async () => { - const cliPath = __dirname + "/../../bin/databricks"; const result = await execFile(cliPath, ["--help"]); assert.ok(result.stdout.indexOf("databricks") > 0); }); + let mocks: any[] = []; + afterEach(() => { + mocks.forEach((mock) => reset(mock)); + mocks = []; + }); + + it("should tell CLI to log its output to a file", async () => { + const logFilePath = getTempLogFilePath(); + const configsSpy = spy(workspaceConfigs); + mocks.push(configsSpy); + when(configsSpy.loggingEnabled).thenReturn(true); + const cli = createCliWrapper(logFilePath); + await execFile(cli.cliPath, ["version", ...cli.loggingArguments]); + const file = await readFile(logFilePath); + // Just checking if the file is not empty to avoid depending on internal CLI log patterns + assert.ok(file.toString().length > 0); + }); + it("should create sync commands", async () => { - const cli = new CliWrapper({ - asAbsolutePath(path: string) { - return path; - }, - } as any); + const logFilePath = getTempLogFilePath(); + const cli = createCliWrapper(logFilePath); const mapper = new SyncDestinationMapper( - new LocalUri( - Uri.file("/Users/fabian.jakobs/Desktop/notebook-best-practices") - ), + new LocalUri(Uri.file("/user/project")), new RemoteUri( Uri.from({ scheme: "wsfs", - path: "/Repos/fabian.jakobs@databricks.com/notebook-best-practices", + path: "/Repos/user@databricks.com/project", }) ) ); + const syncCommand = `${cliPath} sync . /Repos/user@databricks.com/project --watch --output json`; + const loggingArgs = `--log-level debug --log-file ${logFilePath} --log-format json`; let {command, args} = cli.getSyncCommand(mapper, "incremental"); assert.equal( [command, ...args].join(" "), - "./bin/databricks sync . /Repos/fabian.jakobs@databricks.com/notebook-best-practices --watch --output json" + [syncCommand, loggingArgs].join(" ") ); ({command, args} = cli.getSyncCommand(mapper, "full")); assert.equal( [command, ...args].join(" "), - "./bin/databricks sync . /Repos/fabian.jakobs@databricks.com/notebook-best-practices --watch --output json --full" + [syncCommand, loggingArgs, "--full"].join(" ") ); + + const configsSpy = spy(workspaceConfigs); + mocks.push(configsSpy); + when(configsSpy.loggingEnabled).thenReturn(false); + ({command, args} = cli.getSyncCommand(mapper, "incremental")); + assert.equal([command, ...args].join(" "), syncCommand); }); it("should create an 'add profile' command", () => { - const cli = new CliWrapper({ - asAbsolutePath(path: string) { - return path; - }, - } as any); + const cli = createCliWrapper(); const {command, args} = cli.getAddProfileCommand( "DEFAULT", @@ -69,27 +107,20 @@ describe(__filename, () => { assert.equal( [command, ...args].join(" "), - "./bin/databricks configure --no-interactive --profile DEFAULT --host https://databricks.com/ --token" + `${cliPath} configure --no-interactive --profile DEFAULT --host https://databricks.com/ --token` ); }); it("should list profiles when no config file exists", async () => { - const cli = new CliWrapper({ - asAbsolutePath(p: string) { - return path.join(__dirname, "..", "..", p); - }, - } as any); - + const logFilePath = getTempLogFilePath(); + const cli = createCliWrapper(logFilePath); const profiles = await cli.listProfiles("/tmp/does-not-exist"); assert.equal(profiles.length, 0); }); it("should list profiles", async function () { - const cli = new CliWrapper({ - asAbsolutePath(p: string) { - return path.join(__dirname, "..", "..", p); - }, - } as any); + const logFilePath = getTempLogFilePath(); + const cli = createCliWrapper(logFilePath); await withFile(async ({path}) => { await writeFile( @@ -121,11 +152,8 @@ describe(__filename, () => { }); it("should load all valid profiles and return errors for rest", async () => { - const cli = new CliWrapper({ - asAbsolutePath(p: string) { - return path.join(__dirname, "..", "..", p); - }, - } as any); + const logFilePath = getTempLogFilePath(); + const cli = createCliWrapper(logFilePath); await withFile(async ({path}) => { await writeFile( @@ -153,7 +181,7 @@ host = example.com path, new Context({ logger: logging.NamedLogger.getOrCreate( - "cli-wrapper-test", + "cli-profile-format-test", { factory: () => { return { @@ -181,4 +209,38 @@ host = example.com assert.ok(typoLog.level === "error"); }); }); + + it("should show error for corrupted config file and return empty profile list", async () => { + const logFilePath = getTempLogFilePath(); + const cli = createCliWrapper(logFilePath); + + await withFile(async ({path}) => { + await writeFile(path, `[bad]\ntest 123`); + const logs: {level: string; msg?: string; meta: any}[] = []; + const profiles = await cli.listProfiles( + path, + new Context({ + logger: logging.NamedLogger.getOrCreate( + "cli-parsing-error-test", + { + factory: () => { + return { + log: (level, msg, meta) => { + logs.push({level, msg, meta}); + }, + }; + }, + } + ), + }) + ); + const errorLog = logs.find( + (log) => + log.msg?.includes("Failed to parse Databricks Config File") + ); + assert.ok(errorLog !== undefined); + assert.ok(errorLog.level === "error"); + assert.equal(profiles.length, 0); + }); + }); }); diff --git a/packages/databricks-vscode/src/cli/CliWrapper.ts b/packages/databricks-vscode/src/cli/CliWrapper.ts index 2f8194b59..5a27c6371 100644 --- a/packages/databricks-vscode/src/cli/CliWrapper.ts +++ b/packages/databricks-vscode/src/cli/CliWrapper.ts @@ -43,12 +43,29 @@ function getValidHost(host: string) { * of the databricks CLI */ export class CliWrapper { - constructor(private extensionContext: ExtensionContext) {} + constructor( + private extensionContext: ExtensionContext, + private logFilePath?: string + ) {} get cliPath(): string { return this.extensionContext.asAbsolutePath("./bin/databricks"); } + get loggingArguments(): string[] { + if (!workspaceConfigs.loggingEnabled) { + return []; + } + return [ + "--log-level", + "debug", + "--log-file", + this.logFilePath ?? "stderr", + "--log-format", + "json", + ]; + } + /** * Constructs the databricks sync command */ @@ -63,20 +80,23 @@ export class CliWrapper { "--watch", "--output", "json", + ...this.loggingArguments, ]; if (syncType === "full") { args.push("--full"); } - if (workspaceConfigs.cliVerboseMode) { - args.push("--log-level", "debug", "--log-file", "stderr"); - } return {command: this.cliPath, args}; } private getListProfilesCommand(): Command { return { command: this.cliPath, - args: ["auth", "profiles", "--skip-validate"], + args: [ + "auth", + "profiles", + "--skip-validate", + ...this.loggingArguments, + ], }; } @@ -85,13 +105,31 @@ export class CliWrapper { configfilePath?: string, @context ctx?: Context ): Promise> { - const cmd = await this.getListProfilesCommand(); - const res = await execFile(cmd.command, cmd.args, { - env: { - ...EnvVarGenerators.getEnvVarsForCli(configfilePath), - ...EnvVarGenerators.getProxyEnvVars(), - }, - }); + const cmd = this.getListProfilesCommand(); + + let res; + try { + res = await execFile(cmd.command, cmd.args, { + env: { + ...EnvVarGenerators.getEnvVarsForCli(configfilePath), + ...EnvVarGenerators.getProxyEnvVars(), + }, + }); + } catch (e) { + let msg = "Failed to load Databricks Config File"; + if (e instanceof Error) { + if (e.message.includes("cannot parse config file")) { + msg = + "Failed to parse Databricks Config File, please make sure it's in the correct ini format"; + } else if (e.message.includes("spawn UNKNOWN")) { + msg = `Failed to parse Databricks Config File using databricks CLI, please make sure you have permissions to execute this binary: "${this.cliPath}"`; + } + } + ctx?.logger?.error(msg, e); + this.showConfigFileWarning(msg); + return []; + } + const profiles = JSON.parse(res.stdout).profiles || []; const result = []; @@ -113,24 +151,26 @@ export class CliWrapper { msg = `Error parsing profile ${profile.name}`; } ctx?.logger?.error(msg, e); - window - .showWarningMessage( - msg, - "Open Databricks Config File", - "Ignore" - ) - .then((choice) => { - if (choice === "Open Databricks Config File") { - commands.executeCommand( - "databricks.connection.openDatabricksConfigFile" - ); - } - }); + this.showConfigFileWarning(msg); } } return result; } + private async showConfigFileWarning(msg: string) { + const openAction = "Open Databricks Config File"; + const choice = await window.showWarningMessage( + msg, + openAction, + "Ignore" + ); + if (choice === openAction) { + commands.executeCommand( + "databricks.connection.openDatabricksConfigFile" + ); + } + } + public async getBundleSchema(): Promise { const {stdout} = await execFile(this.cliPath, ["bundle", "schema"]); return stdout; diff --git a/packages/databricks-vscode/src/cli/DatabricksCliSyncParser.ts b/packages/databricks-vscode/src/cli/DatabricksCliSyncParser.ts index dfaa3290f..9d9efa3b3 100644 --- a/packages/databricks-vscode/src/cli/DatabricksCliSyncParser.ts +++ b/packages/databricks-vscode/src/cli/DatabricksCliSyncParser.ts @@ -3,13 +3,6 @@ import {EventEmitter} from "vscode"; import {Loggers} from "../logger"; import {SyncState} from "../sync"; -const databricksLogLevelToSdk = new Map([ - ["DEBUG", logging.LEVELS.debug], - ["INFO", logging.LEVELS.info], - ["WARN", logging.LEVELS.warn], - ["ERROR", logging.LEVELS.error], -]); - type EventBase = { timestamp: string; seq: number; @@ -96,28 +89,11 @@ export class DatabricksCliSyncParser { public processStderr(data: string) { const logLines = data.split("\n"); - let currentLogLevel: logging.LEVELS = logging.LEVELS.info; for (let i = 0; i < logLines.length; i++) { const line = logLines[i].trim(); if (line.length === 0) { continue; } - - const typeMatch = line.match( - /[0-9]+(?:\/[0-9]+)+ [0-9]+(?::[0-9]+)+ \[(.+)\]/ - ); - if (typeMatch) { - currentLogLevel = - databricksLogLevelToSdk.get(typeMatch[1]) ?? - currentLogLevel; - } - logging.NamedLogger.getOrCreate(Loggers.CLI).log( - currentLogLevel, - line, - { - outfile: "stderr", - } - ); this.writeEmitter.fire(line.trim() + "\r\n"); if (this.matchForErrors(line)) { return; @@ -155,9 +131,6 @@ export class DatabricksCliSyncParser { if (line.length === 0) { continue; } - logging.NamedLogger.getOrCreate(Loggers.CLI).info(line, { - outfile: "stdout", - }); try { this.processLine(line); diff --git a/packages/databricks-vscode/src/configuration/configureWorkspaceWizard.ts b/packages/databricks-vscode/src/configuration/configureWorkspaceWizard.ts index 01b9ae089..1b19fb979 100644 --- a/packages/databricks-vscode/src/configuration/configureWorkspaceWizard.ts +++ b/packages/databricks-vscode/src/configuration/configureWorkspaceWizard.ts @@ -72,6 +72,7 @@ export async function configureWorkspaceWizard( return false; }, items, + ignoreFocusOut: true, }); state.host = normalizeHost(host); @@ -155,6 +156,7 @@ export async function configureWorkspaceWizard( totalSteps: 2, placeholder: "Select authentication method", items, + ignoreFocusOut: true, shouldResume: async () => { return false; }, diff --git a/packages/databricks-vscode/src/configuration/models/BundleFileConfigModel.ts b/packages/databricks-vscode/src/configuration/models/BundleFileConfigModel.ts deleted file mode 100644 index 9217d24d9..000000000 --- a/packages/databricks-vscode/src/configuration/models/BundleFileConfigModel.ts +++ /dev/null @@ -1,138 +0,0 @@ -import {Disposable, Uri} from "vscode"; -import {BundleFileSet, BundleWatcher} from "../../bundle"; -import {BundleTarget} from "../../bundle/types"; -import {CachedValue} from "../../locking/CachedValue"; -import {BundleFileConfig, isBundleConfigKey} from "../types"; -/** - * Reads and writes bundle configs. This class does not notify when the configs change. - * We use the BundleWatcher to notify when the configs change. - */ -export class BundleFileConfigModel implements Disposable { - private disposables: Disposable[] = []; - - private readonly bundleFileConfigCache = new CachedValue< - BundleFileConfig | undefined - >(async () => { - if (this.target === undefined) { - return undefined; - } - return this.readAll(this.target); - }); - - public readonly onDidChange = this.bundleFileConfigCache.onDidChange; - - private target: string | undefined; - - private readonly readerMapping: Record< - keyof BundleFileConfig, - ( - t?: BundleTarget - ) => Promise - > = { - authParams: this.getAuthParams, - mode: this.getMode, - host: this.getHost, - }; - - constructor( - private readonly bundleFileSet: BundleFileSet, - private readonly bunldeFileWatcher: BundleWatcher - ) { - this.disposables.push( - this.bunldeFileWatcher.onDidChange(async () => { - await this.bundleFileConfigCache.refresh(); - }) - ); - } - - private async getHost(target?: BundleTarget) { - return target?.workspace?.host; - } - - private async getMode(target?: BundleTarget) { - return target?.mode; - } - - /* eslint-disable @typescript-eslint/no-unused-vars */ - private async getAuthParams(target?: BundleTarget) { - return undefined; - } - /* eslint-enable @typescript-eslint/no-unused-vars */ - - get targets() { - return this.bundleFileSet.bundleDataCache.value.then( - (data) => data?.targets - ); - } - - get defaultTarget() { - return this.targets.then((targets) => { - if (targets === undefined) { - return undefined; - } - const defaultTarget = Object.keys(targets).find( - (target) => targets[target].default - ); - return defaultTarget; - }); - } - - public async setTarget(target: string | undefined) { - this.target = target; - await this.bundleFileConfigCache.refresh(); - } - - private async readAll(target: string) { - const configs = {} as any; - const targetObject = (await this.bundleFileSet.bundleDataCache.value) - .targets?.[target]; - - for (const key of Object.keys(this.readerMapping)) { - if (!isBundleConfigKey(key)) { - continue; - } - configs[key] = await this.readerMapping[key](targetObject); - } - return configs as BundleFileConfig; - } - - public async getFileToWrite(key: T) { - const filesWithTarget: Uri[] = []; - const filesWithConfig = ( - await this.bundleFileSet.findFile(async (data, file) => { - const bundleTarget = data.targets?.[this.target ?? ""]; - if (bundleTarget) { - filesWithTarget.push(file); - } - if ( - (await this.readerMapping[key](bundleTarget)) === undefined - ) { - return false; - } - return true; - }) - ).map((file) => file.file); - - if (filesWithConfig.length > 1) { - throw new Error( - `Multiple files found to write the config ${key} for target ${this.target}` - ); - } - - if (filesWithConfig.length === 0 && filesWithTarget.length === 0) { - throw new Error( - `No files found to write the config ${key} for target ${this.target}` - ); - } - - return [...filesWithConfig, ...filesWithTarget][0]; - } - - public async load() { - return await this.bundleFileConfigCache.value; - } - - public dispose() { - this.disposables.forEach((d) => d.dispose()); - } -} diff --git a/packages/databricks-vscode/src/extension.ts b/packages/databricks-vscode/src/extension.ts index 6080ebd57..03eb4ccf6 100644 --- a/packages/databricks-vscode/src/extension.ts +++ b/packages/databricks-vscode/src/extension.ts @@ -151,7 +151,17 @@ export async function activate( workspace.onDidChangeConfiguration(updateFeatureContexts) ); - const cli = new CliWrapper(context); + // Configuration group + let cliLogFilePath; + try { + cliLogFilePath = await loggerManager.getLogFile("databricks-cli"); + } catch (e) { + logging.NamedLogger.getOrCreate(Loggers.Extension).error( + "Failed to create a log file for the CLI", + e + ); + } + const cli = new CliWrapper(context, cliLogFilePath); const bundleFileSet = new BundleFileSet(workspace.workspaceFolders[0].uri); const bundleFileWatcher = new BundleWatcher(bundleFileSet); context.subscriptions.push(bundleFileWatcher); diff --git a/packages/databricks-vscode/src/logger/LoggerManager.test.ts b/packages/databricks-vscode/src/logger/LoggerManager.test.ts index af688a4b2..73eac5fe4 100644 --- a/packages/databricks-vscode/src/logger/LoggerManager.test.ts +++ b/packages/databricks-vscode/src/logger/LoggerManager.test.ts @@ -26,7 +26,6 @@ describe(__filename, function () { logging.NamedLogger.getOrCreate(Loggers.Extension).debug( "test message" ); - logging.NamedLogger.getOrCreate(Loggers.CLI).debug("test message"); await new Promise((resolve) => setTimeout( @@ -34,17 +33,12 @@ describe(__filename, function () { new Time(0.5, TimeUnits.seconds).toMillSeconds().value ) ); - ["sdk-and-extension-logs.json", "databricks-cli-logs.json"].forEach( - async (logfile) => { - const rawLogs = await readFile(path.join(tempDir, logfile), { - encoding: "utf-8", - }); - - const logs = rawLogs.split("\n"); - assert.ok(logs.length !== 0); - assert.ok(logs[0].includes("test message")); - } - ); + const logfile = path.join(tempDir, "sdk-and-extension-logs.json"); + const rawLogs = await readFile(logfile, {encoding: "utf-8"}); + + const logs = rawLogs.split("\n"); + assert.ok(logs.length !== 0); + assert.ok(logs[0].includes("test message")); }); afterEach(async () => { diff --git a/packages/databricks-vscode/src/logger/LoggerManager.ts b/packages/databricks-vscode/src/logger/LoggerManager.ts index f299f9b2e..671ad759a 100644 --- a/packages/databricks-vscode/src/logger/LoggerManager.ts +++ b/packages/databricks-vscode/src/logger/LoggerManager.ts @@ -11,7 +11,7 @@ const {NamedLogger, ExposedLoggers} = logging; export class LoggerManager { constructor(readonly context: ExtensionContext) {} - private async getLogFile(prefix: string) { + async getLogFile(prefix: string) { await mkdir(this.context.logUri.fsPath, {recursive: true}); const logFile = path.join( this.context.logUri.fsPath, @@ -65,11 +65,9 @@ export class LoggerManager { true ); - /** - This logger collects all the logs in the extension. - */ + // This logger collects all the logs in the extension. NamedLogger.getOrCreate( - "Extension", + Loggers.Extension, { factory: (name) => { return loggers.add(name, { @@ -86,29 +84,6 @@ export class LoggerManager { }, true ); - - const cliLogFile = await this.getLogFile("databricks-cli"); - /** - This logger collects all the output from databricks CLI. - */ - NamedLogger.getOrCreate( - "DatabricksCLI", - { - factory: (name) => { - return loggers.add(name, { - transports: [ - getOutputConsoleTransport(outputChannel, { - level: "error", - }), - this.getFileTransport(cliLogFile, { - level: "debug", - }), - ], - }); - }, - }, - true - ); } openLogFolder() { @@ -119,6 +94,5 @@ export class LoggerManager { /* eslint-disable @typescript-eslint/naming-convention */ export enum Loggers { Extension = "Extension", - CLI = "DatabricksCLI", } /* eslint-enable @typescript-eslint/naming-convention */ diff --git a/packages/databricks-vscode/src/run/WorkflowRunner.ts b/packages/databricks-vscode/src/run/WorkflowRunner.ts index ab701856d..9214c0280 100644 --- a/packages/databricks-vscode/src/run/WorkflowRunner.ts +++ b/packages/databricks-vscode/src/run/WorkflowRunner.ts @@ -173,16 +173,7 @@ export class WorkflowRunner implements Disposable { panel.showExportedRun( await cluster.runNotebookAndWait({ path: remoteFilePath, - parameters: { - // eslint-disable-next-line @typescript-eslint/naming-convention - DATABRICKS_SOURCE_FILE: - syncDestination.localToRemote(program) - .workspacePrefixPath, - // eslint-disable-next-line @typescript-eslint/naming-convention - DATABRICKS_PROJECT_ROOT: - syncDestination.remoteUri.workspacePrefixPath, - ...parameters, - }, + parameters, onProgress: ( state: jobs.RunLifeCycleState, run: WorkflowRun @@ -200,16 +191,14 @@ export class WorkflowRunner implements Disposable { ? await new WorkspaceFsWorkflowWrapper( this.connectionManager, this.context - ).createPythonFileWrapper(originalFileUri) + ).createPythonFileWrapper( + originalFileUri, + syncDestination.remoteUri + ) : undefined; const response = await cluster.runPythonAndWait({ path: wrappedFile ? wrappedFile.path : originalFileUri.path, - args: (args ?? []).concat([ - "--databricks-source-file", - originalFileUri.workspacePrefixPath, - "--databricks-project-root", - syncDestination.remoteUri.workspacePrefixPath, - ]), + args: args ?? [], onProgress: ( state: jobs.RunLifeCycleState, run: WorkflowRun diff --git a/packages/databricks-vscode/src/ui/wizard.ts b/packages/databricks-vscode/src/ui/wizard.ts index e4a7d3bb8..5a16df10d 100644 --- a/packages/databricks-vscode/src/ui/wizard.ts +++ b/packages/databricks-vscode/src/ui/wizard.ts @@ -43,6 +43,7 @@ interface QuickAutoCompleteParameters { buttons?: QuickInputButton[]; shouldResume: () => Thenable; items: Array; + ignoreFocusOut: boolean; } interface QuickPickParameters { @@ -54,6 +55,7 @@ interface QuickPickParameters { placeholder: string; buttons?: QuickInputButton[]; shouldResume: () => Thenable; + ignoreFocusOut: boolean; } export class MultiStepInput { @@ -107,6 +109,7 @@ export class MultiStepInput { buttons, shouldResume, items, + ignoreFocusOut, }: QuickAutoCompleteParameters): Promise< | string | (QuickAutoCompleteParameters extends {buttons: (infer I)[]} @@ -129,6 +132,7 @@ export class MultiStepInput { input.totalSteps = totalSteps; input.placeholder = prompt; input.items = [...items]; + input.ignoreFocusOut = ignoreFocusOut; disposables.push( input.onDidChangeValue(async () => { @@ -231,6 +235,7 @@ export class MultiStepInput { placeholder, buttons, shouldResume, + ignoreFocusOut, }: P) { const disposables: Disposable[] = []; try { @@ -243,6 +248,7 @@ export class MultiStepInput { input.totalSteps = totalSteps; input.placeholder = placeholder; input.items = items; + input.ignoreFocusOut = ignoreFocusOut; if (activeItem) { input.activeItems = [activeItem]; } diff --git a/packages/databricks-vscode/src/vscode-objs/StateStorage.ts b/packages/databricks-vscode/src/vscode-objs/StateStorage.ts index 5d3f46a6f..2728f403e 100644 --- a/packages/databricks-vscode/src/vscode-objs/StateStorage.ts +++ b/packages/databricks-vscode/src/vscode-objs/StateStorage.ts @@ -80,7 +80,7 @@ const StorageConfigurations = { }), "databricks.lastInstalledExtensionVersion": withType()({ - location: "workspace", + location: "global", defaultValue: "0.0.0", }), }; diff --git a/packages/databricks-vscode/src/vscode-objs/WorkspaceConfigs.ts b/packages/databricks-vscode/src/vscode-objs/WorkspaceConfigs.ts index 09ba36f21..1a14ceb5d 100644 --- a/packages/databricks-vscode/src/vscode-objs/WorkspaceConfigs.ts +++ b/packages/databricks-vscode/src/vscode-objs/WorkspaceConfigs.ts @@ -37,20 +37,6 @@ export const workspaceConfigs = { .get("clusters.onlyShowAccessibleClusters") ?? false ); }, - get cliVerboseMode() { - const legacyVerboseMode = - workspace - .getConfiguration("databricks") - .get("bricks.verboseMode") ?? false; - - const verboseMode = - workspace - .getConfiguration("databricks") - .get("cli.verboseMode") ?? false; - - return verboseMode || legacyVerboseMode; - }, - get syncDestinationType() { return ( workspace diff --git a/packages/databricks-vscode/src/workspace-fs/WorkspaceFsWorkflowWrapper.test.ts b/packages/databricks-vscode/src/workspace-fs/WorkspaceFsWorkflowWrapper.test.ts index 93d530c11..0f08207b8 100644 --- a/packages/databricks-vscode/src/workspace-fs/WorkspaceFsWorkflowWrapper.test.ts +++ b/packages/databricks-vscode/src/workspace-fs/WorkspaceFsWorkflowWrapper.test.ts @@ -76,6 +76,25 @@ describe(__filename, async () => { ); } + async function getWrapperData( + wrapperName: + | "notebook.workflow-wrapper.py" + | "file.workflow-wrapper.py", + originalFilePath: string + ) { + return ( + await readFile(path.join(resourceDirPath, wrapperName), "utf-8") + ) + .replace( + "{{DATABRICKS_SOURCE_FILE}}", + new RemoteUri(originalFilePath).workspacePrefixPath + ) + .replace( + "{{DATABRICKS_PROJECT_ROOT}}", + new RemoteUri(testDirPath).workspacePrefixPath + ); + } + describe("python files", () => { beforeEach(createMocks); it("should create wrapper for files", async () => { @@ -100,11 +119,14 @@ describe(__filename, async () => { await new WorkspaceFsWorkflowWrapper( instance(mockConnectionManager), instance(mockExtensionContext) - ).createPythonFileWrapper(new RemoteUri(originalFilePath)); + ).createPythonFileWrapper( + new RemoteUri(originalFilePath), + new RemoteUri(testDirPath) + ); - const wrapperData = await readFile( - path.join(resourceDirPath, "file.workflow-wrapper.py"), - "utf-8" + const wrapperData = await getWrapperData( + "file.workflow-wrapper.py", + originalFilePath ); verify( mockWorkspaceService.import( @@ -165,23 +187,6 @@ describe(__filename, async () => { }); }); - async function getWrapperData() { - return ( - await readFile( - path.join(resourceDirPath, "notebook.workflow-wrapper.py"), - "utf-8" - ) - ) - .replace( - "{{DATABRICKS_SOURCE_FILE}}", - new RemoteUri(originalFilePath).workspacePrefixPath - ) - .replace( - "{{DATABRICKS_PROJECT_ROOT}}", - new RemoteUri(testDirPath).workspacePrefixPath - ); - } - it("should create wrapper for databricks python notebook", async () => { await withFile(async (localFilePath) => { const comment = ["# Databricks notebook source"]; @@ -202,7 +207,10 @@ describe(__filename, async () => { "PY_DBNB" ); - const wrapperData = await getWrapperData(); + const wrapperData = await getWrapperData( + "notebook.workflow-wrapper.py", + originalFilePath + ); const expected = comment .concat(wrapperData.split(/\r?\n/)) .concat(["# COMMAND ----------"]) @@ -244,9 +252,16 @@ describe(__filename, async () => { "PY_DBNB" ); - const wrapperData = await getWrapperData(); + const wrapperData = await getWrapperData( + "notebook.workflow-wrapper.py", + originalFilePath + ); const expected = comment .concat([ + "import os", + `os.chdir(os.path.dirname('${ + new RemoteUri(originalFilePath).workspacePrefixPath + }'))`, "# MAGIC %pip install pandas", "# COMMAND ----------", "dbutils.library.restartPython()", @@ -377,7 +392,7 @@ describe(__filename, async () => { }, }, outputs: [], - execution_count: 0, + execution_count: null, }; it("should create wrapper for databricks jupyter notebook", async () => { @@ -448,7 +463,19 @@ describe(__filename, async () => { const expected = { ...notebookMetadata, cells: [ - {...wrapperData, source: ["%pip install x"]}, + { + ...wrapperData, + source: [ + [ + "import os", + `os.chdir(os.path.dirname('${ + new RemoteUri(originalFilePath) + .workspacePrefixPath + }'))`, + "%pip install x", + ].join("\n"), + ], + }, { ...wrapperData, source: ["dbutils.library.restartPython()"], diff --git a/packages/databricks-vscode/src/workspace-fs/WorkspaceFsWorkflowWrapper.ts b/packages/databricks-vscode/src/workspace-fs/WorkspaceFsWorkflowWrapper.ts index 5540bf043..8a505cc6d 100644 --- a/packages/databricks-vscode/src/workspace-fs/WorkspaceFsWorkflowWrapper.ts +++ b/packages/databricks-vscode/src/workspace-fs/WorkspaceFsWorkflowWrapper.ts @@ -11,35 +11,26 @@ import {LocalUri, RemoteUri} from "../sync/SyncDestination"; import {FileUtils} from "../utils"; import {workspaceConfigs} from "../vscode-objs/WorkspaceConfigs"; -function getWrapperPath(remoteFilePath: RemoteUri, extraParts: string[]) { +function getWrapperPath( + remoteOriginalFilePath: RemoteUri, + extraParts: string[] +) { return new RemoteUri( posix.format({ - dir: posix.dirname(remoteFilePath.path), + dir: posix.dirname(remoteOriginalFilePath.path), name: posix - .basename(remoteFilePath.path) + .basename(remoteOriginalFilePath.path) .split(".") .slice(0, -1) .concat(extraParts) .join("."), - ext: posix.extname(remoteFilePath.path), + ext: posix.extname(remoteOriginalFilePath.path), }) ); } -async function readBootstrap( - bootstrapPath: string, - remoteFilePath: RemoteUri, - dbProjectRoot: RemoteUri -) { - return (await readFile(bootstrapPath, "utf-8")) - .replace( - "{{DATABRICKS_SOURCE_FILE}}", - remoteFilePath.workspacePrefixPath - ) - .replace( - "{{DATABRICKS_PROJECT_ROOT}}", - dbProjectRoot.workspacePrefixPath - ); +async function readBootstrap(bootstrapPath: string) { + return await readFile(bootstrapPath, "utf-8"); } type Cell = { @@ -47,6 +38,7 @@ type Cell = { type: "code" | "not_code"; originalCell?: any; }; + function rearrangeCells(cells: Cell[]) { if (!workspaceConfigs.wsfsRearrangeCells) { return cells; @@ -69,9 +61,18 @@ function rearrangeCells(cells: Cell[]) { // as a new cell to the beginging and remove it from the original cell if ( line.startsWith("%pip install") || - line.startsWith("# MAGIC %pip install") || - line.startsWith("dbutils.library.restartPython()") + line.startsWith("# MAGIC %pip install") ) { + begingingCells.push({ + source: [ + "import os", + "os.chdir(os.path.dirname('{{DATABRICKS_SOURCE_FILE}}'))", + line, + ], + type: "code", + }); + continue; + } else if (line.startsWith("dbutils.library.restartPython()")) { begingingCells.push({source: [line], type: "code"}); continue; } @@ -79,6 +80,7 @@ function rearrangeCells(cells: Cell[]) { } endingCells.push(newCell); } + return [...begingingCells, ...endingCells].filter( (cell) => cell.source.length !== 0 ); @@ -92,11 +94,13 @@ export class WorkspaceFsWorkflowWrapper { @logging.withLogContext(Loggers.Extension) private async createFile( - remoteFilePath: RemoteUri, + wrapperPath: RemoteUri, + remoteOriginalFilePath: RemoteUri, + dbProjectRoot: RemoteUri, content: string, @context ctx?: Context ) { - const dirpath = posix.dirname(remoteFilePath.path); + const dirpath = posix.dirname(wrapperPath.path); if (!this.connectionManager.workspaceClient) { throw new Error(`Not logged in`); @@ -109,15 +113,24 @@ export class WorkspaceFsWorkflowWrapper { if (!WorkspaceFsUtils.isDirectory(rootDir)) { throw new Error(`${dirpath} is not a directory`); } + content = content + .replace( + /{{DATABRICKS_SOURCE_FILE}}/g, + remoteOriginalFilePath.workspacePrefixPath + ) + .replace( + /{{DATABRICKS_PROJECT_ROOT}}/g, + dbProjectRoot.workspacePrefixPath + ); const wrappedFile = await rootDir.createFile( - remoteFilePath.path, + wrapperPath.path, content, true, ctx ); if (!WorkspaceFsUtils.isFile(wrappedFile)) { throw new Error( - `Cannot create workflow wrapper for ${remoteFilePath.path}` + `Cannot create workflow wrapper for ${remoteOriginalFilePath.path}` ); } return wrappedFile; @@ -126,7 +139,7 @@ export class WorkspaceFsWorkflowWrapper { @logging.withLogContext(Loggers.Extension) private async createIpynbWrapper( localFilePath: LocalUri, - remoteFilePath: RemoteUri, + remoteOriginalFilePath: RemoteUri, dbProjectRoot: RemoteUri, @context ctx?: Context ) { @@ -145,7 +158,7 @@ export class WorkspaceFsWorkflowWrapper { ) ); const bootstrapJson: JupyterCell = JSON.parse( - await readBootstrap(bootstrapPath, remoteFilePath, dbProjectRoot) + await readBootstrap(bootstrapPath) ); const cells = [bootstrapJson].concat(originalJson["cells"] ?? []).map( // Since each cell.source is a string array where each string can be @@ -169,11 +182,13 @@ export class WorkspaceFsWorkflowWrapper { }; }); return this.createFile( - getWrapperPath(remoteFilePath, [ + getWrapperPath(remoteOriginalFilePath, [ "databricks", "notebook", "workflow-wrapper", ]), + remoteOriginalFilePath, + dbProjectRoot, JSON.stringify(originalJson), ctx ); @@ -182,7 +197,7 @@ export class WorkspaceFsWorkflowWrapper { @logging.withLogContext(Loggers.Extension) private async createDbnbWrapper( localFilePath: LocalUri, - remoteFilePath: RemoteUri, + remoteOriginalFilePath: RemoteUri, dbProjectRoot: RemoteUri, @context ctx?: Context ) { @@ -194,9 +209,9 @@ export class WorkspaceFsWorkflowWrapper { const bootstrapPath = this.extensionContext.asAbsolutePath( path.join("resources", "python", "notebook.workflow-wrapper.py") ); - const bootstrapCode = ( - await readBootstrap(bootstrapPath, remoteFilePath, dbProjectRoot) - ).split(/\r?\n/); + const bootstrapCode = (await readBootstrap(bootstrapPath)).split( + /\r?\n/ + ); // Split original code into cells by # COMMAND ----------\n // and add the bootstrap code to the beginning as a new cell @@ -217,11 +232,13 @@ export class WorkspaceFsWorkflowWrapper { .join("\n# COMMAND ----------\n"); return this.createFile( - getWrapperPath(remoteFilePath, [ + getWrapperPath(remoteOriginalFilePath, [ "databricks", "notebook", "workflow-wrapper", ]), + remoteOriginalFilePath, + dbProjectRoot, wrappedCode, ctx ); @@ -230,7 +247,7 @@ export class WorkspaceFsWorkflowWrapper { @logging.withLogContext(Loggers.Extension) async createNotebookWrapper( localFilePath: LocalUri, - remoteFilePath: RemoteUri, + remoteOriginalFilePath: RemoteUri, dbProjectRoot: RemoteUri, notebookType: FileUtils.NotebookType, @context ctx?: Context @@ -239,14 +256,14 @@ export class WorkspaceFsWorkflowWrapper { case "PY_DBNB": return this.createDbnbWrapper( localFilePath, - remoteFilePath, + remoteOriginalFilePath, dbProjectRoot, ctx ); case "IPYNB": return this.createIpynbWrapper( localFilePath, - remoteFilePath, + remoteOriginalFilePath, dbProjectRoot, ctx ); @@ -255,7 +272,8 @@ export class WorkspaceFsWorkflowWrapper { @logging.withLogContext(Loggers.Extension) async createPythonFileWrapper( - remoteFilePath: RemoteUri, + remoteOriginalFilePath: RemoteUri, + dbProjectRoot: RemoteUri, @context ctx?: Context ) { const bootstrapPath = this.extensionContext.asAbsolutePath( @@ -263,11 +281,13 @@ export class WorkspaceFsWorkflowWrapper { ); const bootstrap = await readFile(bootstrapPath, "utf-8"); return this.createFile( - getWrapperPath(remoteFilePath, [ + getWrapperPath(remoteOriginalFilePath, [ "databricks", "file", "workflow-wrapper", ]), + remoteOriginalFilePath, + dbProjectRoot, bootstrap, ctx ); diff --git a/yarn.lock b/yarn.lock index 4af3b6abe..07e5c83c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1368,9 +1368,9 @@ __metadata: linkType: hard "@types/ini@npm:^1.3.31": - version: 1.3.32 - resolution: "@types/ini@npm:1.3.32" - checksum: 2f11a5d77f901472f3c7d4701c99deaebd4959490ee2d27dd647b4059f07e03a8361d4be4ee9efec5f6440309bb1c92f6108fe50be6bc4af2937cb33cea49e0b + version: 1.3.34 + resolution: "@types/ini@npm:1.3.34" + checksum: 776335c41f3b86e7768fb412617b71f9a1dc55bacc4936dbde28beb6ebc12778c9db17875e006484e745783894af8d399cde93a4de80b61c8c00da288d862293 languageName: node linkType: hard @@ -1513,11 +1513,11 @@ __metadata: linkType: hard "@types/node@npm:^20.6.0": - version: 20.8.7 - resolution: "@types/node@npm:20.8.7" + version: 20.10.7 + resolution: "@types/node@npm:20.10.7" dependencies: - undici-types: ~5.25.1 - checksum: 2173c0c03daefcb60c03a61b1371b28c8fe412e7a40dc6646458b809d14a85fbc7aeb369d957d57f0aaaafd99964e77436f29b3b579232d8f2b20c58abbd1d25 + undici-types: ~5.26.4 + checksum: 86f4f96f5169538f47bbd652ab8e3712cd307701481ff3e9ce0c1ea7d8424a38b5ac4a1d33088cdd9ea1bfe68fd27bbae005a21969aa6d9a36295904da6f09f2 languageName: node linkType: hard @@ -1544,13 +1544,20 @@ __metadata: languageName: node linkType: hard -"@types/semver@npm:^7.5.0, @types/semver@npm:^7.5.1": +"@types/semver@npm:^7.5.0": version: 7.5.4 resolution: "@types/semver@npm:7.5.4" checksum: 120c0189f6fec5f2d12d0d71ac8a4cfa952dc17fa3d842e8afddb82bba8828a4052f8799c1653e2b47ae1977435f38e8985658fde971905ce5afb8e23ee97ecf languageName: node linkType: hard +"@types/semver@npm:^7.5.1": + version: 7.5.6 + resolution: "@types/semver@npm:7.5.6" + checksum: 563a0120ec0efcc326567db2ed920d5d98346f3638b6324ea6b50222b96f02a8add3c51a916b6897b51523aad8ac227d21d3dcf8913559f1bfc6c15b14d23037 + languageName: node + linkType: hard + "@types/sinonjs__fake-timers@npm:^8.1.5": version: 8.1.5 resolution: "@types/sinonjs__fake-timers@npm:8.1.5" @@ -8965,9 +8972,9 @@ __metadata: linkType: hard "reflect-metadata@npm:^0.1.13": - version: 0.1.13 - resolution: "reflect-metadata@npm:0.1.13" - checksum: 798d379a7b6f6455501145419505c97dd11cbc23857a386add2b9ef15963ccf15a48d9d15507afe01d4cd74116df8a213247200bac00320bd7c11ddeaa5e8fb4 + version: 0.1.14 + resolution: "reflect-metadata@npm:0.1.14" + checksum: 155ad339319cec3c2d9d84719f730f8b6a6cd2a074733ec29dbae6c89d48a2914c7d07a2350212594f3aae160fa4da4f903e6512f27ceaf968443a7c692bcad0 languageName: node linkType: hard @@ -10369,13 +10376,6 @@ __metadata: languageName: node linkType: hard -"undici-types@npm:~5.25.1": - version: 5.25.3 - resolution: "undici-types@npm:5.25.3" - checksum: ec9d2cc36520cbd9fbe3b3b6c682a87fe5be214699e1f57d1e3d9a2cb5be422e62735f06e0067dc325fd3dd7404c697e4d479f9147dc8a804e049e29f357f2ff - languageName: node - linkType: hard - "undici-types@npm:~5.26.4": version: 5.26.5 resolution: "undici-types@npm:5.26.5"