< Summary

Information
Class: Orchestrator.PathUtility
Assembly: Orchestrator
File(s): /home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/PathUtility.cs
Line coverage
100%
Covered lines: 17
Uncovered lines: 0
Coverable lines: 17
Total lines: 63
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FindSolutionRoot()100%44100%
GetInstructionsTemplatePath()100%11100%
GetEnvFilePath(...)100%22100%
GetFirebaseJsonPath()100%11100%

File(s)

/home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/PathUtility.cs

#LineLine coverage
 1namespace Orchestrator;
 2
 3public static class PathUtility
 4{
 5    /// <summary>
 6    /// Finds the solution root directory by looking for KicktippAi.slnx in parent directories.
 7    /// </summary>
 8    /// <returns>The path to the solution root directory.</returns>
 9    /// <exception cref="DirectoryNotFoundException">Thrown when the solution root cannot be found.</exception>
 10    public static string FindSolutionRoot()
 11    {
 112        var currentDirectory = Directory.GetCurrentDirectory();
 113        var directory = new DirectoryInfo(currentDirectory);
 14
 115        while (directory != null)
 16        {
 117            var solutionFile = Path.Combine(directory.FullName, "KicktippAi.slnx");
 118            if (File.Exists(solutionFile))
 19            {
 120                return directory.FullName;
 21            }
 122            directory = directory.Parent;
 23        }
 24
 125        throw new DirectoryNotFoundException($"Could not find solution root (KicktippAi.slnx) starting from: {currentDir
 26    }
 27
 28    /// <summary>
 29    /// Gets the path to the instructions template relative to the solution root.
 30    /// </summary>
 31    /// <returns>The full path to the instructions template.</returns>
 32    public static string GetInstructionsTemplatePath()
 33    {
 134        var solutionRoot = FindSolutionRoot();
 135        return Path.Combine(solutionRoot, "prompts", "reasoning-models", "predict-one-match", "v0-handcrafted", "instruc
 36    }
 37
 38    /// <summary>
 39    /// Gets the path to the .env file for a specific project relative to the solution root.
 40    /// </summary>
 41    /// <param name="projectName">The name of the project (e.g., "Orchestrator").</param>
 42    /// <param name="suffix">Optional suffix appended to the .env filename, e.g. ".env.pes-squad".</param>
 43    /// <returns>The full path to the .env file.</returns>
 44    public static string GetEnvFilePath(string projectName, string? suffix = null)
 45    {
 146        var solutionRoot = FindSolutionRoot();
 147        var envFileName = string.IsNullOrWhiteSpace(suffix)
 148            ? ".env"
 149            : $".env.{suffix.Trim()}";
 50
 151        return Path.Combine(solutionRoot, "..", "KicktippAi.Secrets", "src", projectName, envFileName);
 52    }
 53
 54    /// <summary>
 55    /// Gets the path to the Firebase service account JSON file relative to the solution root.
 56    /// </summary>
 57    /// <returns>The full path to the firebase.json file.</returns>
 58    public static string GetFirebaseJsonPath()
 59    {
 160        var solutionRoot = FindSolutionRoot();
 161        return Path.Combine(solutionRoot, "..", "KicktippAi.Secrets", "src", "Orchestrator", "firebase.json");
 62    }
 63}