Skip to content

Commit c6b3ced

Browse files
authored
Merge branch 'main' into feat/support-for-key-only-databricks-tags
2 parents f936946 + b1047b5 commit c6b3ced

53 files changed

Lines changed: 3674 additions & 178 deletions

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
# the repo. Unless a later match takes precedence, these
33
# users will be requested for review when someone opens a
44
# pull request.
5-
* @sd-db @tejassp-db @benc-db
5+
* @sd-db @tejassp-db @benc-db @jprakash-db
6+
7+
# Explicit rule for CI/CD workflow changes
8+
/.github/workflows/ @sd-db @tejassp-db @benc-db @jprakash-db

.github/ISSUE_TEMPLATE/dependabot.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "Setup JFrog PyPI Proxy"
2+
description: "Authenticate with JFrog via OIDC and configure uv to use JFrog as PyPI proxy"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Get JFrog OIDC token
8+
shell: bash
9+
run: |
10+
set -euo pipefail
11+
12+
# Get GitHub OIDC ID token
13+
ID_TOKEN=$(curl -sLS \
14+
-H "User-Agent: actions/oidc-client" \
15+
-H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
16+
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=jfrog-github" | jq .value | tr -d '"')
17+
echo "::add-mask::${ID_TOKEN}"
18+
19+
# Exchange for JFrog access token
20+
ACCESS_TOKEN=$(curl -sLS -XPOST -H "Content-Type: application/json" \
21+
"https://databricks.jfrog.io/access/api/v1/oidc/token" \
22+
-d "{\"grant_type\": \"urn:ietf:params:oauth:grant-type:token-exchange\", \"subject_token_type\":\"urn:ietf:params:oauth:token-type:id_token\", \"subject_token\": \"${ID_TOKEN}\", \"provider_name\": \"github-actions\"}" | jq .access_token | tr -d '"')
23+
echo "::add-mask::${ACCESS_TOKEN}"
24+
25+
if [ -z "$ACCESS_TOKEN" ] || [ "$ACCESS_TOKEN" = "null" ]; then
26+
echo "FAIL: Could not extract JFrog access token"
27+
exit 1
28+
fi
29+
30+
echo "JFROG_ACCESS_TOKEN=${ACCESS_TOKEN}" >> "$GITHUB_ENV"
31+
echo "JFrog OIDC token obtained successfully"
32+
33+
- name: Configure pip and uv to use JFrog PyPI proxy
34+
shell: bash
35+
run: |
36+
set -euo pipefail
37+
JFROG_PYPI_URL="https://gha-service-account:${JFROG_ACCESS_TOKEN}@databricks.jfrog.io/artifactory/api/pypi/db-pypi/simple"
38+
echo "PIP_INDEX_URL=${JFROG_PYPI_URL}" >> "$GITHUB_ENV"
39+
echo "UV_INDEX_URL=${JFROG_PYPI_URL}" >> "$GITHUB_ENV"
40+
41+
# Write pip.conf so subprocesses (hatch, pre-commit, virtualenv) also use JFrog
42+
mkdir -p ~/.config/pip
43+
cat > ~/.config/pip/pip.conf << EOF
44+
[global]
45+
index-url = ${JFROG_PYPI_URL}
46+
EOF
47+
48+
echo "pip and uv configured to use JFrog registry"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: "Setup Python Dependencies"
2+
description: |
3+
Restores pre-cached Python dependencies and enables offline mode.
4+
Outputs cache-hit so callers can fall back to setup-jfrog-pypi on miss.
5+
6+
outputs:
7+
cache-hit:
8+
description: "Whether the dependency cache was restored and offline mode enabled"
9+
value: ${{ steps.uv-cache.outputs.cache-matched-key != '' }}
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Restore uv and pip cache
15+
id: uv-cache
16+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
17+
with:
18+
path: |
19+
~/.cache/uv
20+
~/.cache/pip
21+
~/.cache/pip-wheelhouse
22+
key: python-deps-${{ hashFiles('uv.lock', 'pyproject.toml') }}-latest
23+
restore-keys: python-deps-${{ hashFiles('uv.lock', 'pyproject.toml') }}-
24+
25+
- name: Restore pre-commit cache
26+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
27+
with:
28+
path: ~/.cache/pre-commit
29+
key: pre-commit-deps-${{ hashFiles('.pre-commit-config.yaml') }}-latest
30+
restore-keys: pre-commit-deps-${{ hashFiles('.pre-commit-config.yaml') }}-
31+
32+
- name: Enable offline mode
33+
if: steps.uv-cache.outputs.cache-matched-key != ''
34+
shell: bash
35+
run: |
36+
echo "UV_OFFLINE=true" >> "$GITHUB_ENV"
37+
echo "UV_INDEX_URL=https://databricks.jfrog.io/artifactory/api/pypi/db-pypi/simple" >> "$GITHUB_ENV"
38+
echo "PIP_NO_INDEX=1" >> "$GITHUB_ENV"
39+
echo "PIP_FIND_LINKS=$HOME/.cache/pip-wheelhouse" >> "$GITHUB_ENV"

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
# Python dependencies — security updates only
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
open-pull-requests-limit: 0
9+
rebase-strategy: "disabled"
10+
11+
# GitHub Actions — security updates only
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
open-pull-requests-limit: 0
17+
rebase-strategy: "disabled"

.github/workflows/ci-pr-linting.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,27 @@ on:
1313

1414
jobs:
1515
pr-title:
16-
runs-on: linux-ubuntu-latest
16+
runs-on:
17+
group: databricks-protected-runner-group
18+
labels: linux-ubuntu-latest
1719
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Setup node
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: 20
24-
- name: Install conventional commit parser
25-
shell: bash
26-
run: npm install --global conventional-commits-parser
27-
2820
- name: Validate PR title
2921
id: pr-format
3022
shell: bash
3123
env:
3224
PR_TITLE: ${{ github.event.pull_request.title }}
33-
# language=bash
3425
run: |
3526
echo "PR title: ${PR_TITLE}"
36-
37-
# check if PR title follows conventional commits format
38-
# issue on parser does not support "!" for breaking change (https://github.com/conventional-changelog/conventional-changelog/issues/648)
39-
# so we override the regex to support it
40-
conventionalCommitResult=$(echo "${PR_TITLE}" | conventional-commits-parser -p "^(\w*)!?(?:\(([\w\$\.\-\* ]*)\))?\: (.*)$" | jq ".[].type")
41-
if [[ "${conventionalCommitResult}" != "null" ]]; then
42-
echo "Conventional commit type: ${conventionalCommitResult}"
27+
28+
# Validate PR title follows conventional commits format
29+
# Pattern: type[!][(scope)]: description
30+
# Examples: feat(JIRA-123): add feature, fix!: breaking change
31+
REGEX='^[a-zA-Z]+!?(\([^)]*\))?\: .+'
32+
if [[ "${PR_TITLE}" =~ $REGEX ]]; then
33+
echo "Valid conventional commit format"
4334
exit 0
4435
fi
45-
36+
4637
echo "Invalid PR title"
4738
exit 1
4839

.github/workflows/coverage.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ on:
1010
jobs:
1111
test:
1212
name: Run tests & display coverage
13-
runs-on: linux-ubuntu-latest
13+
runs-on:
14+
group: databricks-protected-runner-group
15+
labels: linux-ubuntu-latest
1416
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
1517
permissions:
1618
# Gives the action the necessary permissions for publishing new
@@ -27,7 +29,7 @@ jobs:
2729
# DO NOT run actions/checkout here, for security reasons
2830
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
2931
- name: Post comment
30-
uses: py-cov-action/python-coverage-comment-action@v3
32+
uses: py-cov-action/python-coverage-comment-action@7188638f871f721a365d644f505d1ff3df20d683 # v3
3133
with:
3234
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3335
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}

.github/workflows/integration.yml

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,19 @@ on:
3535
required: false
3636
type: string
3737

38+
permissions:
39+
id-token: write
40+
contents: read
41+
3842
concurrency:
3943
group: ${{ github.workflow }}-${{ github.ref }}
4044
cancel-in-progress: true
4145

4246
jobs:
4347
run-uc-cluster-e2e-tests:
44-
runs-on: ubuntu-latest
48+
runs-on:
49+
group: databricks-protected-runner-group
50+
labels: linux-ubuntu-latest
4551
environment: azure-prod
4652
# Only run on internal PRs or manual dispatch - skip external forks to avoid secret access failures
4753
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
@@ -52,9 +58,10 @@ jobs:
5258
DBT_DATABRICKS_UC_INITIAL_CATALOG: peco
5359
DBT_DATABRICKS_LOCATION_ROOT: ${{ secrets.TEST_PECO_EXTERNAL_LOCATION }}test
5460
TEST_PECO_UC_CLUSTER_ID: ${{ secrets.TEST_PECO_UC_CLUSTER_ID }}
61+
UV_FROZEN: "1"
5562
steps:
5663
- name: Check out repository
57-
uses: actions/checkout@v4
64+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
5865
with:
5966
# For pull_request: checkout the PR head commit
6067
# For workflow_dispatch with pr_number: checkout that PR's head
@@ -64,9 +71,13 @@ jobs:
6471
# Fetch enough history for PR testing
6572
fetch-depth: 0
6673

74+
- name: Setup JFrog PyPI Proxy
75+
uses: ./.github/actions/setup-jfrog-pypi
76+
77+
6778
- name: Set up python
6879
id: setup-python
69-
uses: actions/setup-python@v5
80+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
7081
with:
7182
python-version: "3.10"
7283

@@ -75,25 +86,27 @@ jobs:
7586
shell: sh
7687

7788
- name: Install uv
78-
uses: astral-sh/setup-uv@v4
89+
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4
7990

8091
- name: Install Hatch
8192
id: install-dependencies
82-
uses: pypa/hatch@install
93+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc # install
8394

8495
- name: Run UC Cluster Functional Tests
8596
run: DBT_TEST_USER=notnecessaryformosttests@example.com DBT_DATABRICKS_LOCATION_ROOT=$DBT_DATABRICKS_LOCATION_ROOT DBT_DATABRICKS_HOST_NAME=$DBT_DATABRICKS_HOST_NAME DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH=$DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH DBT_DATABRICKS_CLIENT_ID=$DBT_DATABRICKS_CLIENT_ID DBT_DATABRICKS_CLIENT_SECRET=$DBT_DATABRICKS_CLIENT_SECRET hatch -v run uc-cluster-e2e
8697

8798
- name: Upload UC Cluster Test Logs
8899
if: always()
89-
uses: actions/upload-artifact@v4
100+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
90101
with:
91102
name: uc-cluster-test-logs
92103
path: logs/
93104
retention-days: 5
94105

95106
run-sqlwarehouse-e2e-tests:
96-
runs-on: ubuntu-latest
107+
runs-on:
108+
group: databricks-protected-runner-group
109+
labels: linux-ubuntu-latest
97110
environment: azure-prod
98111
# Only run on internal PRs or manual dispatch - skip external forks to avoid secret access failures
99112
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
@@ -105,9 +118,10 @@ jobs:
105118
DBT_DATABRICKS_UC_INITIAL_CATALOG: peco
106119
DBT_DATABRICKS_LOCATION_ROOT: ${{ secrets.TEST_PECO_EXTERNAL_LOCATION }}test
107120
TEST_PECO_UC_CLUSTER_ID: ${{ secrets.TEST_PECO_UC_CLUSTER_ID }}
121+
UV_FROZEN: "1"
108122
steps:
109123
- name: Check out repository
110-
uses: actions/checkout@v4
124+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
111125
with:
112126
# For pull_request: checkout the PR head commit
113127
# For workflow_dispatch with pr_number: checkout that PR's head
@@ -117,9 +131,13 @@ jobs:
117131
# Fetch enough history for PR testing
118132
fetch-depth: 0
119133

134+
- name: Setup JFrog PyPI Proxy
135+
uses: ./.github/actions/setup-jfrog-pypi
136+
137+
120138
- name: Set up python
121139
id: setup-python
122-
uses: actions/setup-python@v5
140+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
123141
with:
124142
python-version: "3.10"
125143

@@ -128,25 +146,27 @@ jobs:
128146
shell: sh
129147

130148
- name: Install uv
131-
uses: astral-sh/setup-uv@v4
149+
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4
132150

133151
- name: Install Hatch
134152
id: install-dependencies
135-
uses: pypa/hatch@install
153+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc # install
136154

137155
- name: Run Sql Endpoint Functional Tests
138156
run: DBT_TEST_USER=notnecessaryformosttests@example.com DBT_DATABRICKS_LOCATION_ROOT=$DBT_DATABRICKS_LOCATION_ROOT DBT_DATABRICKS_HOST_NAME=$DBT_DATABRICKS_HOST_NAME DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH=$DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH DBT_DATABRICKS_CLIENT_ID=$DBT_DATABRICKS_CLIENT_ID DBT_DATABRICKS_CLIENT_SECRET=$DBT_DATABRICKS_CLIENT_SECRET hatch -v run sqlw-e2e
139157

140158
- name: Upload SQL Endpoint Test Logs
141159
if: always()
142-
uses: actions/upload-artifact@v4
160+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
143161
with:
144162
name: sql-endpoint-test-logs
145163
path: logs/
146164
retention-days: 5
147165

148166
run-cluster-e2e-tests:
149-
runs-on: ubuntu-latest
167+
runs-on:
168+
group: databricks-protected-runner-group
169+
labels: linux-ubuntu-latest
150170
environment: azure-prod
151171
# Only run on internal PRs or manual dispatch - skip external forks to avoid secret access failures
152172
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
@@ -156,9 +176,10 @@ jobs:
156176
DBT_DATABRICKS_CLIENT_SECRET: ${{ secrets.TEST_PECO_SP_SECRET }}
157177
TEST_PECO_CLUSTER_ID: ${{ secrets.TEST_PECO_CLUSTER_ID }}
158178
DBT_DATABRICKS_LOCATION_ROOT: ${{ secrets.TEST_PECO_EXTERNAL_LOCATION }}test
179+
UV_FROZEN: "1"
159180
steps:
160181
- name: Check out repository
161-
uses: actions/checkout@v4
182+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
162183
with:
163184
# For pull_request: checkout the PR head commit
164185
# For workflow_dispatch with pr_number: checkout that PR's head
@@ -168,9 +189,13 @@ jobs:
168189
# Fetch enough history for PR testing
169190
fetch-depth: 0
170191

192+
- name: Setup JFrog PyPI Proxy
193+
uses: ./.github/actions/setup-jfrog-pypi
194+
195+
171196
- name: Set up python
172197
id: setup-python
173-
uses: actions/setup-python@v5
198+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
174199
with:
175200
python-version: "3.10"
176201

@@ -179,18 +204,18 @@ jobs:
179204
shell: sh
180205

181206
- name: Install uv
182-
uses: astral-sh/setup-uv@v4
207+
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4
183208

184209
- name: Install Hatch
185210
id: install-dependencies
186-
uses: pypa/hatch@install
211+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc # install
187212

188213
- name: Run Cluster Functional Tests
189214
run: DBT_TEST_USER=notnecessaryformosttests@example.com DBT_DATABRICKS_LOCATION_ROOT=$DBT_DATABRICKS_LOCATION_ROOT DBT_DATABRICKS_HOST_NAME=$DBT_DATABRICKS_HOST_NAME DBT_DATABRICKS_HTTP_PATH=$DBT_DATABRICKS_CLUSTER_HTTP_PATH DBT_DATABRICKS_CLIENT_ID=$DBT_DATABRICKS_CLIENT_ID DBT_DATABRICKS_CLIENT_SECRET=$DBT_DATABRICKS_CLIENT_SECRET hatch -v run cluster-e2e
190215

191216
- name: Upload Cluster Test Logs
192217
if: always()
193-
uses: actions/upload-artifact@v4
218+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
194219
with:
195220
name: cluster-test-logs
196221
path: logs/

0 commit comments

Comments
 (0)