-
Notifications
You must be signed in to change notification settings - Fork 872
Populate TransferUtilityDownloadDirectoryResponse with total objects downloaded #4109
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
base: feature/transfermanager
Are you sure you want to change the base?
Conversation
…downloaded stack-info: PR: #4109, branch: GarrettBeatty/stacked/14
8b602c7 to
fe575d5
Compare
…downloaded stack-info: PR: #4109, branch: GarrettBeatty/stacked/14
fe575d5 to
ca38dab
Compare
| var command = new DownloadCommand(this._s3Client, downloadRequest); | ||
|
|
||
| var task = ExecuteCommandAsync(command, internalCts, asyncThrottler); | ||
| var task = ExecuteCommandAsync(command, internalCts, asyncThrottler) |
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.
what im trying to do here is simply "increment value" when task completes
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 adds functionality to track and report the number of successfully downloaded objects in the TransferUtilityDownloadDirectoryResponse. The implementation populates the ObjectsDownloaded property by counting completed download tasks using thread-safe increment operations.
Key changes:
- Added
ObjectsDownloadedproperty toTransferUtilityDownloadDirectoryResponse - Modified
DownloadDirectoryCommand.ExecuteAsyncto track successful downloads using a thread-safe counter - Added dev config for S3 service with patch version bump
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sdk/src/Services/S3/Custom/Transfer/TransferUtilityDownloadDirectoryResponse.cs | Added ObjectsDownloaded property to track the number of successfully downloaded objects |
| sdk/src/Services/S3/Custom/Transfer/Internal/_bcl+netstandard/DownloadDirectoryCommand.cs | Implemented counter for successful downloads using task continuations and thread-safe increment |
| generator/.DevConfigs/c49077d9-90b3-437f-b316-6d8d8833ae73.json | Added dev config specifying this as a patch version change for S3 service |
| /// <summary> | ||
| /// The number of objects that have been downloaded | ||
| /// </summary> | ||
| public long ObjectsDownloaded { get; set; } |
Copilot
AI
Nov 6, 2025
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.
The ObjectsDownloaded property is not accessible to API consumers because the public DownloadDirectoryAsync and DownloadDirectory methods do not return the response object. The internal command returns TransferUtilityDownloadDirectoryResponse, but the public API methods have return type Task (async) or void (sync), discarding the response.
To make this property useful, the public API signatures should be updated to return Task<TransferUtilityDownloadDirectoryResponse> and TransferUtilityDownloadDirectoryResponse respectively. If this is planned for a future change, consider documenting this as work-in-progress. If the API signature cannot be changed due to backward compatibility, consider an alternative mechanism to expose this information.
| "services": [ | ||
| { | ||
| "serviceName": "S3", | ||
| "type": "patch", |
Copilot
AI
Nov 6, 2025
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.
The dev config specifies this as a "patch" change, but this introduces a new public property (ObjectsDownloaded) on TransferUtilityDownloadDirectoryResponse, which is a new feature. According to CONTRIBUTING.md guidelines, new features should be marked as "minor" rather than "patch".
Additionally, if the public API signatures are updated to return the response object (which would be necessary to make this property accessible), that would also constitute a minor version change as it's a backward-compatible API enhancement.
|
|
||
| SemaphoreSlim asyncThrottler = null; | ||
| CancellationTokenSource internalCts = null; | ||
| int successfulDownloads = 0; |
Copilot
AI
Nov 6, 2025
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.
The type of successfulDownloads should be long to match the ObjectsDownloaded property type. While implicit conversion from int to long works, using consistent types improves code clarity and prevents potential overflow issues if the number of downloads exceeds int.MaxValue.
| int successfulDownloads = 0; | |
| long successfulDownloads = 0; |
…downloaded stack-info: PR: #4109, branch: GarrettBeatty/stacked/14
ca38dab to
a7612ae
Compare
…downloaded stack-info: PR: #4109, branch: GarrettBeatty/stacked/14
a7612ae to
3399d67
Compare
…downloaded stack-info: PR: #4109, branch: GarrettBeatty/stacked/14
3399d67 to
3c74513
Compare
Stacked PRs:
Description
Create TransferUtililityDownloadResponse class which is populated with the number of successful downloads.
Motivation and Context
Testing
Types of changes
Checklist
License