Skip to content

Commit 74f1a73

Browse files
authored
Merge branch 'main' into simonfaltum/aitools-pr1-state
2 parents 8f82e04 + 19b4057 commit 74f1a73

Some content is hidden

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

47 files changed

+626
-36
lines changed

.github/workflows/push.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ jobs:
422422
# Use Checks API (not Statuses API) to match the required "Integration Tests" check.
423423
- name: Skip integration tests (pull request)
424424
if: ${{ github.event_name == 'pull_request' && !contains(fromJSON(needs.testmask.outputs.targets), 'test') && !contains(fromJSON(needs.testmask.outputs.targets), 'test-exp-ssh') }}
425-
uses: actions/github-script@v8
425+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
426426
with:
427427
github-token: ${{ steps.generate-check-token.outputs.token }}
428428
script: |
@@ -443,7 +443,7 @@ jobs:
443443
# Use Checks API (not Statuses API) to match the required "Integration Tests" check.
444444
- name: Auto-approve for merge group
445445
if: ${{ github.event_name == 'merge_group' }}
446-
uses: actions/github-script@v8
446+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
447447
with:
448448
github-token: ${{ steps.generate-check-token.outputs.token }}
449449
script: |
@@ -487,7 +487,7 @@ jobs:
487487

488488
steps:
489489
- name: Skip integration tests
490-
uses: actions/github-script@v8
490+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
491491
with:
492492
script: |-
493493
await github.rest.checks.create({

.github/workflows/release-snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
# Snapshot release may only be updated for commits to the main branch.
8989
if: github.ref == 'refs/heads/main'
9090

91-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
91+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
9292
with:
9393
name: Snapshot
9494
prerelease: true

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
3636
# Log into the GitHub Container Registry. The goreleaser action will create
3737
# the docker images and push them to the GitHub Container Registry.
38-
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
38+
- uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
3939
with:
4040
registry: "ghcr.io"
4141
username: "${{ github.actor }}"
@@ -44,13 +44,13 @@ jobs:
4444
# QEMU is required to build cross platform docker images using buildx.
4545
# It allows virtualization of the CPU architecture at the application level.
4646
- name: Set up QEMU dependency
47-
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
47+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
4848

4949
# Pin Docker to 28.0.4 because Docker 29.x changed how buildx pushes
5050
# images (they become manifest lists), which breaks goreleaser's
5151
# docker manifest create step with "is a manifest list" error.
5252
- name: Set up Docker
53-
uses: docker/setup-docker-action@e43656e248c0bd0647d3f5c195d116aacf6fcaf4 # v4.7.0
53+
uses: docker/setup-docker-action@1a6edb0ba9ac496f6850236981f15d8f9a82254d # v5.0.0
5454
with:
5555
version: v28.0.4
5656

@@ -115,7 +115,7 @@ jobs:
115115
AZURE_CLIENT_SECRET: ${{ secrets.DECO_SIGN_AZURE_CLIENT_SECRET }}
116116

117117
- name: Upload Windows artifacts to GitHub Actions
118-
uses: actions/upload-artifact@v7
118+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
119119
with:
120120
name: windows-artifacts
121121
path: |
@@ -135,7 +135,7 @@ jobs:
135135

136136
steps:
137137
- name: Download Windows artifacts
138-
uses: actions/download-artifact@v8
138+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
139139
with:
140140
name: windows-artifacts
141141
path: dist

.github/workflows/suggest-reviewers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2121
with:
2222
fetch-depth: 0
2323

.github/workflows/tagging.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ jobs:
3434
steps:
3535
- name: Generate GitHub App Token
3636
id: generate-token
37-
uses: actions/create-github-app-token@v3
37+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
3838
with:
3939
app-id: ${{ secrets.DECO_SDK_TAGGING_APP_ID }}
4040
private-key: ${{ secrets.DECO_SDK_TAGGING_PRIVATE_KEY }}
4141

4242
- name: Checkout repository
43-
uses: actions/checkout@v6
43+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4444
with:
4545
fetch-depth: 0
4646
token: ${{ steps.generate-token.outputs.token }}

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bundles
1010
* engine/direct: Fix drift in grants resource due to privilege reordering ([#4794](https://github.com/databricks/cli/pull/4794))
11+
* engine/direct: Fix 400 error when deploying grants with ALL_PRIVILEGES ([#4801](https://github.com/databricks/cli/pull/4801))
12+
* Deduplicate grant entries with duplicate principals or privileges during initialization ([#4801](https://github.com/databricks/cli/pull/4801))
1113

1214
### Dependency updates
1315

acceptance/acceptance_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ var (
4747
UseVersion string
4848
WorkspaceTmpDir bool
4949
OnlyOutTestToml bool
50+
Subset bool
5051
)
5152

5253
// In order to debug CLI running under acceptance test, search for TestInprocessMode and update
@@ -78,6 +79,7 @@ func init() {
7879
// to simulate an identical environment.
7980
flag.BoolVar(&WorkspaceTmpDir, "workspace-tmp-dir", false, "Run tests on the workspace file system (For DBR testing).")
8081
flag.BoolVar(&OnlyOutTestToml, "only-out-test-toml", false, "Only regenerate out.test.toml files without running tests")
82+
flag.BoolVar(&Subset, "subset", false, "Select a subset of EnvMatrix variants that cover all output files. Auto-enabled on -update.")
8183
}
8284

8385
const (
@@ -156,7 +158,32 @@ func setReplsForTestEnvVars(t *testing.T, repls *testdiff.ReplacementsContext) {
156158
}
157159
}
158160

161+
// helperScriptUsesEngineCache caches whether a _script helper in a given directory
162+
// (or any of its ancestors) references $DATABRICKS_BUNDLE_ENGINE.
163+
// Since _script helpers are shared across many tests, caching avoids redundant reads.
164+
var helperScriptUsesEngineCache sync.Map
165+
166+
// anyHelperScriptUsesEngine returns true if any _script helper in dir or its ancestors
167+
// contains $DATABRICKS_BUNDLE_ENGINE.
168+
func anyHelperScriptUsesEngine(dir string) bool {
169+
if dir == "" || dir == "." {
170+
return false
171+
}
172+
if v, ok := helperScriptUsesEngineCache.Load(dir); ok {
173+
return v.(bool)
174+
}
175+
content, err := os.ReadFile(filepath.Join(dir, "_script"))
176+
result := (err == nil && strings.Contains(string(content), "$DATABRICKS_BUNDLE_ENGINE")) ||
177+
anyHelperScriptUsesEngine(filepath.Dir(dir))
178+
helperScriptUsesEngineCache.Store(dir, result)
179+
return result
180+
}
181+
159182
func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
183+
if testdiff.OverwriteMode {
184+
Subset = true
185+
}
186+
160187
repls := testdiff.ReplacementsContext{}
161188
cwd, err := os.Getwd()
162189
require.NoError(t, err)
@@ -366,6 +393,12 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
366393
}
367394

368395
expanded := internal.ExpandEnvMatrix(config.EnvMatrix, config.EnvMatrixExclude, extraVars)
396+
if Subset {
397+
scriptContent, _ := os.ReadFile(filepath.Join(dir, EntryPointScript))
398+
scriptUsesEngine := strings.Contains(string(scriptContent), "$DATABRICKS_BUNDLE_ENGINE") ||
399+
anyHelperScriptUsesEngine(dir)
400+
expanded = internal.SubsetExpanded(expanded, dir, scriptUsesEngine)
401+
}
369402

370403
for ind, envset := range expanded {
371404
envname := strings.Join(envset, "/")
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
bundle:
2+
name: schema-dup-grants-$UNIQUE_NAME
3+
4+
resources:
5+
schemas:
6+
apps_schema:
7+
name: schema_dup_grants_$UNIQUE_NAME
8+
catalog_name: main
9+
grants:
10+
- principal: deco-test-user@databricks.com
11+
privileges:
12+
- ALL_PRIVILEGES
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"method": "PATCH",
3+
"path": "/api/2.1/unity-catalog/permissions/schema/main.schema_dup_grants_[UNIQUE_NAME]",
4+
"body": {
5+
"changes": [
6+
{
7+
"add": [
8+
"ALL_PRIVILEGES"
9+
],
10+
"principal": "deco-test-user@databricks.com"
11+
}
12+
]
13+
}
14+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"method": "GET",
3+
"path": "/api/2.1/unity-catalog/permissions/schema/main.schema_dup_grants_[UNIQUE_NAME]"
4+
}
5+
{
6+
"method": "PATCH",
7+
"path": "/api/2.1/unity-catalog/permissions/schema/main.schema_dup_grants_[UNIQUE_NAME]",
8+
"body": {
9+
"changes": [
10+
{
11+
"add": [
12+
"ALL_PRIVILEGES"
13+
],
14+
"principal": "deco-test-user@databricks.com"
15+
}
16+
]
17+
}
18+
}
19+
{
20+
"method": "GET",
21+
"path": "/api/2.1/unity-catalog/permissions/schema/main.schema_dup_grants_[UNIQUE_NAME]"
22+
}
23+
{
24+
"method": "GET",
25+
"path": "/api/2.1/unity-catalog/permissions/schema/main.schema_dup_grants_[UNIQUE_NAME]"
26+
}

0 commit comments

Comments
 (0)