-
Notifications
You must be signed in to change notification settings - Fork 630
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
filter: Improve validation of expression #848
Merged
jacobbednarz
merged 1 commit into
cloudflare:master
from
jacobbednarz:validate-filter-expression-in-schema
Oct 28, 2020
Merged
filter: Improve validation of expression #848
jacobbednarz
merged 1 commit into
cloudflare:master
from
jacobbednarz:validate-filter-expression-in-schema
Oct 28, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
While making changes to filters you need to run `apply` to actually find out whether the expression is valid. This is a slow feedback cycle for developers and there is an API endpoint that allows you to validate expressions before using them so it's a no brainer to improve the validation in the schema. This updates the `ValidateFunc` for `expression` to call out to the validation API endpoint and raise those exceptions earlier in the development cycle. Fixes cloudflare#846
jacobbednarz
force-pushed
the
validate-filter-expression-in-schema
branch
from
October 28, 2020 00:39
a1e3bf2
to
20dc090
Compare
jacobbednarz
added a commit
to jacobbednarz/terraform-provider-cloudflare
that referenced
this pull request
Nov 5, 2020
cloudflare#848 introduced better validation for filters using the Terraform schema. Despite handling the error, the error wasn't returned to the end user and instead the RPC exception is shown the end user. ``` Error: rpc error: code = Unavailable desc = transport is closing ``` This fixes the user experience by returning the errors which now passes the exception onto the end user instead of swallowing it or causing a panic.
jacobbednarz
added a commit
to jacobbednarz/terraform-provider-cloudflare
that referenced
this pull request
Nov 5, 2020
cloudflare#848 introduced better validation for filters using the Terraform schema. Despite handling the error, the error wasn't returned to the end user and instead the RPC exception is shown the end user. ``` Error: rpc error: code = Unavailable desc = transport is closing ``` This fixes the user experience by returning the errors which now passes the exception onto the end user instead of swallowing it or causing a panic.
jacobbednarz
added a commit
to jacobbednarz/terraform-provider-cloudflare
that referenced
this pull request
Nov 5, 2020
Due to the endpoint not supporting API tokens, we needed to build a standalone client which hasn't worked out well and the workarounds to fix it are against the grain of how the Terraform schema is intended to be used leaving us in situation where change in upstream functionality may force us to be on an older version of the SDK if we were to continue. Instead, this reverts cloudflare#848 and cloudflare#860 and once API token support is added to the endpoint, we can reintroduce this without a standalone client. Closes cloudflare#861
This was referenced Nov 5, 2020
jacobbednarz
added a commit
that referenced
this pull request
Nov 1, 2021
While making changes to filters you need to run apply to actually find out whether the expression is valid. This is a slow feedback cycle for developers and there is an API endpoint that allows you to validate expressions before using them so it's a no brainer to improve the validation in the schema. This updates the ValidateFunc for expression to call out to the validation API endpoint and raise those exceptions earlier in the development cycle. Take 2 of #848 now that API tokens are supported in the routes. Closes #846
jacobbednarz
added a commit
that referenced
this pull request
Nov 1, 2021
While making changes to filters you need to run apply to actually find out whether the expression is valid. This is a slow feedback cycle for developers and there is an API endpoint that allows you to validate expressions before using them so it's a no brainer to improve the validation in the schema. This updates the ValidateFunc for expression to call out to the validation API endpoint and raise those exceptions earlier in the development cycle. Take 2 of #848 now that API tokens are supported in the routes. Closes #846
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While making changes to filters you need to run
apply
to actually findout whether the expression is valid. This is a slow feedback cycle for
developers and there is an API endpoint that allows you to validate
expressions before using them so it's a no brainer to improve the
validation in the schema.
This updates the
ValidateFunc
forexpression
to call out to thevalidation API endpoint and raise those exceptions earlier in the
development cycle.
Fixes #846