-
Notifications
You must be signed in to change notification settings - Fork 44
Aggregator: Re-implement the CloudBackendUploader with gcloud-storage crate #2475
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
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.
Pull Request Overview
This PR re-implements the Google Cloud Storage uploader to use the actively maintained gcloud-storage crate, replacing the legacy cloud-storage implementation. Key changes include renaming and reorganizing modules within the gcp_uploader directory, adapting asynchronous build functions in dependency injection, and updating the Cargo.toml dependency.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/file_uploaders/mod.rs | Renamed import from GcpBackendUploader to GCloudBackendUploader to reflect the new implementation. |
src/file_uploaders/gcp_uploader/mod.rs | Organized the gcp_uploader module into separate sub-modules. |
src/file_uploaders/gcp_uploader/interface.rs | Introduced the CloudRemotePath type and the CloudBackendUploader trait with tests for URI generation. |
src/file_uploaders/gcp_uploader/gcloud_backend.rs | Implemented the new GCloudBackendUploader using the gcloud-storage client with async operations and error contexts. |
src/file_uploaders/gcp_uploader/api.rs | Provided the GcpUploader interactor that wraps the new uploader and added comprehensive tests. |
src/dependency_injection/builder/protocol/artifacts.rs | Updated async build functions to create instances of GCloudBackendUploader and adjusted related uploader builders. |
Cargo.toml | Removed the deprecated cloud-storage dependency and added gcloud-storage. |
Test Results 3 files ±0 57 suites ±0 11m 35s ⏱️ +3s Results for commit 3c9f808. ± Comparison against base commit 9df5a56. This pull request removes 9 and adds 9 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
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.
LGTM 👍
mithril-aggregator/src/file_uploaders/gcp_uploader/gcloud_backend.rs
Outdated
Show resolved
Hide resolved
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.
LGTM 🚀
bf257e4
to
e78e57c
Compare
* promoted to a directory * splited into several part in order to isolate the old backend since it will be removed soon
…o `CloudRemotePath` * Renamed to `to_gcloud_storage_location` * This allow easy reuse of this code with the new backend
e78e57c
to
0972218
Compare
As its components are not tied to GCP but only the backend.
* mithril-aggregator from `0.7.47` to `0.7.48`
0972218
to
3c9f808
Compare
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.
LGTM
Content
This PR re-implement the GCP Storage
CloudBackendUploader
usinggcloud-storage
, replacing the previous implementation that was usingcloud-storage
.cloud-storage
have not seen any update in three years and, since it make external requests, can pose security risks. The newgcloud-storage
is more "bare metal" but is actively maintained.Changes
gcp_uploader
module:cloud_uploader
as it's the backend that ties to a specific providerget_location
from the legacy uploader to theCloudRemotePath
(renamed toto_gcloud_storage_location
) since we need to reuse it in the new uploaderGcpBackendUploaderLegacy
then delete it and remove thecloud-storage
dependencyCloudBackendUploader
usinggcloud-storage
: it should be functionally equivalent (I made extra care to ensure the same api paths are called with the same parameters), but since there's no easy way to unit test it we will have to do it directly ontesting-preview
Pre-submit checklist
Comments
If the new implementation crash on
testing-preview
and can't be easily fixed, revert the commit namedchore(aggregator): remove legacy gcp storage uploader backend
and rewire theGcpBackendUploaderLegacy
in dependency injection.Issue(s)
Relates to #2460