Skip to content

direct: revoke grants when the grants node is deleted and the parent stays - #6474

Open
shreyas-goenka wants to merge 4 commits into
mainfrom
isaac/grants-delete-revoke
Open

direct: revoke grants when the grants node is deleted and the parent stays#6474
shreyas-goenka wants to merge 4 commits into
mainfrom
isaac/grants-delete-revoke

Conversation

@shreyas-goenka

@shreyas-goenka shreyas-goenka commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Grants will now be deleted on removal. When grants: [] is explicitly specified, we'll enforce an empty list, only allowing inhereted grants.

shreyas-goenka and others added 4 commits September 1, 2026 12:35
…stays

DoDelete for grants was a deliberate no-op, so removing a grants block left every
grant in place. It now revokes what is actually assigned, including out-of-band
grants, because dropping the node means the empty list is what the bundle enforces.

The no-op existed to keep `bundle destroy` working, so apply now distinguishes the
two triggers: when the parent resource is deleted in the same plan it takes the
child with it, and the child delete is applied as a state-only cleanup instead.

Co-authored-by: Isaac <no-reply@databricks.com>
Replaces the unit tests with an acceptance test that records the plan, the requests
each deploy sends and the grants left on the schema for all three cases: the grants
block removed, the list set to [], and the schema deleted along with its grants.

The goldens are per-engine because the engines still disagree on the second case
(direct plans an update, terraform a delete) and on the third, where terraform sends
a redundant revoke for a securable it is about to drop.

Also shortens childDeletesWithDeletedParent to willDeleteParent.

Co-authored-by: Isaac <no-reply@databricks.com>
exhaustruct wants every field of catalog.UpdatePermissions listed, matching DoUpdate.

The test wrote 16 golden files, one per case per engine. All three cases now append to
a single per-engine file, so the whole comparison reads top to bottom in one place and
the directory holds two goldens instead of sixteen.

Co-authored-by: Isaac <no-reply@databricks.com>
`bundle destroy` hides child nodes from its banner, so the case where the parent goes
away never showed what the grants node was planned as. Planning against a config with
the schema removed names both nodes and their action, which is the same shape destroy
applies: both are a delete, and only the parent's reaches the API on direct.

Co-authored-by: Isaac <no-reply@databricks.com>
@shreyas-goenka
shreyas-goenka marked this pull request as ready for review September 2, 2026 02:24
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

8 files changed
Suggested: @denik
Also eligible: @andrewnester, @janniklasrose, @pietern, @anton-107, @lennartkats-db

/bundle/ - needs approval

Files: bundle/deployplan/action.go, bundle/direct/bundle_apply.go, bundle/direct/dresources/grants.go
Suggested: @denik
Also eligible: @andrewnester, @janniklasrose, @pietern, @anton-107, @lennartkats-db

General files (require maintainer)

Files: .nextchanges/bundles/grants-revoked-on-delete.md
Based on git history:

  • @denik -- recent work in bundle/direct/, .nextchanges/bundles/, bundle/direct/dresources/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

@shreyas-goenka
shreyas-goenka requested review from denik and pietern and removed request for denik September 2, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant