Skip to content
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

Merged
merged 2 commits into from
Sep 16, 2023

Conversation

tstellar
Copy link
Collaborator

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.
@tstellar tstellar requested a review from a team as a code owner September 14, 2023 03:30
@llvmbot
Copy link
Member

llvmbot commented Sep 14, 2023

@llvm/pr-subscribers-github-workflow

Changes 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.

Full diff: https://github.com/llvm/llvm-project/pull/66320.diff

1 Files Affected:

  • (modified) .github/workflows/pr-receive.yml (+6-1)
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: |

@@ -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
Copy link
Member

@MaskRay MaskRay Sep 14, 2023

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

@tru
Copy link
Collaborator

tru commented Sep 14, 2023

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
Copy link
Contributor

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 ?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

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

@tstellar
Copy link
Collaborator Author

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.

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?

@tru
Copy link
Collaborator

tru commented Sep 14, 2023

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.

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.

@tstellar tstellar merged commit 5e4e2a5 into llvm:main Sep 16, 2023
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
…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.
zahiraam pushed a commit to tahonermann/llvm-project that referenced this pull request Oct 24, 2023
…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.
zahiraam pushed a commit to tahonermann/llvm-project that referenced this pull request Oct 24, 2023
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants