Skip to content
Open
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
042dca2
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
5f18f7e
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
288e31a
lint fix
thiyaguk09 Jun 23, 2026
fbedc7c
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
053428f
test: update resumable upload test mocks to use URL and Headers objects
thiyaguk09 Aug 27, 2026
9764d21
style: apply prettier formatting throughout the codebase to ensure co…
thiyaguk09 Aug 28, 2026
b20961b
refactor: improve type safety and remove any casts across storage tra…
thiyaguk09 Aug 28, 2026
d8b93e8
refactor: move upload initialization into the writing event pipeline …
thiyaguk09 Aug 28, 2026
f84761a
docs(storage): update gaxios migration guide and tests
thiyaguk09 Aug 28, 2026
4a73eb4
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
320b5cc
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
c2710bf
lint fix
thiyaguk09 Jun 23, 2026
463e7f8
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
ca30b2e
test: update resumable upload test mocks to use URL and Headers objects
thiyaguk09 Aug 27, 2026
01e1f17
style: apply prettier formatting throughout the codebase to ensure co…
thiyaguk09 Aug 28, 2026
d104ded
refactor: improve type safety and remove any casts across storage tra…
thiyaguk09 Aug 28, 2026
b541179
refactor: move upload initialization into the writing event pipeline …
thiyaguk09 Aug 28, 2026
83eb0f0
Merge remote-tracking branch 'upstream/storage-gaxios-migration' into…
thiyaguk09 Aug 31, 2026
2499646
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
6037752
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
6c0af26
lint fix
thiyaguk09 Jun 23, 2026
9fa92c6
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
d59f213
test: update resumable upload test mocks to use URL and Headers objects
thiyaguk09 Aug 27, 2026
3ec9583
style: apply prettier formatting throughout the codebase to ensure co…
thiyaguk09 Aug 28, 2026
b9e5bb9
refactor: improve type safety and remove any casts across storage tra…
thiyaguk09 Aug 28, 2026
9e948e8
refactor: move upload initialization into the writing event pipeline …
thiyaguk09 Aug 28, 2026
8bd2728
chore: update test formatting and refactor IP filter metadata tests t…
thiyaguk09 Aug 31, 2026
b2e9e05
refactor: update header type definitions in resumable upload tests to…
thiyaguk09 Aug 31, 2026
4eaa783
Merge branch 'storage-gaxios-migration' into docs/gaxios-migration-guide
thiyaguk09 Aug 31, 2026
b236dc7
fix: use object property assignment instead of Headers.set for X-Uplo…
thiyaguk09 Aug 31, 2026
87e8b01
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
79f93ab
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
620e0c0
lint fix
thiyaguk09 Jun 23, 2026
2476994
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
25de310
test: update resumable upload test mocks to use URL and Headers objects
thiyaguk09 Aug 27, 2026
854011f
style: apply prettier formatting throughout the codebase to ensure co…
thiyaguk09 Aug 28, 2026
117ea85
refactor: improve type safety and remove any casts across storage tra…
thiyaguk09 Aug 28, 2026
9b97153
refactor: move upload initialization into the writing event pipeline …
thiyaguk09 Aug 28, 2026
7823f87
chore: update test formatting and refactor IP filter metadata tests t…
thiyaguk09 Aug 31, 2026
3ead0d8
refactor: update header type definitions in resumable upload tests to…
thiyaguk09 Aug 31, 2026
3aa5a72
Merge branch 'storage-gaxios-migration' into docs/gaxios-migration-guide
thiyaguk09 Sep 1, 2026
aa90879
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
589ee20
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
b7a71e7
lint fix
thiyaguk09 Jun 23, 2026
3a9c6f6
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
11d30cb
test: update resumable upload test mocks to use URL and Headers objects
thiyaguk09 Aug 27, 2026
aa72b03
style: apply prettier formatting throughout the codebase to ensure co…
thiyaguk09 Aug 28, 2026
5c7fb31
refactor: improve type safety and remove any casts across storage tra…
thiyaguk09 Aug 28, 2026
8d3f0f0
refactor: move upload initialization into the writing event pipeline …
thiyaguk09 Aug 28, 2026
bf72fb2
chore: update test formatting and refactor IP filter metadata tests t…
thiyaguk09 Aug 31, 2026
3eb2445
refactor: update header type definitions in resumable upload tests to…
thiyaguk09 Aug 31, 2026
859049f
Merge branch 'storage-gaxios-migration' into docs/gaxios-migration-guide
thiyaguk09 Sep 3, 2026
85958f4
fix(storage): standardize URL formatting and enhance transport retry
thiyaguk09 May 7, 2026
251a44b
fix(storage): resolve transport and retry issues (#8235)
thiyaguk09 Jun 23, 2026
9f4e5ea
lint fix
thiyaguk09 Jun 23, 2026
e41e310
fix(storage): Invocation ID is not retained on multipart upload retri…
thiyaguk09 Jul 28, 2026
93dc2fe
test: update resumable upload test mocks to use URL and Headers objects
thiyaguk09 Aug 27, 2026
da25dc9
style: apply prettier formatting throughout the codebase to ensure co…
thiyaguk09 Aug 28, 2026
f99a09d
refactor: improve type safety and remove any casts across storage tra…
thiyaguk09 Aug 28, 2026
74cc740
refactor: move upload initialization into the writing event pipeline …
thiyaguk09 Aug 28, 2026
b03ef5a
chore: update test formatting and refactor IP filter metadata tests t…
thiyaguk09 Aug 31, 2026
d749fc2
refactor: update header type definitions in resumable upload tests to…
thiyaguk09 Aug 31, 2026
f506def
Merge branch 'storage-gaxios-migration' into docs/gaxios-migration-guide
thiyaguk09 Sep 4, 2026
cbb389c
refactor: update header type definitions in resumable upload tests to…
thiyaguk09 Aug 31, 2026
507a93b
Merge branch 'storage-gaxios-migration' into docs/gaxios-migration-guide
thiyaguk09 Sep 7, 2026
2072d69
refactor: update header type definitions in resumable upload tests to…
thiyaguk09 Aug 31, 2026
3a8df03
Merge branch 'storage-gaxios-migration' into docs/gaxios-migration-guide
thiyaguk09 Sep 7, 2026
d1d56b0
Merge branch 'storage-gaxios-migration' into docs/gaxios-migration-guide
thiyaguk09 Sep 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions handwritten/storage/MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Storage v7 to v8 Migration Guide - Gaxios Update

This guide helps you migrate your application from `@google-cloud/storage` v7 to v8, focusing on the changes introduced by updating the underlying HTTP client, `gaxios`, to version 7.

## Key Breaking Changes for Storage Users

### 1. Response Headers are now `Headers` objects

When you receive a full API response from Storage methods (e.g., via callbacks or promise resolutions that include the response object), the `headers` property of the response is now a standard `Headers` object rather than a plain JavaScript object.

**Before (Storage v7):**

```js
const [retrievedFile, apiResponse] = await file.get();
const contentType = apiResponse.headers['content-type'];
```

**After (Storage v8):**

```js
const [retrievedFile, apiResponse] = await file.get();
// Accessing headers requires the .get() method
const contentType = apiResponse.headers.get('content-type');
```

### 2. Passing Headers in Options

If you pass custom headers in options to Storage methods (which extend `GaxiosOptions`), you can still pass plain objects, as the Storage library will convert them to standard `Headers` internally for the request. However, if you read them back from the prepared options or response, they will be `Headers` objects.

**Before (Storage v7):**

```js
// Reading request headers back from response metadata returned a plain object
const customHeader = apiResponse.config.headers['x-custom-header'];
```

**After (Storage v8):**

```js
// Reading request headers back from response metadata requires .get()
const customHeader = apiResponse.config.headers.get('x-custom-header');
```

> [!WARNING]
> **Header Value Stringification:** Plain JavaScript objects allow passing non-string values (such as arrays or numbers) which are implicitly processed. However, the native `Headers` constructor strictly converts all values to standard string representations. For example, passing an array of values (e.g., `['val1', 'val2']`) will result in a single comma-separated string (e.g., `'val1, val2'`). Ensure you pre-format or verify your header values before passing them to custom options.


### 3. URL Resolution (`baseURL`)

If you are using custom `baseURL` options or passing relative URLs to methods that accept them, be aware that resolution now strictly follows the standard native `URL` constructor spec (`new URL(url, baseURL)`). This can affect how leading slashes in paths resolve.

**Before (Storage v7):**

Using standard path-joining custom resolution:
- `baseURL`: `https://storage.googleapis.com/storage/v1`
- `url`: `/b/my-bucket`
- Resolved URL: `https://storage.googleapis.com/storage/v1/b/my-bucket`

**After (Storage v8):**

Strictly resolved via the standard native `URL` constructor rules (where a leading slash resolves relative to the root of the host):
- `baseURL`: `https://storage.googleapis.com/storage/v1`
- `url`: `/b/my-bucket`
- Resolved URL: `https://storage.googleapis.com/b/my-bucket` (resolves relative to host root, stripping `storage/v1`)


## Upgrade Instructions

Update your `@google-cloud/storage` dependency to version 8:

```sh
npm install @google-cloud/storage@latest
```

## Troubleshooting

- If you encounter `undefined` when accessing headers on the response object, ensure you are using `apiResponse.headers.get('header-name')`.
Loading