Uh oh!
There was an error while loading. Please reload this page.
Move artifacts validation to initialize phase; simplify - #2526
Merged
Conversation
denik
requested review from
andrewnester, pietern and shreyas-goenka
as code ownersMarch 19, 2025 15:39
andrewnester
approved these changes
Mar 19, 2025
| "github.com/databricks/cli/libs/python" | ||
| ) | ||
| func Validate() bundle.Mutator { |
Contributor
There was a problem hiding this comment.
It does more than just validation, shall we call it SetupAndValidate?
ContributorAuthor
There was a problem hiding this comment.
Makes sense not to use "Validate". Prefer something shorter than SetupAndValidate. "Initialize" or "Prepare"?
| ### Bundles | ||
| * Processing 'artifacts' section is now done in "bundle validate" (adding defaults, inferring "build", asserting required fields). |
Contributor
There was a problem hiding this comment.
Can you please add a link to the PR as in the other changelog entries?
denikforce-pushed
the
denik/simplify-artifacts
branch
from
March 19, 2025 21:33
e9d2d72 to
844f003Comparedenik
enabled auto-merge
March 19, 2025 21:35
github-merge-queueBot
removed this pull request from the merge queue due to failed status checks
Mar 19, 2025
Uh oh!
There was an error while loading. Please reload this page.
denik
commented
Mar 20, 2025
ContributorAuthor
The error in merge queue is unrelated to the PR (cc @shreyas-goenka): |
github-merge-queueBot
pushed a commit
that referenced
this pull request
Mar 20, 2025
…2530) This test highlights inconsistency between type:whl and non-whl artifacts. The test for non-whl artifacts exists [here](https://github.com/databricks/cli/tree/main/acceptance/bundle/artifacts/build_and_files) added in #2526
github-merge-queueBot
pushed a commit
that referenced
this pull request
Mar 21, 2025
## Changes Bug introduced in #2526. When calling expandGlobs as a function without mutator entry/exit copy, we did not copy typed structure into dynamic structure. Thus expandGlobs saw an old version of config, without absolute paths introduced by code before it. Since it calls filepath.Glob which depends on CWD, it stopped doing the matching. ## Tests New regression test to catch this issues.
deco-sdk-taggingBot
added a commit
that referenced
this pull request
Mar 26, 2025
## Release v0.245.0 ### Bundles * Processing 'artifacts' section is now done in "bundle validate" (adding defaults, inferring "build", asserting required fields) ([#2526])(#2526)) * When uploading artifacts, include relative path in log message ([#2539])(#2539)) * Added support for clusters in deployment bind/unbind commands ([#2536](#2536)) * Added support for volumes in deployment bind/unbind commands ([#2527](#2527)) * Added support for dashboards in deployment bind/unbind commands ([#2516](#2516)) * Added support for registered models in deployment bind/unbind commands ([#2556](#2556)) * Added a mismatch check when host is defined in config and as an env variable ([#2549](#2549)) * New attribute on artifacts entries: `dynamic_version`. When set to true, it patches the wheel with dynamic version suffix so it is always used by Databricks environments, even if original wheel version is the same. Intended for development loop on interactive clusters. ([#2520](#2520))
github-merge-queueBot
pushed a commit
that referenced
this pull request
Apr 15, 2025
## Changes - Move artifacts clean up procedure to "bundle deploy". This reverts change in behaviour introduced in 0.245.0 #2526 ## Why We don't expect major changes on the file system during "validate", it should be as much as possible about reporting issues with the bundle without taking action. ## Tests Existing tests.
denik added a commit
that referenced
this pull request
May 20, 2026
## Changes Moved processing & validating of artifacts section into initialize phase so that it runs as part of 'bundle validate' and results can be inspected in 'bundle validate -o json'. The following things where moved from build phase to initialize: - Creating python_artifact when artifacts is nil. - Adding default 'build' field for whl artifacts. - Expanding globs for cases where 'build' is absent. - Cleaning up 'dist' and 'build' folders. I've also removed a bunch of abstractions and put everything into two (small) mutators - artifacts.Validate() to do all the validations and processing - artifacts.Build() to do the build and related post-processing. ## Why - Having this things in validate allows users to learn early if something is wrong with the configuration. - Putting everything into 2 mutators allows to understand the whole flow around artifacts. I need that for expanding it with dynamic_version feature #2520. ## Tests Existing tests. Converted expand_globs_test.go into acceptance test that runs "bundle validate".
denik added a commit
that referenced
this pull request
May 20, 2026
…2530) This test highlights inconsistency between type:whl and non-whl artifacts. The test for non-whl artifacts exists [here](https://github.com/databricks/cli/tree/main/acceptance/bundle/artifacts/build_and_files) added in #2526
denik added a commit
that referenced
this pull request
May 20, 2026
## Changes Bug introduced in #2526. When calling expandGlobs as a function without mutator entry/exit copy, we did not copy typed structure into dynamic structure. Thus expandGlobs saw an old version of config, without absolute paths introduced by code before it. Since it calls filepath.Glob which depends on CWD, it stopped doing the matching. ## Tests New regression test to catch this issues.
denik pushed a commit
that referenced
this pull request
May 20, 2026
## Release v0.245.0 ### Bundles * Processing 'artifacts' section is now done in "bundle validate" (adding defaults, inferring "build", asserting required fields) ([#2526])(#2526)) * When uploading artifacts, include relative path in log message ([#2539])(#2539)) * Added support for clusters in deployment bind/unbind commands ([#2536](#2536)) * Added support for volumes in deployment bind/unbind commands ([#2527](#2527)) * Added support for dashboards in deployment bind/unbind commands ([#2516](#2516)) * Added support for registered models in deployment bind/unbind commands ([#2556](#2556)) * Added a mismatch check when host is defined in config and as an env variable ([#2549](#2549)) * New attribute on artifacts entries: `dynamic_version`. When set to true, it patches the wheel with dynamic version suffix so it is always used by Databricks environments, even if original wheel version is the same. Intended for development loop on interactive clusters. ([#2520](#2520))
denik added a commit
that referenced
this pull request
May 20, 2026
## Changes - Move artifacts clean up procedure to "bundle deploy". This reverts change in behaviour introduced in 0.245.0 #2526 ## Why We don't expect major changes on the file system during "validate", it should be as much as possible about reporting issues with the bundle without taking action. ## Tests Existing tests.
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 freeto 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
Moved processing & validating of artifacts section into initialize phase so that it runs as part of 'bundle validate' and results can be inspected in 'bundle validate -o json'.
The following things where moved from build phase to initialize:
I've also removed a bunch of abstractions and put everything into two (small) mutators
Why
Tests
Existing tests.
Converted expand_globs_test.go into acceptance test that runs "bundle validate".