alexguo-db commented on code in PR #3115:
URL: https://github.com/apache/arrow-adbc/pull/3115#discussion_r2305281854


##########
.github/workflows/csharp_databricks_e2e.yml:
##########
@@ -0,0 +1,147 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: C# Databricks E2E Tests
+
+on:
+  push:
+    branches: [main]
+    paths:
+      - '.github/workflows/csharp_databricks_e2e.yml'
+      - 'ci/scripts/csharp_databricks_e2e.sh'
+      - 'csharp/src/Apache.Arrow.Adbc/**'
+      - 'csharp/src/Client/**'
+      - 'csharp/src/Drivers/Apache/Hive2/**'
+      - 'csharp/src/Drivers/Apache/Spark/**'
+      - 'csharp/src/Drivers/Databricks/**'
+      - 'csharp/test/Drivers/Databricks/**'
+  pull_request_target:
+    paths:
+      - '.github/workflows/csharp_databricks_e2e.yml'
+      - 'ci/scripts/csharp_databricks_e2e.sh'
+      - 'csharp/src/Apache.Arrow.Adbc/**'
+      - 'csharp/src/Client/**'
+      - 'csharp/src/Drivers/Apache/Hive2/**'
+      - 'csharp/src/Drivers/Apache/Spark/**'
+      - 'csharp/src/Drivers/Databricks/**'
+      - 'csharp/test/Drivers/Databricks/**'
+
+concurrency:
+  group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ 
github.workflow }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+  id-token: write  # Required for OIDC token exchange
+
+defaults:
+  run:
+    # 'bash' will expand to -eo pipefail
+    shell: bash
+
+jobs:
+  csharp-databricks-e2e:
+    name: "C# ${{ matrix.os }} ${{ matrix.dotnet }}"
+    runs-on: ${{ matrix.os }}
+    environment: databricks-e2e
+    if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
+    timeout-minutes: 15
+    strategy:
+      fail-fast: false
+      matrix:
+        dotnet: ['8.0.x']
+        os: [ubuntu-latest, windows-2022, macos-13, macos-latest]
+    steps:
+      - name: Install C#
+        uses: actions/setup-dotnet@v4
+        with:
+          dotnet-version: ${{ matrix.dotnet }}
+      - name: Checkout ADBC
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ github.event.pull_request.head.sha || github.sha }}
+          fetch-depth: 0
+          submodules: recursive
+      - name: Build
+        shell: bash
+        run: ci/scripts/csharp_build.sh $(pwd)

Review Comment:
   @kou  That won't work for us, the Databricks service principal is set up to 
only allow OIDC token exchange when the Github OIDC token originates from the 
main repo. 
   
   > If we run this job on fork repository, evil developers can get only 
GITHUB_TOKEN for their fork repositories.
   
   If we allowed the service principal to accept any Github OIDC token then 
anybody can create a fork and run malicious queries against the Databricks 
workspace. 
   
   The alternative is to use a Databricks personal access token secret but that 
runs into the same problem where we can only store it only on the main repo (so 
only people with main branch permissions can copy the branch to main and run 
the E2E tests)
   
   How is this click approval pattern implemented elsewhere?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to