cake-build / website

:earth_americas: The Cake website: https://cakebuild.net
https://cakebuild.net
MIT License
43 stars 228 forks source link

Synchronize Contributors #2730

Closed cake-contrib-bot closed 1 year ago

cake-contrib-bot commented 1 year ago

The Cake.AddinDiscoverer tool has discovered that the list of contributors has changed.

pascalberger commented 1 year ago

@Jericho Do you have an idea why it created an issue, but no pull request?

Jericho commented 1 year ago

I have seen this problem before. Typically, it's caused by the fact that we trigger GitHub's abuse detection when attempting to create the PR. In this case it's not abuse detection that prevented the PR to be created, but rather this cryptic error:

Octokit.ApiException: Server Error
   at void Octokit.Connection.HandleErrors(IResponse response) in /_/Octokit/Http/Connection.cs:line 734
   at async Task<IResponse> Octokit.Connection.RunRequest(IRequest request, CancellationToken cancellationToken, Func<object, object> preprocessResponseBody) in /_/Octokit/Http/Connection.cs:line 712
   at async Task<IApiResponse<T>> Octokit.Connection.Run<T>(IRequest request, CancellationToken cancellationToken, Func<object, object> preprocessResponseBody) in /_/Octokit/Http/Connection.cs:line 697
   at async Task<T> Octokit.ApiConnection.Post<T>(Uri uri, object data, string accepts, string contentType, CancellationToken cancellationToken) in /_/Octokit/Http/ApiConnection.cs:line 323
   at async Task<Commit> Cake.AddinDiscoverer.Extensions.ModifyFilesAsync(IGitHubClient githubClient, Repository repo, Commit parentCommit, IEnumerable<string> filesToDelete, IEnumerable<(EncodingType Encoding, string Path, string Content)> filesToUpsert, string commitMessage) in C:/projects/cake-addindiscoverer/Source/Cake.AddinDiscoverer/Utilities/Extensions.cs:line 79
   at async Task<Commit> Cake.AddinDiscoverer.Utilities.Misc.CommitToNewBranchAsync(DiscoveryContext context, Repository fork, int? issueNumber, string newBranchName, IEnumerable<(string CommitMessage, IEnumerable<string> FilesToDelete, IEnumerable<ValueTuple<EncodingType, string, string>> FilesToUpsert)> commits) in C:/projects/cake-addindiscoverer/Source/Cake.AddinDiscoverer/Utilities/Misc.cs:line 126
   at async Task<PullRequest> Cake.AddinDiscoverer.Utilities.Misc.CommitToNewBranchAndSubmitPullRequestAsync(DiscoveryContext context, Repository fork, int? issueNumber, string newBranchName, string pullRequestTitle, IEnumerable<(string CommitMessage, IEnumerable<string> FilesToDelete, IEnumerable<ValueTuple<EncodingType, string, string>> FilesToUpsert)> commits) in C:/projects/cake-addindiscoverer/Source/Cake.AddinDiscoverer/Utilities/Misc.cs:line 108
   at async Task Cake.AddinDiscoverer.Steps.GetContributorsStep.SynchronizeFilesCollectivelyAsync(DiscoveryContext context, Repository fork, ValueTuple<string, string, string>[] filesToBeCreated, ValueTuple<string, string, string>[] filesToBeUpdated) in C:/projects/cake-addindiscoverer/Source/Cake.AddinDiscoverer/Steps/GetContributorsStep.cs:line 185
   at async Task Cake.AddinDiscoverer.Steps.GetContributorsStep.ExecuteAsync(DiscoveryContext context, TextWriter log, CancellationToken cancellationToken) in C:/projects/cake-addindiscoverer/Source/Cake.AddinDiscoverer/Steps/GetContributorsStep.cs:line 128
   at async Task<ResultCode> Cake.AddinDiscoverer.AddinDiscoverer.LaunchDiscoveryAsync() in C:/projects/cake-addindiscoverer/Source/Cake.AddinDiscoverer/AddinDiscoverer.cs:line 158
{
  "message": "Server Error"
}

I just tried to run the GetContributors step in debug mode on my laptop and I'm getting the "Server Error" intermittently. Sometimes it completes successfuly and sometimes it fails.

Jericho commented 1 year ago

The bottom line is that I'm baffled and I don't know how to further investigate an intermittent server-side error thrown by the GitHub API.

We could simply close this issue and allow AddinDiscoverer to raise a new issue and hope it can successfully create the associated PR.