jpmcb / prow-github-actions

Slash commands, jobs, and chat-ops for Github actions inspired by Kubernetes Prow ⚓️
MIT License
92 stars 10 forks source link

[BUG] Labeler triggers abuse detection #33

Closed colinmollenhour closed 3 years ago

colinmollenhour commented 3 years ago

Describe the bug

The action is frequently considered "Failed", from the action log:

To Reproduce Steps to reproduce the behavior:

  1. Run labeler on a project with many PRs (~ 146 in our case)

Expected behavior Labeler action completes without error

Github repo https://github.com/OpenMage/magento-lts/runs/1429450362?check_suite_focus=true

Logs

... processing pr: 113 starting PR labeler page 6 Error: Error: error handling issue comment: Error: could not get PRs: HttpError: You have triggered an abuse detection mechanism. Please wait a few minutes before you try again.

Additional info Perhaps the PRs can be filtered to only consider those that have changed in the last 4 hours?

jpmcb commented 3 years ago

Hi Colin, sorry for the late response. Been a crazy last few weeks with the holidays coming up.

I believe this is related to #31 which TLDR, github made some major changes to their API to allow Actions to be run on events generated by forks. In other words, there should be ways to avoid having to use the "chron" schedule labeler. I've been considering removing it entierly and giving people a mechanism to just use the default github api labeler outlined here: https://github.com/actions/labeler/issues/12#issuecomment-670967607

Right now, I'd recommend trying the pull_request_target method from the above link. I'll update this issue once I have made updates to the repo and released the newest version.

jpmcb commented 3 years ago

Hi Colin, I've looked into this and I've made doc changes.

I'm going to keep the chron job in place as is for now and recommend people use the Github actions/labeler for PR labeling since it now fully supports pull_request_target. I may deprecate the chron labeler in the future, but for now, it may still be useful for batch processing many PRs.

Please refer to the chron docs for further info: https://github.com/jpmcb/prow-github-actions/blob/main/docs/cron-jobs.md

colinmollenhour commented 3 years ago

Thanks @jpmcb !