Skip to content

Commit 7b2b51c

Browse files
mwojtyczkaIvannKurchenko
authored andcommitted
Merge branch 'main' into feature/foreign-key-check-with-null-safe-support
2 parents 39914ba + 920b30a commit 7b2b51c

63 files changed

Lines changed: 2209 additions & 1148 deletions

Some content is hidden

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

.github/actions/jfrog-auth/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,15 @@ runs:
4848
uv auth login "${UV_INDEX_URL}" --username gha-service-account --password "${JFROG_ACCESS_TOKEN}"
4949
printf "%s=%s\n" 'UV_INDEX_URL' "${UV_INDEX_URL}" >> "${GITHUB_ENV}"
5050
printf "%s=%s\n" 'UV_FROZEN' '1' >> "${GITHUB_ENV}"
51+
52+
- name: Configure npm/yarn for JFrog
53+
shell: bash
54+
env:
55+
JFROG_ACCESS_TOKEN: "${{ steps.jfrog-auth.outputs.jfrog-access-token }}"
56+
run: |
57+
umask 077
58+
cat > ~/.npmrc << EOF
59+
registry=https://databricks.jfrog.io/artifactory/api/npm/db-npm/
60+
//databricks.jfrog.io/artifactory/api/npm/db-npm/:_authToken=${JFROG_ACCESS_TOKEN}
61+
always-auth=true
62+
EOF
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'Pre-build DQX wheel'
2+
description: >
3+
Builds the DQX wheel once per CI job and exports the absolute path as DQX_PREBUILT_WHEEL.
4+
Tests that use PrebuiltWheels copy this artifact instead of running `pip wheel` per-test,
5+
which avoids JFrog auth failures after the 1h OIDC token TTL expires mid-suite.
6+
runs:
7+
using: "composite"
8+
steps:
9+
- name: Build wheel
10+
shell: bash
11+
run: |
12+
# Bump version per CI run so cluster library installs and pip caches
13+
# don't reuse stale bytes. Delegate the scheme to blueprint so it
14+
# matches what blueprint would compute per-test
15+
NEW_VERSION="$(UV_FROZEN=1 uv run --quiet python -c '
16+
from databricks.labs.blueprint.wheels import ProductInfo
17+
from databricks.labs.dqx.config import WorkspaceConfig
18+
print(ProductInfo.from_class(WorkspaceConfig).version())
19+
')"
20+
test -n "$NEW_VERSION" || { echo "failed to compute unreleased version"; exit 1; }
21+
22+
VERSION_FILE="src/databricks/labs/dqx/__about__.py"
23+
sed -i "s/^__version__ = .*/__version__ = \"${NEW_VERSION}\"/" "$VERSION_FILE"
24+
25+
make build
26+
27+
# Restore so later steps see a clean tree
28+
git checkout -- "$VERSION_FILE"
29+
30+
WHEEL_PATH="$(find dist -maxdepth 1 -name '*.whl' -print -quit)"
31+
test -n "$WHEEL_PATH" || { echo "no wheel produced in dist/"; ls -la dist/; exit 1; }
32+
33+
printf '%s=%s\n' 'DQX_PREBUILT_WHEEL' "$PWD/$WHEEL_PATH" >> "$GITHUB_ENV"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Setup Environment'
2+
description: 'Setup uv, authenticate with JFrog, and configure package managers (pip, uv, npm).'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Setup uv
7+
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
8+
with:
9+
version: "0.11.2"
10+
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
11+
12+
- name: Setup for JFrog
13+
uses: ./.github/actions/jfrog-auth

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ Resolves #..
1414
- [ ] added integration tests
1515
- [ ] added end-to-end tests
1616
- [ ] added performance tests
17+
18+
### Documentation and Demos
19+
<!-- Any user facing changes require documentation and demos update -->
20+
21+
- [ ] added/updated demos
22+
- [ ] added/updated docs

.github/workflows/acceptance.yml

Lines changed: 54 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
types: [ opened, synchronize, ready_for_review ]
66
merge_group:
77
types: [ checks_requested ]
8-
push:
9-
branches:
10-
- main
118

129
permissions:
1310
contents: read
@@ -17,14 +14,23 @@ concurrency:
1714
cancel-in-progress: false # don't cancel ongoing runs to ensure fixtures are completed and resources terminated
1815

1916
jobs:
17+
# Gate all downstream jobs behind a single check so PRs from forks (no access to the
18+
# tool environment) and draft PRs do not trigger the expensive acceptance suite.
19+
# PRs from forks are to be tested by the reviewer(s) / maintainer(s) before merging.
20+
not-a-fork:
21+
runs-on:
22+
group: databrickslabs-protected-runner-group
23+
labels: linux-ubuntu-latest
24+
if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork
25+
steps:
26+
- run: echo "Not a fork PR, proceeding"
2027

2128
integration:
22-
# Only run this job for PRs from branches on the main repository and not from forks.
23-
# Workflows triggered by PRs from forks don't have access to the tool environment.
24-
# PRs from forks to be tested by the reviewer(s) / maintainer(s) before merging.
25-
if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork
29+
needs: not-a-fork
2630
environment: tool
27-
runs-on: larger
31+
runs-on:
32+
group: larger-runners
33+
labels: larger
2834
permissions:
2935
# Access to the integration testing infrastructure.
3036
id-token: write
@@ -36,17 +42,11 @@ jobs:
3642
with:
3743
fetch-depth: 0
3844

39-
- name: Setup uv
40-
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
41-
with:
42-
version: "0.11.2"
43-
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
45+
- name: Setup environment
46+
uses: ./.github/actions/setup-env
4447

45-
- name: Setup for JFrog
46-
uses: ./.github/actions/jfrog-auth
47-
48-
- name: Run unit tests and generate test coverage report
49-
run: make test
48+
- name: Pre-build DQX wheel
49+
uses: ./.github/actions/prebuild-wheel
5050

5151
# Integration tests are run from within tests/integration folder.
5252
# Create .coveragerc with correct relative path to source code.
@@ -56,13 +56,14 @@ jobs:
5656
[run]
5757
source = ../../src
5858
relative_files = true
59+
parallel = true
5960
EOF
6061
6162
# Run tests from `tests/integration` as defined in .codegen.json
6263
# and generate code coverage for modules defined in .coveragerc
6364
# Run 10 tests in parallel: https://github.com/databrickslabs/sandbox/blob/main/acceptance/ecosystem/pytest_run.py
6465
- name: Run integration tests and generate test coverage report
65-
uses: databrickslabs/sandbox/acceptance@3313d06ce86227537b3f37f5974f7eecb2a8e59a # acceptance/v0.4.4
66+
uses: databrickslabs/sandbox/acceptance@83461e5dd7021feabb1a9ca3ee10d6f46b72092a # acceptance/v0.4.6
6667
with:
6768
vault_uri: ${{ secrets.VAULT_URI }}
6869
timeout: 2h
@@ -72,24 +73,22 @@ jobs:
7273
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
7374
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
7475
COVERAGE_FILE: ${{ github.workspace }}/.coverage # make sure the coverage report is preserved
75-
7676
- name: Merge coverage reports and convert them to XML
7777
run: make combine-coverage
7878

79-
# Recursively search the entire workspace directory for all coverage reports.
80-
# All uploaded test coverage reports will be used even if publish is done multiple time.
8179
- name: Publish test coverage
8280
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
8381
with:
8482
use_oidc: true
83+
files: coverage-combined.xml
84+
flags: integration
8585

8686
integration_serverless:
87-
# Only run this job for PRs from branches on the main repository and not from forks.
88-
# Workflows triggered by PRs from forks don't have access to the tool environment.
89-
# PRs from forks to be tested by the reviewer(s) / maintainer(s) before merging.
90-
if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork
87+
needs: not-a-fork
9188
environment: tool
92-
runs-on: larger
89+
runs-on:
90+
group: larger-runners
91+
labels: larger
9392
permissions:
9493
id-token: write
9594
pull-requests: write
@@ -101,14 +100,11 @@ jobs:
101100
with:
102101
fetch-depth: 0
103102

104-
- name: Setup uv
105-
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
106-
with:
107-
version: "0.11.2"
108-
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
103+
- name: Setup environment
104+
uses: ./.github/actions/setup-env
109105

110-
- name: Setup for JFrog
111-
uses: ./.github/actions/jfrog-auth
106+
- name: Pre-build DQX wheel
107+
uses: ./.github/actions/prebuild-wheel
112108

