Files
gitcommiteditor/Services/IHistoryHealthService.cs

79 lines
2.7 KiB
C#

using MarketAlly.GitCommitEditor.Models;
using MarketAlly.GitCommitEditor.Models.HistoryHealth;
namespace MarketAlly.GitCommitEditor.Services;
/// <summary>
/// Service for analyzing and reporting on git repository history health.
/// </summary>
public interface IHistoryHealthService
{
/// <summary>
/// Analyzes repository history health and generates a comprehensive report.
/// </summary>
/// <param name="repoPath">Path to the repository.</param>
/// <param name="options">Analysis options.</param>
/// <param name="progress">Progress reporter.</param>
/// <param name="ct">Cancellation token.</param>
/// <returns>Complete health report with scores, issues, and recommendations.</returns>
Task<HistoryHealthReport> AnalyzeHistoryHealthAsync(
string repoPath,
HistoryAnalysisOptions? options = null,
IProgress<AnalysisProgress>? progress = null,
CancellationToken ct = default);
/// <summary>
/// Analyzes history health for a managed repository.
/// </summary>
Task<HistoryHealthReport> AnalyzeHistoryHealthAsync(
ManagedRepo repo,
HistoryAnalysisOptions? options = null,
IProgress<AnalysisProgress>? progress = null,
CancellationToken ct = default);
/// <summary>
/// Exports a health report to the specified format.
/// </summary>
Task<string> ExportHealthReportAsync(
HistoryHealthReport report,
ReportFormat format,
CancellationToken ct = default);
/// <summary>
/// Exports a health report to a file.
/// </summary>
Task ExportHealthReportToFileAsync(
HistoryHealthReport report,
ReportFormat format,
string outputPath,
CancellationToken ct = default);
/// <summary>
/// Executes a single cleanup operation.
/// </summary>
Task<CleanupExecutionResult> ExecuteCleanupAsync(
ManagedRepo repo,
CleanupOperation operation,
CleanupExecutionOptions? options = null,
IProgress<CleanupProgress>? progress = null,
CancellationToken ct = default);
/// <summary>
/// Executes all cleanup operations from a report.
/// </summary>
Task<BatchCleanupResult> ExecuteAllCleanupsAsync(
ManagedRepo repo,
CleanupSuggestions suggestions,
CleanupExecutionOptions? options = null,
IProgress<CleanupProgress>? progress = null,
CancellationToken ct = default);
/// <summary>
/// Creates a backup branch before cleanup operations.
/// </summary>
Task<string> CreateBackupBranchAsync(
ManagedRepo repo,
string? branchName = null,
CancellationToken ct = default);
}