-
Notifications
You must be signed in to change notification settings - Fork 375
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
cleanup(storage)!: uploads track committed_size #7868
cleanup(storage)!: uploads track committed_size #7868
Conversation
Fixing how the `storage` client library deals with reponses lacking a `Range` header will break any existing unit tests that mock a `ResumableUploadSession`. This creates an opportunity to cleanup the semantics of `ResumableUploadResponse`. This change performs that cleanup. **BREAKING CHANGE:** with this PR any use of the `storage::internal::ResumableUploadResponse` type require changes. Applications should have little need for this type, outside mocks, so the changes should not affect production code. Nevertheless, we apologize for the inconvenience, and while we would have preferred to avoid breaking changes, it was inevitable to introduce some breaking changes to fix a data loss bug. If you are affected by this change, we expect that any existing tests will fail to compile. This was an intentional choice, the semantics of some values are changing, we think it is better to have these issues detected at compile-time rather than during test execution. We have updated the examples to use the new mocks, and the release notes include more details on how to change any affected tests.
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov Report
@@ Coverage Diff @@
## main #7868 +/- ##
=======================================
Coverage 95.12% 95.12%
=======================================
Files 1285 1285
Lines 116163 116122 -41
=======================================
- Hits 110496 110457 -39
+ Misses 5667 5665 -2
Continue to review full report at Codecov.
|
CHANGELOG.md
Outdated
} | ||
``` | ||
|
||
That is, you need to re-order the fields **and** change increase the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/change increase/increase/?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
// We expect a `Range:` header in the format described here: | ||
// https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload | ||
// that is the value should match `bytes=0-[0-9]+`: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opt nit: Remove blank line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Fixing how the
storage
client library deals with reponses lacking aRange
header will break any existing unit tests that mock aResumableUploadSession
. This creates an opportunity to cleanup thesemantics of
ResumableUploadResponse
. This change performs thatcleanup.
BREAKING CHANGE: with this PR any use of the
storage::internal::ResumableUploadResponse
type require changes.Applications should have little need for this type, outside mocks, so
the changes should not affect production code.
Nevertheless, we apologize for the inconvenience, and while we would have
preferred to avoid breaking changes, it was inevitable to introduce some
breaking changes to fix a data loss bug.
If you are affected by this change, we expect that any existing tests
will fail to compile. This was an intentional choice, the semantics of
some values are changing, we think it is better to have these issues
detected at compile-time rather than during test execution.
We have updated the examples to use the new mocks, and the release notes
include more details on how to change any affected tests.
Fixes #6880, part of the work for #7835
This change is