Skip to content

Commit

Permalink
logging for needs commit
Browse files Browse the repository at this point in the history
  • Loading branch information
goaaats committed Oct 5, 2024
1 parent 13a84fa commit 952f4a1
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Plogon/BuildProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,16 +1315,20 @@ private BuildResult.ReviewedNeed GetNeedStatus(string key, string version, State

private void CommitReviewedNeeds(IEnumerable<BuildResult.ReviewedNeed> needs)
{
this.pluginRepository.AddReviewedNeeds(needs
.Where(need => need.ReviewedBy != null)
.Select(need => new State.Need
{
Key = need.Name,
ReviewedBy = this.actor ?? throw new Exception("Committing, but reviewer is null"),
Version = need.Version,
ReviewedAt = DateTime.UtcNow,
Type = need.Type,
}));
var newNeeds = needs
.Where(need => need.ReviewedBy != null)
.Select(
need => new State.Need
{
Key = need.Name,
ReviewedBy = this.actor ?? throw new Exception("Committing, but reviewer is null"),
Version = need.Version,
ReviewedAt = DateTime.UtcNow,
Type = need.Type,
}).ToList();

Log.Information("Adding {Count} newly reviewed needs to repo state", newNeeds.Count);
this.pluginRepository.AddReviewedNeeds(newNeeds);
}

private static void CopySourceForArchive(DirectoryInfo from, DirectoryInfo to, int depth = 0)
Expand Down

0 comments on commit 952f4a1

Please sign in to comment.