Skip to content

Commit da2e1ff

Browse files
committed
ci: limit contributors to 2 open pull requests
Call the shared floci-io/.github pr-limit workflow on opened, reopened and ready_for_review, and on closed and converted_to_draft to clear stale labels. Runs for the same pull request queue rather than cancel, and manual runs use their own concurrency group. Contributors keep at most 2 open, non-draft pull requests: the 3rd and 4th get the over-pr-limit label and a reminder, and from 2026-10-08 the 5th and later are closed automatically. Bots and maintainers are exempt. Add a CONTRIBUTING.md following the organization template (DCO sign-off, commit messages, how to run the tests locally, the pull request limit), so the repository no longer falls back to the organization default. Signed-off-by: Hector Ventura <hectorvent@gmail.com>
1 parent e20db34 commit da2e1ff

2 files changed

Lines changed: 128 additions & 0 deletions

File tree

‎.github/workflows/pr-limit.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: PR Limit
2+
3+
# Open-PR limit for contributors (see CONTRIBUTING.md, "Pull Request Limits and Review
4+
# Bandwidth"). The logic, limits and wording live in the shared reusable workflow in
5+
# floci-io/.github; this file only wires the events to it.
6+
#
7+
# pull_request_target gives the token write access on fork PRs. Neither this workflow
8+
# nor the reusable one checks out or runs PR code; they only call the GitHub API.
9+
10+
on:
11+
pull_request_target:
12+
# closed and converted_to_draft only remove stale over-pr-limit labels.
13+
types: [opened, reopened, ready_for_review, closed, converted_to_draft]
14+
# Manual hook: evaluate any open PR. Dry run by default, so it only logs the decision.
15+
workflow_dispatch:
16+
inputs:
17+
pr_number:
18+
description: 'PR number to evaluate'
19+
required: true
20+
dry_run:
21+
description: 'Only log what would happen'
22+
type: boolean
23+
default: true
24+
25+
permissions:
26+
issues: write
27+
pull-requests: write
28+
29+
concurrency:
30+
# github.ref is the base branch under pull_request_target, so key on the PR number;
31+
# otherwise every PR run would cancel every other. Manual runs get their own group:
32+
# GitHub keeps only one pending run per group, so sharing it would let a manual dry
33+
# run replace a live evaluation waiting in the queue. Live runs for the same PR queue
34+
# rather than cancel; a newer live event may replace an older pending one, which is
35+
# fine because it evaluates the PR's current state.
36+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.pr_number }}-${{ github.event_name == 'workflow_dispatch' && 'manual' || 'live' }}
37+
cancel-in-progress: false
38+
39+
jobs:
40+
pr-limit:
41+
uses: floci-io/.github/.github/workflows/pr-limit.yml@main
42+
with:
43+
pr-number: ${{ format('{0}', github.event.pull_request.number || inputs.pr_number) }}
44+
dry-run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }}

‎CONTRIBUTING.md‎

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Contributing to testcontainers-floci (Python)
2+
3+
Thanks for contributing. Issues, reviews, docs, and pull requests are all welcome, and you
4+
don't need permission to start. Before you dig in, a quick read of the project
5+
[GOVERNANCE.md](https://github.com/floci-io/.github/blob/main/GOVERNANCE.md) explains how
6+
decisions are made and how contributors grow into Maintainers over time.
7+
8+
## Developer Certificate of Origin (DCO) sign-off
9+
10+
Every commit must be **signed off**, certifying the
11+
[Developer Certificate of Origin](https://developercertificate.org/), a lightweight statement
12+
that you wrote the contribution or otherwise have the right to submit it under the project's
13+
license. It is **required for a pull request to be merged**.
14+
15+
Sign off by adding the `-s` flag when you commit:
16+
17+
```bash
18+
git commit -s -m "feat(config): add Kinesis service configuration"
19+
```
20+
21+
This appends a `Signed-off-by: Your Name <your@email>` trailer using your configured git
22+
identity. If you forget, you can amend the most recent commit with `git commit --amend -s`, or
23+
sign off a range during an interactive rebase.
24+
25+
Why Floci uses the DCO and not a CLA is explained in the
26+
[organization contributing guide](https://github.com/floci-io/.github/blob/main/CONTRIBUTING.md#why-the-dco-and-not-a-cla).
27+
28+
## Commit messages
29+
30+
- Use [Conventional Commits](https://www.conventionalcommits.org/), e.g.
31+
`fix(container): expose the RDS port range`.
32+
- Releases are cut by semantic-release from these messages: `feat` and `fix` commits decide the
33+
next version, so pick the type that matches the change.
34+
- **No AI attribution.** Do not add "Generated by", "Co-Authored-By: …-bot", or similar
35+
trailers to commit messages.
36+
37+
## Running tests locally
38+
39+
Set up a development environment with [uv](https://docs.astral.sh/uv/) (or
40+
`pip install -e ".[dev]"`):
41+
42+
```bash
43+
uv sync --extra dev
44+
```
45+
46+
Lint, format check and type check, as CI runs them:
47+
48+
```bash
49+
ruff check .
50+
ruff format --check .
51+
mypy floci
52+
```
53+
54+
Unit tests need no Docker:
55+
56+
```bash
57+
pytest -m "not integration" -v
58+
```
59+
60+
Integration tests start a real Floci container, so they need Docker:
61+
62+
```bash
63+
docker pull floci/floci:latest
64+
pytest -m integration -v
65+
```
66+
67+
## Pull Request Limits and Review Bandwidth
68+
69+
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.
70+
71+
- **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.
72+
- **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.
73+
- **Draft PRs:** drafts do not count against the limit. Mark a draft as ready for review only when you have review capacity available.
74+
- **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.
75+
76+
Once your current pull requests are reviewed, merged, or closed, you are welcome to open new ones!
77+
78+
## Questions and discussion
79+
80+
- 💬 **[Slack](https://join.slack.com/t/floci/shared_invite/zt-3tjn02s3q-A00kEjJ1cZxsg_imTfy6Cw)**: quick questions and community chat.
81+
- 🗣️ **[GitHub Discussions](https://github.com/orgs/floci-io/discussions)**: feature ideas, design tradeoffs, and proposals.
82+
83+
By contributing, you agree to abide by the project
84+
[Code of Conduct](https://github.com/floci-io/.github/blob/main/CODE_OF_CONDUCT.md).

0 commit comments

Comments
 (0)