-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Clean up cloud provider-related identifiers in the backend code #9928
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
Clean up cloud provider-related identifiers in the backend code #9928
Conversation
Currently, the naming pattern is inconsistent and sometimes doesn't match the official name of the external service. This patch renames such identifiers, starting from the following official names: * Amazon S3 (ref: <https://aws.amazon.com/s3/>). * Azure Blob Storage (ref: <https://azure.microsoft.com/en-us/products/storage/blobs>). * Google Cloud Storage (ref: <https://cloud.google.com/storage?hl=en>). I guess technically they just call it "Cloud Storage", but it would be ambiguous without Google. Specifically, I renamed the members of `CloudProviderChoice`, and the names of the `_CloudStorage` subclasses. I didn't change the _values_ of `CloudProviderChoice`, because this would be a breaking API change, and I don't think that's worth doing. In addition, I: * Removed the `GOOGLE_DRIVE` member, which has no implementation. * Used `TextChoices` to give each member a human-readable description.
e9f869d to
fcc1989
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #9928 +/- ##
===========================================
+ Coverage 75.35% 82.33% +6.97%
===========================================
Files 427 483 +56
Lines 46353 49417 +3064
Branches 4131 4132 +1
===========================================
+ Hits 34931 40686 +5755
+ Misses 11422 8731 -2691
🚀 New features to boost your workflow:
|
cvat/apps/engine/cloud_provider.py
Outdated
|
|
||
|
|
||
| class AzureBlobContainer(_CloudStorage): | ||
| class AbsCloudStorage(_CloudStorage): |
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.
I'm not sure Abs can be considered the established abbreviation for this service. Have you seen it anywhere? I'd prefer calling it Azure....
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.
I'm not sure Abs can be considered the established abbreviation for this service. Have you seen it anywhere?
It's admittedly not hugely prominent, but examples exist.
I'd prefer calling it
Azure....
IMO, just "Azure" is not specific enough. Would "AzureBlobCloudStorage" work for you?
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.
Yes, I'd prefer AzureBlobCloudStorage instead.
I also think it would be right to rename all *CloudStorage classes to something like *Client eventually, because it better reflects the purpose of these classes and allows to avoid stuff like storage = db_storage_to_storage_instance(db_storage) in several places in the code.
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.
Yes, I'd prefer
AzureBlobCloudStorageinstead.
Okay, I did it.
I also think it would be right to rename all
*CloudStorageclasses to something like*Clienteventually, because it better reflects the purpose of these classes and allows to avoid stuff likestorage = db_storage_to_storage_instance(db_storage)in several places in the code.
Yeah, I agree. I even thought about doing that in this PR, but I figured I should do one thing at a time, or I'd never finish. 🙂
|
Motivation and context
Currently, the naming pattern is inconsistent and sometimes doesn't match the official name of the external service. This patch renames such identifiers, starting from the following official names:
Amazon S3 (ref: https://aws.amazon.com/s3/).
Azure Blob Storage (ref: https://azure.microsoft.com/en-us/products/storage/blobs).
Google Cloud Storage (ref: https://cloud.google.com/storage?hl=en). I guess technically they just call it "Cloud Storage", but it would be ambiguous without Google.
Specifically, I renamed the members of
CloudProviderChoice, and the names of the_CloudStoragesubclasses.I didn't change the values of
CloudProviderChoice, because this would be a breaking API change, and I don't think that's worth doing.In addition, I:
GOOGLE_DRIVEmember, which has no implementation.TextChoicesto give each member a human-readable description.How has this been tested?
Checklist
developbranch[ ] I have updated the documentation accordingly[ ] I have added tests to cover my changes[ ] I have linked related issues (see GitHub docs)License
Feel free to contact the maintainers if that's a concern.