From 363e241f350f23ab8428608f3174eb78c551fb77 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Tue, 15 Sep 2026 01:52:00 +0530 Subject: [PATCH 1/2] Excempt PR Limit --- .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 | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr_limit.yml b/.github/workflows/pr_limit.yml index 2174a61ed35..a3409941725 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 496895ddc0b..1c4d50b0798 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 cd6f76d76c4..46cdb0f2df3 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 a715211fde8..294a7c5e6a4 100644 --- a/docs/source/developers/bug_reports.rst +++ b/docs/source/developers/bug_reports.rst @@ -243,7 +243,7 @@ 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 repository access to the repository may have at most **3 pull requests open at the same time**. 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 From 92b3c983bf2a197324c941a058c896fb1c8c2827 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan <156181482+Reranko05@users.noreply.github.com> Date: Tue, 15 Sep 2026 12:54:17 +0530 Subject: [PATCH 2/2] Update docs/source/developers/bug_reports.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Raúl Cumplido --- docs/source/developers/bug_reports.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/developers/bug_reports.rst b/docs/source/developers/bug_reports.rst index 294a7c5e6a4..28bea77600c 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 repository 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.