databricks-cli/bundle
Andrew Nester 83443bae8d
Make resource and artifact paths in bundle config relative to config folder (#708)
# Warning: breaking change

## Changes
Instead of having paths in bundle config files be relative to bundle
root even if the config file is nested, this PR makes such paths
relative to the folder where the config is located.

When bundle is initialised, these paths will be transformed to relative
paths based on bundle root. For example,
we have file structure like this
```
- mybundle
| - bundle.yml
| - subfolder
| -- resource.yml
| -- my.whl
```

Previously, we had to reference `my.whl` in resource.yml like this,
which was confusing because resource.yml is in the same subfolder
```
sync:
  include:
    - ./subfolder/*.whl
...
tasks:
  - task_key: name
    libraries:
      - whl: ./subfolder/my.whl
...
```

After the change we can reference it like this (which is in line with
the current behaviour for notebooks)

```
sync:
  include:
    - ./*.whl
...
tasks:
  - task_key: name
    libraries:
      - whl: ./my.whl
...
```

## Tests
Existing `translate_path_tests` successfully passed after refactoring.

Added a couple of uses cases for `Libraries` paths.

Added a bundle config tests with include config and sync section

---------

Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
2023-09-04 09:55:01 +00:00
..
artifacts Fixed artifact file uploading on Windows and wheel execution on DBR 13.3 (#722) 2023-08-31 14:10:32 +00:00
config Make resource and artifact paths in bundle config relative to config folder (#708) 2023-09-04 09:55:01 +00:00
deploy Pin Terraform binary version to 1.5.5 (#715) 2023-08-30 14:08:37 +00:00
deployer Fix locker unlock for destroy (#492) 2023-06-19 15:57:25 +02:00
internal/tf Update Terraform provider schema structs from 1.23.0 (#713) 2023-08-30 13:58:28 +00:00
libraries Correctly identify local paths in libraries section (#702) 2023-08-29 08:26:09 +00:00
phases Added transformation mutator for Python wheel task for them to work on DBR <13.1 (#635) 2023-08-30 12:21:39 +00:00
python Make resource and artifact paths in bundle config relative to config folder (#708) 2023-09-04 09:55:01 +00:00
run Add development runs (#522) 2023-07-12 08:51:54 +02:00
schema Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
tests Make resource and artifact paths in bundle config relative to config folder (#708) 2023-09-04 09:55:01 +00:00
bundle.go Added support for sync.include and sync.exclude sections (#671) 2023-08-18 08:07:25 +00:00
bundle_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
context.go Make sync command work in bundle context; reorder args (#207) 2023-02-20 11:33:30 +01:00
context_test.go Add command that writes the materialized bundle configuration to stdout (#95) 2022-11-21 15:39:53 +01:00
deferred.go Added support for bundle.Seq, simplified Mutator.Apply interface (#403) 2023-05-24 14:45:19 +02:00
deferred_test.go Added support for bundle.Seq, simplified Mutator.Apply interface (#403) 2023-05-24 14:45:19 +02:00
mutator.go Added support for bundle.Seq, simplified Mutator.Apply interface (#403) 2023-05-24 14:45:19 +02:00
mutator_test.go Added support for bundle.Seq, simplified Mutator.Apply interface (#403) 2023-05-24 14:45:19 +02:00
root.go First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
root_test.go Log the bundle root configuration file if applicable (#657) 2023-08-11 12:28:05 +00:00
seq.go Added support for bundle.Seq, simplified Mutator.Apply interface (#403) 2023-05-24 14:45:19 +02:00
seq_test.go Added support for bundle.Seq, simplified Mutator.Apply interface (#403) 2023-05-24 14:45:19 +02:00