From a876d1c929edf0b7d61645b3354fd643b4729ffc Mon Sep 17 00:00:00 2001 From: Juan Fiorenzano Date: Thu, 10 Jul 2025 13:30:44 -0700 Subject: [PATCH] Removed RustCLI experiments --- .../Configs/RustCliDetectorExperiment.cs | 35 ------------------- .../Configs/RustSbomVsCliExperiment.cs | 22 ------------ .../Configs/RustSbomVsCrateExperiment.cs | 22 ------------ .../Extensions/ServiceCollectionExtensions.cs | 3 -- 4 files changed, 82 deletions(-) delete mode 100644 src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustCliDetectorExperiment.cs delete mode 100644 src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustSbomVsCliExperiment.cs delete mode 100644 src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustSbomVsCrateExperiment.cs diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustCliDetectorExperiment.cs b/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustCliDetectorExperiment.cs deleted file mode 100644 index 3ec089917..000000000 --- a/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustCliDetectorExperiment.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace Microsoft.ComponentDetection.Orchestrator.Experiments.Configs; - -using System.Threading.Tasks; -using Microsoft.ComponentDetection.Contracts; -using Microsoft.ComponentDetection.Detectors.Rust; - -/// -/// Validating the Rust CLI detector against the Rust crate detector. -/// -public class RustCliDetectorExperiment : IExperimentConfiguration -{ - private readonly ICommandLineInvocationService commandLineInvocationService; - private bool cargoCliAvailable; - - /// - /// Initializes a new instance of the class. - /// - /// The command line invocation service. - public RustCliDetectorExperiment(ICommandLineInvocationService commandLineInvocationService) => this.commandLineInvocationService = commandLineInvocationService; - - /// - public string Name => "RustCliDetector"; - - /// - public bool IsInControlGroup(IComponentDetector componentDetector) => componentDetector is RustCrateDetector; - - /// - public bool IsInExperimentGroup(IComponentDetector componentDetector) => componentDetector is RustCliDetector; - - /// - public bool ShouldRecord(IComponentDetector componentDetector, int numComponents) => this.cargoCliAvailable; - - /// - public async Task InitAsync() => this.cargoCliAvailable = await this.commandLineInvocationService.CanCommandBeLocatedAsync("cargo", null); -} diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustSbomVsCliExperiment.cs b/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustSbomVsCliExperiment.cs deleted file mode 100644 index 08ebb1b35..000000000 --- a/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustSbomVsCliExperiment.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Microsoft.ComponentDetection.Orchestrator.Experiments.Configs; - -using Microsoft.ComponentDetection.Contracts; -using Microsoft.ComponentDetection.Detectors.Rust; - -/// -/// Validating the Rust SBOM detector against the Rust CLI detector. -/// -public class RustSbomVsCliExperiment : IExperimentConfiguration -{ - /// - public string Name => "RustSbomVsCliExperiment"; - - /// - public bool IsInControlGroup(IComponentDetector componentDetector) => componentDetector is RustCliDetector; - - /// - public bool IsInExperimentGroup(IComponentDetector componentDetector) => componentDetector is RustSbomDetector; - - /// - public bool ShouldRecord(IComponentDetector componentDetector, int numComponents) => true; -} diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustSbomVsCrateExperiment.cs b/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustSbomVsCrateExperiment.cs deleted file mode 100644 index 4801ff2f7..000000000 --- a/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/RustSbomVsCrateExperiment.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Microsoft.ComponentDetection.Orchestrator.Experiments.Configs; - -using Microsoft.ComponentDetection.Contracts; -using Microsoft.ComponentDetection.Detectors.Rust; - -/// -/// Validating the Rust SBOM detector against the Rust crate detector. -/// -public class RustSbomVsCrateExperiment : IExperimentConfiguration -{ - /// - public string Name => "RustSbomVsCrateExperiment"; - - /// - public bool IsInControlGroup(IComponentDetector componentDetector) => componentDetector is RustCrateDetector; - - /// - public bool IsInExperimentGroup(IComponentDetector componentDetector) => componentDetector is RustSbomDetector; - - /// - public bool ShouldRecord(IComponentDetector componentDetector, int numComponents) => true; -} diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Extensions/ServiceCollectionExtensions.cs b/src/Microsoft.ComponentDetection.Orchestrator/Extensions/ServiceCollectionExtensions.cs index 8b61b57db..35332ea62 100644 --- a/src/Microsoft.ComponentDetection.Orchestrator/Extensions/ServiceCollectionExtensions.cs +++ b/src/Microsoft.ComponentDetection.Orchestrator/Extensions/ServiceCollectionExtensions.cs @@ -65,9 +65,6 @@ public static IServiceCollection AddComponentDetection(this IServiceCollection s services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); services.AddSingleton(); // Detectors