Skip to content

Fail a create that returns no resource id - #7358

Draft
janniklasrose wants to merge 1 commit into
mainfrom
janniklasrose/create-empty-id-guard
Draft

janniklasrose wants to merge 1 commit into
mainfrom
janniklasrose/create-empty-id-guard

Conversation

@janniklasrose

Copy link
Copy Markdown
Member

Changes

DeploymentUnit.Create saved whatever id DoCreate returned, including an empty string, and UpdateWithID did the same for DoUpdateWithID. An empty id is stored as-is, and on the next plan GetResourceID returns nothing, so the engine treats the resource as missing and creates it again. Both paths now return an error before saving state when the id is empty.

Two unit tests with a minimal fake adapter cover the create and update-with-id paths and assert that no state is written.

Why

The resource README describes this check as a framework guarantee; the engine did not implement it, so an adapter that trusted the README could leave untracked resources behind.

Tests

  • go test ./bundle/direct/... -count=1, including the two new tests.
  • ./task lint-q, ./task ws.

This pull request and its description were written by Isaac.

An empty id would be saved as-is, and the next plan would treat the resource as missing and create it again.

Co-authored-by: Isaac <no-reply@databricks.com>
@janniklasrose janniklasrose added the new-resource-work Skills, docs and small refactors for onboarding new bundle resources label Nov 4, 2026
@github-actions github-actions Bot added the DABs DABs related issues label Nov 4, 2026
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 6173eec

Run: 41864554015

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 271 15 6:36
✅​ aws-windows-latest-4core-16gb 273 13 5:45
✅​ azure linux-2core-8gb 270 15 6:00
✅​ azure-windows-latest-4core-16gb 272 13 4:55
✅​ gcp linux-2core-8gb 271 15 5:56
✅​ gcp-windows-latest-4core-16gb 273 13 6:07
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:34 azure-windows-latest-4core-16gb TestAccept
3:29 aws-windows-latest-4core-16gb TestAccept
3:18 gcp-windows-latest-4core-16gb TestAccept

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues new-resource-work Skills, docs and small refactors for onboarding new bundle resources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants