danger / swift

⚠️ Stop saying "you forgot to …" in code review
https://danger.systems/swift/
MIT License
1.04k stars 135 forks source link

Danger fails to publish results details on Github #513

Closed alessandrodn closed 2 years ago

alessandrodn commented 2 years ago

We use Danger swift 3.12.3 from Bitrise and publish our results back to Github PRs. Everything worked great so far.

In the last week or so we saw that Danger fails to publish its error and warning on Gitub: the logs reports the following error

Request failed [422]: https://api.github.com/repos/getnexar/mobile/pulls/4975/reviews
Response: {
  "message": "Unprocessable Entity",
  "errors": [
    "Pull request review thread position is invalid and Pull request review thread diff hunk can't be blank"
  ],
  "documentation_url": "https://docs.github.com/rest/reference/pulls#create-a-review-for-a-pull-request"
}
Feedback: https://github.com/getnexar/mobile/pull/4975#issuecomment-1074895914
Danger: ⅹ Failing the build, there are 3 fails.
## Failures
Function should have 5 parameters or less: it currently has 9 (`function_parameter_count`)
-
Function should have 5 parameters or less: it currently has 9 (`function_parameter_count`)
-
@alessandrodn, you have 2 failures in this PR.
## Warnings
File should contain 600 lines or less: currently contains 611 (`file_length`)
-
Collection literals should not have trailing commas. (`trailing_comma`)
Launching Danger Swift ci (v3.12.3)
Finding out where the danger executable is
Running: /usr/local/bin/danger ci --process danger-swift --passURLForDSL --verbose 

It's not a matter of token as we can see Danger publishing in the PR but the content is empty, despite the errors and warnings, as indicated in the log.

Screen Shot 2022-03-22 at 16 22 52
sschizas commented 2 years ago

We are facing the same issue when running danger swift on Bitrise:

Failing the build, there are 2 fails.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814594847. Attempting retry.
Retry 1 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814594828. Attempting retry.
Retry 1 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814594819. Attempting retry.
Retry 1 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814594863. Attempting retry.
Retry 1 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615802. Attempting retry.
Retry 1 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615769. Attempting retry.
Retry 1 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615789. Attempting retry.
Retry 1 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615812. Attempting retry.
Retry 1 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814594819. Attempting retry.
Retry 2 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615769. Attempting retry.
Retry 2 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615812. Attempting retry.
Retry 2 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615789. Attempting retry.
Retry 2 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615812. Attempting retry.
Retry 3 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814594819. Attempting retry.
Retry 3 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615789. Attempting retry.
Retry 3 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814594819
Response: 
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/pulls/comments/814615789
Response: 
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/issues/804/comments. Attempting retry.
Retry 1 of 3.
Request failed [500]: https://api.github.com/repos/bluegroundltd/guest-app-ios/issues/804/comments. Attempting retry.
Retry 2 of 3.
Feedback: https://github.com/bluegroundltd/guest-app-ios/pull/804#issuecomment-1075345840
Nikoloutsos commented 2 years ago

+1

orta commented 2 years ago

GitHub API is having issues ATM: https://www.githubstatus.com/ could be related

alessandrodn commented 2 years ago

@orta Github is back to normal but we still experienced the same issue consistently. Is there anything more we can provide on our side to help investigate the issue?

sschizas commented 2 years ago

@orta I think it relates with #514 issue.

narwold commented 2 years ago

I am experiencing this issue in Danger JS as well.

ggndpsingh commented 2 years ago

We are experiencing this issue as well on our iOS project. It started happening a couple of weeks ago. Danger is running correctly. It just fails at the very end before posting results. It's also not posting any comments about failures in a PR.


Request failed [403]: https://api.github.com/user
Response: {
  "message": "Resource not accessible by integration",
  "documentation_url": "https://docs.github.com/rest/reference/users#get-the-authenticated-user"
}
Request failed [422]: https://api.github.com/repos/domain-group/domain-ios-app/pulls/7737/reviews
Response: {
  "message": "Unprocessable Entity",
  "errors": [
    "Pull request review thread position is invalid and Pull request review thread diff hunk can't be blank"
  ],
  "documentation_url": "https://docs.github.com/rest/reference/pulls#create-a-review-for-a-pull-request"
}
Request failed [403]: https://api.github.com/user
Response: {
  "message": "Resource not accessible by integration",
  "documentation_url": "https://docs.github.com/rest/reference/users#get-the-authenticated-user"
}
}```
AvdLee commented 2 years ago

The weird thing to me is that regular messages and other parts are correctly reported:

image

In a way, it looks like it relates to errors and warnings only 🤔

AvdLee commented 2 years ago

Alright; got it! It's related to the file and line properties not being respected by GitHub anymore. Once I reported errors w/o these references, things started working fine:

image

This kind of makes me think that it started failing after GH introduced their new PR file navigation window:

image

@f-meloni do you know more details about the file and line logic?

f-meloni commented 2 years ago

I think it might be related to the issue I've opened here https://github.com/danger/danger-js/issues/1207

f-meloni commented 2 years ago

Looks like that issue is been fixed, please let me know if is OK now

alessandrodn commented 2 years ago

Yep seems working fine, thanks a lot