Skip to content
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

Set policy tags to empty instead of null #545

Closed
wants to merge 1 commit into from

Conversation

tabdulradi
Copy link

@tabdulradi tabdulradi commented Jul 14, 2020

Currently when BigQuery returns policy tag object without names, the whole policy tag field is set to null, which is not consistent with the REST Api, this pull request changes the behaviour to return an instance with names set to null instead.

This change modifies a previous PR #522, that was created in response to my GCP support ticket, slightly tweaking the behaviour to make it more consistent with the REST api.

  • Make sure to open an issue as a bug/issue before writing your code! There is GCP issue instead. The case Id is 24194276
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Jul 14, 2020
@codecov
Copy link

codecov bot commented Jul 14, 2020

Codecov Report

Merging #545 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #545   +/-   ##
=========================================
  Coverage     81.49%   81.49%           
  Complexity     1226     1226           
=========================================
  Files            77       77           
  Lines          6220     6221    +1     
  Branches        691      691           
=========================================
+ Hits           5069     5070    +1     
  Misses          792      792           
  Partials        359      359           
Impacted Files Coverage Δ Complexity Δ
...ain/java/com/google/cloud/bigquery/PolicyTags.java 100.00% <100.00%> (ø) 6.00 <2.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6d9491...3312baf. Read the comment docs.

When BigQuery returns policy tag object without names, policy tags will have names field set to
null (instead of the policy tags object itself set to null) to be consistent with the REST api.
@tabdulradi
Copy link
Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jul 14, 2020
@pmakani pmakani added the kokoro:run Add this label to force Kokoro to re-run the tests. label Jul 14, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Jul 14, 2020
@shollyman
Copy link
Contributor

Thanks for the submission. However, the backend service response is also being corrected so that it doesn't provide the empty message for policyTags, which is the behavior the first PR mirrors. In this case, I'm going to recommend that we don't move forward with this PR.

@stephaniewang526
Copy link
Contributor

closing per @shollyman comment

@marengaz
Copy link

@shollyman @stephaniewang526

the reason for suggesting this change was so that we can tell the difference between the following scenarios:

  • policy tag was never added to this field "policyTags":null
  • policy tag was added to this field "policyTags":{"names":["projects/myproj/locations/eu/taxonomies/123/policyTags/456"]}
  • policy tag was added to this field, then removed "policyTags":{"names":[]}

it mirrors the behaviour of the description field:

  • description was never added to this field "description":null
  • description was added to this field "description":"my description"
  • description was added to this field, then removed "description":""

we value this granularity. whats the reason for removing it?

@shollyman
Copy link
Contributor

If you want awareness of this kind of change, then I'd suggest something like the BigQuery audit log feature. If it doesn't convey the information you need, then I'd suggest making a request on the public issue tracker or via support channels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants