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

Storage: add generation arguments (from #7023). #7444

Merged
merged 15 commits into from
Mar 14, 2019
Merged

Storage: add generation arguments (from #7023). #7444

merged 15 commits into from
Mar 14, 2019

Conversation

@tseaver tseaver added the api: storage Issues related to the Cloud Storage API. label Feb 25, 2019
@googlebot
Copy link

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 or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok 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 all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Feb 25, 2019
@tseaver
Copy link
Contributor Author

tseaver commented Mar 4, 2019

I've created #7478 to track the flaky systest, which I believe is unrelated to the changes in this PR (I cannot reproduce locally).

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Mar 4, 2019
Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding one question. Overall LGTM.

storage/google/cloud/storage/bucket.py Outdated Show resolved Hide resolved
@tseaver tseaver added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 12, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 12, 2019
@tseaver
Copy link
Contributor Author

tseaver commented Mar 12, 2019

The flaky module tear-down for storage system tests is unrelated: I've reported it in #7505.

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

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 14, 2019
@googlebot
Copy link

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 or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok 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 all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot 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 Mar 14, 2019
@frankyn frankyn 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 Mar 14, 2019
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@tseaver tseaver merged commit 806c6df into googleapis:master Mar 14, 2019
@tseaver tseaver deleted the 7023-storage-add_generation_arguments branch March 14, 2019 17:32
@747project
Copy link

Thank you for this! Is there a timeframe on when we can expect this to appear in a pypi release of google-cloud-storage?

@max-sixty
Copy link

FYI this broke some of our tests - potentially on us but posting at least for others.

Now if a process has a blob and it's overwritten, blob.exists() is False. It used to be true.

Specifically, this was our fixture:

@pytest.fixture()
def existing_blob_name(project, bucket, blob_name_expanded, data):
    blob = gcs.client(project).get_bucket(
        bucket).blob(blob_name_expanded)
    blob.upload_from_string(dill.dumps(data))
    assert blob.exists()
    yield blob.name
    blob.delete()

This was our test (for an internal wrapper method):

def test_set_overwrite(existing_blob_name, bucket, project):
    # could do this with a parameter but so small
    with pytest.raises(ValueError):
        gcs.set(existing_blob_name, 'abc', bucket=bucket,
                project=project, overwrite=False)

    gcs.set(existing_blob_name, 'abc', bucket=bucket,
            project=project, overwrite=True)

This failed on blob.delete(), since the newly written blob has a different generation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement. 🚨 This issue needs some love.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants