Skip to content

feat: add preview MultipartUploadClient#listParts - #3359

Closed
ShreyasSinha wants to merge 38 commits into
staged-mpu-merge-trainfrom
mpu-feature-3
Closed

feat: add preview MultipartUploadClient#listParts#3359
ShreyasSinha wants to merge 38 commits into
staged-mpu-merge-trainfrom
mpu-feature-3

Conversation

@ShreyasSinha

Copy link
Copy Markdown
Collaborator
  1. Adding model classes for List request and response.
  2. Implemented List for Multipart Upload.

Refer: #3348

@product-auto-labelproduct-auto-labelBot added size: l Pull request size is large. api: storage Issues related to the googleapis/java-storage API. labels Oct 22, 2025
@ShreyasSinha
ShreyasSinha marked this pull request as ready for review October 22, 2025 18:32
@ShreyasSinha
ShreyasSinha requested a review from a teamOctober 22, 2025 18:32
@ShreyasSinha
ShreyasSinha requested a review from a teamOctober 22, 2025 20:01
@product-auto-labelproduct-auto-labelBot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Oct 26, 2025
Comment on lines +115 to +119
@JsonCreator
public static StorageClass valueOf(String constant) {
if (constant == null || constant.isEmpty()) {
return null;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why is this necessary?

If I remove it and run the following test, the test passes:

privatestaticfinalclassTestXmlObject2 {
@JacksonXmlProperty(localName = "storageClass")
privateStorageClassstorageClass;
}
@TestpublicvoidtestParseStringValueEnum() throwsIOException {
//language=xmlStringxml = "<TestXmlObject2>\n"
+ " <storageClass>STANDARD</storageClass>"
+ "</TestXmlObject2>";
InputStreamin = newByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8));
TestXmlObject2expected = newTestXmlObject2(StorageClass.STANDARD);
TestXmlObject2actual =
xmlObjectParser.parseAndClose(in, StandardCharsets.UTF_8, TestXmlObject2.class);
assertThat(actual).isEqualTo(expected);
}

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

This is required incase we have a null string. Try to run test https://paste.googleplex.com/5523315682836480 after removing it. You'll get https://paste.googleplex.com/5523315682836480 failure.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Okay, but that is a deserialization issue not an enum resolution issue.

Enums can't have null values, and changing this method breaks that contract.
The exception explicitly states this fact:

Caused by: java.lang.IllegalArgumentException: Empty enum constants not allowed.
at com.google.cloud.StringEnumType.valueOf(StringEnumType.java:66)
at com.google.cloud.storage.StorageClass.valueOf(StorageClass.java:116)

Here is a PR that makes enum parsing work for xml without modifying any behavior or adding additional annotations: #3377

@BenWhitehead

Copy link
Copy Markdown
Collaborator

I'll spend some time tomorrow figuring out the dependencies failing build.

@BenWhitehead

Copy link
Copy Markdown
Collaborator

Applying the following patch to this branch should fix the failing dependency check

Index: google-cloud-storage/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================diff --git a/google-cloud-storage/pom.xml b/google-cloud-storage/pom.xml--- a/google-cloud-storage/pom.xml	(revision c7549b10d56e40c5576a6a7f471d7cd6f8bba397)+++ b/google-cloud-storage/pom.xml	(date 1761754153688)@@ -28,6 +28,14 @@
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>+ <artifactId>jackson-databind</artifactId>+ </dependency>+ <dependency>+ <groupId>com.fasterxml.jackson.core</groupId>+ <artifactId>jackson-annotations</artifactId>+ </dependency>+ <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

The fix can be verified locally by running mvn dependency:analyze -DfailOnWarning=true

@product-auto-labelproduct-auto-labelBot added size: l Pull request size is large. and removed size: xl Pull request size is extra large. labels Oct 30, 2025
@BenWhiteheadBenWhitehead mentioned this pull request Oct 30, 2025
10 tasks
@BenWhitehead

Copy link
Copy Markdown
Collaborator

Assuming my fixes in #3377 are included in the ultimate merge train, this PR can be considered done.

@BenWhiteheadBenWhitehead left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ready for merge train

Base automatically changed from mpu-feature-2 to staged-mpu-merge-trainNovember 3, 2025 21:11
@BenWhiteheadBenWhitehead changed the title feat: Adding API for ListPartsfeat: add MultipartUploadClient#listPartsNov 3, 2025
@BenWhiteheadBenWhitehead changed the title feat: add MultipartUploadClient#listPartsfeat: add preview MultipartUploadClient#listPartsNov 3, 2025
BenWhitehead added a commit that referenced this pull request Nov 3, 2025
BEGIN_NESTED_COMMIT
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#createMultipartUpload #3356
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#listParts #3359
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#abortMultipartUpload #3361
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#uploadPart #3375
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#completeMultipartUpload #3372
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadSettings
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
END_COMMIT_OVERRIDE
END_NESTED_COMMIT
Other changes:
1. chore: refactor retrier creation from HttpStorageOptions to StorageOptions #3350
2. chore: refactorings for CreateMultipartUpload #3364
3. chore: fix xml parsing of StringEnumValue's so that the enum contract is not broken #3377
4. chore: add PredefinedAcl#xmlEntry
Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
BenWhitehead added a commit that referenced this pull request Nov 3, 2025
BEGIN_NESTED_COMMIT
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#createMultipartUpload #3356
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#listParts #3359
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#abortMultipartUpload #3361
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#uploadPart #3375
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#completeMultipartUpload #3372
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadSettings
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
END_COMMIT_OVERRIDE
END_NESTED_COMMIT
Other changes:
1. chore: refactor retrier creation from HttpStorageOptions to StorageOptions #3350
2. chore: refactorings for CreateMultipartUpload #3364
3. chore: fix xml parsing of StringEnumValue's so that the enum contract is not broken #3377
4. chore: add PredefinedAcl#xmlEntry
Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
BenWhitehead added a commit that referenced this pull request Nov 3, 2025
BEGIN_NESTED_COMMIT
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#createMultipartUpload #3356
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#listParts #3359
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#abortMultipartUpload #3361
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#uploadPart #3375
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadClient#completeMultipartUpload #3372
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
feat: add preview MultipartUploadSettings
END_COMMIT_OVERRIDE
BEGIN_COMMIT_OVERRIDE
END_COMMIT_OVERRIDE
END_NESTED_COMMIT
Other changes:
1. chore: refactor retrier creation from HttpStorageOptions to StorageOptions #3350
2. chore: refactorings for CreateMultipartUpload #3364
3. chore: fix xml parsing of StringEnumValue's so that the enum contract is not broken #3377
4. chore: add PredefinedAcl#xmlEntry
Co-authored-by: BenWhitehead <BenWhitehead@users.noreply.github.com>
@BenWhitehead

Copy link
Copy Markdown
Collaborator

merged to main in #3378

@BenWhitehead
BenWhitehead deleted the mpu-feature-3 branch November 3, 2025 23:51
@release-pleaserelease-pleaseBot mentioned this pull request Nov 3, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storageIssues related to the googleapis/java-storage API.size: lPull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ShreyasSinha@BenWhitehead