rtCamp / action-phpcs-code-review

Github Action to perform automated code review on pull requests
https://github.com/rtCamp/github-actions-library
MIT License
101 stars 26 forks source link

Error: GitHub API communication error. Please contact a human. #48

Closed djboris88 closed 3 years ago

djboris88 commented 3 years ago

I'm having the same issue as https://github.com/rtCamp/action-phpcs-code-review/issues/43, but I have created the token using a bot GitHub account.

[ 2021-03-23T00:19:51+05:30 -- 0 ]  Posting a comment to a Pull-Request; {
    "repo_owner": "***",
    "repo_name": "***",
    "pr_number": 7,
    "commit_id": "9d586af77f38316a51e2d7ee20551f93c461f25c",
    "message": "GitHub API communication error. Please contact a human."
}

Also, the log generated by this step is very, very long, more than 2700 lines when issues are found. There are many PHP Notices generated, for example:

PHP Notice:  Undefined index: status in /home/rtbot/vip-go-ci-tools/vip-go-ci/github-api.php on line 479
PHP Notice:  Trying to access array offset on value of type null in /home/rtbot/vip-go-ci-tools/vip-go-ci/github-api.php on line 479
PHP Notice:  Undefined index: status in /home/rtbot/vip-go-ci-tools/vip-go-ci/github-api.php on line 480
PHP Notice:  Trying to access array offset on value of type null in /home/rtbot/vip-go-ci-tools/vip-go-ci/github-api.php on line 480
PHP Notice:  Undefined property: stdClass::$message in /home/rtbot/vip-go-ci-tools/vip-go-ci/github-api.php on line 523
PHP Notice:  Undefined property: stdClass::$message in /home/rtbot/vip-go-ci-tools/vip-go-ci/github-api.php on line 541
PHP Notice:  Undefined property: stdClass::$message in /home/rtbot/vip-go-ci-tools/vip-go-ci/github-api.php on line 548

One more question, since this action sets the CHANGES_REQUESTED status, once the phpcs errors are fixed, what is the flow supposed to be? The fix is not automatically recognized, even if the subsequential check passes, the change request still remains. Should I just dismiss it?

mrrobot47 commented 3 years ago

This has been fixed in https://github.com/rtCamp/action-phpcs-code-review/releases/tag/v2.0.4 Please use the latest tag @v2 when running the action. Please reopen this issue if the error continues.

mrrobot47 commented 3 years ago

One more question, since this action sets the CHANGES_REQUESTED status, once the phpcs errors are fixed, what is the flow supposed to be? The fix is not automatically recognized, even if the subsequential check passes, the change request still remains.

Once the errors are fixed, the reviews should become stale.

Should I just dismiss it?

Yes.

smileBeda commented 3 years ago

I am getting that same error, and have no idea how to fix it. It happens all of a sudden, the same repo and PHPCS worked just fine for months. Today I committed to same repo again and the bot can't complete the scan it fails with GitHub API communication error. Please contact a human.

It also breaks the actual scan by telling me there are files named wrongly, but it mentions files that do not even exist in the repo.

... What can be done?

Thanks!