From 41918829df7b142d6445a8273e220cd37cb0dd99 Mon Sep 17 00:00:00 2001 From: Paul Dorsch Date: Mon, 5 Aug 2024 09:33:52 -0700 Subject: [PATCH] graduate pipreport --- .../pip/PipComponentDetector.cs | 4 ++-- .../pip/PipReportComponentDetector.cs | 4 ++-- .../Experiments/Configs/PipReportExperiment.cs | 18 ------------------ .../Extensions/ServiceCollectionExtensions.cs | 1 - 4 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/PipReportExperiment.cs diff --git a/src/Microsoft.ComponentDetection.Detectors/pip/PipComponentDetector.cs b/src/Microsoft.ComponentDetection.Detectors/pip/PipComponentDetector.cs index 058fcbb9e..2fe75539b 100644 --- a/src/Microsoft.ComponentDetection.Detectors/pip/PipComponentDetector.cs +++ b/src/Microsoft.ComponentDetection.Detectors/pip/PipComponentDetector.cs @@ -11,7 +11,7 @@ namespace Microsoft.ComponentDetection.Detectors.Pip; using Microsoft.ComponentDetection.Contracts.TypedComponent; using Microsoft.Extensions.Logging; -public class PipComponentDetector : FileComponentDetector +public class PipComponentDetector : FileComponentDetector, IDefaultOffComponentDetector { private readonly IPythonCommandService pythonCommandService; private readonly IPythonResolver pythonResolver; @@ -38,7 +38,7 @@ public PipComponentDetector( public override IEnumerable SupportedComponentTypes { get; } = new[] { ComponentType.Pip }; - public override int Version { get; } = 12; + public override int Version { get; } = 13; protected override async Task> OnPrepareDetectionAsync( IObservable processRequests, diff --git a/src/Microsoft.ComponentDetection.Detectors/pip/PipReportComponentDetector.cs b/src/Microsoft.ComponentDetection.Detectors/pip/PipReportComponentDetector.cs index 07469be89..e7f536d81 100644 --- a/src/Microsoft.ComponentDetection.Detectors/pip/PipReportComponentDetector.cs +++ b/src/Microsoft.ComponentDetection.Detectors/pip/PipReportComponentDetector.cs @@ -16,7 +16,7 @@ namespace Microsoft.ComponentDetection.Detectors.Pip; using Microsoft.Extensions.Logging; using Newtonsoft.Json; -public class PipReportComponentDetector : FileComponentDetector, IExperimentalDetector +public class PipReportComponentDetector : FileComponentDetector { // environment variables private const string PipReportOverrideBehaviorEnvVar = "PipReportOverrideBehavior"; @@ -76,7 +76,7 @@ private enum PipReportOverrideBehavior public override IEnumerable SupportedComponentTypes { get; } = new[] { ComponentType.Pip }; - public override int Version { get; } = 5; + public override int Version { get; } = 6; protected override bool EnableParallelism { get; set; } = true; diff --git a/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/PipReportExperiment.cs b/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/PipReportExperiment.cs deleted file mode 100644 index 27efde329..000000000 --- a/src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs/PipReportExperiment.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Microsoft.ComponentDetection.Orchestrator.Experiments.Configs; - -using Microsoft.ComponentDetection.Contracts; -using Microsoft.ComponentDetection.Detectors.Pip; - -/// -/// Validating the . -/// -public class PipReportExperiment : IExperimentConfiguration -{ - public string Name => "PipReport"; - - public bool IsInControlGroup(IComponentDetector componentDetector) => componentDetector is PipComponentDetector; - - public bool IsInExperimentGroup(IComponentDetector componentDetector) => componentDetector is PipReportComponentDetector; - - 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 0d8575fab..41d16ccc5 100644 --- a/src/Microsoft.ComponentDetection.Orchestrator/Extensions/ServiceCollectionExtensions.cs +++ b/src/Microsoft.ComponentDetection.Orchestrator/Extensions/ServiceCollectionExtensions.cs @@ -63,7 +63,6 @@ public static IServiceCollection AddComponentDetection(this IServiceCollection s services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); // Detectors // CocoaPods