Skip to content

feat: Validate undefined column in TestResource#144

Merged
yevgenypats merged 2 commits intomainfrom
feat/testing_sdk
Sep 20, 2022
Merged

feat: Validate undefined column in TestResource#144
yevgenypats merged 2 commits intomainfrom
feat/testing_sdk

Conversation

@yevgenypats
Copy link
Copy Markdown
Contributor

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

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

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
@yevgenypats yevgenypats merged commit 98e8999 into main Sep 20, 2022
@yevgenypats yevgenypats deleted the feat/testing_sdk branch September 20, 2022 10:57
val := data[columnName]
if val != nil {
switch resource.Table.Columns.Get(columnName).Type {
case schema.TypeJSON:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).
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.

4 participants