diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2575495..3372ea5 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -25,3 +25,4 @@ - [ ] `README.md` updated (if a command or flag changed) - [ ] Native binary verified (`mvn package -Pnative`) — required if Jackson serialization or dependencies changed - [ ] Commit messages / PR title follow [Conventional Commits](https://www.conventionalcommits.org/) — a `feat`/`fix`/`perf` subject becomes the release note, so `CHANGELOG.md` needs no hand edit +- [ ] I have no more than 2 open, non-draft pull requests in this repository (maintainers and dependency bots are exempt). diff --git a/.github/workflows/pr-limit.yml b/.github/workflows/pr-limit.yml new file mode 100644 index 0000000..4441d9c --- /dev/null +++ b/.github/workflows/pr-limit.yml @@ -0,0 +1,44 @@ +name: PR Limit + +# Open-PR limit for contributors (see CONTRIBUTING.md, "Pull Request Limits and Review +# Bandwidth"). The logic, limits and wording live in the shared reusable workflow in +# floci-io/.github; this file only wires the events to it. +# +# pull_request_target gives the token write access on fork PRs. Neither this workflow +# nor the reusable one checks out or runs PR code; they only call the GitHub API. + +on: + pull_request_target: + # closed and converted_to_draft only remove stale over-pr-limit labels. + types: [opened, reopened, ready_for_review, closed, converted_to_draft] + # Manual hook: evaluate any open PR. Dry run by default, so it only logs the decision. + workflow_dispatch: + inputs: + pr_number: + description: 'PR number to evaluate' + required: true + dry_run: + description: 'Only log what would happen' + type: boolean + default: true + +permissions: + issues: write + pull-requests: write + +concurrency: + # github.ref is the base branch under pull_request_target, so key on the PR number; + # otherwise every PR run would cancel every other. Manual runs get their own group: + # GitHub keeps only one pending run per group, so sharing it would let a manual dry + # run replace a live evaluation waiting in the queue. Live runs for the same PR queue + # rather than cancel; a newer live event may replace an older pending one, which is + # fine because it evaluates the PR's current state. + group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.pr_number }}-${{ github.event_name == 'workflow_dispatch' && 'manual' || 'live' }} + cancel-in-progress: false + +jobs: + pr-limit: + uses: floci-io/.github/.github/workflows/pr-limit.yml@main + with: + pr-number: ${{ format('{0}', github.event.pull_request.number || inputs.pr_number) }} + dry-run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cbef40f..87ba468 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -133,6 +133,17 @@ Do not include `Co-Authored-By` trailers for AI tools in commit messages. Attrib - Docs, formatting, and low-risk internal refactors may not need new tests, but the existing suite must pass - If a PR includes no new tests, explain why in the description +### Pull Request Limits and Review Bandwidth + +To make sure every contribution gets a thorough, high-quality review in a reasonable time, we ask contributors to keep **no more than 2 open, non-draft pull requests** at any time in this repository. + +- **Why this policy exists:** maintainer review time is limited. Capping concurrent open PRs prevents review backlogs, reduces context switching, and keeps PR cycle times short for everyone. +- **Dependent work:** if your work depends on a PR that has not been merged yet, build on that branch or note the dependency in the discussion instead of opening separate, uncoordinated PRs. +- **Draft PRs:** drafts do not count against the limit. Mark a draft as ready for review only when you have review capacity available. +- **How it is applied:** a bot labels your 3rd and later open pull requests `over-pr-limit` with a reminder. Starting **2026-10-08**, from your 5th open pull request onward, new ones are closed automatically. Your branch and commits are kept, and you can reopen the PR once one of your other PRs is merged or closed. Maintainers and dependency bots are not counted. + +Once your current pull requests are reviewed, merged, or closed, you are welcome to open new ones! + ## Release Process (maintainers) Releases are cut when there is something worth shipping. Unlike the emulators, floci-cli is