Fixed bundle deploy to not update permissions for unbound resources#3642
Fixed bundle deploy to not update permissions for unbound resources#3642andrewnester merged 10 commits intomainfrom
Conversation
| } | ||
|
|
||
| s.Jobs[jobId] = jobs.Job{JobId: jobId, Settings: &jobSettings} | ||
| s.Jobs[jobId] = jobs.Job{JobId: jobId, Settings: &jobSettings, CreatorUserName: TestUser.UserName} |
There was a problem hiding this comment.
CreatorUserName field is used by TF to check if the resource exists or not. CreatorUserName should be non-empty for the resource to be considered as "exists"
There was a problem hiding this comment.
Useful context, please include as a comment to persist it.
|
shreyas-goenka
left a comment
There was a problem hiding this comment.
This PR fixes the issue for all resource types right? Can we fix that in the PR title?
| } | ||
|
|
||
| s.Jobs[jobId] = jobs.Job{JobId: jobId, Settings: &jobSettings} | ||
| s.Jobs[jobId] = jobs.Job{JobId: jobId, Settings: &jobSettings, CreatorUserName: TestUser.UserName} |
There was a problem hiding this comment.
Useful context, please include as a comment to persist it.
pietern
left a comment
There was a problem hiding this comment.
Can you confirm if the acceptance test fails if unbind doesn't remove the permissions from the state? The permissions for the first and second resources are identical, and the resource key in the state is identical as well.
| Monitors map[string]catalog.MonitorInfo | ||
| Apps map[string]apps.App | ||
| Schemas map[string]catalog.SchemaInfo | ||
| SchemasGrants map[string][]catalog.PrivilegeAssignment |
There was a problem hiding this comment.
Nit: should also be singular, SchemaGrants, as in "grants for a schema".
|
@pietern yes, I wrote the acceptance test with this failure first and confirmed that removing the fix makes the test fail |
## Release v0.270.0 ### Notable Changes * Add 'databricks bundle plan' command. This command shows the deployment plan for the current bundle configuration without making any changes. ([#3530](#3530)) ### Bundles * Add 'databricks bundle plan' command ([#3530](#3530)) * Add new Lakeflow Pipelines support for bundle generate ([#3568](#3568)) * Fix bundle deploy to not update permissions or grants for unbound resources ([#3642](#3642)) * Introduce new bundle variable: `${workspace.current_user.domain_friendly_name}` ([#3623](#3623)) * Improve the output of bundle run when bundle is not deployed ([#3652](#3652))
Changes
Fixed bundle deploy to not update permissions for unbound resources
Why
The original issue occurred because we hadn't removed the permissions section for the corresponding resources from the TF state. and therefore, permissions were continued to be managed by TF and, as a result, cleared out.
Tests
Added an acceptance test