-
Notifications
You must be signed in to change notification settings - Fork 113
Pass CancellationToken from commands
#1530
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
Conversation
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 introduces CancellationToken support throughout the Component Detection command pipeline, leveraging new capabilities from Spectre.Console.Cli. The changes also include migration to primary constructors and addition of XML documentation for better code clarity.
Key changes:
- Added
CancellationTokenparameters toIScanExecutionService.ExecuteScanAsyncandIDetectorProcessingService.ProcessDetectorsAsyncinterfaces - Updated
ScanCommandto pass cancellation tokens through the execution chain - Migrated
ListDetectorsCommandandListDetectorsSettingsto use primary constructors
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
IScanExecutionService.cs |
Added XML documentation and CancellationToken parameter to ExecuteScanAsync method |
ScanExecutionService.cs |
Added CancellationToken parameter to ExecuteScanAsync implementation and XML documentation |
IDetectorProcessingService.cs |
Added XML documentation and CancellationToken parameter to ProcessDetectorsAsync method |
ScanCommand.cs |
Updated to propagate CancellationToken to ExecuteScanAsync calls and added parameter documentation |
ListDetectorsCommand.cs |
Migrated from traditional constructor to primary constructor pattern |
ListDetectorsSettings.cs |
Migrated from class with empty body to primary constructor syntax |
src/Microsoft.ComponentDetection.Orchestrator/Services/IDetectorProcessingService.cs
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Orchestrator/Services/IDetectorProcessingService.cs
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Orchestrator/Services/ScanExecutionService.cs
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Orchestrator/Services/IScanExecutionService.cs
Show resolved
Hide resolved
c582378 to
edadde4
Compare
edadde4 to
9a382ef
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1530 +/- ##
=====================================
Coverage 90.3% 90.3%
=====================================
Files 418 418
Lines 35300 35299 -1
Branches 2188 2188
=====================================
Hits 31877 31877
Misses 2980 2980
+ Partials 443 442 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
One of the new features in
Spectre.Console.Cliwas support for top-levelCancellationTokensupport. This means, that we will be able to pipe cancellation support the entire way through Component Detection. This is a first trial run, passing theCancellationTokenthrough toScanExecutionServiceandDetectorProcessingService.Additionally, I added XML documentation and migrated to primary constructors.