Skip to content

Commit

Permalink
Emit number of patterns with diffs as a regular log
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan committed Sep 5, 2024
1 parent e98773a commit 8927129
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Runner/Jobs/RegexDiffJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,17 +449,15 @@ private async Task UploadSourceGeneratorResultsAsync(RegexEntry[] entries)

int patternsWithDiffs = entries.Count(e => e.ShortDiff is not null);

// MihuBot looks for this exact string in logs
await LogAsync($"NOTE: {patternsWithDiffs} out of {entries.Length} patterns have generated source code changes.");

if (patternsWithDiffs > 0)
{
string shortExample = GenerateExamplesMarkdown(entries, GitHubHelpers.CommentLengthLimit / 2, maxEntries: 10);
string longExample = GenerateExamplesMarkdown(entries, GitHubHelpers.GistLengthLimit, maxEntries: int.MaxValue);

await UploadTextArtifactAsync("ShortExampleDiffs.md",
$"""
{patternsWithDiffs} out of {entries.Length} patterns have generated source code changes.
{shortExample}
""");
await UploadTextArtifactAsync("ShortExampleDiffs.md", shortExample);

if (shortExample != longExample)
{
Expand Down

0 comments on commit 8927129

Please sign in to comment.