Skip to content

Fixed error reporting when included invalid files in include section#543

Merged
andrewnester merged 5 commits intomainfrom
fix-invalid-includes
Jul 7, 2023
Merged

Fixed error reporting when included invalid files in include section#543
andrewnester merged 5 commits intomainfrom
fix-invalid-includes

Conversation

@andrewnester
Copy link
Copy Markdown
Contributor

Changes

Fixed error reporting when included invalid files in include section

Case 1. When the file to include is invalid, throw an error
Case 2. When the file is loaded but the schema is wrong, indicate which file is failed to load

Tests

With non-existent notexists.yml

databricks bundle deploy
Error: notexists.yml defined in 'include' section does not match any files

With malformed notexists.yml

databricks bundle deploy
Error: failed to load /Users/andrew.nester/dabs/wheel/notexists.yml: error unmarshaling JSON: json: cannot unmarshal string into Go value of type config.Root

@andrewnester andrewnester requested a review from pietern July 4, 2023 09:19
@andrewnester andrewnester requested a review from pietern July 4, 2023 11:07
Copy link
Copy Markdown
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a case where there are no matches and the pattern is a glob.

Everything else LGTM!

@andrewnester
Copy link
Copy Markdown
Contributor Author

@pietern "[a-z].yml" and "?.yml" glob patterns from the test above actually cover it already as they don't match any files

@andrewnester andrewnester requested a review from pietern July 5, 2023 08:34
@andrewnester andrewnester enabled auto-merge (squash) July 7, 2023 10:16
@andrewnester andrewnester merged commit b14920c into main Jul 7, 2023
@pietern pietern mentioned this pull request Jul 7, 2023
pietern added a commit that referenced this pull request Jul 10, 2023
## Changes

CLI:
* Fix secrets put-secret command
([#545](#545)).
* Fixed ignoring required positional parameters when --json flag is
provided ([#535](#535)).
* Update cp help message to not require file scheme
([#554](#554)).

Bundles:
* Fix: bundle destroy fails when bundle.tf.json file is deleted
([#519](#519)).
* Fixed error reporting when included invalid files in include section
([#543](#543)).
* Make top level workspace optional in JSON schema
([#562](#562)).
* Propagate TF_CLI_CONFIG_FILE env variable
([#555](#555)).
* Update Terraform provider schema structs
([#563](#563)).
* Update inline JSON schema documentation
([#557](#557)).

Dependencies:
* Bump Go SDK to v0.12.0
([#540](#540)).
* Bump github.com/hashicorp/terraform-json from 0.17.0 to 0.17.1
([#541](#541)).
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.

2 participants