Add GitHub pull request creation cap support#111
Open
potiuk wants to merge 1 commit into
Open
Conversation
Implements the pull request creation cap interaction limit (community/maintainers#840), which limits the number of open pull requests a user without write access may have open at one time via the PATCH /repos/{owner}/{repo}/interaction-limits/pulls/ creation-cap endpoint. Configured under github.pull_requests.creation_cap with `enabled` and an optional `max_open_pull_requests` (1-1000). Removing the section disables a cap previously managed by .asf.yaml. Includes tests and README docs. Generated-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
939fcb8 to
7286ea7
Compare
o-nikolas
reviewed
Jul 13, 2026
o-nikolas
left a comment
There was a problem hiding this comment.
Would love to see this supported by asf.yaml
|
|
||
| if creation_cap: | ||
| enabled = creation_cap.get("enabled", False) | ||
| max_open_pull_requests = creation_cap.get("max_open_pull_requests") |
There was a problem hiding this comment.
No default value provided here like for the above. Does anything undefined happen if we get None back here from get(), especially if we happen to get True from the line above?
o-nikolas
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements support for GitHub's pull request creation cap
— an interaction limit that caps how many open pull requests a user without write access may have
open at one time. Users with write access are unaffected.
It uses the
PATCH /repos/{owner}/{repo}/interaction-limits/pulls/creation-capendpoint (schema takenfrom GitHub's OpenAPI description, since the REST docs were not yet published when the changelog went out).
Configuration
Nested under the existing
github.pull_requestsblock:enabled: falseturns the cap off.creation_capsection disables a cap that was previously managed by.asf.yaml.Changes
asfyaml/feature/github/__init__.py—creation_capstrictyaml schema + directive registrationasfyaml/feature/github/pr_creation_cap.py— new directive (payload build, 1–1000 range validation,disable-on-removal, noop-aware, idempotent PATCH)
tests/github_pr_creation_cap.py— 9 tests (schema validation + enable/disable/removal/out-of-range/noop)README.md— new "Pull request creation cap" subsection + ToC entryTesting
Full suite passes (105 tests),
ruffandmypyclean on the new code.