-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Fixed ShareClient.GetStatistics() bug #9438
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
Fixed ShareClient.GetStatistics() bug #9438
Conversation
| /// The approximate size of the data stored in bytes, rounded up to the nearest gigabyte. Note that this value may not include all recently created or recently resized files. | ||
| /// </summary> | ||
| public int ShareUsageBytes { get; internal set; } | ||
| public long ShareUsageInBytes { get; internal set; } |
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.
One example of this situation from BCL is Array.Length vs Array.LongLength, I'm not sure that we should use the same naming pattern but just FYI.
| /// <summary> | ||
| /// Warning: Share usage may exceed int.MaxValue. Use ShareUsageInBytes instead. | ||
| /// </summary> | ||
| public int ShareUsageBytes { |
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.
Nit - use [EditorBrowsable(Never)] here so folks don't even see this in intellisense.
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.
fixed.
| if (ShareUsageInBytes > int.MaxValue) | ||
| { | ||
| #pragma warning disable CA1065 // Do not raise exceptions in unexpected locations | ||
| throw new OverflowException("ShareUsageInBytes exceeds int.MaxValue. Use ShareUsageInBytes instead."); |
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.
Change to "ShareUsageBytes exceeds int.MaxValue. Use ShareUsageInBytes instead." and move to Constants
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.
fixed.
| /// <summary> | ||
| /// Creates a new PermissionInfo instance for mocking. | ||
| /// </summary> | ||
| public static ShareStatistics ShareStatistics(int shareUsageBytes) |
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.
Nit - use [EditorBrowsable(Never)] here so folks don't even see this in intellisense.
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.
fixed.
| { | ||
| Transport = new MockTransport(mockResponse) | ||
| }; | ||
| ShareClient shareClient = new ShareClient(new Uri(TestConfigDefault.FileServiceEndpoint), shareClientOption); |
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.
This still needs to be instrumented for the sync/async to work correctly.
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.
fixed.
|
/azp run net - storage -ci |
|
No pipelines are associated with this pull request. |
|
Nice job team. I’m very grateful to have experienced this process. #PleaseHireMeMicrosoft 🤣 👏🙏 |
Resolves #9186