Repository navigation
Conversation
When applying a saved plan, Build is skipped and LocalLibraryPaths expands artifact and library globs itself. It patched only the first wheel each artifact glob matched and kept every version, so after a version bump it uploaded the patched old wheel and unpatched new ones while the job referenced patched wheels that were never uploaded. Keep the latest wheel per distribution, as ExpandGlobReferences does, and patch every match. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Regression test report ✅Commit: Selected 1 changed tests (limit=20, 0 not selected) 2 tests: regression=2 unreleased=0 coverage=0 failing=0
TestAccept/bundle/artifacts/whl_dynamic_readplan/DMS=/READPLAN=1: branch ✅ | main (e6f3460) ❌ | latest (v1.28.0) ❌main (e6f3460): latest (v1.28.0): TestAccept/bundle/artifacts/whl_dynamic_readplan/DMS=true/READPLAN=1: branch ✅ | main (e6f3460) ❌ | latest (v1.28.0) ❌main (e6f3460): latest (v1.28.0): |
…x-readplan-dynamic-wheels # Conflicts: # acceptance/bundle/artifacts/whl_dynamic_readplan/output.txt # acceptance/bundle/artifacts/whl_dynamic_readplan/script # acceptance/bundle/artifacts/whl_dynamic_readplan/test.toml
✅ Integration test reportCommit: 849d983
Top 6 slowest tests (at least 2 minutes):
|
…x-readplan-dynamic-wheels # Conflicts: # acceptance/bundle/artifacts/whl_dynamic_readplan/output.txt # acceptance/bundle/artifacts/whl_dynamic_readplan/test.toml
There was a problem hiding this comment.
Automated review at 849d983. Each finding was verified against the code.
No blocking issues found. 2 non-blocking comment(s) below.
This PR makes LocalLibraryPaths (used only by bundle deploy --plan) keep only the latest version of each wheel, for both library globs and artifact file globs, and patch every wheel an artifact glob matches instead of only the first. That fixes the common case recorded in whl_dynamic_readplan. Two of the regressions you list in the description hold up when traced through the code. Each one ends in a successful deploy whose job or pipeline points at a wheel that was never uploaded. They're worth closing here, or at least pinning with a test, before the Badness note is removed.
…x-readplan-dynamic-wheels # Conflicts: # acceptance/bundle/artifacts/whl_dynamic_readplan/test.toml
deploy --plan picks the upload set from the local files again, while the plan recorded the names that existed at plan time. They differ when the files change in between, and for references SwitchToPatchedWheels does not rewrite, such as pipeline environment dependencies on a dynamic_version wheel. Add each referenced file that the upload set lacks, and fail before uploading anything when a referenced file has no local counterpart. Co-authored-by: Isaac <no-reply@databricks.com>
Changes
bundle deploy --planpicks the local files to upload as follows:LocalLibraryPathsappliespatchwheel.FilterLatestWheelsto globbed library paths and to artifact file globs, asExpandGlobReferencesandartifacts.expandGlobsdo on the plain deploy path. It also patches every wheel an artifact glob matches instead of only the first one.PlanLocalLibraryPaths(bundle/libraries/plan_paths.go) adds every file that the plan's resources reference under the artifact upload path and that the set above lacks. It reads the planned state of the resources the plan changes, and the remote state of the ones it leaves unchanged, leaving out values the plan marks as unmanaged. It finds each file among the patched wheels in the local cache and the files any library or artifact glob matches, or by re-patching a matching wheel. When a wheel the plan is about to deploy has no local file, it fails before anything is cleaned up or uploaded, and asks to runbundle planagain.Why
After a version bump, or with several packages built into one
dist/,deploy --planuploaded the patched old wheel and the unpatched new ones, while the job referenced patched wheels that were never uploaded. Recorded in #8156.Choosing the latest wheel again at apply time is not enough on its own. The plan recorded the names that existed at
bundle plantime, and those differ when the local files change in between: a newer build into the samedist/, another target's build, or a touched wheel, whose patched name comes from its mtime. They also differ for references thatSwitchToPatchedWheelsdoes not rewrite, such as pipelineenvironment.dependencieson adynamic_versionwheel, which keep the unpatched name. The upload step empties the remote directory first, so a referenced file that is not uploaded is lost. Reading the references from the plan covers all of these. It also avoids copyingSwitchToPatchedWheels' rules, which #5306 changes.Gaps and risks
experimental.skip_artifact_cleanup.%pip installlines and--wheel=arguments. This includesfile:///Volumes/..., which contains the upload path. A reference that names the same location another way, such asdbfs:/Volumes/..., is not seen.experimental.python_wheel_wrapper, the wheel is installed by a%pip installline in a generated notebook, which is not part of the plan. If the local wheels change between plan and apply, that notebook can name a wheel that was not uploaded, as before this PR.dynamic_versionartifact gets only the patched copy uploaded, and no resource names the raw one. An exact library path whose file was deleted after the plan still fails during upload, after cleanup, as before.deploy --plan --selectuploads only the latest version for unselected resources too, like plaindeploy --select.bundle deploy --planreaches this code, so plain deploy is unchanged.Risk: medium. Changes are limited to
deploy --plan, but they change which files it uploads and add an error that fails a deploy which used to report success with missing wheels.Tests
bundle/artifacts/whl_dynamic_readplan(from #8156) now uploads exactly the wheels the job references, so its output is updated and the Badness is removed. Reverting any of the threeLocalLibraryPathschanges fails it: the stale 0.0.2 build that nothing references catches the library glob filter, thepinnedtask that names 0.0.1 by its exact path catches the artifact glob filter, and the second package catches the removedbreak.New
bundle/artifacts/whl_dynamic_readplan_refshas a job and a pipeline on adynamic_versionartifact with two packages. It covers four cases:It has two variants (DMS off and on) at about 3s each. Each of these fails it: going back to
LocalLibraryPaths, dropping the cache lookup, or dropping the remote-state read.New unit test
TestPlanUploadReferencescovers planned and unchanged references, deletes, unmanaged values, extras, nested paths and embedded paths.The acceptance tests under bundle/artifacts, bundle/deploy, bundle/integration_whl, bundle/resources/{pipelines,clusters,jobs} and bundle/environments pass locally, except
bundle/deploy/mlops-stacks, which fails on main as well. The bundle and libs/patchwheel unit tests pass too.This PR was created by analyzing coverage gaps.
Coverage: http://go/cli/dashboard/coverage/file/bundle/libraries/remote_path.go (LocalLibraryPaths, lines 25-87).
🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.