databricks-cli/libs/template
shreyas-goenka 897741f55a
Store DBR version in context (#2438)
## Changes
This PR also starts storing the DBR versions in the context.

Go patch file used:
```
@@
var x expression
@@
-dbr.MockRuntime(x, true)
+dbr.MockRuntime(x, dbr.Environment{IsDbr: true, Version: "15.4"})

@@
var x expression
@@
-dbr.MockRuntime(x, false)
+dbr.MockRuntime(x, dbr.Environment{})
```

ref: https://github.com/uber-go/gopatch

## Why
This localised all DBR version accesses to `libs/dbr`. Relevant comment:
https://github.com/databricks/cli/pull/2432#discussion_r1982878616

## Tests
Exiting tests are modified.
2025-03-06 13:01:43 +00:00
..
templates Use schema field for pipeline in builtin template (#2347) 2025-03-05 14:19:33 +00:00
testdata Add the `bundle_uuid` helper function for templates (#1947) 2024-12-02 10:29:29 +00:00
builtin.go Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
builtin_test.go Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
config.go Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
config_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
file.go Use `filer.Filer` to write template instantiation (#1911) 2024-11-20 11:11:31 +01:00
file_test.go Set the write bit for files written during template initialization (#2068) 2025-01-08 13:18:28 +00:00
helpers.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
helpers_test.go Enable testifylint and fix the issues (#2065) 2025-01-02 12:03:41 +01:00
reader.go Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
reader_test.go Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
renderer.go Set the write bit for files written during template initialization (#2068) 2025-01-08 13:18:28 +00:00
renderer_test.go Store DBR version in context (#2438) 2025-03-06 13:01:43 +00:00
resolver.go Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
resolver_test.go Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
template.go Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
template_test.go Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
writer.go Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
writer_test.go Store DBR version in context (#2438) 2025-03-06 13:01:43 +00:00