Light, fluffy, and always free - The AWS Local Emulator alternative
ci: limit contributors to 2 open pull requests (#4864)
Hector Ventura8d056e9456ba
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.mdindex 7d7f0d5461..a6eab3c487 100644--- a/.github/pull_request_template.md+++ b/.github/pull_request_template.md@@ -19,6 +19,7 @@- [ ] `./mvnw test` passes locally- [ ] New or updated integration test added- [ ] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)+- [ ] I have no more than 2 open, non-draft pull requests in this repository (maintainers and dependency bots are exempt).<!-- First PR here? Your CI checks wait for a maintainer to approve them before they run — that's GitHub's gate on first-time contributors, not a problem with your PR. --><!-- Questions, or want feedback on an approach before going further? Join us on Slack: https://join.slack.com/t/floci/shared_invite/zt-3tjn02s3q-A00kEjJ1cZxsg_imTfy6Cw -->diff --git a/.github/workflows/pr-limit.yml b/.github/workflows/pr-limit.ymlindex b9140d7e7d..4441d9cb94 100644--- a/.github/workflows/pr-limit.yml+++ b/.github/workflows/pr-limit.yml@@ -1,112 +1,44 @@-name: PR Limit Notice+name: PR Limit-# Advisory guard: contributors may have at most 5 open PRs at a time. When one-# is opened (or reopened) beyond that, this posts a polite reminder and adds-# the `over-pr-limit` label. It never closes PRs or fails checks.+# 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.#-# Exempt: bot accounts (dependabot alone may hold many PRs) and maintainers-# (OWNER/MEMBER/COLLABORATOR association). The label is removed automatically-# only when this same PR is re-evaluated while the author is back under the-# limit; stale labels on other PRs are cleaned up manually by maintainers.+# 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 so the token has write access on fork PRs. This- # workflow never checks out or executes PR code — it only calls the GitHub- # API — so the elevated context is not exposed.pull_request_target:- types: [opened, reopened]- # Manual test hook: evaluate an arbitrary PR (bypasses the exemptions).+ # 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: truepermissions:issues: writepull-requests: writeconcurrency:- # github.ref is the base branch under pull_request_target, so key on the PR- # number instead — otherwise every PR run would cancel every other.- group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.pr_number }}- cancel-in-progress: true--env:- PR_LIMIT: 5- LABEL: over-pr-limit+ # 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: falsejobs:- check-pr-limit:- name: Check author open-PR count- runs-on: ubuntu-latest- timeout-minutes: 5- # Manual dispatch skips exemptions (it is a maintainer-driven test).- # Over-exempting via author_association is fine: the check is advisory.- if: >- github.event_name == 'workflow_dispatch' ||- (github.event.pull_request.user.type != 'Bot' &&- !contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association))-- steps:- - name: Evaluate open-PR count and notify- env:- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}- EVENT_PR_NUMBER: ${{ github.event.pull_request.number }}- EVENT_AUTHOR: ${{ github.event.pull_request.user.login }}- INPUT_PR_NUMBER: ${{ inputs.pr_number }}- run: |- if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then- PR_NUMBER="$INPUT_PR_NUMBER"- AUTHOR=$(gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --json author --jq .author.login)- else- PR_NUMBER="$EVENT_PR_NUMBER"- AUTHOR="$EVENT_AUTHOR"- fi-- # Live list endpoint, not the search API — search indexing lags and- # can miss the PR that was just opened. The count includes the- # current PR, so "max 5 open" triggers at COUNT > 5.- COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --author "$AUTHOR" \- --state open --limit 100 --json number --jq 'length')- echo "Author $AUTHOR has $COUNT open PR(s); limit is $PR_LIMIT."-- if [ "$COUNT" -le "$PR_LIMIT" ]; then- gh api -X DELETE \- "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels/$LABEL" \- > /dev/null 2>&1 || true- exit 0- fi-- # Ensure the label exists (idempotent; self-heals if deleted).- gh label create "$LABEL" --repo "$GITHUB_REPOSITORY" --force \- --color fbca04 \- --description "Author has more than $PR_LIMIT open PRs — advisory only"-- gh pr edit "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --add-label "$LABEL"-- # Post the notice at most once per PR: skip when the marker comment- # already exists (e.g. the PR was closed and reopened).- if gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" \- --paginate --jq '.[].body' | grep -qF 'pr-limit-notice'; then- echo "Notice already posted; skipping comment."- exit 0- fi-- PR_LIST_URL="https://github.com/$GITHUB_REPOSITORY/pulls?q=is%3Apr+is%3Aopen+author%3A$AUTHOR"-- # One paragraph per line: GitHub renders a single newline in a- # comment as a hard line break.- BODY=$(cat <<EOF- <!-- pr-limit-notice -->- 👋 Thanks for the pull request!-- It looks like you now have **$COUNT open pull requests** in this repository, which is above our advisory limit of **$PR_LIMIT**. To keep the review backlog focused and make sure every contribution gets proper attention, we ask contributors to shepherd their existing PRs to the finish line before opening new ones — responding to review feedback, rebasing, or closing any that are no longer needed.-- Here is [your list of open PRs]($PR_LIST_URL). Nothing is blocked and this PR stays open — this is just a friendly nudge. The \`$LABEL\` label helps maintainers see at a glance which PRs to prioritize.-- If some of these PRs are stacked or intentionally related, just say so here and a maintainer will take that into account.- EOF- )-- gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$BODY"+ 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.mdindex 0598d495cc..4f93559eea 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -257,10 +257,21 @@ update path.3. CI runs tests automatically. All checks must pass before merge.4. Keep PRs focused: one feature or fix per PR.5. Reference any related issues in the PR description.-6. Keep at most **5 open PRs** at a time. A bot leaves an advisory note and an `over-pr-limit` label on PRs opened beyond that. Nothing gets closed or blocked, but please land or close your existing PRs before opening more.+6. Keep at most **2 open, non-draft PRs** at a time: see [Pull Request Limits and Review Bandwidth](#pull-request-limits-and-review-bandwidth).Docker images are built on contributor PRs only for the compatibility suite (`.github/workflows/compatibility.yml`, on changes under `src/**` and the compat test trees) and are never published, so merging to `main` is always cheap.+### 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)Stable releases ship on the **1st and 3rd Tuesday of each month**. Merging to `main` doesdiff --git a/docs/contributing.md b/docs/contributing.mdindex 773dbd1124..dd7232d4ec 100644--- a/docs/contributing.md+++ b/docs/contributing.md@@ -122,7 +122,7 @@ add or change, and leave unrelated cleanups for their own PR.- [ ] Commit messages follow Conventional Commits- [ ] Code follows the style rules above-Please keep at most **5 open PRs** at a time. A bot leaves an advisory note (label `over-pr-limit`) on PRs opened beyond that. See [CONTRIBUTING.md](https://github.com/floci-io/floci/blob/main/CONTRIBUTING.md#pull-request-guidelines) for details.+Please keep **no more than 2 open, non-draft pull requests** at a time. A bot labels your 3rd and later open PRs `over-pr-limit`, and starting 2026-10-08 it closes new ones from your 5th onward. See [CONTRIBUTING.md](https://github.com/floci-io/floci/blob/main/CONTRIBUTING.md#pull-request-limits-and-review-bandwidth) for details.## Releases