From 01f04cf9930d73881d6a4934d437c2ccec508b55 Mon Sep 17 00:00:00 2001 From: TungPham-TomTom <143825701+TungPham-TomTom@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:29:39 +0200 Subject: [PATCH 1/5] Make scripts SC2086 compliant (#102) Co-authored-by: Pieter Noordhuis --- setup_release.sh | 4 ++-- setup_snapshot.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/setup_release.sh b/setup_release.sh index 6a2b512..c1a38cd 100644 --- a/setup_release.sh +++ b/setup_release.sh @@ -9,7 +9,7 @@ fi # Pull latest version from VERSION file if not set. if [ -z "${VERSION:-}" ]; then - VERSION=$(cat $(dirname $0)/VERSION) + VERSION=$(cat $(dirname "$0")/VERSION) fi FILE="databricks_cli_$VERSION" @@ -52,4 +52,4 @@ unzip -q "${FILE}.zip" -d .bin # Add databricks to path. dir=$PWD/.bin chmod +x "${dir}/databricks" -echo "$dir" >> $GITHUB_PATH +echo "$dir" >> "$GITHUB_PATH" diff --git a/setup_snapshot.sh b/setup_snapshot.sh index f427460..78e10f6 100755 --- a/setup_snapshot.sh +++ b/setup_snapshot.sh @@ -71,7 +71,7 @@ macOS) ;; esac -gh run download $last_successful_run_id -n $artifact -D .bin +gh run download "$last_successful_run_id" -n "$artifact" -D .bin dir="$PWD/.bin/$(cli_snapshot_directory)" @@ -82,11 +82,11 @@ fi if [ "$RUNNER_OS" == "Windows" ]; then ( - cd $dir + cd "$dir" mv ./databricks.exe ./databricks ) fi # Add databricks to path. -chmod +x $dir/databricks -echo "$dir" >> $GITHUB_PATH +chmod +x "$dir/databricks" +echo "$dir" >> "$GITHUB_PATH" From b81a5558055d1d72d627a7bd4c4d13b9acca86ee Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 6 Jun 2024 14:58:50 +0200 Subject: [PATCH 2/5] Update actions/checkout to v4 (#108) --- .github/workflows/release-pr.yml | 2 +- .github/workflows/tag.yml | 2 +- .github/workflows/test.yml | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 3e08753..b8dc62c 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 996aa81..d43ab6d 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2806e14..00f73a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: - windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: ./setup-cli @@ -46,7 +46,7 @@ jobs: - windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: ./setup-cli @@ -72,7 +72,7 @@ jobs: - windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: ./setup-cli @@ -108,7 +108,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: ./setup-cli @@ -150,7 +150,7 @@ jobs: - windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: ./setup-cli @@ -182,7 +182,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: ./setup-cli From ce9c0be9faa2ad048581493357ccab1dc7b4dbea Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 6 Jun 2024 14:59:49 +0200 Subject: [PATCH 3/5] Update peter-evans/create-pull-request to v6.0.5 (#109) Fixes deprecation warning in action summary. --- .github/workflows/release-pr.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index b8dc62c..9107c41 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -25,7 +25,9 @@ jobs: - name: Create a release pull request id: cpr - uses: peter-evans/create-pull-request@v5 + + # Version v6.0.5 + uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e with: author: "eng-dev-ecosystem-bot " committer: "eng-dev-ecosystem-bot " From de068a8031311b1e060c9f30017972e254ef45cb Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 6 Jun 2024 15:00:03 +0200 Subject: [PATCH 4/5] Update LICENSE (#111) See https://www.databricks.com/legal/db-license --- LICENSE | 74 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/LICENSE b/LICENSE index 21db58b..9878fb4 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. From 7c81ed80778384dbbc95d083a8809cce6f993643 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 6 Jun 2024 15:00:50 +0200 Subject: [PATCH 5/5] Run shellcheck from action (#112) This prevents new failing checks from being committed. Also see #102. --- .github/workflows/test.yml | 16 ++++++++++++++++ install.sh | 2 +- setup_release.sh | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 00f73a8..f841a09 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -209,3 +209,19 @@ jobs: - name: Assert installation path is ~/bin run: ./setup-cli/assert/path.sh ~/bin/databricks shell: bash + + shellcheck: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + path: ./setup-cli + + - name: Install shellcheck + run: sudo apt-get install shellcheck + shell: bash + + - name: Run shellcheck + run: shellcheck ./setup-cli/*.sh + shell: bash diff --git a/install.sh b/install.sh index 03f5ce9..4c86edd 100755 --- a/install.sh +++ b/install.sh @@ -88,7 +88,7 @@ unzip -q "${FILE}.zip" # Add databricks to path. chmod +x ./databricks cp ./databricks "$TARGET" -echo "Installed $($TARGET/databricks -v) at $TARGET/databricks." +echo "Installed $("$TARGET/databricks" -v) at $TARGET/databricks." # Clean up temporary directory. cd "$OLDPWD" diff --git a/setup_release.sh b/setup_release.sh index c1a38cd..450a502 100644 --- a/setup_release.sh +++ b/setup_release.sh @@ -9,7 +9,7 @@ fi # Pull latest version from VERSION file if not set. if [ -z "${VERSION:-}" ]; then - VERSION=$(cat $(dirname "$0")/VERSION) + VERSION=$(cat "$(dirname "$0")"/VERSION) fi FILE="databricks_cli_$VERSION"