Skip to content

Decouple connection from Blob - #823

Merged
dhermes merged 5 commits into
googleapis:masterfrom
dhermes:decouple-connection-in-blob
Apr 16, 2015
Merged

Decouple connection from Blob#823
dhermes merged 5 commits into
googleapis:masterfrom
dhermes:decouple-connection-in-blob

Conversation

@dhermes

Copy link
Copy Markdown
Contributor

NOTE: Has #822 as diffbase.

Towards #728

@tseaver I made a separate commit for each method with used Blob.connection but can combine them if you like.

I wanted to get rid of the Blob.connection property, but _PropertyMixin.reload() and _PropertyMixin.patch() use it as well as ObjectACL.reload() and ObjectACL.save().

@dhermesdhermes added the api: storage Issues related to the Cloud Storage API. label Apr 14, 2015
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 14, 2015
@dhermesdhermes changed the title Decouple connection in blobDecouple connection from BlobApr 14, 2015
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 5cf9023 on dhermes:decouple-connection-in-blob into 6283ab9 on GoogleCloudPlatform:master.

@tseaver

Copy link
Copy Markdown
Contributor

9932f0d LGTM
e429f9a LGTM
8ebb280 see comments inline (setting connection=None in ctors to verify that override is used)
824ff20 same issue
5cf9023 same issue

@dhermes
dhermesforce-pushed the decouple-connection-in-blob branch from 5cf9023 to a54b630CompareApril 15, 2015 21:50
@dhermes

Copy link
Copy Markdown
ContributorAuthor

@tseaver I imagine this being a transient issue since at some point connection will not be bound to any of the types or to the stubs.

I'm not sure what would need to be checked either.

@tseaver

Copy link
Copy Markdown
Contributor

@dhermes in the tests, we should pass None to the bucket ctor in order to ensure that the passed-in connection is being used (the tests as we have them would pass if the methods took the connection argument, but then fell back to using self.connection).

@dhermes

Copy link
Copy Markdown
ContributorAuthor

The heisenbug that @jgeewax fixed in #834 raised it's head here too. Only the 2nd time I had seen (build failure was first). Will rebase.


@tseaver All the Blob methods I changed use the passed in connection only and don't fall back to self.connection.

They are moving towards no connection anywhere, so falling back is a no-no.

@dhermes
dhermesforce-pushed the decouple-connection-in-blob branch from a54b630 to ca34a4aCompareApril 16, 2015 16:30
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling ca34a4a on dhermes:decouple-connection-in-blob into 40d84e9 on GoogleCloudPlatform:master.

@tseaver

Copy link
Copy Markdown
Contributor

That's why having the bucket initialized with an invalid connection is the Right Thing (TM): it ensures that fallback cannot cause the test to succeed.

@dhermes

Copy link
Copy Markdown
ContributorAuthor

Gotcher. Current plan is to cherry-pick each of the 5 commits and then replace Bucket(connection) with Bucket(None) or similar. (About to spend an hour without internet on BART.)

LMK if this is a bad idea.

This is to blob and bucket can use it without import cycles.
@tseaver

Copy link
Copy Markdown
Contributor

SGTM

Allowing the default connection to be used or direct use of
a credentials object.
Allowing the default connection to be used.
Allowing the default connection to be used as fallback or takes
an explicit connection argument.
Allowing the default connection to be used as fallback or takes
an explicit connection argument.
@dhermes
dhermesforce-pushed the decouple-connection-in-blob branch from ca34a4a to 60d43acCompareApril 16, 2015 18:24
@dhermes

Copy link
Copy Markdown
ContributorAuthor

@tseaver PTAL

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 60d43ac on dhermes:decouple-connection-in-blob into 40d84e9 on GoogleCloudPlatform:master.

@tseaver

Copy link
Copy Markdown
Contributor

LGTM

dhermes added a commit that referenced this pull request Apr 16, 2015
@dhermes
dhermes merged commit 06e26ad into googleapis:masterApr 16, 2015
@dhermes

Copy link
Copy Markdown
ContributorAuthor

@tseaver Can we divvy up work and try to close out #728 together?

@dhermes
dhermes deleted the decouple-connection-in-blob branch April 16, 2015 19:31
@tseaver

Copy link
Copy Markdown
Contributor

How do you see the split?

@dhermes

Copy link
Copy Markdown
ContributorAuthor

Can you handle the methods in acl.py and I'll try to cover the rest (Bucket and _PropertyMixin)?

Then we "converge" and remove the connection property from Blob (it gets used in acl.py).

@tseaver

Copy link
Copy Markdown
Contributor

OK. I just inventoried those methods in #825.

@dhermes

Copy link
Copy Markdown
ContributorAuthor

Awesome! Thanks

@dhermesdhermes mentioned this pull request Jun 4, 2015
parthea pushed a commit that referenced this pull request Aug 21, 2025
* chore(deps): update all dependencies
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
---------
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Sep 16, 2025
* chore(deps): update all dependencies
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
---------
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Sep 18, 2025
Source-Link: googleapis/synthtool@0da1658
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:5cddfe2fb5019bbf78335bc55f15bc13e18354a56b3ff46e1834f8e540807f05
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 26, 2025
parthea pushed a commit that referenced this pull request Mar 6, 2026
Source-Link: googleapis/synthtool@cb96037
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2d816f26f728ac8b24248741e7d4c461c09764ef9f7be3684d557c9632e46dbd
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Mar 9, 2026
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
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

@dhermes@coveralls@tseaver@googlebot