Skip to content

Commit d150916

Browse files
authored
Show permissions & grants in plan; use resource keys in the output (#3961)
## Changes The json plan for terraform now includes grants and permissions resources and skip actions. This matches direct plan. The text plan for terraform and direct now print permissions and grants as separate resources. The "The following resources will be deleted" message now mention resources by full name, e.g. "resources.sql_warehouses.foo" instead of "sql_warehouse foo". This matches "bundle plan" output and internal representation. Note, this message still filters out permissions and grants, they are not relevant there. For context, we used to use terraform-based resource types and shows grants & permissions in "will be deleted" message: #3075 ## Why Consistency: we already use "resources.jobs.foo" format in json plan, direct state file, error messages. This is extends it to the rest of the output. We need to treat grants and permissions as first class citizens, because they need to be migrated. After migration we're going to ask users to run "bundle plan" to check for permanent drift and it's important that we show changes in permissions/grants there and also that we separate them from their parent resource. ## Tests Existing tests, some are extended to run additional "bundle plan" commands.
1 parent 134c1a8 commit d150916

File tree

194 files changed

+627
-268
lines changed

Some content is hidden

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

194 files changed

+627
-268
lines changed

acceptance/bundle/apps/app_yaml/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Deployment complete!
2323

2424
>>> [CLI] bundle destroy --auto-approve
2525
The following resources will be deleted:
26-
delete app myapp
26+
delete resources.apps.myapp
2727

2828
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
2929

acceptance/bundle/bundle_tag/id/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Resources:
7272

7373
>>> [CLI] bundle destroy --auto-approve
7474
The following resources will be deleted:
75-
delete job foo
75+
delete resources.jobs.foo
7676

7777
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
7878

acceptance/bundle/bundle_tag/url/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Resources:
7272

7373
>>> [CLI] bundle destroy --auto-approve
7474
The following resources will be deleted:
75-
delete job foo
75+
delete resources.jobs.foo
7676

7777
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
7878

acceptance/bundle/bundle_tag/url_ref/out.destroy.terraform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The following resources will be deleted:
2-
delete job bar
3-
delete job foo
2+
delete resources.jobs.bar
3+
delete resources.jobs.foo
44

55
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
66

acceptance/bundle/deploy/files/no-snapshot-sync/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ print('Modified!')
6565

6666
>>> [CLI] bundle destroy --auto-approve
6767
The following resources will be deleted:
68-
delete job foo
68+
delete resources.jobs.foo
6969

7070
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]
7171

acceptance/bundle/deploy/mlops-stacks/output.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ Warning: unknown field: description
129129
in resources/ml-artifacts-resource.yml:21:7
130130

131131
The following resources will be deleted:
132-
delete experiment experiment
133-
delete job batch_inference_job
134-
delete job model_training_job
135-
delete model model
132+
delete resources.experiments.experiment
133+
delete resources.jobs.batch_inference_job
134+
delete resources.jobs.model_training_job
135+
delete resources.models.model
136136

137137
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev
138138

acceptance/bundle/deployment/bind/dashboard/recreation/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQU
99

1010
This action will result in the deletion or recreation of the following dashboards.
1111
This will result in changed IDs and permanent URLs of the dashboards that will be recreated:
12-
recreate dashboard dashboard1
12+
recreate resources.dashboards.dashboard1
1313
Error: the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed
1414

1515

acceptance/bundle/deployment/bind/job/generate-and-bind/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Deployment complete!
2929

3030
>>> [CLI] bundle destroy --auto-approve
3131
The following resources will be deleted:
32-
delete job test_job_key
32+
delete resources.jobs.test_job_key
3333

3434
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-generate-bind-[UNIQUE_NAME]
3535

acceptance/bundle/deployment/unbind/grants/output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ Deployment complete!
3535

3636
>>> [CLI] bundle destroy --auto-approve
3737
The following resources will be deleted:
38-
delete schema schema_1
38+
delete resources.schemas.schema_1
3939

4040
This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
41-
delete schema schema_1
41+
delete resources.schemas.schema_1
4242

4343
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]
4444

acceptance/bundle/deployment/unbind/permissions/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Deployment complete!
4141

4242
>>> [CLI] bundle destroy --auto-approve
4343
The following resources will be deleted:
44-
delete job job_1
44+
delete resources.jobs.job_1
4545

4646
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]
4747

0 commit comments

Comments
 (0)