-
Notifications
You must be signed in to change notification settings - Fork 15
feat!: Validate provider config #435
base: main
Are you sure you want to change the base?
Conversation
var diags diag.Diagnostics | ||
|
||
// validate provider configuration before proceeding | ||
validateResponse, err := p.ValidateProviderConfig(ctx, &cqproto.ValidateProviderConfigRequest{Config: request.Config}) |
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.
Every call to ConfigureProvider
also runs ValidateProviderConfig
. This also means we decode and defaultize the config twice: once in validate and one down below.
Maybe worth doing a live walkthrough on this to go through all the cases. One questions in the meanwhile:
|
Im working on a complete re-write of cloudquery core including no-diags so let's put this on hold for now as otherwise I wont be able to merge: |
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.
Going into a feature freeze in cloudquery core and sdk apart from P0 bugs until cloudquery v2 is done https://github.com/cloudquery/cloudquery
Implements cloudquery/cloudquery#1104
I'm not sure if this is really necessary at this point, as we decode the config before validating schema anyway. If it doesn't decode cleanly we just stop there and don't go into the schema validation.
This PR also starts decoding the config in strict mode, unknown keys in the config will produce errors from now on.