113109
# Integration tests are run from within tests/integration folder.
114110
# Create .coveragerc with correct relative path to source code.
@@ -118,10 +114,11 @@ jobs:
118114
[run]
119115
source = ../../src
120116
relative_files = true
117+
parallel = true
121118
EOF
122119
123120
- name: Run integration tests on serverless cluster
124-
uses: databrickslabs/sandbox/acceptance@3313d06ce86227537b3f37f5974f7eecb2a8e59a # acceptance/v0.4.4
121+
uses: databrickslabs/sandbox/acceptance@83461e5dd7021feabb1a9ca3ee10d6f46b72092a # acceptance/v0.4.6
125122
with:
126123
vault_uri: ${{ secrets.VAULT_URI }}
127124
timeout: 2h
@@ -132,20 +129,22 @@ jobs:
132129
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
133130
DATABRICKS_SERVERLESS_COMPUTE_ID: ${{ env.DATABRICKS_SERVERLESS_COMPUTE_ID }}
134131
COVERAGE_FILE: ${{ github.workspace }}/.coverage # make sure the coverage report is preserved
135-
136132
- name: Merge coverage reports and convert them to XML
137133
run: make combine-coverage
138134

139-
# collects all coverage reports
140135
- name: Publish test coverage
141136
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
142137
with:
143138
use_oidc: true
139+
files: coverage-combined.xml
140+
flags: integration-serverless
144141

145142
e2e:
146-
if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork
143+
needs: not-a-fork
147144
environment: tool
148-
runs-on: larger
145+
runs-on:
146+
group: larger-runners
147+
labels: larger
149148
permissions:
150149
id-token: write
151150
pull-requests: write
@@ -155,21 +154,18 @@ jobs:
155154
with:
156155
fetch-depth: 0
157156

158-
- name: Setup uv
159-
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
160-
with:
161-
version: "0.11.2"
162-
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
157+
- name: Setup environment
158+
uses: ./.github/actions/setup-env
163159

164-
- name: Setup for JFrog
165-
uses: ./.github/actions/jfrog-auth
160+
- name: Pre-build DQX wheel
161+
uses: ./.github/actions/prebuild-wheel
166162

167163
# Required for DAB (Databricks Asset Bundle) e2e tests
168164
- name: Install Databricks CLI
169-
uses: databricks/setup-cli@acd0e77a1ed7f15f528faca1e1f7f5590bcfdff8 # v0.296.0
165+
uses: databricks/setup-cli@596b0a354ba14aa59921aca1b02bd67c2b0a81a5 # v0.297.2
170166

171167
- name: Run e2e tests
172-
uses: databrickslabs/sandbox/acceptance@3313d06ce86227537b3f37f5974f7eecb2a8e59a # acceptance/v0.4.4
168+
uses: databrickslabs/sandbox/acceptance@83461e5dd7021feabb1a9ca3ee10d6f46b72092a # acceptance/v0.4.6
173169
with:
174170
vault_uri: ${{ secrets.VAULT_URI }}
175171
timeout: 2h
@@ -181,9 +177,11 @@ jobs:
181177
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
182178

183179
e2e_serverless:
184-
if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork
180+
needs: not-a-fork
185181
environment: tool
186-
runs-on: larger
182+
runs-on:
183+
group: larger-runners
184+
labels: larger
187185
permissions:
188186
id-token: write
189187
pull-requests: write
@@ -195,21 +193,18 @@ jobs:
195193
with:
196194
fetch-depth: 0
197195

198-
- name: Setup uv
199-
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
200-
with:
201-
version: "0.11.2"
202-
checksum: "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981"
196+
- name: Setup environment
197+
uses: ./.github/actions/setup-env
203198

204-
- name: Setup for JFrog
205-
uses: ./.github/actions/jfrog-auth
199+
- name: Pre-build DQX wheel
200+
uses: ./.github/actions/prebuild-wheel
206201

207202
# Required for DAB (Databricks Asset Bundle) e2e tests
208203
- name: Install Databricks CLI
209-
uses: databricks/setup-cli@acd0e77a1ed7f15f528faca1e1f7f5590bcfdff8 # v0.296.0
204+
uses: databricks/setup-cli@596b0a354ba14aa59921aca1b02bd67c2b0a81a5 # v0.297.2
210205

211206
- name: Run e2e tests on serverless cluster
212-
uses: databrickslabs/sandbox/acceptance@3313d06ce86227537b3f37f5974f7eecb2a8e59a # acceptance/v0.4.4
207+
uses: databrickslabs/sandbox/acceptance@83461e5dd7021feabb1a9ca3ee10d6f46b72092a # acceptance/v0.4.6
213208
with:
214209
vault_uri: ${{ secrets.VAULT_URI }}
215210
timeout: 2h

0 commit comments

Comments
 (0)