Skip to content

direct: pass last-persisted state to DoDelete#5279

Open
pietern wants to merge 1 commit into
mainfrom
direct-delete-with-state
Open

direct: pass last-persisted state to DoDelete#5279
pietern wants to merge 1 commit into
mainfrom
direct-delete-with-state

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented May 20, 2026

Summary

Extends IResource.DoDelete to take the resource's last-persisted state alongside id. The framework loads it from dstate in DeploymentUnit.Delete and DeploymentUnit.Recreate, and Adapter.DoDelete forwards it to the resource implementation. No behavioral change in this PR: every existing resource ignores the new argument (_ *FooState).

Motivation: some delete APIs need values that come from local config (e.g. postgres_project.purge_on_delete, which is set on the user's resource and forwarded to the Lakebase DeleteProject RPC). Today there is nowhere to plumb those values because DoDelete only sees the resource id. This change keeps the call symmetric with DoCreate/DoUpdate, which already receive state.

Adapter-level validation now type-checks DoDelete state the same way it already does for DoCreate newState.

Test plan

  • Unit + acceptance suites pass (go test ./bundle/..., go test ./acceptance/...); no fixture updates needed since behavior is unchanged.

This pull request and its description were written by Isaac.

Extends IResource.DoDelete to take the resource's last-persisted state
alongside id. The framework loads it from dstate in DeploymentUnit.Delete
and DeploymentUnit.Recreate, and Adapter.DoDelete forwards it to the
resource implementation. No behavioral change in this PR: every existing
resource ignores the new argument (_ *FooState).

Motivation: some delete APIs need values that come from local config
(e.g. postgres_project.purge_on_delete, which is set on the user's
resource and forwarded to the Lakebase DeleteProject RPC). Today there
is nowhere to plumb those values because DoDelete only sees the resource
id. This change keeps the call symmetric with DoCreate/DoUpdate, which
already receive state.

Co-authored-by: Isaac
@pietern pietern temporarily deployed to test-trigger-is May 20, 2026 11:08 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is May 20, 2026 11:08 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown
Contributor

Waiting for approval

Based on git history, these people are best suited to review:

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

Eligible reviewers: @andrewnester, @anton-107, @janniklasrose, @lennartkats-db, @shreyas-goenka

Suggestions based on git history. See OWNERS for ownership rules.

@pietern pietern requested a review from denik May 20, 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