Validate required/unit-constrained UC fields early in bundle validate#5818
Open
radakam wants to merge 3 commits into
Open
Validate required/unit-constrained UC fields early in bundle validate#5818radakam wants to merge 3 commits into
radakam wants to merge 3 commits into
Conversation
Reject missing sql_warehouse name, missing grant principal, and out-of-range catalog/schema custom_max_retention_hours at validate/plan time instead of letting them pass and fail later at deploy with low-context backend errors. DECO-27550
Collaborator
Integration test reportCommit: cfbbb09
21 interesting tests: 14 SKIP, 7 RECOVERED
Top 5 slowest tests (at least 2 minutes):
|
Contributor
Approval status: pending
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
bundle validate(and thereforeplan/deploy) now fails early with a clear, actionable error for three UC fields that the SDK models as optional but the backend requires:sql_warehouses.*.name— errors withsql_warehouse name is required.grants[*].principal— errors withgrant principal is required, on every securable that supports grants (catalogs, schemas, volumes, external_locations, registered_models, vector_search_indexes).catalogs/schemas.*.custom_max_retention_hours— errors when out of range: the field is in hours but the backend only accepts0or168–720(7–30 days), e.g.custom_max_retention_hours must be 0 or between 168 and 720 hours (7 to 30 days), got 7.Implemented in the existing
validate:requiredmutator (runs inphases.Initialize(), covering validate/plan/deploy), following the existing dashboard bespoke-validation precedent.Why
These fields were modeled as loosely-typed/optional (
json:"...,omitempty"), sobundle validateandbundle planpassed but the deploy was rejected by the backend with late, low-context 400s (e.g.Invalid PermissionsChange — at least one of 'principal' or 'principal_id' must be set, orrecovery period must be 0 or between 7 and 30 days). Discovered via fuzz testing; affects both the Terraform and direct engines. Failing early with a message that names the offending field is much more actionable.Tests
acceptance/bundle/validate/:sql_warehouse_required_name/(both engines)grants_required_principal/(direct-only; verifies a missing principal errors while a valid grant passes)retention_hours_range/(direct-only; verifies out-of-range values on catalogs and schemas error while in-range values pass)empty_resourcesgolden files that now surface thesql_warehouse name is requirederror.