Skip to content

Commit a746850

Browse files
committed
Require an "open for pull requests" issue label on PRs
Replace the pull request template with the new contribution policy: a pull request must reference an issue in this repo that is open and carries the "open for pull requests" label, or it is closed automatically. The rule is deliberately without exceptions, including for documentation and typo fixes, which the previous template explicitly waved through. A rule with exceptions is a rule that gets argued about on every pull request that lands near the boundary, and the argument costs more than labeling a two line issue does. CONTRIBUTING describes the process and what each of the issue labels means for a contributor. The issue templates gain a note pointing at the same policy, so the expectation is set when the issue is opened rather than when the pull request is closed. The gate is implemented as a github webhook handler in publishthing (publishthing.apps.prgate), configured per project from build_ln. Change-Id: I1e6e5c2362a7178989d671146a14f281fa4ee8cf
1 parent 222b76b commit a746850

4 files changed

Lines changed: 144 additions & 0 deletions

File tree

‎.github/CONTRIBUTING.md‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributing to Mako
2+
3+
For general developer guidelines, please see our current Developer Guide at
4+
[Develop](https://www.sqlalchemy.org/develop.html).
5+
6+
## Pull requests require an approved issue ##
7+
8+
**We accept pull requests only for issues that a maintainer has marked with
9+
the `open for pull requests` label.** A pull request that doesn't reference
10+
such an issue is closed automatically, by a bot, as soon as it's opened.
11+
12+
The reason is that the vast majority of unsolicited pull requests are
13+
solutions to a problem we haven't agreed on yet, and reviewing them costs far
14+
more than writing them does. Settling the approach on the issue first means
15+
nobody writes code that was never going to be merged.
16+
17+
The process is:
18+
19+
1. **Open an issue** describing the problem or the feature, with a complete,
20+
runnable example. For a bug, that means a script we can run that shows the
21+
wrong behavior.
22+
2. **Wait for a maintainer** to look at it. If we agree the change is wanted
23+
and that an outside contribution is the right way to get it, we add the
24+
`open for pull requests` label.
25+
3. **Then open the pull request**, referencing the issue.
26+
27+
Some labels you'll see on issues, and what they mean for contributors:
28+
29+
| label | meaning |
30+
| --- | --- |
31+
| `open for pull requests` | we'd welcome a pull request for this |
32+
| `code review in progress` | someone is already working on it, in a pull request or directly in gerrit |
33+
| `NO pull requests please` | we're handling this one ourselves; please don't |
34+
35+
An issue with none of these labels hasn't been decided on yet. Asking on the
36+
issue is fine; opening a pull request to make the case is not, and it will be
37+
closed.
38+
39+
This applies to documentation and typo fixes too. We know that feels heavy
40+
for a one-line change, but the alternative is a rule with exceptions that have
41+
to be argued about, and we'd rather have one rule. A typo is a two-line issue
42+
and we'll label it quickly.
43+
44+
## Note on use of AI, agents and bots ##
45+
46+
Mako follows the same policy as SQLAlchemy; please see
47+
[the SQLAlchemy contributing guide](https://github.com/sqlalchemy/sqlalchemy/blob/main/.github/CONTRIBUTING.md#note-on-use-of-ai-agents-and-bots).
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Create a bug report
3+
about: Errors and regression reports with complete reproducing test cases and/or stack traces.
4+
---
5+
6+
**Describe the bug**
7+
<!-- A clear and concise description of what the bug is. -->
8+
9+
**To Reproduce**
10+
<!-- Provide your reproducing test case here. It should be complete and
11+
runnable on its own, with no dependencies beyond Mako itself. -->
12+
13+
```py
14+
# Insert code here
15+
```
16+
17+
**Error**
18+
<!-- Provide the complete text of any errors received, as formatted text,
19+
not a screenshot. -->
20+
21+
```
22+
# Insert stack trace here
23+
```
24+
25+
**Versions**
26+
- OS:
27+
- Python:
28+
- Mako:
29+
30+
**Additional context**
31+
<!-- Add any other context about the problem here. -->
32+
33+
**Thinking of submitting a pull request for this?** Please wait until a
34+
maintainer has added the `open for pull requests` label to this issue. Pull
35+
requests that don't reference an issue carrying that label are closed
36+
automatically.
37+
38+
**Have a nice day!**

‎.github/ISSUE_TEMPLATE/use_case.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature Request / Use Case
3+
about: Describe a use case that Mako doesn't currently support.
4+
---
5+
6+
**Describe the use case**
7+
<!-- What are you trying to do that Mako doesn't currently allow? -->
8+
9+
10+
**Example Use**
11+
<!-- Provide a clear example of what the code would look like if this
12+
were supported. -->
13+
14+
```py
15+
# Insert code here
16+
```
17+
18+
**Additional context**
19+
<!-- Add any other context about the use case here. -->
20+
21+
**Thinking of submitting a pull request for this?** Please wait until a
22+
maintainer has added the `open for pull requests` label to this issue. Pull
23+
requests that don't reference an issue carrying that label are closed
24+
automatically.
25+
26+
**Have a nice day!**

‎.github/pull_request_template.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!-- Provide a general summary of your proposed changes in the Title field above -->
2+
3+
**This project accepts pull requests only for issues that a maintainer has
4+
marked with the `open for pull requests` label.**
5+
6+
A pull request that doesn't reference such an issue **is closed
7+
automatically**. That isn't a judgment on your change: it's how we settle on
8+
an approach before anyone spends time writing code, and how we keep two
9+
people from doing the same work at once.
10+
11+
The issue you reference has to be:
12+
13+
* in this repository,
14+
* open,
15+
* labeled `open for pull requests`, and
16+
* not already labeled `code review in progress`, which means someone is
17+
working on it already.
18+
19+
If there's no such issue yet, open one describing the problem or the feature,
20+
including a complete, runnable example, and wait for a maintainer to add the
21+
label. Please don't open a pull request first and ask for the label
22+
afterwards.
23+
24+
### Fixes
25+
26+
<!-- Put the issue number after the "#" below, e.g. "Fixes: #1234".
27+
Leaving this blank means this pull request will be closed. -->
28+
29+
Fixes: #
30+
31+
### Description
32+
33+
<!-- Describe your changes in detail. -->

0 commit comments

Comments
 (0)