-
Notifications
You must be signed in to change notification settings - Fork 8
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
Introduce BlobStore & IdStore APIs #1126
Conversation
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.
Hello @vorburger, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request introduces the BlobStore
and IdStore
APIs, along with an initial implementation for IPFS. The BlobStore
interface defines methods for storing and loading blobs of data using CIDs (Content Identifiers). The IdStore
interface defines methods for linking IDs to CIDs. The pull request also includes an IPFS
implementation of the BlobStore
interface, which allows storing and retrieving data from IPFS. Additionally, the pull request includes updates to the BUILD
files and minor refactoring of IPFSResource
and IPFSResourceTest
to align with the new package structure.
Highlights
- API Introduction: Introduces
BlobStore
andIdStore
interfaces for content-addressable storage. - IPFS Implementation: Provides an initial
IPFS
implementation of theBlobStore
interface. - Dependency Injection: Leverages
IPFSResource.Provider
for accessing IPFS resources.
Changelog
Click here to see the changelog
- java/dev/enola/cas/BUILD
- Added a new BUILD file for the
dev.enola.cas
package, defining thecas
java_binary andtests
junit_tests. - Includes dependencies on common Enola libraries, guava, ipld-java-cid, multiformats, jspecify, and slf4j.
- Added a new BUILD file for the
- java/dev/enola/cas/BlobStore.java
- Created a new
BlobStore
interface withstore
andload
methods for content-addressable storage. - The interface uses CIDs (Content Identifiers) for addressing blobs.
- Includes a comment mentioning various potential implementations like local files, Key Value Stores, casync, IPFS, Iroh Network, and consensus-based systems.
- Created a new
- java/dev/enola/cas/IPFS.java
- Created a new
IPFS
class implementing theBlobStore
interface. - The
IPFS
class uses anIPFSResource.Provider
to access IPFS resources. - The
load
method retrieves data from IPFS using the provided CID. - The
store
method is currently implemented withUnsupportedOperationException
.
- Created a new
- java/dev/enola/cas/IPFSResource.java
- Moved
IPFSResource
fromdev.enola.common.io.resource
todev.enola.cas
package. - No functional changes.
- Moved
- java/dev/enola/cas/IPFSResourceTest.java
- Moved
IPFSResourceTest
fromdev.enola.common.io.resource
todev.enola.cas
package. - Added imports for
OkHttpResource
,ReadableResource
, andResourceProvider
fromdev.enola.common.io.resource
.
- Moved
- java/dev/enola/cas/IdStore.java
- Created a new
IdStore
interface withlink
andget
methods for linking IDs to CIDs. - The interface uses
ByteSeq
for IDs and CIDs for content addresses.
- Created a new
- java/dev/enola/cas/package-info.java
- Created a new
package-info.java
file for thedev.enola.cas
package. - Includes a description of CAS (Content-addressable storage) and the
@NullMarked
annotation.
- Created a new
- java/dev/enola/cli/BUILD
- Added
//java/dev/enola/cas
as a dependency to thecli
java_binary.
- Added
- java/dev/enola/cli/CommandWithResourceProvider.java
- Added import for
dev.enola.cas.IPFSResource
.
- Added import for
- java/dev/enola/common/io/hashbrown/Multihashes.java
- Added a TODO comment to support blake3 hashing algorithm, referencing issue Blake3 #1125.
- Added a TODO comment regarding murmur3-x64-64, with a warning about a potential issue in Guava.
- java/dev/enola/common/io/resource/ResourceProvider.java
- Updated TODO comments regarding ResourceProvider interface.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Trivia time!
What does IPFS stand for?
Click here for the answer
InterPlanetary File System
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request introduces the BlobStore
and IdStore
APIs, providing an abstraction for content-addressable storage. The code includes interfaces for storing and retrieving blobs and linking IDs to CIDs, along with an IPFS implementation of the BlobStore
interface. Overall, the changes seem well-structured and introduce useful abstractions. However, there are a few areas that could be improved.
Summary of Findings
Merge Readiness
The pull request introduces important new abstractions for content-addressable storage. While the code appears to be well-structured, the IPFS
implementation of BlobStore
currently only supports loading and not storing. Additionally, the IdStore
interface is introduced but not implemented. Before merging, it would be beneficial to either implement the store
method in IPFS
or provide a clear indication of when it will be implemented. Also, consider providing a basic implementation of IdStore
or clarifying its intended use. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. Given the unimplemented store
method and the lack of an IdStore
implementation, I recommend that the pull request not be merged until these are addressed.
Relates to #777.