Skip to content

Add error for when an etag is specified in dashboard configuration - #3723

Merged
shreyas-goenka merged 9 commits into
mainfrom
error-etag
Oct 8, 2025
Merged

Add error for when an etag is specified in dashboard configuration#3723
shreyas-goenka merged 9 commits into
mainfrom
error-etag

Conversation

@shreyas-goenka

@shreyas-goenkashreyas-goenka commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

Changes

Users should never set etags in their configuration. It's meant to be a pure internal state.

Why

This validation can potentially help simplify downstream code since we can read etags directly from a merged view of (config + state) and be confident that the etag values come from state.

Note: This is not a breaking change since existing users would see errors when they try to update their dashboard if they specified etags in their configuration today:

databricks_dashboard.dashboard: Modifying... [id=01f0a29746cd1d1991ae7cc9e6331576]
╷
│ Error: cannot update dashboard: Entity etag provided does not match currently stored etag. Please reload the entity and try the action again.
│ │ with databricks_dashboard.dashboard,
│ on main.tf line 13, in resource "databricks_dashboard" "dashboard":
│ 13: resource "databricks_dashboard" "dashboard" {
│ ╵

Tests

New acceptance test.

@shreyas-goenka
shreyas-goenka marked this pull request as ready for review October 6, 2025 09:21
Comment threadNEXT_CHANGELOG.md Outdated
Comment threadacceptance/bundle/validate/no_dashboard_etag/output.txt Outdated
@shreyas-goenkashreyas-goenka changed the title Add error for when an etag is specified in bundle configurationAdd error for when an etag is specified in dashboard configurationOct 6, 2025
validate.Enum(),

// Validate that no dashboard etags are set. They are purely internal state and should not be set by the user.
validate.ValidateDashboardEtags(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not resourcemutator be a better place for this? Currently this misses resources set by PyDABs.

Related, can we have an abstraction similar to SetDefault() that allows us easily adding output-only fields?

MustNotBeSet("resources.dashboards.*.etag"),

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation happens after PyDABs resources are loaded.

can we have an abstraction similar to SetDefault() that allows us easily adding output-only fields?

Longer term, perhaps. We can autogenerate those based on OUTPUT only or other annotations. For now we don't need to generalize.

@shreyas-goenkashreyas-goenkaOct 6, 2025

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MustNotBeSet("resources.dashboards.*.etag")

In this case I opted for the static types because those are easier to discover / navigate. Eventually we can use the dynamic paths but I don't want to do that prematurely here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation happens after PyDABs resources are loaded.

Right, I did not notice.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 8, 2025

Copy link
Copy Markdown
Collaborator

Run: 18340420577

Env✅​pass🔄​flaky🙈​skip🪲​BUG
🪲​aws linux31545401
🪲​aws windows31825391
🪲​aws-ucws linux4354361
🪲​aws-ucws windows4364351
🪲​azure linux31635391
🪲​azure windows31825381
🪲​azure-ucws linux4354351
🪲​azure-ucws windows4364341
🪲​gcp linux3185411
🪲​gcp windows3195401
11 failing tests:
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
TestAccept✅​pass✅​pass✅​pass✅​pass🔄​flaky✅​pass✅​pass✅​pass✅​pass✅​pass
TestAccept/bundle/templates/default-python/combinations/classic✅​pass✅​pass✅​pass✅​pass🔄​flaky✅​pass✅​pass✅​pass✅​pass✅​pass
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=yes/PY=no✅​pass✅​pass✅​pass✅​pass✅​pass🔄​flaky✅​pass✅​pass✅​pass✅​pass
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=no/NBOOK=yes/PY=yes✅​pass✅​pass✅​pass✅​pass✅​pass🔄​flaky✅​pass✅​pass✅​pass✅​pass
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/DLT=yes/NBOOK=no/PY=yes✅​pass🔄​flaky✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass
TestAccept/bundle/templates/default-python/combinations/classic/DATABRICKS_BUNDLE_ENGINE=terraform/DLT=yes/NBOOK=yes/PY=no✅​pass🔄​flaky✅​pass✅​pass🔄​flaky✅​pass✅​pass✅​pass✅​pass✅​pass
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/UV_PYTHON=3.11🔄​flaky✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_BUNDLE_ENGINE=direct-exp/UV_PYTHON=3.12🔄​flaky✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass
TestAccept/selftest/record_cloud/pipeline-crud🔄​flaky✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass
TestAccept/selftest/record_cloud/pipeline-crud/DATABRICKS_BUNDLE_ENGINE=direct-exp🔄​flaky✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass✅​pass
TestTelemetryEndpoint🪲​BUG🪲​BUG🪲​BUG🪲​BUG🪲​BUG🪲​BUG🪲​BUG🪲​BUG🪲​BUG🪲​BUG

@shreyas-goenka
shreyas-goenka added this pull request to the merge queueOct 8, 2025
Merged via the queue into main with commit 739a132Oct 8, 2025
13 checks passed
@shreyas-goenka
shreyas-goenka deleted the error-etag branch October 8, 2025 11:00
deco-sdk-taggingBot added a commit that referenced this pull request Oct 8, 2025
## Release v0.272.0
### Bundles
* Fix processing short pip flags in environment dependencies ([#3708](#3708))
* Add support for referencing local files in -e pip flag for environment dependencies ([#3708](#3708))
* Add error for when an etag is specified in dashboard configuration. Setting etags was never supported / valid in bundles but now users will see this error during validation rather than deployment. ([#3723](#3723))
* Fix PIP flag processing in pipeline environment dependencies ([#3734](#3734))
denik pushed a commit that referenced this pull request May 20, 2026
…3723)
## Changes
Users should never set etags in their configuration. It's meant to be a
pure internal state.
## Why
This validation can potentially help simplify downstream code since we
can read etags directly from a merged view of (config + state) and be
confident that the etag values come from state.
Note: This is not a breaking change since existing users would see
errors when they try to update their dashboard if they specified etags
in their configuration today:
```
databricks_dashboard.dashboard: Modifying... [id=01f0a29746cd1d1991ae7cc9e6331576]
╷
│ Error: cannot update dashboard: Entity etag provided does not match currently stored etag. Please reload the entity and try the action again.
│ │ with databricks_dashboard.dashboard,
│ on main.tf line 13, in resource "databricks_dashboard" "dashboard":
│ 13: resource "databricks_dashboard" "dashboard" {
│ ╵
```
## Tests
New acceptance test.
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.272.0
### Bundles
* Fix processing short pip flags in environment dependencies ([#3708](#3708))
* Add support for referencing local files in -e pip flag for environment dependencies ([#3708](#3708))
* Add error for when an etag is specified in dashboard configuration. Setting etags was never supported / valid in bundles but now users will see this error during validation rather than deployment. ([#3723](#3723))
* Fix PIP flag processing in pipeline environment dependencies ([#3734](#3734))
Sign up for freeto 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.

5 participants

@shreyas-goenka@eng-dev-ecosystem-bot@pietern@denik@andrewnester