Skip to content

Commit 718dc9c

Browse files
committed
fix getting remote url
1 parent 2929656 commit 718dc9c

35 files changed

Lines changed: 7128 additions & 26268 deletions

.build-constraints.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
hatch-fancy-pypi-readme==25.1.0 \
2+
--hash=sha256:9c58ed3dff90d51f43414ce37009ad1d5b0f08ffc9fc216998a06380f01c0045 \
3+
--hash=sha256:ce0134c40d63d874ac48f48ccc678b8f3b62b8e50e9318520d2bffc752eedaf3
4+
hatchling==1.29.0 \
5+
--hash=sha256:50af9343281f34785fab12da82e445ed987a6efb34fd8c2fc0f6e6630dbcc1b0 \
6+
--hash=sha256:793c31816d952cee405b83488ce001c719f325d9cda69f1fc4cd750527640ea6
7+
# via hatch-fancy-pypi-readme
8+
packaging==26.0 \
9+
--hash=sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4 \
10+
--hash=sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529
11+
# via hatchling
12+
pathspec==1.0.4 \
13+
--hash=sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645 \
14+
--hash=sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723
15+
# via hatchling
16+
pluggy==1.6.0 \
17+
--hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \
18+
--hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746
19+
# via hatchling
20+
trove-classifiers==2026.1.14.14 \
21+
--hash=sha256:00492545a1402b09d4858605ba190ea33243d361e2b01c9c296ce06b5c3325f3 \
22+
--hash=sha256:1f9553927f18d0513d8e5ff80ab8980b8202ce37ecae0e3274ed2ef11880e74d
23+
# via hatchling

.codegen.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
"src/databricks/labs/dqx/__about__.py": "__version__ = \"$VERSION\""
44
},
55
"toolchain": {
6-
"required": ["python3", "hatch"],
7-
"pre_setup": ["hatch env create"],
8-
"prepend_path": ".venv/bin"
6+
"required": ["make", "uv"],
7+
"pre_setup": ["make dev"],
8+
"prepend_path": ".venv/bin",
9+
"test": ["make test"]
910
}
10-
}
11+
}

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
label: Current Behavior
2121
description: |
2222
A concise description of what you're experiencing.
23-
**Do not paste links to attachments with logs and/or images, as all issues will attachments will get deleted.**
23+
**Do not paste links to attachments with logs and/or images, as all issues with attachments will get deleted.**
2424
Use the `Relevant log output` field to paste redacted log output without personal identifying information (PII).
2525
You can Ctrl/Cmd+V the screenshot, which would appear as a rendered image if it doesn't contain any PII.
2626
validations:
@@ -67,6 +67,6 @@ body:
6767
- type: textarea
6868
id: logs
6969
attributes:
70-
label: Relevant log output
71-
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
70+
label: Relevant log output, error message and full stacktrace
71+
description: Please copy and paste any relevant log output, error message and full stacktrace. This will be automatically formatted into code, so no need for backticks.
7272
render: shell
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'Authenticate for JFrog'
2+
description: 'Authenticate with JFrog using OIDC based on the GitHub repository.'
3+
# TODO: Factor out into an external action, once releases are allowed.
4+
outputs:
5+
jfrog-access-token:
6+
description: "Access token for JFrog"
7+
value: "${{ steps.jfrog-auth.outputs.jfrog-access-token }}"
8+
runs:
9+
using: "composite"
10+
steps:
11+
- id: jfrog-auth
12+
name: Authenticate against JFrog
13+
shell: bash
14+
run: |
15+
"${GITHUB_ACTION_PATH}/jfrog-auth" "${ACTIONS_ID_TOKEN_REQUEST_URL}" "${ACTIONS_ID_TOKEN_REQUEST_TOKEN}"
16+
17+
- id: detect-cmds
18+
name: Detecting python package/project managers.
19+
shell: bash
20+
run: |
21+
for cmd in pip3 uv
22+
do
23+
command -v "${cmd}" > /dev/null && found=true || found=false
24+
printf '::debug::%s\n' "Found ${cmd}: ${found}"
25+
printf '%s=%s\n' "command_${cmd}" "${found}" >> "${GITHUB_OUTPUT}"
26+
done
27+
28+
- name: Configure pip for JFrog
29+
if: "${{ steps.detect-cmds.outputs.command_pip3 == 'true' }}"
30+
shell: bash
31+
env:
32+
JFROG_ACCESS_TOKEN: "${{ steps.jfrog-auth.outputs.jfrog-access-token }}"
33+
run: |
34+
umask 077
35+
cat > "$RUNNER_TEMP/.pip.conf" <<EOF
36+
[global]
37+
index-url = https://gha-service-account:${JFROG_ACCESS_TOKEN}@databricks.jfrog.io/artifactory/api/pypi/db-pypi/simple
38+
EOF
39+
printf '%s=%s\n' 'PIP_CONFIG_FILE' "${RUNNER_TEMP}/.pip.conf" >> "${GITHUB_ENV}"
40+
41+
- name: Configure uv for JFrog
42+
if: "${{ steps.detect-cmds.outputs.command_uv == 'true' }}"
43+
shell: bash
44+
env:
45+
JFROG_ACCESS_TOKEN: "${{ steps.jfrog-auth.outputs.jfrog-access-token }}"
46+
UV_INDEX_URL: 'https://databricks.jfrog.io/artifactory/api/pypi/db-pypi/simple'
47+
run: |
48+
uv auth login "${UV_INDEX_URL}" --username gha-service-account --password "${JFROG_ACCESS_TOKEN}"
49+
printf "%s=%s\n" 'UV_INDEX_URL' "${UV_INDEX_URL}" >> "${GITHUB_ENV}"
50+
printf "%s=%s\n" 'UV_FROZEN' '1' >> "${GITHUB_ENV}"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Obtain a JFrog access token, assuming GitHub OIDC.
4+
#
5+
set -eu
6+
7+
_request_url="$1"
8+
_request_token="$2"
9+
10+
#
11+
# Step 1: Obtain the OIDC identifier token from GitHub.
12+
#
13+
printf '::debug::%s\n' "Fetching OIDC identifier token from GitHub..."
14+
_id_token="$(curl -sLS \
15+
-H 'User-Agent: actions/oidc-client' \
16+
-H "Authorization: Bearer ${_request_token}" \
17+
"${_request_url}&audience=jfrog-github" |
18+
jq -r .value)"
19+
printf '::add-mask::%s\n' "${_id_token}"
20+
21+
#
22+
# Step 2: Exchange it for the JFrog access token.
23+
#
24+
printf '::debug::%s\n' "Exchanging OIDC identifier token for JFrog access token..."
25+
_access_token=$(curl -sLS \
26+
--json "{\"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\"}" \
27+
"https://databricks.jfrog.io/access/api/v1/oidc/token" |
28+
jq -r .access_token)
29+
printf '::add-mask::%s\n' "${_access_token}"
30+
31+
if [ -z "${_access_token}" ] || [ "${_access_token}" = 'null' ]
32+
then
33+
printf '::error::%s\n' "Could not fetch JFrog access token."
34+
exit 1
35+
fi
36+
37+
printf '%s=%s\n' 'jfrog-access-token' "${_access_token}" >> "${GITHUB_OUTPUT}"

.github/dependabot.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "pip"
3+
- package-ecosystem: "uv"
44
directory: "/"
5+
cooldown:
6+
default-days: 7
7+
exclude:
8+
- "databricks*"
59
schedule:
610
interval: "daily"
7-
- package-ecosystem: "github-actions"
8-
directory: "/"
9-
schedule:
10-
interval: "daily"

.github/workflows/acceptance.yml

Lines changed: 44 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ on:
1010
- main
1111

1212
permissions:
13-
id-token: write
1413
contents: read
15-
pull-requests: write
1614

1715
concurrency:
1816
group: ${{ github.workflow }}-${{ github.ref }}
@@ -27,21 +25,25 @@ jobs:
2725
if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork
2826
environment: tool
2927
runs-on: larger
28+
permissions:
29+
# Access to the integration testing infrastructure.
30+
id-token: write
31+
# Write test results to the PR.
32+
pull-requests: write
3033
steps:
3134
- name: Checkout Code
3235
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3336
with:
3437
fetch-depth: 0
3538

36-
- name: Install Python
37-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
39+
- name: Setup uv
40+
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
3841
with:
39-
cache: 'pip'
40-
cache-dependency-path: '**/pyproject.toml'
41-
python-version: '3.12'
42+
version: "0.11.2"
43+
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
4244

43-
- name: Install hatch
44-
run: pip install hatch==1.16.5
45+
- name: Setup for JFrog
46+
uses: ./.github/actions/jfrog-auth
4547

4648
- name: Run unit tests and generate test coverage report
4749
run: make test
@@ -72,8 +74,7 @@ jobs:
7274
COVERAGE_FILE: ${{ github.workspace }}/.coverage # make sure the coverage report is preserved
7375

7476
- name: Merge coverage reports and convert them to XML
75-
run: |
76-
hatch run combine_coverage
77+
run: make combine-coverage
7778

7879
# Recursively search the entire workspace directory for all coverage reports.
7980
# All uploaded test coverage reports will be used even if publish is done multiple time.
@@ -89,6 +90,9 @@ jobs:
8990
if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork
9091
environment: tool
9192
runs-on: larger
93+
permissions:
94+
id-token: write
95+
pull-requests: write
9296
env:
9397
DATABRICKS_SERVERLESS_COMPUTE_ID: auto
9498
steps:
@@ -97,15 +101,14 @@ jobs:
97101
with:
98102
fetch-depth: 0
99103

100-
- name: Install Python
101-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
104+
- name: Setup uv
105+
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
102106
with:
103-
cache: 'pip'
104-
cache-dependency-path: '**/pyproject.toml'
105-
python-version: '3.12'
107+
version: "0.11.2"
108+
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
106109

