chore: Clean up redundant code and align model signatures#417
Merged
Conversation
- Delete empty GeneralUpdate.ClientCore directory (bin/obj artifacts only) - DownloadResult.Url replaced with DownloadResult.Asset (full DownloadAsset) - IDownloadExecutor.ExecuteAsync now accepts DownloadAsset instead of string url Closes #411
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the download refactor/cleanup from #411 by removing stale artifacts and aligning the download pipeline to pass richer DownloadAsset metadata through executor/orchestrator boundaries.
Changes:
- Removed the leftover
src/c#/GeneralUpdate.ClientCore/directory (build artifacts only). - Updated
IDownloadExecutor.ExecuteAsyncto accept aDownloadAssetinstead of a URL string, and updated executors/orchestrator call sites accordingly. - Updated
DownloadResultto carry the fullDownloadAssetinstead of just a URL.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/c#/GeneralUpdate.Core/Download/Orchestrators/DefaultDownloadOrchestrator.cs | Passes DownloadAsset into the executor and updates failure reporting to reference Asset.Url. |
| src/c#/GeneralUpdate.Core/Download/Models/DownloadProgress.cs | Updates DownloadResult to include DownloadAsset instead of Url. |
| src/c#/GeneralUpdate.Core/Download/Executors/OssDownloadExecutor.cs | Aligns executor signature to accept DownloadAsset and returns DownloadResult(asset, ...). |
| src/c#/GeneralUpdate.Core/Download/Executors/HttpDownloadExecutor.cs | Aligns executor signature to accept DownloadAsset and returns DownloadResult(asset, ...). |
| src/c#/GeneralUpdate.Core/Download/Abstractions/IDownloadExecutor.cs | Changes interface contract to accept DownloadAsset instead of URL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
124
to
+125
| var failedDetails = results.Where(r => !r.Success) | ||
| .Select(r => ((object)r.Url, r.ErrorMessage ?? "failed")).ToList(); | ||
| .Select(r => ((object)r.Asset.Url, r.ErrorMessage ?? "failed")).ToList(); |
Comment on lines
17
to
20
| public record DownloadResult( | ||
| string? Url, | ||
| DownloadAsset Asset, | ||
| string? LocalPath, | ||
| long DownloadedBytes, |
Comment on lines
79
to
83
| catch (Exception ex) when (ex is not OperationCanceledException) | ||
| { | ||
| sw.Stop(); | ||
| return new DownloadResult(url, null, existingBytes, sw.Elapsed, retries, false, ex.Message); | ||
| return new DownloadResult(asset, null, existingBytes, sw.Elapsed, retries, false, ex.Message); | ||
| } |
Comment on lines
42
to
46
| catch (Exception ex) when (ex is not OperationCanceledException) | ||
| { | ||
| sw.Stop(); | ||
| return new DownloadResult(url, null, 0, sw.Elapsed, 0, false, ex.Message); | ||
| return new DownloadResult(asset, null, 0, sw.Elapsed, 0, false, ex.Message); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #411