Repository navigation
Conversation
…oy uploads files
bundle validate accepted ${resources.volumes.bar.non_existent}; plan and deploy
failed only at planning, after deploy had uploaded the bundle files, with an
error naming internal Go types. Validate and the pre-deploy checks now apply
the planner's own check (the field must exist in the state or the remote
type of the target resource) and report a user-facing error at the
reference's location. The plan reports the same message.
Co-authored-by: Isaac <no-reply@databricks.com>
…ow the wheel wrapper skip, share the planner check Co-authored-by: Isaac <no-reply@databricks.com>
…raries, name the field as written Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
Regression test report ✅Commit: Selected 3 changed tests (limit=20, 0 not selected) 6 tests: regression=6 unreleased=0 coverage=0 failing=0
TestAccept/bundle/resource_deps/non_existent_field/DMS=: branch ✅ | main (7a48abb) ❌ | latest (v1.28.0) ❌main (7a48abb): latest (v1.28.0): same output as main (7a48abb) TestAccept/bundle/resource_deps/non_existent_field/DMS=true: branch ✅ | main (7a48abb) ❌ | latest (v1.28.0) ❌main (7a48abb): latest (v1.28.0): TestAccept/bundle/resource_deps/non_existent_field_wheel_wrapper/DMS=: branch ✅ | main (7a48abb) ❌ | latest (v1.28.0) ❌main (7a48abb): latest (v1.28.0): same output as main (7a48abb) TestAccept/bundle/resource_deps/non_existent_field_wheel_wrapper/DMS=true: branch ✅ | main (7a48abb) ❌ | latest (v1.28.0) ❌main (7a48abb): latest (v1.28.0): TestAccept/bundle/variables/resolve-resources-fields/DMS=: branch ✅ | main (7a48abb) ❌ | latest (v1.28.0) ❌main (7a48abb): latest (v1.28.0): same output as main (7a48abb) TestAccept/bundle/variables/resolve-resources-fields/DMS=true: branch ✅ | main (7a48abb) ❌ | latest (v1.28.0) ❌main (7a48abb): latest (v1.28.0): same output as main (7a48abb) |
Collaborator
✅ Integration test reportCommit: aa75a0f
Top 4 slowest tests (at least 2 minutes):
|
This branch has not been deployed
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 validatenow rejects a reference to a field that the target resource type does not have, such as${resources.volumes.bar.non_existent}.bundle planandbundle deployreject it before they upload anything or call the workspace. All three report the same error at the reference's location:How it works:
LookupReferencePreDeploy. A field must exist in the target's state type or its remote type, after Terraform-to-DABs path translation, andidalways exists. That rule is now one function,checkReferenceFieldExists, which the planner and the new check share.extractReferencesis refactored intowalkReferences, which both use.makePlanskips it. A node with state is always visited.validate.Validate(onlybundle validateruns this). And as the first step ofphases.PreDeployChecks, which runs after the build for plan, deploy, pipelines deploy and apps deploy. The after-build run sees exactly the config the planner sees.bundle validateskips those two fields. The after-build check has no such skip.Why
The Badness note on
acceptance/bundle/resource_deps/non_existent_field:Before,
bundle validatepassed andbundle deployprinted:After, validate, plan and deploy all fail with the error above, and deploy uploads nothing.
This only turns an existing failure into an earlier and clearer one. The check rejects only references that the planner rejects on every deploy. References to fields that exist only remotely or are filled in by the server keep passing, such as
apps.*.url,pipelines.*.stateandpipelines.*.creator_user_name. So do map keys,id, Terraform-style paths, and permissions or grants entries.Dashboard: TestAccept/bundle/resource_deps/non_existent_field (the Badness note; no CI failures).
Tests
acceptance/bundle/resource_deps/non_existent_field: validate, plan and deploy each show the new error. Deploy shows no upload. The Badness note is removed.New
acceptance/bundle/resource_deps/non_existent_field_wheel_wrapper: a bad reference in wrapped wheel task parameters still passes validate, plan and deploy, as today. A bad reference elsewhere in the same job is rejected by validate and deploy. Mutation check: without the wheel skip, the test fails.acceptance/bundle/variables/resolve-resources-fieldsreferencesschemas.bar.non_existingand only runs validate. Deploy has always rejected that reference, and validate now reports it. The script prints the JSON as before. This is the same script shape as #7989, which also touches this test.Unit tests (
bundle/direct/reference_fields_test.go) cover:id, map keys, Terraform-style paths, permissions and grants entries;volume_path, non-resource references, dotted resource keys, missing target resources, a whole-node reference in a new empty node;Mutation checks: dropping the remote-type half of the rule, the empty-node skip or the missing-target skip each fails a case.
TestLookupReferencePreDeploy_UnknownFieldpins that the planner and the check return the same error.The whole
TestAccept/bundlesuite passes locally.bundle/deploy/mlops-stacksfails the same way on main in this environment.Gaps and risks
bundle validateruns before the build, so it can still report a false error in one case. A local library path with a reference in its directory part, where a directory with that literal name exists, is rewritten by the build, and the plan never sees the reference. Plan and deploy are exact because their check runs after the build.PrepareInputConfig);internal_immutable_snapshots, registered afterPreDeployChecks);InitAll(nil), about 1-10 ms, plus per-resource state preparation).bundle/config/validateand touchresolve-resources-fields. Whichever merges second needs a small rebase.This PR fixes behavior recorded as Badness in acceptance tests.
AI agent (opus5.5, isaac_claude)
🤖 This pull request and its description were written by Isaac.