-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allow variable references in non-string fields in the JSON schema #1398
Conversation
@@ -14,7 +14,15 @@ func TestIntSchema(t *testing.T) { | |||
|
|||
expected := | |||
`{ | |||
"type": "number" | |||
"anyOf": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current approach is not ideal from a top down POV, and there is indeed room for refactoring out the "Go struct" -> "JSON Schema" transformation from bundle-specific transformations. That being said, I think this approach is fine given we don't anticipate a lot of changes to bundle schema
generation, and it'll not be that hard to refactor if we need to in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The asserts on the JSON serialized format are not ideal but can be addressed another time.
This is a bugfix release. CLI: * Pass `DATABRICKS_CONFIG_FILE` for `auth profiles` ([#1394](#1394)). Bundles: * Show a better error message for using wheel tasks with older DBR versions ([#1373](#1373)). * Allow variable references in non-string fields in the JSON schema ([#1398](#1398)). * Fix variable overrides in targets for non-string variables ([#1397](#1397)). * Fix bundle schema for variables ([#1396](#1396)). * Fix bundle documentation URL ([#1399](#1399)). Internal: * Removed autogenerated docs for the CLI commands ([#1392](#1392)). * Remove `JSON.parse` call from homebrew-tap action ([#1393](#1393)). * Ensure that Python dependencies are installed during upgrade ([#1390](#1390)).
This is a bugfix release. CLI: * Pass `DATABRICKS_CONFIG_FILE` for `auth profiles` ([#1394](#1394)). Bundles: * Show a better error message for using wheel tasks with older DBR versions ([#1373](#1373)). * Allow variable references in non-string fields in the JSON schema ([#1398](#1398)). * Fix variable overrides in targets for non-string variables ([#1397](#1397)). * Fix bundle schema for variables ([#1396](#1396)). * Fix bundle documentation URL ([#1399](#1399)). Internal: * Removed autogenerated docs for the CLI commands ([#1392](#1392)). * Remove `JSON.parse` call from homebrew-tap action ([#1393](#1393)). * Ensure that Python dependencies are installed during upgrade ([#1390](#1390)).
Tests
Verified manually.
Before:
![Screenshot 2024-04-24 at 7 18 44 PM](https://private-user-images.githubusercontent.com/88374338/325321546-b4aef51f-0c16-4589-9d47-cdec9ab91158.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwMzQ3MzQsIm5iZiI6MTcyMjAzNDQzNCwicGF0aCI6Ii84ODM3NDMzOC8zMjUzMjE1NDYtYjRhZWY1MWYtMGMxNi00NTg5LTlkNDctY2RlYzlhYjkxMTU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI2VDIyNTM1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg4MDgyNjQ2NjA4YTk3NTI4Nzk0ZDViMzdhYzBkYTA1OTRiZjQxZjNhMTNjZTBiZDkwNTJiMDJiY2NiN2ViMjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9SvqG-xtj612uo6GBMxzZsWZlxg-C0K7DFBR0gxHDwM)
After:
![Screenshot 2024-04-24 at 7 18 31 PM](https://private-user-images.githubusercontent.com/88374338/325321640-3d8e412e-77ee-4641-943d-f99eab26ba02.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6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0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI2VDIyNTM1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1MWI0MmI5YjkwY2QxMGRmYjQ3MGViZTlmZWZmZWU3ZWZmZWE1MDMyZDAxODcyYTQwZGUwMzRlNzRhYjdhMjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.q6C0sIcdiCEG4mGQ4PZmTfhLAtdl9uHT-hlV_ajpE84)
Manually verified the schema diff is sane. Example: