databricks-cli/bundle/config
stikkireddy 3c1e69a064
Update variable regex to support hyphens (#503)
## Changes

Modified interpolation logic to use:
`\$\{([a-zA-Z]+([-_]*[a-zA-Z0-9]+)*(\.[a-zA-Z]+([-_]*[a-zA-Z0-9]+)*)*)\}`

**Edit**: Suggested by @pietern
`\$\{([a-zA-Z]+([-_]?[a-zA-Z0-9]+)*(\.[a-zA-Z]+([-_]?[a-zA-Z0-9]+)*)*)\}`
to be more selective and not allow consequent hyphens or underscores to
make the keys more readable.

Explanation:
1. All interpolation starts with `${` and ends with `}`
2. All interpolated locations are split by by `.`
3. All sections are expected to start with a alphabet `[a-zA-Z]`; no
numbers, hyphens or underscores.
4. All sections are expected to end with an alphanumeric `[a-zA-Z0-9]`
no hyphens or underscores

This change allows the current interpolation to be more permissive.

**Note** it does break backwards compatibility because `[a-zA-Z] !=
[\w]`. `\w` includes alphanumeric and underscores. `\w = [a-zA-Z0-9_]`

## Tests
There are two tests with examples of valid and invalid interpolation and
a test to validate expansion.
2023-06-23 12:56:54 +02:00
..
interpolation Update variable regex to support hyphens (#503) 2023-06-23 12:56:54 +02:00
mutator Skip path translation of job task for jobs with a Git source (#404) 2023-06-07 12:34:59 +02:00
resources Update to Go SDK v0.8.0 (#351) 2023-04-21 10:30:20 +02:00
testdata Detect duplicate identifiers in bundle config (#332) 2023-04-17 12:21:21 +02:00
variable Add config environment support for variable overriding (#383) 2023-05-15 14:07:18 +02:00
artifact.go Add readonly bundle tag for internal fields (#302) 2023-04-04 12:16:07 +02:00
bundle.go Add omitempty tag to bundle git details (#372) 2023-05-01 14:34:12 +02:00
environment.go Add config environment support for variable overriding (#383) 2023-05-15 14:07:18 +02:00
git.go Add git config block to bundle config (#356) 2023-04-26 16:54:36 +02:00
lock.go Acquire lock prior to deploy (#270) 2023-03-22 16:37:26 +01:00
lock_test.go Acquire lock prior to deploy (#270) 2023-03-22 16:37:26 +01:00
resources.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
resources_test.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
root.go Check for nil environment before accessing it (#453) 2023-06-08 20:55:49 +00:00
root_test.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
workspace.go Rename: bricks -> databricks (#393) 2023-05-22 16:40:50 +02:00