Uh oh!
There was an error while loading. Please reload this page.
Support multiple locations for diagnostics - #1610
Conversation
…ction and modify all diagnostics paths to be relative to the bundle root path
shreyas-goenka
commented
Jul 18, 2024
Just FYI, gopatch used to get refactor and get to a starting point for more custom changes. There's something satisfying about writing patch files: |
Integration tests have been triggered, just in case. |
| Severity: diag.Warning, | ||
| Summary: "You are using the legacy mode of run_as. The support for this mode is experimental and might be removed in a future release of the CLI. In order to run the DLT pipelines in your DAB as the run_as user this mode changes the owners of the pipelines to the run_as identity, which requires the user deploying the bundle to be a workspace admin, and also a Metastore admin if the pipeline target is in UC.", | ||
| Path: dyn.MustPathFromString("experimental.use_legacy_run_as"), | ||
| Locations: b.Config.GetLocations("experimental.use_legacy_run_as"), |
There was a problem hiding this comment.
Note that we display multiple locations here since they are all relevant.
| Path: loc.Path(), | ||
| Severity: diag.Warning, | ||
| Summary: fmt.Sprintf("Pattern %s does not match any files", p), | ||
| Locations: []dyn.Location{loc.Location()}, |
There was a problem hiding this comment.
Does not matter if we use loc.Locations() or just a single location here since array values can only have a single location during merging. Still only using a single location here to keep it easy to reason about.
| // Show only the location where the job_cluster_key is defined. | ||
| // Other associated locations are not relevant since they are | ||
| // overridden during merging. | ||
| Locations: []dyn.Location{loc.Location()}, |
There was a problem hiding this comment.
Eventually I'll followup with a PR to show warnings when scalar configuration is being overridden.
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.
shreyas-goenka
commented
Jul 23, 2024
Also addressing the applicable comments in #1616 |
Bundles: * Add UUID function to bundle template functions ([#1612](#1612)). * Upgrade TF provider to 1.49.0 ([#1617](#1617)). * Upgrade TF provider to 1.49.1 ([#1626](#1626)). * Support multiple locations for diagnostics ([#1610](#1610)). * Split artifact cleanup into prepare step before build ([#1618](#1618)). * Move to a single prompt during bundle destroy ([#1583](#1583)). Internal: * Add tests for the Workspace API readahead cache ([#1605](#1605)). * Update Python dependencies before install when upgrading a labs project ([#1624](#1624)).
Bundles: * Add UUID function to bundle template functions ([#1612](#1612)). * Upgrade TF provider to 1.49.0 ([#1617](#1617)). * Upgrade TF provider to 1.49.1 ([#1626](#1626)). * Support multiple locations for diagnostics ([#1610](#1610)). * Split artifact cleanup into prepare step before build ([#1618](#1618)). * Move to a single prompt during bundle destroy ([#1583](#1583)). Internal: * Add tests for the Workspace API readahead cache ([#1605](#1605)). * Update Python dependencies before install when upgrading a labs project ([#1624](#1624)).
## Changes This PR changes `diag.Diagnostics` to allow including multiple locations associated with the diagnostic message. The diagnostics that now return multiple locations with this PR are: 1. Warning for unknown keys in config. 2. Use of experimental.run_as 3. Accidental sync.exludes that exclude all files. ## Tests Existing unit tests pass. New unit test case to assert on error message when multiple locations are included. Example output: ``` ➜ bundle-playground-2 ~/cli2/cli/cli bundle validate Warning: You are using the legacy mode of run_as. The support for this mode is experimental and might be removed in a future release of the CLI. In order to run the DLT pipelines in your DAB as the run_as user this mode changes the owners of the pipelines to the run_as identity, which requires the user deploying the bundle to be a workspace admin, and also a Metastore admin if the pipeline target is in UC. at experimental.use_legacy_run_as in resources.yml:10:22 databricks.yml:13:22 Name: fix run_if Target: default Workspace: User: shreyas.goenka@databricks.com Path: /Users/shreyas.goenka@databricks.com/.bundle/fix run_if/default Found 1 warning ```
Bundles: * Add UUID function to bundle template functions ([#1612](#1612)). * Upgrade TF provider to 1.49.0 ([#1617](#1617)). * Upgrade TF provider to 1.49.1 ([#1626](#1626)). * Support multiple locations for diagnostics ([#1610](#1610)). * Split artifact cleanup into prepare step before build ([#1618](#1618)). * Move to a single prompt during bundle destroy ([#1583](#1583)). Internal: * Add tests for the Workspace API readahead cache ([#1605](#1605)). * Update Python dependencies before install when upgrading a labs project ([#1624](#1624)).
Changes
This PR changes
diag.Diagnosticsto allow including multiple locations associated with the diagnostic message. The diagnostics that now return multiple locations with this PR are:Tests
Existing unit tests pass. New unit test case to assert on error message when multiple locations are included.
Example output: