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

chore(storage): integrate Compose in new interface #6414

Merged
merged 11 commits into from
Jul 26, 2022

Conversation

tritone
Copy link
Contributor

@tritone tritone commented Jul 25, 2022

Change production code paths for Composer to use the new transport
agnostic interface.

Required a few setup steps to make tests pass, which will be needed for
other integrations too:

  • Add initialization of tc to NewClient
  • Add new useGRPC flag to remove switches on tc in Reader/Writer

Also a few cleanups:

  • Use EncryptionKey from dstObject
  • Use defaultGen instead of hard coded int

Also, a unit test checks that setting Generation with composer causes
a failure. Currently this is enforced by applyConds. I added
a separate validation for this instead, but I could do a pass-
through of the Generation through the interface -- it's just
confusing looking because setting Generation on a new object
is never valid.

noahdietz and others added 7 commits July 19, 2022 12:10
chore: sync main to storage-refactor
chore: sync main to storage-refactor
* chore: release main (googleapis#6351)

* test(profiler): compile busybench before running backoff test (googleapis#6375)

* chore(bigquery/storage/managedwriter): augment test logging (googleapis#6373)

* chore(storage): RewriteObject implementation (googleapis#6313)

* chore(storage): RewriteObject implementation

* address feedback

* refactor source/destination object types

* address feedback

* address feedback

* fix test

* chore(main): release storage 1.24.0 (googleapis#6336)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Chris Cotter <[email protected]>

* chore(internal/gapicgen): update microgen v0.31.2 (googleapis#6383)

Only includes fixes to regapic generation.

* test(bigquery/storage/managedwriter): relax error checking (googleapis#6385)

When a user issues a large request, the response from the
backend is a bare "InvalidArgument".  This PR removes additional
validation on information that is only attached when interrogating
the backend from a known client; it's stripped in the normal case.

Internal issue 239740070 was created to address the unactionable
nature of the response.

Fixes: googleapis#6361

* feat(firestore): adds Bulkwriter support to Firestore client (googleapis#5946)

* feat: adds Bulkwriter support to Firestore client

* test(storage): unflake TestIntegration_ACL (googleapis#6392)

Few minor changes to make sure potentially flaky and/or
eventually consistent operations for ACLs are retried appropriately.

Fixes googleapis#6379

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Amarin (Um) Phaosawasdi <[email protected]>
Co-authored-by: shollyman <[email protected]>
Co-authored-by: Noah Dietz <[email protected]>
Co-authored-by: Chris Cotter <[email protected]>
Co-authored-by: Eric Schmidt <[email protected]>
chore: sync main to storage-refactor
chore: sync main to storage-refactor
Change production code paths for Composer to use the new transport
agnostic interface.

Required a few small changes to make tests pass:
* Add initialization of tc to NewClient
* Add new useGRPC flag to remove switches on tc in Reader/Writer
* A unit test checks that setting Generation with composer causes
  a failure. Currently this is enforced by applyConds. I added
  a separate validation for this instead, but I could do a pass-
  through of the Generation through the interface -- it's just
  confusing looking because setting Generation on a new object
  is never valid.
@tritone tritone requested review from a team as code owners July 25, 2022 17:06
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: storage Issues related to the Cloud Storage API. labels Jul 25, 2022
Copy link
Contributor

@noahdietz noahdietz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for doing that bit of leg work to get ancillary things set up. Looking into why presubmits didn't run.

storage/copy.go Outdated
call := c.dst.c.raw.Objects.Compose(c.dst.bucket, c.dst.object, req).Context(ctx)
if err := applyConds("ComposeFrom destination", c.dst.gen, c.dst.conds, call); err != nil {
return nil, err
// TODO: factor this out to a function?
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the definition of idempotency here a generalized one? Or is it specific to Copy/Compose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's specific to copy/compose. However was thinking I could add a helper func to create the storage opts just to eliminate a few of these lines of boilerplate which will be in every func:

func makeStorageOpts(idempotent bool, retry *retryConfig, userProject string) []storageOption {...}

Maybe this defeats the point of the options interface though?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this defeats the point of the options interface though?

Perhaps...let's just keep the TODO and evaluate as we go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure sounds good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll be adding this in a separate PR.

@noahdietz noahdietz added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 25, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 25, 2022
@noahdietz
Copy link
Contributor

Looking into why presubmits didn't run.

I reran kokoro and it actually executed this time. Just need to fix a lint error gofmt -w storage/copy.go.

@tritone tritone added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 26, 2022
@tritone tritone merged commit be23ac8 into googleapis:storage-refactor Jul 26, 2022
@tritone tritone deleted the compose-integration2 branch July 26, 2022 18:10
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. kokoro:force-run Add this label to force Kokoro to re-run the tests. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants