From 720c2c60bb4af38035a28383205e5d7746e3835b Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 29 Oct 2025 03:49:08 +0000
Subject: [PATCH 1/2] Update spectre-console monorepo to 0.53.0
---
Directory.Packages.props | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Directory.Packages.props b/Directory.Packages.props
index b5ac1e414..a922a1462 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -38,10 +38,10 @@
-
-
+
+
-
+
From 2d63c5a096ac27ff9429ef6c3d80c14812255af6 Mon Sep 17 00:00:00 2001
From: Jamie Magee
Date: Tue, 28 Oct 2025 21:51:56 -0700
Subject: [PATCH 2/2] Use new Spectre.Console Execute override with
CancellationToken support
---
.../Commands/ListDetectorsCommand.cs | 6 +++++-
.../Commands/ScanCommand.cs | 6 +++++-
.../Commands/ListDetectorCommandTests.cs | 3 ++-
.../Commands/ScanCommandTests.cs | 7 ++++---
4 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Commands/ListDetectorsCommand.cs b/src/Microsoft.ComponentDetection.Orchestrator/Commands/ListDetectorsCommand.cs
index c2b24e730..2704e4e28 100644
--- a/src/Microsoft.ComponentDetection.Orchestrator/Commands/ListDetectorsCommand.cs
+++ b/src/Microsoft.ComponentDetection.Orchestrator/Commands/ListDetectorsCommand.cs
@@ -1,6 +1,7 @@
namespace Microsoft.ComponentDetection.Orchestrator.Commands;
using System.Collections.Generic;
+using System.Threading;
using Microsoft.ComponentDetection.Contracts;
using Spectre.Console;
using Spectre.Console.Cli;
@@ -27,7 +28,10 @@ public ListDetectorsCommand(
}
///
- public override int Execute(CommandContext context, ListDetectorsSettings settings)
+ public override int Execute(
+ CommandContext context,
+ ListDetectorsSettings settings,
+ CancellationToken cancellationToken)
{
var table = new Table();
table.AddColumn("Name");
diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Commands/ScanCommand.cs b/src/Microsoft.ComponentDetection.Orchestrator/Commands/ScanCommand.cs
index e2d7d39e0..de4a28048 100644
--- a/src/Microsoft.ComponentDetection.Orchestrator/Commands/ScanCommand.cs
+++ b/src/Microsoft.ComponentDetection.Orchestrator/Commands/ScanCommand.cs
@@ -2,6 +2,7 @@ namespace Microsoft.ComponentDetection.Orchestrator.Commands;
using System;
using System.IO;
+using System.Threading;
using System.Threading.Tasks;
using Microsoft.ComponentDetection.Common;
using Microsoft.ComponentDetection.Contracts.BcdeModels;
@@ -37,7 +38,10 @@ public ScanCommand(
}
///
- public override async Task ExecuteAsync(CommandContext context, ScanSettings settings)
+ public override async Task ExecuteAsync(
+ CommandContext context,
+ ScanSettings settings,
+ CancellationToken cancellationToken)
{
this.fileWritingService.Init(settings.Output);
var result = await this.scanExecutionService.ExecuteScanAsync(settings);
diff --git a/test/Microsoft.ComponentDetection.Orchestrator.Tests/Commands/ListDetectorCommandTests.cs b/test/Microsoft.ComponentDetection.Orchestrator.Tests/Commands/ListDetectorCommandTests.cs
index 3a0749062..1855e7dea 100644
--- a/test/Microsoft.ComponentDetection.Orchestrator.Tests/Commands/ListDetectorCommandTests.cs
+++ b/test/Microsoft.ComponentDetection.Orchestrator.Tests/Commands/ListDetectorCommandTests.cs
@@ -2,6 +2,7 @@ namespace Microsoft.ComponentDetection.Orchestrator.Tests.Commands;
using System.Collections.Generic;
using System.Linq;
+using System.Threading;
using FluentAssertions;
using Microsoft.ComponentDetection.Contracts;
using Microsoft.ComponentDetection.Orchestrator.Commands;
@@ -29,7 +30,7 @@ public void ListDetectorCommands_ExecutesListDetectors()
var command = new ListDetectorsCommand(mockDetectors, console);
- var result = command.Execute(null, new ListDetectorsSettings());
+ var result = command.Execute(null, new ListDetectorsSettings(), CancellationToken.None);
result.Should().Be(0);
console.Output.Should().ContainAll(fakeIds);
diff --git a/test/Microsoft.ComponentDetection.Orchestrator.Tests/Commands/ScanCommandTests.cs b/test/Microsoft.ComponentDetection.Orchestrator.Tests/Commands/ScanCommandTests.cs
index c2c8f7154..ca96692ef 100644
--- a/test/Microsoft.ComponentDetection.Orchestrator.Tests/Commands/ScanCommandTests.cs
+++ b/test/Microsoft.ComponentDetection.Orchestrator.Tests/Commands/ScanCommandTests.cs
@@ -2,6 +2,7 @@ namespace Microsoft.ComponentDetection.Orchestrator.Tests.Commands;
using System;
using System.IO;
+using System.Threading;
using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.ComponentDetection.Common;
@@ -40,7 +41,7 @@ public async Task ScanCommand_ExecutesScanAndWritesManifestAsync()
{
var settings = new ScanSettings { Output = "output" };
- var result = await this.command.ExecuteAsync(null, settings);
+ var result = await this.command.ExecuteAsync(null, settings, CancellationToken.None);
this.fileWritingServiceMock.Verify(x => x.Init(settings.Output), Times.Once);
this.scanExecutionServiceMock.Verify(x => x.ExecuteScanAsync(settings), Times.Once);
@@ -54,7 +55,7 @@ public async Task ScanCommand_ExecutesScanAndWritesUserManifestAsync()
{
var settings = new ScanSettings { Output = "output", ManifestFile = new FileInfo("manifest.json") };
- var result = await this.command.ExecuteAsync(null, settings);
+ var result = await this.command.ExecuteAsync(null, settings, CancellationToken.None);
this.fileWritingServiceMock.Verify(x => x.Init(settings.Output), Times.Once);
this.scanExecutionServiceMock.Verify(x => x.ExecuteScanAsync(settings), Times.Once);
@@ -71,7 +72,7 @@ public async Task ScanCommand_ExecutesScanAndPrintsManifestAsync()
await using var tw = new StreamWriter(ms);
Console.SetOut(tw);
- var result = await this.command.ExecuteAsync(null, settings);
+ var result = await this.command.ExecuteAsync(null, settings, CancellationToken.None);
this.fileWritingServiceMock.Verify(x => x.Init(settings.Output), Times.Once);
this.scanExecutionServiceMock.Verify(x => x.ExecuteScanAsync(settings), Times.Once);