Skip to content

Conversation

@KodaiD
Copy link
Contributor

@KodaiD KodaiD commented Nov 18, 2025

Description

This PR adds Cloud Storage support to the Object Storage adapter.

Related issues and/or PRs

Changes made

  • Added an ObjectStorageWrapper implementation for Cloud Storage.
  • Added unit tests.
  • Added a GitHub workflow for integration tests.

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

Release notes

Added Google Cloud Storage adapter.

@KodaiD KodaiD self-assigned this Nov 18, 2025
@KodaiD KodaiD added the enhancement New feature or request label Nov 18, 2025
@gemini-code-assist
Copy link
Contributor

It looks like you might be trying to invoke a command. If you'd like me to perform a code review, please use /gemini review. If you'd like a summary of the pull request, please use /gemini summary. You can also type /gemini help to see a list of all available commands.

@KodaiD
Copy link
Contributor Author

KodaiD commented Nov 18, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for Google Cloud Storage as a backend for the Object Storage adapter. The changes include adding a new CloudStorageWrapper, its configuration, and corresponding unit and integration tests. The implementation is comprehensive and follows the existing patterns for other object storage providers. I've found a few issues, including a potential NullPointerException if credentials aren't provided, incorrect exception handling in batch deletes, a copy-paste error in the CloudStorageProvider, and a minor issue in the build configuration. Overall, this is a great addition, and with these fixes, it will be a robust implementation.

@KodaiD
Copy link
Contributor Author

KodaiD commented Nov 18, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for Google Cloud Storage to the Object Storage adapter, which is a significant and well-executed enhancement. The changes include a new CloudStorageWrapper implementation, its corresponding configuration class, and a service provider. A notable improvement is the refactoring of the ObjectStorageConfig interface, which enhances abstraction and has been consistently applied to the existing Blob Storage and S3 implementations. Error handling has been improved, particularly in the close() methods of ObjectStorage and ObjectStorageAdmin. The addition of comprehensive unit and integration tests for the new Cloud Storage functionality is commendable. Overall, the pull request is of high quality. I have one suggestion to refine the exception handling in the CloudStorageWrapper constructor for better clarity.

@KodaiD KodaiD marked this pull request as ready for review November 18, 2025 04:29
Copilot AI review requested due to automatic review settings November 18, 2025 04:29
Copilot finished reviewing on behalf of KodaiD November 18, 2025 04:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Google Cloud Storage support as a new object storage adapter for ScalarDB, implementing the ObjectStorageWrapper interface to enable Cloud Storage as a backend storage option alongside existing adapters (S3, Azure Blob Storage).

Key Changes:

  • Implemented CloudStorageWrapper with full CRUD operations using Google Cloud Storage API
  • Added configuration support via CloudStorageConfig using DatabaseConfig properties
  • Extended ObjectStorageWrapper interface to support exceptions in close() method and added documentation for deleteByPrefix atomicity constraints

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
CloudStorageWrapper.java Core implementation of Cloud Storage adapter with get, insert, update, delete operations using Google Cloud Storage client
CloudStorageConfig.java Configuration class mapping DatabaseConfig properties to Cloud Storage settings (project ID, bucket, credentials)
CloudStorageProvider.java Service provider implementation for Cloud Storage adapter discovery
CloudStorageErrorCode.java Enum defining Cloud Storage HTTP error codes for error handling
CloudStorageWrapperTest.java Comprehensive unit tests for CloudStorageWrapper operations
CloudStorageConfigTest.java Unit tests for configuration validation and property loading
ObjectStorageWrapper.java Updated interface with close() exception handling and deleteByPrefix documentation
ObjectStorageWrapperException.java Added constructor accepting message-only for improved exception handling
PreconditionFailedException.java Added constructor accepting message-only for simpler exception creation
ObjectStorageConfig.java Removed getUsername() method from interface (moved to implementation classes)
S3Config.java Moved getUsername() from interface override to implementation-specific method
BlobStorageConfig.java Moved getUsername() from interface override to implementation-specific method
ObjectStorageWrapperFactory.java Added factory support for CloudStorageWrapper instantiation
ObjectStorageUtils.java Added utility support for CloudStorageConfig creation
ObjectStorage.java Updated close() to handle ObjectStorageWrapperException with logging
ObjectStorageAdmin.java Updated close() to handle ObjectStorageWrapperException with logging
ObjectStorageWrapperIntegrationTest.java Added Cloud Storage support and test data adjustments for numeric version strings
ObjectStorageWrapperLargeObjectWriteIntegrationTest.java Added Cloud Storage parallel upload configuration and test data size adjustment
ObjectStorageEnv.java Added isCloudStorage() helper for test environment detection
core/build.gradle Added google-cloud-storage dependency and formatting improvements
build.gradle Added googleCloudStorageVersion property (2.60.0)
.github/workflows/object-storage-adapter-check.yaml Added Cloud Storage integration test workflow and fixed S3 artifact naming
META-INF/services/com.scalar.db.api.DistributedStorageProvider Registered CloudStorageProvider for service discovery

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@KodaiD KodaiD requested review from a team, Torch3333, brfrn169, feeblefakie and komamitsu and removed request for a team November 18, 2025 06:12
Copy link
Contributor

@Torch3333 Torch3333 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!
I just left non-blocking comments.

@brfrn169 brfrn169 requested a review from josh-wong November 19, 2025 05:11
@KodaiD KodaiD requested a review from komamitsu November 19, 2025 05:29
Copy link
Collaborator

@brfrn169 brfrn169 left a comment

Choose a reason for hiding this comment

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

Left a minor comment. Other than that, LGTM! Thank you!

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

Copy link
Member

@josh-wong josh-wong left a comment

Choose a reason for hiding this comment

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

I left a minor suggestion and a comment (the comment isn't a blocker). Other than that, LGTM. Thank you!🙇🏻‍♂️

@KodaiD KodaiD enabled auto-merge (squash) November 19, 2025 10:19
@KodaiD KodaiD merged commit 4110cdb into master Nov 19, 2025
67 of 72 checks passed
@KodaiD KodaiD deleted the add-gcs-support branch November 19, 2025 10:22
feeblefakie pushed a commit that referenced this pull request Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants