< Summary

Information
Class: Orchestrator.Commands.Observability.Experiments.RunCommunityToDateSettings
Assembly: Orchestrator
File(s): /home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Commands/Observability/Experiments/RunCommunityToDateSettings.cs
Line coverage
75%
Covered lines: 12
Uncovered lines: 4
Coverable lines: 16
Total lines: 76
Line coverage: 75%
Branch coverage
50%
Covered branches: 7
Total branches: 14
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
Validate()50%251255.56%
GetParticipantIdFilter()50%22100%

File(s)

/home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Commands/Observability/Experiments/RunCommunityToDateSettings.cs

#LineLine coverage
 1using System.ComponentModel;
 2using Spectre.Console;
 3using Spectre.Console.Cli;
 4
 5namespace Orchestrator.Commands.Observability.Experiments;
 6
 7public sealed class RunCommunityToDateSettings : CommandSettings
 8{
 9    [CommandOption("--manifest")]
 10    [Description("Path to the prepared community-to-date manifest JSON file")]
 111    public string ManifestPath { get; set; } = string.Empty;
 12
 13    [CommandOption("--run-family-name")]
 14    [Description("Optional base name used to derive one Langfuse dataset run name per participant")]
 15    public string? RunFamilyName { get; set; }
 16
 17    [CommandOption("--run-description")]
 18    [Description("Optional Langfuse dataset run description applied to all participant runs")]
 19    public string? RunDescription { get; set; }
 20
 21    [CommandOption("--dataset-name")]
 22    [Description("Optional hosted dataset name override")]
 23    public string? DatasetName { get; set; }
 24
 25    [CommandOption("--batch-size")]
 26    [Description("Optional batch size override used within each participant run")]
 27    [DefaultValue(25)]
 128    public int BatchSize { get; set; } = 25;
 29
 30    [CommandOption("--participant-limit")]
 31    [Description("Optional limit for the number of participant runs to execute, ordered by display name")]
 32    public int? ParticipantLimit { get; set; }
 33
 34    [CommandOption("--participant-ids")]
 35    [Description("Optional comma-separated participant ids to execute. When omitted, all manifest participants are used"
 36    public string? ParticipantIds { get; set; }
 37
 38    [CommandOption("--replace-runs")]
 39    [Description("Delete existing participant dataset runs with the same derived names before starting")]
 40    [DefaultValue(false)]
 41    public bool ReplaceRuns { get; set; }
 42
 43    public override ValidationResult Validate()
 44    {
 145        if (string.IsNullOrWhiteSpace(ManifestPath))
 46        {
 047            return ValidationResult.Error("--manifest is required");
 48        }
 49
 150        if (BatchSize < 1)
 51        {
 052            return ValidationResult.Error("--batch-size must be at least 1");
 53        }
 54
 155        if (ParticipantLimit is < 1)
 56        {
 057            return ValidationResult.Error("--participant-limit must be at least 1 when provided");
 58        }
 59
 160        if (ParticipantIds is not null && GetParticipantIdFilter().Count == 0)
 61        {
 062            return ValidationResult.Error("--participant-ids must contain at least one non-empty participant id when pro
 63        }
 64
 165        return ValidationResult.Success();
 66    }
 67
 68    internal IReadOnlySet<string> GetParticipantIdFilter()
 69    {
 170        return string.IsNullOrWhiteSpace(ParticipantIds)
 171            ? new HashSet<string>(StringComparer.Ordinal)
 172            : ParticipantIds
 173                .Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries)
 174                .ToHashSet(StringComparer.Ordinal);
 75    }
 76}