databricks-cli/bundle/config/loader/testdata/format_not_match
shreyas-goenka bca9c2eda4
Add validation for files with a `.(resource-name).yml` extension (#1780)
## Changes
We want to encourage a pattern of specifying only a single resource in a
YAML file when the `.(resource-type).yml` extension is used (for
example, `.job.yml`). This convention could allow us to bijectively map
a resource YAML file to its corresponding resource in the Databricks
workspace.

This PR:
1. Emits a recommendation diagnostic when we detect this convention is
being violated. We can promote this to a warning when we want to
encourage this pattern more strongly.
2. Visualises the recommendation diagnostics in the `bundle validate`
command.

**NOTE:** While this PR also shows the recommendation for `.yaml` files,
we do not encourage users to use this extension. We only support it here
since it's part of the YAML standard and some existing users might
already be using `.yaml`.

## Tests
Unit tests and manually. Here's what an example output looks like:
```
Recommendation: define a single job in a file with the .job.yml extension.
  at resources.jobs.bar
     resources.jobs.foo
  in foo.job.yml:13:7
     foo.job.yml:5:7

The following resources are defined or configured in this file:
  - bar (job)
  - foo (job)
```

---------

Co-authored-by: Lennart Kats (databricks) <lennart.kats@databricks.com>
2024-10-07 09:16:20 +00:00
..
job_and_pipeline.experiment.yml Add validation for files with a `.(resource-name).yml` extension (#1780) 2024-10-07 09:16:20 +00:00
job_and_pipeline.job.yml Add validation for files with a `.(resource-name).yml` extension (#1780) 2024-10-07 09:16:20 +00:00
multiple_resources.model_serving_endpoint.yml Add validation for files with a `.(resource-name).yml` extension (#1780) 2024-10-07 09:16:20 +00:00
second_job_in_target.job.yml Add validation for files with a `.(resource-name).yml` extension (#1780) 2024-10-07 09:16:20 +00:00
single_job.pipeline.yaml Add validation for files with a `.(resource-name).yml` extension (#1780) 2024-10-07 09:16:20 +00:00
two_jobs.job.yml Add validation for files with a `.(resource-name).yml` extension (#1780) 2024-10-07 09:16:20 +00:00
two_jobs_in_target.job.yml Add validation for files with a `.(resource-name).yml` extension (#1780) 2024-10-07 09:16:20 +00:00