Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation for files with a .(resource-name).yml extension #1780

Open
wants to merge 11 commits into
base: test-util-location
Choose a base branch
from

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Sep 19, 2024

Changes

We want to encourage a pattern of only specifying a single resource in a YAML file when an .(resource-type).yml (like .job.yml) is used. This convention could allow us to bijectively map a resource YAML file to it's corresponding resource in the Databricks workspace.

This PR:

  1. Emits an info 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 info diagnostics in the bundle validate command.

Tests

Unit tests and manually. Here's what an example output looks like:

➜  bundle-playground git:(master) ✗ cli bundle validate
Info: We recommend only defining a single job in a file with the .job.yml extension.
The following resources are defined or configured in this file:
  - bar (job)
  - foo (job)

  at resources.jobs.bar
     resources.jobs.foo
  in foo.job.yml:13:7
     foo.job.yml:5:7

@shreyas-goenka shreyas-goenka changed the base branch from main to test-util-location September 24, 2024 15:32
@shreyas-goenka shreyas-goenka changed the title Add detection and info diagnostic for convention for .<resource-type>.yml files Add validation when a .(resource-name).yml extension is used Sep 24, 2024
@shreyas-goenka shreyas-goenka changed the title Add validation when a .(resource-name).yml extension is used Add validation for files with a.(resource-name).yml extensio Sep 24, 2024
@shreyas-goenka shreyas-goenka changed the title Add validation for files with a.(resource-name).yml extensio Add validation for files with a.(resource-name).yml extensios Sep 24, 2024
@shreyas-goenka shreyas-goenka changed the title Add validation for files with a.(resource-name).yml extensios Add validation for files with a.(resource-name).yml extension Sep 24, 2024
@shreyas-goenka shreyas-goenka changed the title Add validation for files with a.(resource-name).yml extension Add validation for files with a .(resource-name).yml extension Sep 24, 2024
@shreyas-goenka shreyas-goenka marked this pull request as ready for review September 24, 2024 15:54
@shreyas-goenka
Copy link
Contributor Author

Triggered nightlies against this PR...

@shreyas-goenka
Copy link
Contributor Author

Nightlies are green!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant