Skip to content

fix(gcp-resources): Add update_time to PKs of gcp_cloudiot_device_states#6552

Merged
kodiakhq[bot] merged 4 commits intocloudquery:mainfrom
erezrokah:fix/gcp_cloudiot_device_states_pks
Jan 11, 2023
Merged

fix(gcp-resources): Add update_time to PKs of gcp_cloudiot_device_states#6552
kodiakhq[bot] merged 4 commits intocloudquery:mainfrom
erezrokah:fix/gcp_cloudiot_device_states_pks

Conversation

@erezrokah
Copy link
Copy Markdown
Member

Summary

Similar to #6551

@cq-bot cq-bot added the gcp label Jan 9, 2023
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 9, 2023

This PR has the following changes to source plugin(s) tables:

  • Table gcp_cloudiot_device_states: primary key constraint added to column update_time

@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Jan 9, 2023
@yevgenypats
Copy link
Copy Markdown
Contributor

I think in that case the right pk is device_name + updateTime

@erezrokah
Copy link
Copy Markdown
Member Author

I think in that case the right pk is device_name + updateTime

Is it guaranteed that updateTime is unique? I don't know actually. Maybe it's possible to update the device twice at the same time

@erezrokah erezrokah force-pushed the fix/gcp_cloudiot_device_states_pks branch 2 times, most recently from 36efa8f to baf13c9 Compare January 10, 2023 09:52
@erezrokah
Copy link
Copy Markdown
Member Author

I think in that case the right pk is device_name + updateTime

OK let's try with update_time and see how it goes

@erezrokah
Copy link
Copy Markdown
Member Author

Something is up with the test failures, not sure why it fails the PK validation

@erezrokah erezrokah removed the automerge Automatically merge once required checks pass label Jan 10, 2023
@erezrokah erezrokah changed the title fix(gcp-resources): Remove project_id and device_name as PKs of gcp_cloudiot_device_states fix(gcp-resources): Add update_time to PKs of gcp_cloudiot_device_states Jan 10, 2023
@erezrokah erezrokah force-pushed the fix/gcp_cloudiot_device_states_pks branch from 734266c to fb3ca98 Compare January 10, 2023 15:52
@erezrokah
Copy link
Copy Markdown
Member Author

Blocked by cloudquery/plugin-sdk#596, a bug in our type system

@erezrokah
Copy link
Copy Markdown
Member Author

The real blocker is cloudquery/plugin-sdk#597

@erezrokah
Copy link
Copy Markdown
Member Author

Another correction, we should be handling this in

func resolverTransformer(field reflect.StructField, path string) schema.ColumnResolver {
. I'll check why it's not working

@erezrokah erezrokah force-pushed the fix/gcp_cloudiot_device_states_pks branch from fb3ca98 to 6398326 Compare January 11, 2023 00:52
@erezrokah
Copy link
Copy Markdown
Member Author

Another correction, we should be handling this in

OK so I just used the wrong resolver Path instead of ResolveProtoTimestamp when redefining the column 🤦

@erezrokah erezrokah added automerge Automatically merge once required checks pass and removed blocked labels Jan 11, 2023
@kodiakhq kodiakhq bot merged commit b78eca5 into cloudquery:main Jan 11, 2023
kodiakhq bot pushed a commit that referenced this pull request Jan 11, 2023
🤖 I have created a release *beep* *boop*
---


## [7.1.1](plugins-source-gcp-v7.1.0...plugins-source-gcp-v7.1.1) (2023-01-11)


### Bug Fixes

* **gcp-resources:** Add `update_time` to PKs of `gcp_cloudiot_device_states` ([#6552](#6552)) ([b78eca5](b78eca5))

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

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants