Skip to content

Commit 499cc0d

Browse files
committed
Merge remote-tracking branch 'origin/main' into split-release-workflows
2 parents e754326 + 096b29d commit 499cc0d

34 files changed

Lines changed: 345 additions & 68 deletions

.github/actions/setup-build-environment/action.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ runs:
1212
- name: Checkout repository and submodules
1313
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414

15-
- name: Setup JFrog CLI with OIDC
16-
if: runner.os != 'macOS'
17-
uses: jfrog/setup-jfrog-cli@279b1f629f43dd5bc658d8361ac4802a7ef8d2d5 # v4.9.1
18-
env:
19-
JF_URL: https://databricks.jfrog.io
20-
with:
21-
oidc-provider-name: github-actions
15+
- name: Setup JFrog
16+
uses: ./.github/actions/setup-jfrog
2217

2318
- name: Create cache identifier
2419
run: echo "${{ inputs.cache-key }}" > cache.txt
@@ -32,14 +27,6 @@ runs:
3227
go.sum
3328
cache.txt
3429
35-
- name: Download Go modules via JFrog
36-
if: runner.os != 'macOS'
37-
shell: bash
38-
run: |
39-
jf goc --repo-resolve=db-golang
40-
jf go mod download
41-
jf go mod download -modfile=tools/go.mod
42-
4330
- name: Setup Python
4431
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4532
with:
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: 'Setup JFrog'
2+
description: >-
3+
Exchange a GitHub OIDC token for a JFrog access token and configure
4+
Go and Python package managers to use the JFrog Artifactory proxy.
5+
Requires the calling job to have "permissions: id-token: write".
6+
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- name: Get JFrog OIDC token
11+
shell: bash
12+
run: |
13+
set -euo pipefail
14+
15+
# Verify that the job has id-token: write permission.
16+
if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] || [ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ]; then
17+
echo "::error::OIDC token request URL/token not available. Does this job have 'permissions: id-token: write'?"
18+
exit 1
19+
fi
20+
21+
# Exchange GitHub OIDC token for JFrog access token.
22+
ID_TOKEN=$(curl -sLS \
23+
-H "User-Agent: actions/oidc-client" \
24+
-H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
25+
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=jfrog-github" | jq -r .value)
26+
echo "::add-mask::${ID_TOKEN}"
27+
28+
if [ -z "$ID_TOKEN" ] || [ "$ID_TOKEN" = "null" ]; then
29+
echo "::error::Failed to obtain GitHub OIDC token."
30+
exit 1
31+
fi
32+
33+
ACCESS_TOKEN=$(curl -sLS -XPOST -H "Content-Type: application/json" \
34+
"https://databricks.jfrog.io/access/api/v1/oidc/token" \
35+
-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 -r .access_token)
36+
echo "::add-mask::${ACCESS_TOKEN}"
37+
38+
if [ -z "$ACCESS_TOKEN" ] || [ "$ACCESS_TOKEN" = "null" ]; then
39+
echo "::error::Failed to exchange GitHub OIDC token for JFrog access token."
40+
exit 1
41+
fi
42+
43+
# Verify the token works.
44+
HTTP_STATUS=$(curl -sL -o /dev/null -w "%{http_code}" \
45+
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
46+
"https://databricks.jfrog.io/artifactory/api/system/version")
47+
if [ "$HTTP_STATUS" != "200" ]; then
48+
echo "::error::JFrog auth check failed (HTTP ${HTTP_STATUS})."
49+
exit 1
50+
fi
51+
52+
echo "JFROG_ACCESS_TOKEN=${ACCESS_TOKEN}" >> "$GITHUB_ENV"
53+
54+
- name: Configure Go to use JFrog proxy
55+
shell: bash
56+
run: |-
57+
set -euo pipefail
58+
CREDS="gha-service-account:${JFROG_ACCESS_TOKEN}"
59+
echo "::add-mask::${CREDS}"
60+
echo "GOPROXY=https://${CREDS}@databricks.jfrog.io/artifactory/api/go/db-golang,direct" >> "$GITHUB_ENV"
61+
echo "GONOSUMDB=*" >> "$GITHUB_ENV"
62+
63+
- name: Configure Python (uv/pip) to use JFrog proxy
64+
shell: bash
65+
run: |-
66+
set -euo pipefail
67+
CREDS="gha-service-account:${JFROG_ACCESS_TOKEN}"
68+
echo "::add-mask::${CREDS}"
69+
echo "UV_INDEX_URL=https://${CREDS}@databricks.jfrog.io/artifactory/api/pypi/db-pypi/simple" >> "$GITHUB_ENV"
70+
echo "PIP_INDEX_URL=https://${CREDS}@databricks.jfrog.io/artifactory/api/pypi/db-pypi/simple" >> "$GITHUB_ENV"

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
cooldown:
8+
default-days: 14
79
ignore:
810
# Ignore Databricks Go SDK because its upgrade requires code generation
911
- dependency-name: github.com/databricks/databricks-sdk-go
1012
- package-ecosystem: "gomod"
1113
directory: "/tools"
1214
schedule:
1315
interval: "weekly"
16+
cooldown:
17+
default-days: 14
1418
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#directories
1519
- package-ecosystem: "github-actions"
1620
directories:

.github/workflows/push.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ jobs:
9595
group: databricks-protected-runner-group-large
9696
labels: linux-ubuntu-latest-large
9797

98-
- name: windows
99-
runner:
100-
group: databricks-protected-runner-group-large
101-
labels: windows-server-latest-large
98+
# Windows runners are offline; commented out temporarily.
99+
# - name: windows
100+
# runner:
101+
# group: databricks-protected-runner-group-large
102+
# labels: windows-server-latest-large
102103

103104
- name: macos
104105
runner:
@@ -226,10 +227,11 @@ jobs:
226227
group: databricks-protected-runner-group-large
227228
labels: linux-ubuntu-latest-large
228229

229-
- name: windows
230-
runner:
231-
group: databricks-protected-runner-group-large
232-
labels: windows-server-latest-large
230+
# Windows runners are offline; commented out temporarily.
231+
# - name: windows
232+
# runner:
233+
# group: databricks-protected-runner-group-large
234+
# labels: windows-server-latest-large
233235

234236
- name: macos
235237
runner:
@@ -271,10 +273,11 @@ jobs:
271273
group: databricks-protected-runner-group-large
272274
labels: linux-ubuntu-latest-large
273275

274-
- name: windows
275-
runner:
276-
group: databricks-protected-runner-group-large
277-
labels: windows-server-latest-large
276+
# Windows runners are offline; commented out temporarily.
277+
# - name: windows
278+
# runner:
279+
# group: databricks-protected-runner-group-large
280+
# labels: windows-server-latest-large
278281

279282
- name: macos
280283
runner:

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* engine/direct: Fix unwanted recreation of secret scopes when scope_backend_type is not set ([#4834](https://github.com/databricks/cli/pull/4834))
1515
* engine/direct: Fix bind and unbind for non-Terraform resources ([#4850](https://github.com/databricks/cli/pull/4850))
1616
* engine/direct: Fix deploying removed principals ([#4824](https://github.com/databricks/cli/pull/4824))
17+
* engine/direct: Fix secret scope permissions migration from Terraform to Direct engine ([#4866](https://github.com/databricks/cli/pull/4866))
1718

1819
### Dependency updates
1920

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
bundle:
2+
name: test-bundle-$UNIQUE_NAME
3+
4+
resources:
5+
secret_scopes:
6+
foo:
7+
name: test-scope-$UNIQUE_NAME
8+
backend_type: DATABRICKS
9+
permissions:
10+
- level: READ
11+
group_name: users
12+
- level: WRITE
13+
group_name: admins

acceptance/bundle/invariant/continue_293/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/invariant/migrate/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/invariant/migrate/test.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
EnvMatrixExclude.no_catalog = ["INPUT_CONFIG=catalog.yml.tmpl"]
33
EnvMatrixExclude.no_external_location = ["INPUT_CONFIG=external_location.yml.tmpl"]
44

5-
# Unexpected action='create' for resources.secret_scopes.foo.permissions
6-
EnvMatrixExclude.no_secret_scope = ["INPUT_CONFIG=secret_scope.yml.tmpl"]
7-
EnvMatrixExclude.no_secret_scope2 = ["INPUT_CONFIG=secret_scope_default_backend_type.yml.tmpl"]
8-
95
# Cross-resource permission references (e.g. ${resources.jobs.job_b.permissions[0].level})
106
# don't work in terraform mode: the terraform interpolator converts the path to
117
# ${databricks_job.job_b.permissions[0].level}, but Terraform's databricks_job resource

acceptance/bundle/invariant/no_drift/out.test.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)