feat(mono):add base_storage to handle common logic#1212
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a BaseStorage and StorageConnector trait to centralize common database logic, refactors all existing storage modules to embed BaseStorage via Deref, and updates dependent code in both Jupiter and Ceres to use the new batch_save_model API.
- Add
BaseStorage/StorageConnectorwithbatch_save_modelimplementation. - Refactor each
*Storagestruct to hold aBaseStorageand implementDeref. - Update consumers (tests, LFS init, Ceres import and API service) to use the trait-based batch API.
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| mercury/src/errors.rs | Add conversion from MegaError to GitError |
| jupiter/src/tests.rs | Switch tests to use BaseStorage; commented out old instantiation |
| jupiter/src/storage/base_storage.rs | Introduce BaseStorage and StorageConnector with batch logic |
| jupiter/src/storage/* | Refactor all storage modules to embed BaseStorage and implement Deref |
| jupiter/src/storage/mod.rs | Update Service/Storage to build from BaseStorage |
| jupiter/src/lfs_storage/mod.rs | Change LFS init signature to accept raw DatabaseConnection |
| jupiter/src/lfs_storage/local_storage.rs | Update LocalStorage to construct LfsDbStorage from BaseStorage |
| ceres/src/pack/import_repo.rs | Replace free-function batch_save_model calls with trait method |
| ceres/src/api_service/mono_api_service.rs | Same update in the Mono API service |
genedna
enabled auto-merge
July 10, 2025 08:27
genedna
approved these changes
Jul 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.