Uh oh!
There was an error while loading. Please reload this page.
Add mutator documentation in initialize phase - #2560
Conversation
| // Reads (dynamic): resources.jobs.*.{notebook_task.notebook_path,spark_jar_task.main_class_name,spark_python_task.python_file}, resources.pipelines.*.{libraries.notebook.path,libraries.file.path}, resources.dashboards.*.definition, resources.apps.*.{package,resources.*.path} | ||
| // Updates (dynamic): resources.jobs.*.{notebook_task.notebook_path,spark_jar_task.main_class_name,spark_python_task.python_file}, resources.pipelines.*.{libraries.notebook.path,libraries.file.path}, resources.dashboards.*.definition, resources.apps.*.{package,resources.*.path} (converts local paths to workspace paths) | ||
| // Translates local file paths to workspace paths for notebooks, files, and directories |
There was a problem hiding this comment.
The list of paths is incorrect; lists items that are not updated and omits others.
There was a problem hiding this comment.
This one is quite complex, no wonder LLM could not write correct comment. I also don't see what exactly it updates from a glance.
Can you suggest authoritative description? Can also be a follow up PR.
There was a problem hiding this comment.
For now, I removed wrong comment completely.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
175631e to
a6eea15Comparea6e9049 to
1fcad7aCompare| // Figure out if the sync root path is identical or an ancestor of the bundle root path. | ||
| // If it is an ancestor, this updates all paths to be relative to the sync root path. | ||
| // Reads (typed): b.Config.Sync.Paths (calculates longest common parent together with bundle root). | ||
| // Updates (typed) b.{SyncRoot,SyncRootPath} (set to calculate sync root, which is either bundle root or some parent of bundle root) |
There was a problem hiding this comment.
| // Updates (typed) b.{SyncRoot,SyncRootPath} (set to calculate sync root, which is either bundle root or some parent of bundle root) | |
| // Updates (typed) b.{SyncRoot,SyncRootPath} (set to inferred sync root, which is either bundle root or some parent of bundle root) |
There was a problem hiding this comment.
Not sure why the comment was disregarded as it seems like inferred makes more sense here
There was a problem hiding this comment.
"inferred" to be implies some guessing or really deep reasoning. We just calculate the closest common parent, nothing fancy.
Uh oh!
There was an error while loading. Please reload this page.
| // searches for strings with variable references in them. | ||
| // Reads (dynamic): * (strings) (searches for strings with workspace path variables prefixed with "/Workspace") | ||
| // Updates (dynamic): * (strings) (removes "/Workspace" prefix from workspace path variables) | ||
| // Finds and removes "/Workspace" prefix from all strings in bundle configuration |
There was a problem hiding this comment.
| // Finds and removes "/Workspace" prefix from all strings in bundle configuration | |
| // Finds and removes "/Workspace" prefix from all references to `workspace.root_path`, `workspace.file_path` etc in bundle configuration |
d1a0669 to
1ed2ec0CompareUh oh!
There was an error while loading. Please reload this page.
| // Figure out if the sync root path is identical or an ancestor of the bundle root path. | ||
| // If it is an ancestor, this updates all paths to be relative to the sync root path. | ||
| // Reads (typed): b.Config.Sync.Paths (calculates longest common parent together with bundle root). | ||
| // Updates (typed) b.{SyncRoot,SyncRootPath} (set to calculate sync root, which is either bundle root or some parent of bundle root) |
There was a problem hiding this comment.
Not sure why the comment was disregarded as it seems like inferred makes more sense here
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // searches for strings with variable references in them. | ||
| mutator.RewriteWorkspacePrefix(), | ||
| // Reads (dynamic): variables.* (checks for existing values, defaults, and lookup references) |
There was a problem hiding this comment.
Not sure what this part means, should it be clarified?
| // Reads (dynamic): variables.* (checks for existing values, defaults, and lookup references) | ||
| // Updates (dynamic): variables.*.value (sets values from environment variables, variable files, or defaults) | ||
| // Resolves and sets values for bundle variables from environment variables, variable files, or defaults |
There was a problem hiding this comment.
Maybe worth clarifying the order how we set the variables?
| // Reads (typed): b.Config.RunAs, b.Config.Workspace.CurrentUser (validates run_as configuration) | ||
| // Reads (dynamic): run_as (checks if run_as is specified) | ||
| // Updates (typed): b.Config.Resources.Jobs[].RunAs (sets job run_as fields to bundle run_as) |
There was a problem hiding this comment.
It only does it when Experimental.UseLegacyRunAs is set which is imprortant part here. It also does it for pipelines and mostly just validates that we don;t use run_as with unsupported resources
| // Reads (typed): b.Config.Experimental.PythonWheelWrapper, b.Config.Presets.SourceLinkedDeployment (checks Python wheel wrapper and deployment mode settings) | ||
| // Reads (dynamic): resources.jobs.*.tasks (checks for tasks with local libraries and incompatible DBR versions) | ||
| // Provides warnings when Python wheel tasks require DBR 13.3+ or when wheel wrapper is incompatible with source-linked deployment |
There was a problem hiding this comment.
This seems incorrect, the warning is for cases when python wheel tasks are used on DBRs < 13.3
eac2aa0 to
b35785dCompare7aafea4 to
b5ae417CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
## Changes - Add comments to every mutator call in initialize.go. Some of them written manually, most are AI generated. The script & prompt are not included available on separate branch: https://github.com/databricks/cli/blob/denik/mutator-documentation-with-script/tools/update_phases_comments.pyhttps://github.com/databricks/cli/blob/denik/mutator-documentation-with-script/bundle/phases/mutator_documentation.md ## Why This helps to see what changes are mutators making to bundle (if any), without reading every source file. --------- Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
Changes
The script & prompt are not included available on separate branch:
https://github.com/databricks/cli/blob/denik/mutator-documentation-with-script/tools/update_phases_comments.py
https://github.com/databricks/cli/blob/denik/mutator-documentation-with-script/bundle/phases/mutator_documentation.md
Why
This helps to see what changes are mutators making to bundle (if any), without reading every source file.