< Summary

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

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FindSolutionRoot()0%2040%
GetInstructionsTemplatePath()100%210%
GetEnvFilePath(...)100%210%
GetFirebaseJsonPath()100%210%

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    {
 012        var currentDirectory = Directory.GetCurrentDirectory();
 013        var directory = new DirectoryInfo(currentDirectory);
 14
 015        while (directory != null)
 16        {
 017            var solutionFile = Path.Combine(directory.FullName, "KicktippAi.slnx");
 018            if (File.Exists(solutionFile))
 19            {
 020                return directory.FullName;
 21            }
 022            directory = directory.Parent;
 23        }
 24
 025        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    {
 034        var solutionRoot = FindSolutionRoot();
 035        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    /// <returns>The full path to the .env file.</returns>
 43    public static string GetEnvFilePath(string projectName)
 44    {
 045        var solutionRoot = FindSolutionRoot();
 046        return Path.Combine(solutionRoot, "..", "KicktippAi.Secrets", "src", projectName, ".env");
 47    }
 48
 49    /// <summary>
 50    /// Gets the path to the Firebase service account JSON file relative to the solution root.
 51    /// </summary>
 52    /// <returns>The full path to the firebase.json file.</returns>
 53    public static string GetFirebaseJsonPath()
 54    {
 055        var solutionRoot = FindSolutionRoot();
 056        return Path.Combine(solutionRoot, "..", "KicktippAi.Secrets", "src", "Orchestrator", "firebase.json");
 57    }
 58}