Skip to content

Storage: Track deleted labels; make Bucket.patch() send them. - #3737

Merged
lukesneeringer merged 7 commits into
googleapis:masterfrom
lukesneeringer:issue-3711
Aug 10, 2017
Merged

Storage: Track deleted labels; make Bucket.patch() send them.#3737
lukesneeringer merged 7 commits into
googleapis:masterfrom
lukesneeringer:issue-3711

Conversation

@lukesneeringer

Copy link
Copy Markdown
Contributor

Uses #3715 as a base.

This PR adds tracking for deleted labels on the Bucket object, and causes the appropriate data to be sent when Bucket.patch is called.

Fixes#3711.

@lukesneeringerlukesneeringer added the api: storage Issues related to the Cloud Storage API. label Aug 7, 2017
@lukesneeringerlukesneeringer self-assigned this Aug 7, 2017
@googlebot

Copy link
Copy Markdown

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebotgooglebot added the cla: no This human has *not* signed the Contributor License Agreement. label Aug 7, 2017
@lukesneeringer

Copy link
Copy Markdown
ContributorAuthor

Grumble grumble grumble @googlebot.

@lukesneeringerlukesneeringer 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 Aug 7, 2017
@googlebotgooglebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Aug 7, 2017
@tseaver

Copy link
Copy Markdown
Contributor

#3715 merged, so you can rebase to appease googlebot.

@lukesneeringerlukesneeringer 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 Aug 7, 2017
@lukesneeringer

Copy link
Copy Markdown
ContributorAuthor

Done, just need a review (and to fix CI).

@googlebotgooglebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Aug 7, 2017
@lukesneeringerlukesneeringer 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 Aug 7, 2017
``client`` stored on the current object.
"""
answer = super(Bucket, self).update(client=client)
self._label_removals.clear()

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment threadstorage/tests/unit/test_bucket.py Outdated
_, _, kwargs = client._connection.api_request.mock_calls[0]
self.assertEqual(len(kwargs['data']['labels']), 2)
self.assertEqual(kwargs['data']['labels']['color'], 'red')
self.assertEqual(kwargs['data']['labels']['flavor'], 'cherry')

This comment was marked as spam.

This comment was marked as spam.

@googlebotgooglebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Aug 7, 2017
@lukesneeringer

Copy link
Copy Markdown
ContributorAuthor

Thanks for catching that @tseaver. Updates made.

# If the values are reset, the changes must as well.
self._changes = set()
if hasattr(self, '_label_removals'):
self._label_removals.clear()

This comment was marked as spam.

This comment was marked as spam.

@lukesneeringer

Copy link
Copy Markdown
ContributorAuthor

@tseaver@jonparrott Can someone give this a final signoff so I can merge it? :-)

@lukesneeringerlukesneeringer 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 Aug 10, 2017
@lukesneeringer
lukesneeringer merged commit 64d1728 into googleapis:masterAug 10, 2017
@lukesneeringer
lukesneeringer deleted the issue-3711 branch August 10, 2017 18:38
@dhermesdhermes mentioned this pull request Aug 14, 2017
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 21, 2017
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 22, 2017
landrito pushed a commit to landrito/google-cloud-python that referenced this pull request Aug 22, 2017
@lukesneeringerlukesneeringer mentioned this pull request Aug 24, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storageIssues related to the Cloud Storage API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@lukesneeringer@googlebot@tseaver@theacodes