Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/detectors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

| Detector | Status |
| -------------------------- | ---------- |
| CondaLockComponentDetector | DefaultOff |
| CondaLockComponentDetector | Experimental |

- [Docker Compose](dockercompose.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.ComponentDetection.Detectors.Poetry;
using Microsoft.Extensions.Logging;
using YamlDotNet.Serialization;

public class CondaLockComponentDetector : FileComponentDetector, IDefaultOffComponentDetector
public class CondaLockComponentDetector : FileComponentDetector, IExperimentalDetector
Comment thread
ryanbrandenburg marked this conversation as resolved.
{
public CondaLockComponentDetector(
IComponentStreamEnumerableFactory componentStreamEnumerableFactory,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace Microsoft.ComponentDetection.Orchestrator.Experiments.Configs;

using Microsoft.ComponentDetection.Contracts;
using Microsoft.ComponentDetection.Detectors.Pip;
using Microsoft.ComponentDetection.Detectors.Poetry;

/// <summary>
/// Experiment to validate CondaLockComponentDetector against PipReportComponentDetector.
/// </summary>
public class CondaLockDetectorExperiment : IExperimentConfiguration
{
/// <inheritdoc />
public string Name => "CondaLockDetectorExperiment";

/// <inheritdoc />
public bool IsInControlGroup(IComponentDetector componentDetector) => componentDetector is PipReportComponentDetector;

/// <inheritdoc />
public bool IsInExperimentGroup(IComponentDetector componentDetector) => componentDetector is CondaLockComponentDetector;

/// <inheritdoc />
public bool ShouldRecord(IComponentDetector componentDetector, int numComponents) => true;
Comment thread
grvillic marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static IServiceCollection AddComponentDetection(this IServiceCollection s
services.AddSingleton<IExperimentProcessor, DefaultExperimentProcessor>();
services.AddSingleton<IExperimentConfiguration, SimplePipExperiment>();
services.AddSingleton<IExperimentConfiguration, UvLockDetectorExperiment>();
services.AddSingleton<IExperimentConfiguration, CondaLockDetectorExperiment>();
services.AddSingleton<IExperimentConfiguration, LinuxApplicationLayerExperiment>();
services.AddSingleton<IExperimentConfiguration, MSBuildBinaryLogExperiment>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,13 @@ public void UvLockComponentDetector_ImplementsIExperimentalDetector()
uvLockDetector.Should().NotBeNull("because UvLockComponentDetector should be registered");
uvLockDetector.Should().BeAssignableTo<IExperimentalDetector>("because UvLockComponentDetector should implement IExperimentalDetector");
}

[TestMethod]
public void CondaLockComponentDetector_ImplementsIExperimentalDetector()
{
var condaLockDetector = this.detectors.SingleOrDefault(d => d.Id == "CondaLock");

condaLockDetector.Should().NotBeNull("because CondaLockComponentDetector should be registered");
condaLockDetector.Should().BeAssignableTo<IExperimentalDetector>("because CondaLockComponentDetector should implement IExperimentalDetector");
}
}
Loading