danger / swift

⚠️ Stop saying "you forgot to …" in code review

Home Page:https://danger.systems/swift/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub API request fails silently

fabianehlert opened this issue · comments

I'm using version 3.18.0 of danger-swift on Bitrise CI to analyze pull requests on GitHub via danger-swift ci --failOnErrors.

Since a couple of days ago, I've noticed that while the exit code of danger-swift still indicates a successful execution, the logs show that the GitHub API has responded with an error. This can be observed on pull requests with a diff of more than 300 files. However, reading the GitHub API docs, it seems that the file limit is set to 3000. And looking at older builds of my project, I can see that just a week ago, pull requests larger than 300 files would not show this error in the logs and danger-swift would properly annotate the pull request.

I couldn't find any noteworthy release notes mentioning a change of the file limit in the GitHub API. I hope you might have some ideas and I'm happy to share more specific details if needed. Thank you!

Here's the full log:

+ danger-swift ci --failOnErrors
Request failed [406]: https://api.github.com/repos/org/repo/pulls/id
Response: {
  "message": "Sorry, the diff exceeded the maximum number of files (300). Consider using 'List pull requests files' API or locally cloning the repository instead.",
  "errors": [
    {
      "resource": "PullRequest",
      "field": "diff",
      "code": "too_large"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/pulls/pulls#list-pull-requests-files"
}
Found only messages, passing those to review.

Maybe GitHub changed the API limits?

Maybe GitHub changed the API limits?

I was thinking about that too but couldn't find any recent notes in this direction 🤔