Repository navigation
Include variable locations in --include-locations output - #7351
petrapostelnicu-db wants to merge 3 commits into
Conversation
The location map that `bundle validate` and `bundle summary` emit with --include-locations now covers variables: - variables.<name>: where the variable is declared. - variables.<name>.value: where the resolved value comes from, such as a target override or .databricks/bundle/<target>/variable-overrides.json. It is absent when the value has no file, as with --var, BUNDLE_VAR_*, and lookups. The workspace UI uses this to link each variable to its file. Co-authored-by: Isaac <no-reply@databricks.com>
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 2 tests: regression=2 unreleased=0 coverage=0 failing=0
TestAccept/bundle/variables/locations/DMS=: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌main (663e1f7): latest (v1.24.0): same output as main (663e1f7) TestAccept/bundle/variables/locations/DMS=true: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌main (663e1f7): latest (v1.24.0): same output as main (663e1f7) |
✅ Integration test reportCommit: f969f68
Top 3 slowest tests (at least 2 minutes):
|
| dyn.NewPattern(dyn.Key("resources"), dyn.Key("jobs"), dyn.AnyKey(), dyn.Key("tasks")), // Job tasks ("resources.jobs.my_job.tasks") | ||
| dyn.NewPattern(dyn.Key("resources"), dyn.Key("jobs"), dyn.AnyKey(), dyn.Key("tasks"), dyn.AnyIndex()), // Job task items ("resources.jobs.my_job.tasks[2]") | ||
| dyn.NewPattern(dyn.Key("variables"), dyn.AnyKey()), // Variable definitions ("variables.my_var") | ||
| dyn.NewPattern(dyn.Key("variables"), dyn.AnyKey(), dyn.Key("value")), // Resolved variable values ("variables.my_var.value") |
There was a problem hiding this comment.
Should this get a .nextchanges/bundles/ entry? The last --include-locations change (#7185) has one in the changelog, and the UI side will want to know which CLI version ships the variable keys.
| @@ -0,0 +1,10 @@ | |||
| [[Server]] | |||
| Pattern = "GET /api/2.0/preview/scim/v2/ServicePrincipals" | |||
There was a problem hiding this comment.
This is the same stub as in variables/lookup/test.toml, and issue_3039_lookup_with_ref carries a third variant. Maybe time to add a ServicePrincipals handler to libs/testserver instead, like .agents/rules/testing.md asks?
There was a problem hiding this comment.
you're right. i removed the variable and the stub instead, I think adding service principals handler should be a separate pr. in my case, it wasn't needed, the variable with no value location test case is already covered by from_cli
| "databricks.yml:18:5" | ||
| ], | ||
| "variables.complex_var.value": [ | ||
| "databricks.yml:46:9" |
There was a problem hiding this comment.
Is it expected that the complex value points at the first key inside the override (46:9) rather than the override itself (complex_var: at 45:7)? Probably fine if the UI only needs a line to link to, just checking it's intentional.
There was a problem hiding this comment.
yes, it is intentional (kept consistent with resources ) and the ui only needs to link the file
The location map that
bundle validateandbundle summaryemit with --include-locations now covers variables:The workspace UI uses this to link each variable to its file in the deployments modal.