Skip to content

Commit eb21997

Browse files
committed
remove all_priv; sort in testserver; use one user in tests
1 parent 84a2e0c commit eb21997

File tree

12 files changed

+88
-180
lines changed

12 files changed

+88
-180
lines changed

acceptance/bundle/resources/grants/schemas/update/databricks.yml.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ resources:
1111
privileges:
1212
- CREATE_TABLE
1313
- USE_SCHEMA
14-
- principal: pieter.noordhuis@databricks.com
15-
privileges: ["USE_SCHEMA"]

acceptance/bundle/resources/grants/schemas/update/out.deploy1.requests.direct.json

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,7 @@
1010
],
1111
"principal": "denis.bilenko@databricks.com",
1212
"remove": [
13-
"ALL_PRIVILEGES",
14-
"APPLY_TAG",
15-
"CREATE_FUNCTION",
16-
"CREATE_VOLUME",
17-
"EXECUTE",
18-
"MANAGE",
19-
"MODIFY",
20-
"READ_VOLUME",
21-
"REFRESH",
22-
"SELECT",
23-
"WRITE_VOLUME"
24-
]
25-
},
26-
{
27-
"add": [
28-
"USE_SCHEMA"
29-
],
30-
"principal": "pieter.noordhuis@databricks.com",
31-
"remove": [
32-
"ALL_PRIVILEGES",
33-
"APPLY_TAG",
34-
"CREATE_FUNCTION",
35-
"CREATE_TABLE",
36-
"CREATE_VOLUME",
37-
"EXECUTE",
38-
"MANAGE",
39-
"MODIFY",
40-
"READ_VOLUME",
41-
"REFRESH",
42-
"SELECT",
43-
"WRITE_VOLUME"
13+
"ALL_PRIVILEGES"
4414
]
4515
}
4616
]

acceptance/bundle/resources/grants/schemas/update/out.deploy1.requests.terraform.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
"USE_SCHEMA"
1010
],
1111
"principal": "denis.bilenko@databricks.com"
12-
},
13-
{
14-
"add": [
15-
"USE_SCHEMA"
16-
],
17-
"principal": "pieter.noordhuis@databricks.com"
1812
}
1913
]
2014
}

acceptance/bundle/resources/grants/schemas/update/out.deploy2.requests.direct.json

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,7 @@
1010
],
1111
"principal": "denis.bilenko@databricks.com",
1212
"remove": [
13-
"ALL_PRIVILEGES",
14-
"CREATE_FUNCTION",
15-
"CREATE_VOLUME",
16-
"EXECUTE",
17-
"MANAGE",
18-
"MODIFY",
19-
"READ_VOLUME",
20-
"REFRESH",
21-
"SELECT",
22-
"USE_SCHEMA",
23-
"WRITE_VOLUME"
24-
]
25-
},
26-
{
27-
"add": [
28-
"CREATE_VOLUME",
29-
"MANAGE"
30-
],
31-
"principal": "pieter.noordhuis@databricks.com",
32-
"remove": [
33-
"ALL_PRIVILEGES",
34-
"APPLY_TAG",
35-
"CREATE_FUNCTION",
36-
"CREATE_TABLE",
37-
"EXECUTE",
38-
"MODIFY",
39-
"READ_VOLUME",
40-
"REFRESH",
41-
"SELECT",
42-
"USE_SCHEMA",
43-
"WRITE_VOLUME"
13+
"ALL_PRIVILEGES"
4414
]
4515
}
4616
]

acceptance/bundle/resources/grants/schemas/update/out.deploy2.requests.terraform.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@
1111
"remove": [
1212
"USE_SCHEMA"
1313
]
14-
},
15-
{
16-
"add": [
17-
"CREATE_VOLUME",
18-
"MANAGE"
19-
],
20-
"principal": "pieter.noordhuis@databricks.com",
21-
"remove": [
22-
"USE_SCHEMA"
23-
]
2414
}
2515
]
2616
}

acceptance/bundle/resources/grants/schemas/update/out.destroy.requests.terraform.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
"CREATE_TABLE",
1010
"APPLY_TAG"
1111
]
12-
},
13-
{
14-
"principal": "pieter.noordhuis@databricks.com",
15-
"remove": [
16-
"CREATE_VOLUME",
17-
"MANAGE"
18-
]
1912
}
2013
]
2114
}

acceptance/bundle/resources/grants/schemas/update/out.plan1.direct.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@
2828
"CREATE_TABLE",
2929
"USE_SCHEMA"
3030
]
31-
},
32-
{
33-
"principal": "pieter.noordhuis@databricks.com",
34-
"privileges": [
35-
"USE_SCHEMA"
36-
]
3731
}
3832
]
3933
},

acceptance/bundle/resources/grants/schemas/update/out.plan2.direct.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
"CREATE_TABLE",
3333
"APPLY_TAG"
3434
]
35-
},
36-
{
37-
"principal": "pieter.noordhuis@databricks.com",
38-
"privileges": [
39-
"CREATE_VOLUME",
40-
"MANAGE"
41-
]
4235
}
4336
]
4437
}
@@ -53,22 +46,13 @@
5346
"CREATE_TABLE",
5447
"USE_SCHEMA"
5548
]
56-
},
57-
{
58-
"principal": "pieter.noordhuis@databricks.com",
59-
"privileges": [
60-
"USE_SCHEMA"
61-
]
6249
}
6350
]
6451
},
6552
"changes": {
6653
"local": {
6754
"grants[0].privileges[1]": {
6855
"action": "update"
69-
},
70-
"grants[1].privileges": {
71-
"action": "update"
7256
}
7357
}
7458
}

acceptance/bundle/resources/grants/schemas/update/output.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ Deployment complete!
1111

1212
>>> print_requests.py /permissions
1313

14+
>>> [CLI] grants get schema main.schema_grants_[UNIQUE_NAME]
15+
{
16+
"privilege_assignments": [
17+
{
18+
"principal": "denis.bilenko@databricks.com",
19+
"privileges": [
20+
"CREATE_TABLE",
21+
"USE_SCHEMA"
22+
]
23+
}
24+
]
25+
}
26+
1427
>>> [CLI] bundle debug plan
1528

1629
>>> print_requests.py /permissions
@@ -23,6 +36,19 @@ Deployment complete!
2336

2437
>>> print_requests.py /permissions
2538

39+
>>> [CLI] grants get schema main.schema_grants_[UNIQUE_NAME]
40+
{
41+
"privilege_assignments": [
42+
{
43+
"principal": "denis.bilenko@databricks.com",
44+
"privileges": [
45+
"APPLY_TAG",
46+
"CREATE_TABLE"
47+
]
48+
}
49+
]
50+
}
51+
2652
>>> [CLI] bundle destroy --auto-approve
2753
The following resources will be deleted:
2854
delete schema grants_schema

acceptance/bundle/resources/grants/schemas/update/script

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ trace print_requests.py /permissions > out.plan1.requests.$DATABRICKS_BUNDLE_ENG
55
trace $CLI bundle deploy
66
trace print_requests.py /permissions > out.deploy1.requests.$DATABRICKS_BUNDLE_ENGINE.json
77

8-
update_file.py databricks.yml '["USE_SCHEMA"]' '["CREATE_VOLUME", "MANAGE"]'
8+
# Since we're sending different requests between terraform and direct, assert that the end result is the same:
9+
trace $CLI grants get schema main.schema_grants_$UNIQUE_NAME | jq --sort-keys
10+
11+
#update_file.py databricks.yml '["USE_SCHEMA"]' '["CREATE_VOLUME", "MANAGE"]'
912
update_file.py databricks.yml USE_SCHEMA APPLY_TAG
1013

1114
# different on cloud vs local due to remote state
@@ -15,5 +18,7 @@ trace print_requests.py /permissions > out.plan2.requests.$DATABRICKS_BUNDLE_ENG
1518
trace $CLI bundle deploy
1619
trace print_requests.py /permissions > out.deploy2.requests.$DATABRICKS_BUNDLE_ENGINE.json
1720

21+
trace $CLI grants get schema main.schema_grants_$UNIQUE_NAME | jq --sort-keys
22+
1823
trace $CLI bundle destroy --auto-approve
1924
trace print_requests.py /permissions > out.destroy.requests.$DATABRICKS_BUNDLE_ENGINE.json

0 commit comments

Comments
 (0)