-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workflows/pr-receive: Ignore pull requests with 10 or more commits #66320
Conversation
This will cause the auto-labeler not to run on pull requests with more than 10 commits. Usually larger pull requests like this are mistakes and we want to avoid generating an excessive amount of notifications. It may be possible for legitimate pull requests to have 10 or more commits from people pushing fixup commits to addresss review comments. However, these pull requests should already have the correct labels by the time they grow to 10 commits.
@llvm/pr-subscribers-github-workflow ChangesThis will cause the auto-labeler not to run on pull requests with more than 10 commits. Usually larger pull requests like this are mistakes and we want to avoid generating an excessive amount of notifications.It may be possible for legitimate pull requests to have 10 or more commits from people pushing fixup commits to addresss review comments. However, these pull requests should already have the correct labels by the time they grow to 10 commits.Full diff: https://github.com/llvm/llvm-project/pull/66320.diff 1 Files Affected:
diff --git a/.github/workflows/pr-receive.yml b/.github/workflows/pr-receive.yml index 91bfa582dbad974..feb4a202d0ac58c 100644 --- a/.github/workflows/pr-receive.yml +++ b/.github/workflows/pr-receive.yml @@ -10,7 +10,12 @@ permissions: jobs: pr-target: runs-on: ubuntu-latest - if: github.repository == 'llvm/llvm-project' + # Ignore PRs with more than 10 commits. Pull requests with a lot of + # commits tend to be accidents usually when somone made a mistake while trying + # to rebase. We want to ignore these pull requests to avoid excessive + # notifications. + if: github.repository == 'llvm/llvm-project' && + github.event.pull_request.commits < 10 steps: - name: Store PR Information run: | |
.github/workflows/pr-receive.yml
Outdated
@@ -10,7 +10,12 @@ permissions: | |||
jobs: | |||
pr-target: | |||
runs-on: ubuntu-latest | |||
if: github.repository == 'llvm/llvm-project' | |||
# Ignore PRs with more than 10 commits. Pull requests with a lot of | |||
# commits tend to be accidents usually when somone made a mistake while trying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comma and fix a typo: commits tend to be accidents, usually when someone made a mistake while trying
I wonder if 10 is a little limited, but I guess we can start there and try. maybe we should write something to the action log that it was skipped so it can be debugged later if we wonder why things are not being labeled correctly. |
# to rebase. We want to ignore these pull requests to avoid excessive | ||
# notifications. | ||
if: github.repository == 'llvm/llvm-project' && | ||
github.event.pull_request.commits < 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Should we add github.event.pull_request.draft == false
too ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we could add that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm going to add this in a separate pull request, because I want to write a separate commit message about ignoring drafts and I can't push more than two commits at once here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think in order to add this, we would need to run this action when the Draft flag is removed from the PR, but I don't see an event for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a while to find it https://docs.github.com/en/rest/overview/issue-event-types?apiVersion=2022-11-28#ready_for_review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR for ignoring drafts: #66578
If we add an extra step to output debug information, then the action's result will be listed as failed rather than skipped as it is now. How much do you think this matters? |
Maybe not that much. We can roll it out without it and add it later if we run into a lot of problems. |
…lvm#66320) This will cause the auto-labeler not to run on pull requests with more than 10 commits. Usually larger pull requests like this are mistakes and we want to avoid generating an excessive amount of notifications. It may be possible for legitimate pull requests to have 10 or more commits from people pushing fixup commits to addresss review comments. However, these pull requests should already have the correct labels by the time they grow to 10 commits.
…lvm#66320) This will cause the auto-labeler not to run on pull requests with more than 10 commits. Usually larger pull requests like this are mistakes and we want to avoid generating an excessive amount of notifications. It may be possible for legitimate pull requests to have 10 or more commits from people pushing fixup commits to addresss review comments. However, these pull requests should already have the correct labels by the time they grow to 10 commits.
…lvm#66320) This will cause the auto-labeler not to run on pull requests with more than 10 commits. Usually larger pull requests like this are mistakes and we want to avoid generating an excessive amount of notifications. It may be possible for legitimate pull requests to have 10 or more commits from people pushing fixup commits to addresss review comments. However, these pull requests should already have the correct labels by the time they grow to 10 commits.
This will cause the auto-labeler not to run on pull requests with more than 10 commits. Usually larger pull requests like this are mistakes and we want to avoid generating an excessive amount of notifications.
It may be possible for legitimate pull requests to have 10 or more commits from people pushing fixup commits to addresss review comments. However, these pull requests should already have the correct labels by the time they grow to 10 commits.