feat(worker): emit WorkerLog for merge, discard, reset
This commit is contained in:
@@ -136,6 +136,7 @@ public sealed class TaskMergeService
|
|||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
"Merged task {TaskId} branch {Branch} into {Target} (remove worktree: {Remove})",
|
"Merged task {TaskId} branch {Branch} into {Target} (remove worktree: {Remove})",
|
||||||
taskId, wt.BranchName, targetBranch, removeWorktree);
|
taskId, wt.BranchName, targetBranch, removeWorktree);
|
||||||
|
await _broadcaster.WorkerLog($"Merged \"{task.Title}\" into {targetBranch}", WorkerLogLevel.Success, DateTime.UtcNow);
|
||||||
|
|
||||||
return new MergeResult(StatusMerged, Array.Empty<string>(), cleanupWarning);
|
return new MergeResult(StatusMerged, Array.Empty<string>(), cleanupWarning);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ public sealed class TaskResetService
|
|||||||
if (wt is not null && wt.State == WorktreeState.Active && list.WorkingDir is not null)
|
if (wt is not null && wt.State == WorktreeState.Active && list.WorkingDir is not null)
|
||||||
{
|
{
|
||||||
await _wtManager.DiscardAsync(wt, list.WorkingDir, ct);
|
await _wtManager.DiscardAsync(wt, list.WorkingDir, ct);
|
||||||
|
await _broadcaster.WorkerLog($"Discarded worktree for \"{task.Title}\"", WorkerLogLevel.Warn, DateTime.UtcNow);
|
||||||
worktreeChanged = true;
|
worktreeChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,5 +65,6 @@ public sealed class TaskResetService
|
|||||||
await _broadcaster.WorktreeUpdated(taskId);
|
await _broadcaster.WorktreeUpdated(taskId);
|
||||||
|
|
||||||
_logger.LogInformation("Reset task {TaskId} to Manual (worktree discarded: {Discarded})", taskId, worktreeChanged);
|
_logger.LogInformation("Reset task {TaskId} to Manual (worktree discarded: {Discarded})", taskId, worktreeChanged);
|
||||||
|
await _broadcaster.WorkerLog($"Reset \"{task.Title}\"", WorkerLogLevel.Warn, DateTime.UtcNow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user