feat: Validate undefined column in TestResource#144
Merged
yevgenypats merged 2 commits intomainfrom Sep 20, 2022
Merged
Conversation
erezrokah
approved these changes
Sep 20, 2022
I found quite a few issue where we use resource.Set but we dont define the column and the destination pluginfails to write because the column doesn't exist
06ceab2 to
3ae0c18
Compare
disq
approved these changes
Sep 20, 2022
| val := data[columnName] | ||
| if val != nil { | ||
| switch resource.Table.Columns.Get(columnName).Type { | ||
| case schema.TypeJSON: |
Contributor
There was a problem hiding this comment.
I think there's also going to be a new class of bug where we set a JSON column using a string or byte slice (that was already marshalled to JSON). It's very rare, if ever, that we'd want to write a string directly to a JSON column, even though it would marhsal to JSON just fine, so maybe we can check for that issue here
kodiakhq bot
pushed a commit
that referenced
this pull request
Sep 20, 2022
🤖 I have created a release *beep* *boop* --- ## [0.7.5](v0.7.4...v0.7.5) (2022-09-20) ### Features * Validate undefined column in TestResource ([#144](#144)) ([98e8999](98e8999)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Merged
1 task
This file contains hidden or 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
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.
I found quite a few issue where we use resource.Set but we dont define the column and the destination pluginfails to write because the column doesn't exist
Summary
Use the following steps to ensure your PR is ready to be reviewed
go fmtto format your code 🖊golangci-lint run🚨 (install golangci-lint here)