Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Oct 22, 2025

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:

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.

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

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.
@SpecLad SpecLad force-pushed the clean-up-cloud-providers branch from e9f869d to fcc1989 Compare October 22, 2025 12:50
@SpecLad SpecLad marked this pull request as ready for review October 22, 2025 12:50
@SpecLad SpecLad requested a review from nmanovic as a code owner October 22, 2025 12:50
@SpecLad SpecLad requested a review from zhiltsov-max October 22, 2025 12:54
@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.33%. Comparing base (cf9ce57) to head (fa9dc91).
⚠️ Report is 19 commits behind head on develop.

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     
Components Coverage Δ
cvat-ui 77.06% <ø> (+0.33%) ⬆️
cvat-server 86.28% <81.25%> (+12.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.



class AzureBlobContainer(_CloudStorage):
class AbsCloudStorage(_CloudStorage):
Copy link
Contributor

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....

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Okay, I did it.

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.

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. 🙂

@sonarqubecloud
Copy link

@zhiltsov-max zhiltsov-max merged commit d50747b into cvat-ai:develop Oct 29, 2025
40 checks passed
@cvat-bot cvat-bot bot mentioned this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants