Skip to content

fix(gcp-resources): Remove bucket_name as PK of gcp_storage_bucket_policies#6550

Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/gcp_storage_bucket_policies_pks
Jan 10, 2023
Merged

fix(gcp-resources): Remove bucket_name as PK of gcp_storage_bucket_policies#6550
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:fix/gcp_storage_bucket_policies_pks

Conversation

@erezrokah
Copy link
Copy Markdown
Member

Summary

gcp_storage_bucket_policies used the parent bucket's name as a PK. This means we could only get 1 policy per bucket in overwrite* modes.
Per a better field, this PR fixes it so we use _cq_id

@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Jan 9, 2023
@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_storage_bucket_policies: primary key constraint added to column _cq_id
  • Table gcp_storage_bucket_policies: primary key constraint removed from column bucket_name

@yevgenypats
Copy link
Copy Markdown
Contributor

Seems in that case the right pk is version + parent_name

@erezrokah erezrokah force-pushed the fix/gcp_storage_bucket_policies_pks branch from 030cae5 to 761d733 Compare January 10, 2023 09:33
@erezrokah
Copy link
Copy Markdown
Member Author

Seems in that case the right pk is version + parent_name

The policy struct doesn't have a version (only Etag and an array of Bindings):
https://github.com/googleapis/google-cloud-go/blob/947c9ace8740e40abe0ca79acb894ea333655f88/iam/iam.go#L353

@kodiakhq kodiakhq bot merged commit fb6a2de into cloudquery:main Jan 10, 2023
erezrokah pushed a commit that referenced this pull request Jan 10, 2023
🤖 I have created a release *beep* *boop*
---


##
[6.1.1](plugins-source-gcp-v6.1.0...plugins-source-gcp-v6.1.1)
(2023-01-10)


### Bug Fixes

* **gcp-resources:** Add `organization_id` and `name` as PK of
`gcp_resourcemanager_folders`
([#6547](#6547))
([3c0e702](3c0e702))
* **gcp-resources:** Add `project_id` and `id` as PKs of
`gcp_bigquery_datasets`
([#6532](#6532))
([fd00133](fd00133))
* **gcp-resources:** Add `project_id` and `id` as PKs of
`gcp_bigquery_tables`
([#6533](#6533))
([523c84f](523c84f))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_domains_registrations`
([#6537](#6537))
([47c87b4](47c87b4))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_functions_functions`
([#6538](#6538))
([8552503](8552503))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_iam_deny_policies`
([#6539](#6539))
([d230ede](d230ede))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_iam_service_account_keys`, remove `service_account_unique_id` from
PKs ([#6541](#6541))
([00ca437](00ca437))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_kms_crypto_keys`
([#6542](#6542))
([3d4d03c](3d4d03c))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_kms_keyrings`
([#6543](#6543))
([fbde9e4](fbde9e4))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_run_locations`
([#6548](#6548))
([88c1993](88c1993))
* **gcp-resources:** Add `project_id` and `name` as PKs of
`gcp_run_services`
([#6549](#6549))
([237e28d](237e28d))
* **gcp-resources:** Add `project_id` as PK of `gcp_logging_metrics`
([#6544](#6544))
([599b935](599b935))
* **gcp-resources:** Add `project_id` as PK of `gcp_logging_sinks`
([#6545](#6545))
([d183b51](d183b51))
* **gcp-resources:** Add `version` to PKs of
`gcp_cloudiot_device_configs`
([#6551](#6551))
([12252c3](12252c3))
* **gcp-resources:** Change `gcp_appengine_firewall_ingress_rules` PK to
`_cq_id` ([#6531](#6531))
([5d87911](5d87911))
* **gcp-resources:** Remove `bucket_name` as PK of
`gcp_storage_bucket_policies`
([#6550](#6550))
([fb6a2de](fb6a2de))
* **gcp-resources:** Remove `metadata` from `gcp_aiplatform_models`
([#6529](#6529))
([e068e19](e068e19))

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