This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 40067d77eb GH-51331: [CI] Exempt collaborators from concurrent PR
limit (#51332)
40067d77eb is described below
commit 40067d77eb4114baf77522c61b08bac9231a4422
Author: Aaditya Srinivasan <[email protected]>
AuthorDate: Wed Sep 16 02:52:55 2026 +0530
GH-51331: [CI] Exempt collaborators from concurrent PR limit (#51332)
### Rationale for this change
Exempt contributors with repository collaborator access from the concurrent
pull request limit.
The workflow comments and documentation are updated accordingly.
### Are these changes tested?
Not yet.
### Are there any user-facing changes?
No.
Closes: #51331
* GitHub Issue: #51331
Lead-authored-by: Aaditya Srinivasan <[email protected]>
Co-authored-by: Aaditya Srinivasan
<[email protected]>
Co-authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
.github/workflows/pr_limit.yml | 4 ++--
.github/workflows/pr_limit/check.js | 20 ++++++++++----------
.github/workflows/pr_limit/comment.md | 2 +-
docs/source/developers/bug_reports.rst | 3 ++-
4 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/pr_limit.yml b/.github/workflows/pr_limit.yml
index 2174a61ed3..a340994172 100644
--- a/.github/workflows/pr_limit.yml
+++ b/.github/workflows/pr_limit.yml
@@ -16,7 +16,7 @@
# under the License.
# Limits the number of concurrently open pull requests a contributor
-# without write access can have. This mirrors GitHub's native
+# without repository access can have. This mirrors GitHub's native
# "pull request creation cap" setting, which requires admin rights and
# so can only be configured for ASF repositories via .asf.yaml. Once
# https://github.com/apache/infrastructure-asfyaml/pull/111 is merged,
@@ -40,7 +40,7 @@ permissions:
pull-requests: write
issues: write
env:
- # Maximum number of open pull requests per contributor without write
+ # Maximum number of open pull requests per contributor without repository
# access. A pull request that takes the contributor over this limit is
# closed with an explanatory comment.
PR_LIMIT: 3
diff --git a/.github/workflows/pr_limit/check.js
b/.github/workflows/pr_limit/check.js
index 496895ddc0..1c4d50b079 100644
--- a/.github/workflows/pr_limit/check.js
+++ b/.github/workflows/pr_limit/check.js
@@ -17,10 +17,10 @@
const fs = require("fs");
-const WRITE_PERMISSIONS = new Set(["write", "maintain", "admin"]);
+const HAS_ACCESS = new Set(["triage", "write", "maintain", "admin"]);
/**
- * Returns whether the user has write access to the repository.
+ * Returns whether the user has repository access.
*
* Note that `author_association` is not a reliable signal for this:
* ASF members show up as MEMBER regardless of their permission on this
@@ -30,14 +30,14 @@ const WRITE_PERMISSIONS = new Set(["write", "maintain",
"admin"]);
* @param {Object} context
* @param {String} username
*/
-async function hasWriteAccess(github, context, username) {
+async function hasAccess(github, context, username) {
try {
const {data} = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username: username
});
- return WRITE_PERMISSIONS.has(data.permission);
+ return HAS_ACCESS.has(data.role_name);
} catch (error) {
if (error.status === 404) {
return false;
@@ -106,16 +106,16 @@ module.exports = async ({github, context, core}) => {
return;
}
- if (await hasWriteAccess(github, context, user.login)) {
- core.info(`Skipping: ${user.login} has write access.`);
+ if (await hasAccess(github, context, user.login)) {
+ core.info(`Skipping: ${user.login} has repository access.`);
return;
}
- // A committer reopening a previously closed pull request is a deliberate
- // decision to accept it, so don't close it again.
+ // A user with repository access reopening a previously closed pull request
+ // is a deliberate decision to accept it, so don't close it again.
const sender = context.payload.sender;
- if (sender.login !== user.login && await hasWriteAccess(github, context,
sender.login)) {
- core.info(`Skipping: ${context.payload.action} by ${sender.login}, who has
write access.`);
+ if (sender.login !== user.login && await hasAccess(github, context,
sender.login)) {
+ core.info(`Skipping: ${context.payload.action} by ${sender.login}, who has
repository access.`);
return;
}
diff --git a/.github/workflows/pr_limit/comment.md
b/.github/workflows/pr_limit/comment.md
index cd6f76d76c..46cdb0f2df 100644
--- a/.github/workflows/pr_limit/comment.md
+++ b/.github/workflows/pr_limit/comment.md
@@ -21,7 +21,7 @@ Thanks for opening a pull request!
**This pull request has been automatically closed because you currently have
${OPEN_COUNT} open pull requests, which is more than the limit of ${PR_LIMIT}.**
-Due to the increase in pull requests opened by AI bots, and in order to keep
the review queue manageable, Apache Arrow limits contributors without write
access to at most ${PR_LIMIT} concurrently open pull requests. This helps make
sure each pull request gets the attention it needs and that work in progress
does not go stale.
+Due to the increase in pull requests opened by AI bots, and in order to keep
the review queue manageable, Apache Arrow limits contributors without
repository access to at most ${PR_LIMIT} concurrently open pull requests. This
helps make sure each pull request gets the attention it needs and that work in
progress does not go stale.
Once one of [your other open pull
requests](https://github.com/apache/arrow/pulls/${USERNAME}) has been merged or
closed, you are welcome to reopen this one.
diff --git a/docs/source/developers/bug_reports.rst
b/docs/source/developers/bug_reports.rst
index a715211fde..28bea77600 100644
--- a/docs/source/developers/bug_reports.rst
+++ b/docs/source/developers/bug_reports.rst
@@ -243,8 +243,9 @@ Limit on concurrent pull requests
+++++++++++++++++++++++++++++++++
Due to the increase in pull requests opened by AI bots, and in order to keep
-the review queue manageable, contributors without write access to the
+the review queue manageable, contributors without the required access to the
repository may have at most **3 pull requests open at the same time**.
+The required access is either write access (committers) or triage
(collaborators).
A pull request opened beyond that limit is automatically closed by a GitHub
Actions workflow, with a comment explaining why. Once one of your other pull
requests has been merged or closed, you can reopen it.