Skip to content

Commit 8ec3bea

Browse files
authored
Merge branch 'main' into bouncycastle-register-issue
2 parents 4d71ed6 + ef2d661 commit 8ec3bea

66 files changed

Lines changed: 891 additions & 561 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dco-check.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: DCO Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
branches: [ main ]
7+
8+
jobs:
9+
dco-check:
10+
runs-on: ubuntu-latest
11+
name: Check DCO Sign-off
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # Fetch full history to check all commits
17+
ref: ${{ github.event.pull_request.head.ref }}
18+
repository: ${{ github.event.pull_request.head.repo.full_name }}
19+
20+
- name: Add upstream remote (for forks)
21+
run: |
22+
# Add the upstream repository as a remote if this is a fork
23+
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
24+
echo "This is a fork, adding upstream remote"
25+
git remote add upstream https://github.com/${{ github.repository }}.git
26+
git fetch upstream ${{ github.event.pull_request.base.ref }}
27+
else
28+
echo "This is not a fork, using origin"
29+
fi
30+
31+
- name: Check DCO Sign-off
32+
run: |
33+
#!/bin/bash
34+
set -e
35+
36+
# Get the list of commits in this PR
37+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
38+
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
39+
40+
echo "Checking commits from $BASE_SHA to $HEAD_SHA"
41+
42+
# Verify that both commits exist
43+
if ! git cat-file -e "$BASE_SHA" 2>/dev/null; then
44+
echo "Error: Base commit $BASE_SHA not found"
45+
echo "Trying to fetch from upstream..."
46+
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
47+
git fetch upstream ${{ github.event.pull_request.base.ref }}
48+
else
49+
git fetch origin ${{ github.event.pull_request.base.ref }}
50+
fi
51+
fi
52+
53+
if ! git cat-file -e "$HEAD_SHA" 2>/dev/null; then
54+
echo "Error: Head commit $HEAD_SHA not found"
55+
exit 1
56+
fi
57+
58+
# Get commit messages for all commits in the PR
59+
COMMITS=$(git rev-list --no-merges "$BASE_SHA..$HEAD_SHA")
60+
61+
if [ -z "$COMMITS" ]; then
62+
echo "No commits found in this PR"
63+
exit 0
64+
fi
65+
66+
FAILED_COMMITS=()
67+
68+
for commit in $COMMITS; do
69+
echo "Checking commit: $commit"
70+
71+
# Get the commit message
72+
COMMIT_MSG=$(git log --format=%B -n 1 "$commit")
73+
74+
# Check if the commit message contains "Signed-off-by:"
75+
if echo "$COMMIT_MSG" | grep -q "^Signed-off-by: "; then
76+
echo "✅ Commit $commit has DCO sign-off"
77+
else
78+
echo "❌ Commit $commit is missing DCO sign-off"
79+
FAILED_COMMITS+=("$commit")
80+
fi
81+
done
82+
83+
if [ ${#FAILED_COMMITS[@]} -ne 0 ]; then
84+
echo ""
85+
echo "❌ DCO Check Failed!"
86+
echo "The following commits are missing the required 'Signed-off-by' line:"
87+
for commit in "${FAILED_COMMITS[@]}"; do
88+
echo " - $commit: $(git log --format=%s -n 1 "$commit")"
89+
done
90+
echo ""
91+
echo "To fix this, you need to sign off your commits. You can:"
92+
echo "1. Add sign-off to new commits: git commit -s -m 'Your commit message'"
93+
echo "2. Amend existing commits: git commit --amend --signoff"
94+
echo "3. For multiple commits, use: git rebase --signoff HEAD~N (where N is the number of commits)"
95+
echo ""
96+
echo "The sign-off should be in the format:"
97+
echo "Signed-off-by: Your Name <your.email@example.com>"
98+
echo ""
99+
echo "For more details, see CONTRIBUTING.md"
100+
exit 1
101+
else
102+
echo ""
103+
echo "✅ All commits have proper DCO sign-off!"
104+
fi

.github/workflows/loggingTesting.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
name: Test JDBC Logging
22

33
on:
4+
push:
5+
branches:
6+
- main
47
workflow_dispatch:
58
inputs:
69
branch:
710
description: 'Branch to checkout'
811
required: false
912
default: 'main'
10-
repository:
11-
description: 'Repository to checkout (e.g., user/repo)'
12-
required: false
13-
default: 'databricks/databricks-jdbc'
14-
pull_request_target:
1513

1614
jobs:
1715
test-logging:
@@ -33,8 +31,7 @@ jobs:
3331
- name: Checkout code
3432
uses: actions/checkout@v4
3533
with:
36-
ref: ${{ github.event.pull_request.head.ref || inputs.branch }}
37-
repository: ${{ github.event.pull_request.head.repo.full_name || inputs.repository }}
34+
ref: ${{ inputs.branch || github.ref }}
3835

3936
- name: Set up Java
4037
uses: actions/setup-java@v4
@@ -45,6 +42,19 @@ jobs:
4542
- name: Build JDBC driver
4643
run: mvn clean package -DskipTests
4744

45+
- name: Find JAR file
46+
shell: bash
47+
run: |
48+
# Find the main JAR file dynamically
49+
MAIN_JAR=$(find target -name "databricks-jdbc-*-oss.jar" -not -name "*-thin.jar" | head -1)
50+
if [ -z "$MAIN_JAR" ]; then
51+
echo "ERROR: Could not find main JAR file in target directory"
52+
ls -la target/
53+
exit 1
54+
fi
55+
echo "Using JAR file: $MAIN_JAR"
56+
echo "MAIN_JAR=$MAIN_JAR" >> $GITHUB_ENV
57+
4858
- name: Set Environment Variables
4959
if: runner.os != 'Windows'
5060
shell: bash
@@ -79,8 +89,10 @@ jobs:
7989
rm -rf target/test-classes
8090
mkdir -p target/test-classes
8191
92+
echo "Using JAR file: $MAIN_JAR"
93+
8294
javac \
83-
-cp "target/databricks-jdbc-1.0.7-oss.jar" \
95+
-cp "$MAIN_JAR" \
8496
-d target/test-classes \
8597
src/test/java/com/databricks/client/jdbc/LoggingTest.java
8698
@@ -94,7 +106,9 @@ jobs:
94106
OS_TYPE=$(uname | tr '[:upper:]' '[:lower:]')
95107
if [[ "$OS_TYPE" == "linux" ]]; then SEP=":"; else SEP=";"; fi
96108
echo "Using classpath separator: '$SEP'"
97-
CP="target/test-classes${SEP}target/databricks-jdbc-1.0.7-oss.jar"
109+
echo "Using JAR file: $MAIN_JAR"
110+
111+
CP="target/test-classes${SEP}$MAIN_JAR"
98112
99113
java \
100114
--add-opens=java.base/java.nio=ALL-UNNAMED \

.github/workflows/prCheckJDK8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: JDK 8 Build and Test
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types: [opened, synchronize, reopened]
66
branches: [jdk-8]
77

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Integration Tests Workflow - Pull Requests
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
branches: [main]
7+
8+
jobs:
9+
build-and-test:
10+
name: Build and Run Integration Tests (PR)
11+
runs-on:
12+
group: databricks-protected-runner-group
13+
labels: linux-ubuntu-latest
14+
strategy:
15+
matrix:
16+
include:
17+
- test-command: mvn -B compile test -Dtest=*IntegrationTests
18+
fake-service-type: 'SQL_EXEC'
19+
- test-command: mvn -B compile test -Dtest=*IntegrationTests,!M2MPrivateKeyCredentialsIntegrationTests,!SqlExecApiHybridResultsIntegrationTests,!DBFSVolumeIntegrationTests,!M2MAuthIntegrationTests,!UCVolumeIntegrationTests
20+
fake-service-type: 'THRIFT_SERVER'
21+
steps:
22+
- name: Checkout PR
23+
uses: actions/checkout@v4
24+
25+
- uses: actions/setup-java@v4
26+
with:
27+
java-version: 21
28+
distribution: 'adopt'
29+
- uses: actions/cache@v4
30+
with:
31+
path: ~/.m2
32+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
33+
restore-keys: ${{ runner.os }}-m2
34+
- name: Run Integration Tests (without secrets)
35+
run: ${{ matrix.test-command }}
36+
env:
37+
FAKE_SERVICE_TYPE: ${{ matrix.fake-service-type }}

.github/workflows/proxyTesting.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
name: Proxy Test with Dual Squid Proxies
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
branch:
7-
description: 'Branch to checkout'
8-
required: false
9-
default: 'main'
10-
repository:
11-
description: 'Repository to checkout (e.g., user/repo)'
12-
required: false
13-
default: 'databricks/databricks-jdbc'
14-
pull_request_target:
4+
push:
5+
branches: [main]
156

167
jobs:
178
proxy-test:
@@ -25,9 +16,6 @@ jobs:
2516
################################################################
2617
- name: Checkout
2718
uses: actions/checkout@v4
28-
with:
29-
ref: ${{ github.event.pull_request.head.ref || inputs.branch }}
30-
repository: ${{ github.event.pull_request.head.repo.full_name || inputs.repository }}
3119

3220
################################################################
3321
# 2) Set Up Java

.github/workflows/runIntegrationTests.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
1-
name: Integration Tests Workflow
1+
name: Integration Tests Workflow - Main Branch
22

33
on:
44
push:
55
branches: [main]
6-
pull_request_target:
7-
types: [opened, synchronize, reopened]
8-
branches: [main]
9-
workflow_dispatch:
10-
inputs:
11-
branch:
12-
description: 'Branch to checkout'
13-
required: false
14-
default: 'main'
15-
repository:
16-
description: 'Repository to checkout (e.g., user/repo)'
17-
required: false
18-
default: 'databricks/databricks-jdbc'
196

207
jobs:
218
build-and-test:
@@ -34,12 +21,8 @@ jobs:
3421
token-secret: THRIFT_DATABRICKS_TOKEN
3522
fake-service-type: 'THRIFT_SERVER'
3623
steps:
37-
- name: Checkout PR or Manual Dispatch
24+
- name: Checkout code
3825
uses: actions/checkout@v4
39-
with:
40-
ref: ${{ github.event.pull_request.head.ref || inputs.branch || github.ref_name }}
41-
repository: ${{ github.event.pull_request.head.repo.full_name || inputs.repository || github.repository }}
42-
token: ${{ secrets.GITHUB_TOKEN }}
4326

4427
- uses: actions/setup-java@v4
4528
with:

NEXT_CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## [Unreleased]
44

55
### Added
6-
-
6+
- Added DCO (Developer Certificate of Origin) check workflow for pull requests to ensure all commits are properly signed-off
77

88
### Updated
99
-

src/test/resources/cloudfetchapi/metadataintegrationtests/testcatalogandschemainformation/mappings/oregon-staging_6051921418418893.jobs_sql_extended_results_2025-01-28t211905z_a2439299-2870-48b0-8b39-487c49f8c91d-692f562c-d3ab-4372-8823-10fe0bcc0710.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/test/resources/cloudfetchapi/metadataintegrationtests/testcatalogandschemainformation/mappings/oregon-staging_6051921418418893.jobs_sql_extended_results_2025-01-28t211907z_23c49a02-a597-4767-9270-3ac2a46c71de-04e4a2fa-da56-4e48-99ba-011e6bc37ef8.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/test/resources/cloudfetchapi/metadataintegrationtests/testcatalogandschemainformation/mappings/oregon-staging_6051921418418893.jobs_sql_extended_results_2025-01-28t211917z_4056829b-39f4-48b8-9581-0cf8ea3b94a6-18102891-ba79-4d28-ab71-e384c103a147.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)