From f2db461187521a7a93d0d825c9af862d1466932e Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sat, 8 Aug 2026 17:35:20 -0500 Subject: [PATCH] docs: tell contributors where their changes go, and add the templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CONTRIBUTING described GitFlow as though there were one forge. There are two, and nothing said so: an outside contributor reading it had no way to learn that GitHub is a mirror of `main` and that pull requests belong on `contrib`. The first external PR duly went to `main`, which was our omission rather than theirs. The templates carry the parts that keep being repeated by hand — sign-off, the local check commands, and the two failures that a graph framework invites: an implementation growing an option that its public interface never declares, and behavior that works on Node while silently doing nothing on Deno and Bun. Blank issues stay enabled. Scope and placement discussions are most of what gets filed here and they don't fit a bug form. Signed-off-by: Diego Resendez --- .github/ISSUE_TEMPLATE/bug_report.md | 28 +++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 3 ++ .github/PULL_REQUEST_TEMPLATE.md | 18 ++++++++++ CONTRIBUTING.md | 52 ++++++++++++++++++++++++++-- 4 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..47efcbf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,28 @@ +--- +name: Bug report +about: Something behaves differently from what the docs or the types promise +labels: bug +--- + +## What happened + +## What you expected + +## Minimal reproduction + +The smallest module and route that shows it: + +```ts + +``` + +## Environment + +- green-tea version: +- Runtime and version: +- OS: + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..9deffda --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,3 @@ +# Design questions, scope decisions and "should this live in core?" threads don't fit a +# bug form, and they are most of what gets filed here. Keep the blank option available. +blank_issues_enabled: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..3b882a8 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,18 @@ + + +## What this changes + + + +Closes # + +## Checklist + +- [ ] Commits are signed off (`git commit -s`) +- [ ] `npm run lint`, `npm run format:check`, `npm run typecheck` and `npm test` pass locally +- [ ] New behavior has a test +- [ ] A new public option or method is also declared in `src/app/types.ts`, and noted in `README.md` +- [ ] Behavior is the same on Node, Deno and Bun — or the difference is deliberate, and said out loud here diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4cf1e99..afebbe0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,36 @@ Thanks for your interest. green-tea is open source, but not anyone can push directly — contributions land through reviewed pull/merge requests with a **DCO sign-off**. +## Where to send your changes + +Development happens on a private Gitea instance. The GitHub repository is a downstream mirror: it receives `main` and release tags, and nothing else. Which branch you target depends on where you are. + +**From GitHub, if you are an outside contributor:** open your pull request against **`contrib`**. Not `main`. `main` on GitHub is a mirror of released code, and merging into it puts the two forges out of sync and breaks the next release push. A maintainer reviews on `contrib` and then carries your commits upstream into Gitea's `develop`, with your authorship and your sign-off intact. + +**From Gitea, if you have access:** follow the branch model below. + +### Worked example + +```bash +# fork Expressive-Tea/green-tea on GitHub, then +git clone git@github.com:/green-tea.git +cd green-tea +git remote add upstream https://github.com/Expressive-Tea/green-tea.git +git fetch upstream + +# branch from contrib, not from main +git checkout -b fix/close-timeout upstream/contrib + +# ... make the change, add a test ... + +git commit -s -m "fix: add a timeout to app.close()" +git push origin fix/close-timeout +``` + +Then open the pull request with **`contrib`** as the base branch. + +`contrib` tracks released code, so it is reset to `main` after each release. If your branch has been open across one, rebase onto the new `contrib` before pushing again. + ## Developer Certificate of Origin (DCO) We use the [Developer Certificate of Origin](./DCO) instead of a CLA. It's a lightweight, per-commit affirmation that you have the right to submit your work under the project's license. No copyright assignment, no paperwork. @@ -26,6 +56,13 @@ To sign off a range you forgot to sign: git rebase --signoff ``` +Or, for the commit you just made: + +```bash +git commit --amend -s +git push --force-with-lease +``` + ## Branch model (GitFlow) - `main` — production-ready, protected. No direct pushes. @@ -33,6 +70,7 @@ git rebase --signoff - `feature/` — branch from `develop`. - `hotfix/` — branch from `main`. - `release/` — release stabilization. +- `contrib` — GitHub only. Where outside contributions land before a maintainer moves them to `develop`. `main` and `develop` are protected: they require a reviewed MR and signed-off commits. (Branch protection is configured on the git server, not in this repo.) @@ -40,17 +78,25 @@ git rebase --signoff Follow [Conventional Commits](https://www.conventionalcommits.org/): `feat:`, `fix:`, `chore:`, `docs:`, `test:`, `refactor:`. Focus the message on the *why*. Do not add AI co-authoring attribution. -## Before you open an MR +## Before you open a pull request + +Run what CI runs: ```bash -npm test # all tests must pass +npm run lint +npm run format:check npm run typecheck # must be clean — this includes the compile-time-guarantee type test +npm test # all tests must pass ``` - Write tests for new behavior (TDD welcome). We use Vitest. - Keep runtime dependencies at zero beyond `reflect-metadata`. +- A new option or method on a public interface has to change that interface too. An implementation that grows a parameter without `src/app/types.ts` growing it as well is unreachable for anyone consuming the package. - New public API needs a doc note in `README.md`. +- If your change only works on one runtime, say so in the pull request. green-tea runs on Node, Deno, Bun and the edge, and behavior that quietly differs between them is treated as a bug — an explicit "not available here" is fine, silence is not. + +On GitHub, workflows do not run on pull requests from forks until a maintainer approves them, so your first push may sit without any checks for a while. That is not a rejection. ## Reporting issues -Open an issue with a minimal reproduction: green-tea version, Node version, and the smallest module/route that shows the problem. +Open an issue with a minimal reproduction: green-tea version, runtime and version, and the smallest module/route that shows the problem.