Drop empty strings on omitempty fields before deploy - #6088
Open
denik wants to merge 6 commits into
Open
Conversation
Contributor
Approval status: pending
|
An optional (omitempty) resource field set to "" -- often via a variable that
resolved to an empty string, e.g. policy_id: ${var.x} -- was force-sent to the
backend and rejected ("'' is not a valid cluster policy ID"). A new
DropEmptyStrings normalize option removes such values, applied by a
DropEmptyStrings mutator in the initialize phase after variable resolution.
Fields without omitempty (required, e.g. spark_version) are kept. The fix is
engine-agnostic and reflected in bundle validate -o json.
Co-authored-by: Isaac
Apps API always returns "" for an unset description, so tfdyn/convert_app.go injects it to avoid terraform drift. Exempt apps.description from DropEmptyStrings so the direct and terraform engines send the same create request. Co-authored-by: Isaac
Co-authored-by: Isaac
The script passes leading-slash path filters to print_requests.py; Git Bash on Windows rewrites them into Windows paths, so the filter is rejected. Set MSYS_NO_PATHCONV=1 for this test. Co-authored-by: Isaac
The fix drops empty omitempty strings, so the direct-only gap closes to empty and those fields move to dropped-by-both. apps.description stays sent by both. Co-authored-by: Isaac
denik
force-pushed
the
denik/empty-string-cleanup
branch
from
July 28, 2026 16:47
4a35603 to
f679d8f
Compare
MSYS_NO_PATHCONV=1 broke print_requests.py itself on Windows (its /c/... script path became unopenable). The script already uses double-slash filters (^//api/2.0/workspace), which is the correct Windows-safe form, so the env override was both unnecessary and harmful. Co-authored-by: Isaac
Collaborator
Integration test reportCommit: 9b8d8f8
13 interesting tests: 4 SKIP, 3 FAIL, 3 RECOVERED, 2 flaky, 1 KNOWN
|
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.
Why
An optional (omitempty) resource field set to
""— often via a variable that resolved to an empty string, e.g.policy_id: ${var.x}— was force-sent to the backend and rejected with'' is not a valid cluster policy ID. Terraform dropped these via omitempty, but the direct engine sent them.Changes
A new
convert.DropEmptyStringsnormalize option removes empty-string values on omitempty fields, applied by aDropEmptyStringsmutator in the initialize phase after variable resolution. Required fields without omitempty (e.g.spark_version) are kept, andapps.descriptionis exempt to match terraform's existing behavior. The result is engine-agnostic and reflected inbundle validate -o json.