107-
- name: Install hatch
108-
run: pip install hatch==1.16.5
110+
- name: Setup for JFrog
111+
uses: ./.github/actions/jfrog-auth
109112

110113
# Integration tests are run from within tests/integration folder.
111114
# Create .coveragerc with correct relative path to source code.
@@ -131,8 +134,7 @@ jobs:
131134
COVERAGE_FILE: ${{ github.workspace }}/.coverage # make sure the coverage report is preserved
132135

133136
- name: Merge coverage reports and convert them to XML
134-
run: |
135-
hatch run combine_coverage
137+
run: make combine-coverage
136138

137139
# collects all coverage reports
138140
- name: Publish test coverage
@@ -144,43 +146,27 @@ jobs:
144146
if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork
145147
environment: tool
146148
runs-on: larger
149+
permissions:
150+
id-token: write
151+
pull-requests: write
147152
steps:
148153
- name: Checkout Code
149154
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
150155
with:
151156
fetch-depth: 0
152157

153-
- name: Install Python
154-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
158+
- name: Setup uv
159+
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
155160
with:
156-
cache: 'pip'
157-
cache-dependency-path: '**/pyproject.toml'
158-
python-version: '3.12'
161+
version: "0.11.2"
162+
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
159163

160-
- name: Install hatch
161-
run: pip install hatch==1.16.5
162-
163-
- name: Install dbt
164-
run: |
165-
pip install dbt-core==1.10.9 dbt-databricks==1.10.9
164+
- name: Setup for JFrog
165+
uses: ./.github/actions/jfrog-auth
166166

167+
# Required for DAB (Databricks Asset Bundle) e2e tests
167168
- name: Install Databricks CLI
168-
run: |
169-
curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh
170-
databricks --version
171-
172-
- name: Azure login (OIDC)
173-
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
174-
with:
175-
client-id: ${{ secrets.ARM_CLIENT_ID }}
176-
tenant-id: ${{ secrets.ARM_TENANT_ID }}
177-
allow-no-subscriptions: true
178-
179-
- name: Set env vars for Azure CLI auth
180-
run: |
181-
val=$(az keyvault secret show --id "${{ secrets.VAULT_URI }}/secrets/DATABRICKS-HOST" --query value -o tsv)
182-
echo "DATABRICKS_HOST=$val" >> $GITHUB_ENV
183-
echo "DATABRICKS_AUTH_TYPE=azure-cli" >> $GITHUB_ENV
169+
uses: databricks/setup-cli@acd0e77a1ed7f15f528faca1e1f7f5590bcfdff8 # v0.296.0
184170

185171
- name: Run e2e tests
186172
uses: databrickslabs/sandbox/acceptance@3313d06ce86227537b3f37f5974f7eecb2a8e59a # acceptance/v0.4.4
@@ -198,6 +184,9 @@ jobs:
198184
if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork
199185
environment: tool
200186
runs-on: larger
187+
permissions:
188+
id-token: write
189+
pull-requests: write
201190
env:
202191
DATABRICKS_SERVERLESS_COMPUTE_ID: auto
203192
steps:
@@ -206,37 +195,18 @@ jobs:
206195
with:
207196
fetch-depth: 0
208197

209-
- name: Install Python
210-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
198+
- name: Setup uv
199+
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
211200
with:
212-
cache: 'pip'
213-
cache-dependency-path: '**/pyproject.toml'
214-
python-version: '3.12'
215-
216-
- name: Install hatch
217-
run: pip install hatch==1.16.5
201+
version: "0.11.2"
202+
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
218203

219-
- name: Install dbt
220-
run: |
221-
pip install dbt-core==1.10.9 dbt-databricks==1.10.9
204+
- name: Setup for JFrog
205+
uses: ./.github/actions/jfrog-auth
222206

207+
# Required for DAB (Databricks Asset Bundle) e2e tests
223208
- name: Install Databricks CLI
224-
run: |
225-
curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh
226-
databricks --version
227-
228-
- name: Azure login (OIDC)
229-
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
230-
with:
231-
client-id: ${{ secrets.ARM_CLIENT_ID }}
232-
tenant-id: ${{ secrets.ARM_TENANT_ID }}
233-
allow-no-subscriptions: true
234-
235-
- name: Set env vars for Azure CLI auth
236-
run: |
237-
val=$(az keyvault secret show --id "${{ secrets.VAULT_URI }}/secrets/DATABRICKS-HOST" --query value -o tsv)
238-
echo "DATABRICKS_HOST=$val" >> $GITHUB_ENV
239-
echo "DATABRICKS_AUTH_TYPE=azure-cli" >> $GITHUB_ENV
209+
uses: databricks/setup-cli@acd0e77a1ed7f15f528faca1e1f7f5590bcfdff8 # v0.296.0
240210

241211
- name: Run e2e tests on serverless cluster
242212
uses: databrickslabs/sandbox/acceptance@3313d06ce86227537b3f37f5974f7eecb2a8e59a # acceptance/v0.4.4

0 commit comments

Comments
 (0)