Skip to content

Commit

Permalink
Get contributors from multiple linked issues/PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Nov 15, 2023
1 parent 4f002b8 commit 9fdf779
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/GitReleaseManager.Core/ReleaseNotes/ReleaseNotesBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,18 @@ private Dictionary<string, List<Issue>> GetIssuesDict(List<Issue> issues)
return issuesByLabel;
}

private static List<User> GetContributors(List<Issue> issues)
private static List<User> GetContributors(IEnumerable<Issue> issues)
{
var contributors = issues
.Select(i => i.User)
.Union(issues.Select(i => i.LinkedIssue?.User))
var contributors = issues.Select(i => i.User);
var linkedContributors = issues.SelectMany(i => i.LinkedIssues).Select(i => i.User);

var allContributors = contributors
.Union(linkedContributors)
.Where(u => u != null)
.DistinctBy(u => u.Login)

Check failure on line 141 in src/GitReleaseManager.Core/ReleaseNotes/ReleaseNotesBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

The call is ambiguous between the following methods or properties: 'System.Linq.Enumerable.DistinctBy<TSource, TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TKey>)' and 'GitReleaseManager.Core.Extensions.LinqExtensions.DistinctBy<TSource, TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TKey>)'

Check failure on line 141 in src/GitReleaseManager.Core/ReleaseNotes/ReleaseNotesBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

The call is ambiguous between the following methods or properties: 'System.Linq.Enumerable.DistinctBy<TSource, TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TKey>)' and 'GitReleaseManager.Core.Extensions.LinqExtensions.DistinctBy<TSource, TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TKey>)'

Check failure on line 141 in src/GitReleaseManager.Core/ReleaseNotes/ReleaseNotesBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

The call is ambiguous between the following methods or properties: 'System.Linq.Enumerable.DistinctBy<TSource, TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TKey>)' and 'GitReleaseManager.Core.Extensions.LinqExtensions.DistinctBy<TSource, TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TKey>)'

Check failure on line 141 in src/GitReleaseManager.Core/ReleaseNotes/ReleaseNotesBuilder.cs

View workflow job for this annotation

GitHub Actions / build (windows-2022)

The call is ambiguous between the following methods or properties: 'System.Linq.Enumerable.DistinctBy<TSource, TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TKey>)' and 'GitReleaseManager.Core.Extensions.LinqExtensions.DistinctBy<TSource, TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TKey>)'
.ToList();

return contributors;
return allContributors;
}

private string GetValidLabel(string label, int issuesCount)
Expand Down

0 comments on commit 9fdf779

Please sign in to comment.