Merge pull request 'release: promote the contributor-facing docs and CI gates to main' (#37) from develop into main
This commit was merged in pull request #37.
This commit is contained in:
commit
7518a5a785
9 files changed
+258
-3
No files matched your search
@@ -1,3 +1,14 @@
|
||||
# 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
|
||||
|
||||
contact_links:
|
||||
- name: Security vulnerability
|
||||
url: https://github.com/Expressive-Tea/green-tea/security/advisories/new
|
||||
about: Report it privately instead. Never in a public issue — see SECURITY.md.
|
||||
- name: Documentation
|
||||
url: https://green-tea.expressive-tea.io/docs/
|
||||
about: How to wire a route, a module, a plugin or a runtime adapter.
|
||||
- name: Help with your own app
|
||||
url: mailto:support@expressive-tea.io
|
||||
about: Implementation questions about your code rather than a bug in green-tea.
|
||||
@@ -10,7 +10,7 @@ Closes #
|
||||
|
||||
- [ ] The base branch above is `contrib`
|
||||
- [ ] Commits are signed off (`git commit -s`)
|
||||
- [ ] `npm run lint`, `npm run format:check`, `npm run typecheck` and `npm test` pass locally
|
||||
- [ ] `npm run lint`, `npm run format:check`, `npm run typecheck`, `npm test`, `npm run complexity:check` and `npm run build` 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
|
||||
@@ -5,6 +5,36 @@ on:
|
||||
pull_request:
|
||||
branches: [develop, main, contrib]
|
||||
jobs:
|
||||
# Separate job so a missing sign-off reports on its own and doesn't hide behind the code
|
||||
# gates, and so it costs nothing on push. Checks that the trailer is present, not that it
|
||||
# matches the author — a mismatch is a judgement call for a reviewer, an absent trailer
|
||||
# is not, and telling a contributor on their first push beats telling them on review.
|
||||
dco:
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Every commit needs a Signed-off-by
|
||||
env:
|
||||
RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
|
||||
run: |
|
||||
missing=0
|
||||
for sha in $(git rev-list --no-merges "$RANGE"); do
|
||||
if ! git show -s --format='%(trailers:key=Signed-off-by,valueonly)' "$sha" | grep -q '[^[:space:]]'; then
|
||||
echo "::error::no Signed-off-by: $(git show -s --format='%h %s' "$sha")"
|
||||
missing=1
|
||||
fi
|
||||
done
|
||||
if [ "$missing" = 1 ]; then
|
||||
echo "We use the DCO instead of a CLA. See CONTRIBUTING.md."
|
||||
echo "Fix the whole branch with: git rebase --signoff ${{ github.event.pull_request.base.sha }}"
|
||||
echo "Then: git push --force-with-lease"
|
||||
exit 1
|
||||
fi
|
||||
echo "All commits signed off."
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -17,3 +17,10 @@ website/dist/
|
||||
|
||||
# Edge (Miniflare) test bundle artifact
|
||||
test/edge/_worker.mjs
|
||||
|
||||
# Bun writes this on `bun install`, and nothing here consumes it: `npm run test:bun` runs
|
||||
# `bun test` against the node_modules npm installed, which package-lock.json already pins.
|
||||
# deno.lock IS tracked, and that asymmetry is deliberate — the Deno tests import `npm:` and
|
||||
# `jsr:` specifiers that Deno resolves against registries, so only a lockfile makes them
|
||||
# reproducible. Bun resolves the same package.json npm does.
|
||||
bun.lock
|
||||
@@ -0,0 +1,89 @@
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at **compliance@expressive-tea.io**. All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
||||
|
||||
If you would rather write to a named person than to an address, the project lead reads
|
||||
diego.resendez@expressive-tea.io. Reports about a maintainer, including the project lead,
|
||||
should go to compliance@expressive-tea.io, which is not maintained by the project team.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
|
||||
@@ -99,6 +99,38 @@ If your assistant reads repository instructions, `AGENTS.md` has the conventions
|
||||
|
||||
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.
|
||||
|
||||
## Local setup
|
||||
|
||||
Node 18 or newer, which is what `engines` requires and what CI runs.
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
That does one thing worth knowing about: the `prepare` script points `core.hooksPath` at
|
||||
`.githooks/`, which installs a pre-commit gate. The gate formats and lint-fixes your staged
|
||||
sources automatically, then refuses the commit if `npm run lint` or `npm run complexity:check`
|
||||
fails. It is there so CI tells you nothing you couldn't have heard locally. Confirm it took:
|
||||
|
||||
```bash
|
||||
git config core.hooksPath # should print .githooks
|
||||
```
|
||||
|
||||
If it prints nothing, run `git config core.hooksPath .githooks` yourself. If you install with
|
||||
something other than npm, check this before your first commit rather than after.
|
||||
|
||||
`npm test` runs the Node suite under Vitest. The other three runtimes have their own commands
|
||||
and their own toolchains, and none of them run in CI:
|
||||
|
||||
```bash
|
||||
npm run test:deno # needs deno
|
||||
npm run test:bun # needs bun
|
||||
npm run test:edge # Miniflare
|
||||
```
|
||||
|
||||
You are not expected to install all three to fix a typo. You are expected to run the one your
|
||||
change touches, and to say in the pull request which ones you ran.
|
||||
|
||||
## Before you open a pull request
|
||||
|
||||
Run what CI runs:
|
||||
@@ -108,9 +140,12 @@ 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
|
||||
npm run complexity:check
|
||||
npm run build
|
||||
```
|
||||
|
||||
- Write tests for new behavior (TDD welcome). We use Vitest.
|
||||
- `complexity:check` caps the cognitive complexity of every function in `src/`. What it measures is how much you have to hold in your head to follow a function from top to bottom, and it charges nesting more heavily than branching: a condition inside a closure inside a function costs several times what the same condition costs at the top level. Going over the threshold is not a verdict on your code — it means one function has grown to ask too much of whoever reads it next. The fix is nearly always to lift a nested closure out to module scope, where its branches are charged once instead of three times over. Raising `COMPLEXITY_MAX` is not the fix, even though the script suggests it.
|
||||
- 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`.
|
||||
@@ -121,3 +156,9 @@ On GitHub, workflows do not run on pull requests from forks until a maintainer a
|
||||
## Reporting issues
|
||||
|
||||
Open an issue with a minimal reproduction: green-tea version, runtime and version, and the smallest module/route that shows the problem.
|
||||
|
||||
**Except for security.** If what you found is exploitable, do not open an issue — an issue is world-readable the moment you press the button. Email security@expressive-tea.io or use the [private advisory form](https://github.com/Expressive-Tea/green-tea/security/advisories/new). [`SECURITY.md`](./SECURITY.md) has the scope and what to expect back.
|
||||
|
||||
## Code of conduct
|
||||
|
||||
By taking part here you agree to the [Code of Conduct](./CODE_OF_CONDUCT.md), which is the Contributor Covenant 2.1. Reports go to compliance@expressive-tea.io.
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting a vulnerability
|
||||
|
||||
Email **security@expressive-tea.io**. Please do not open a public issue for something
|
||||
exploitable — an issue is world-readable from the moment you press the button, and that is
|
||||
the one thing a security report cannot be.
|
||||
|
||||
Include whatever you have: the version, the runtime, and the smallest app that shows it.
|
||||
A route, a module and a request is usually enough. If you have a working exploit, send it;
|
||||
if you only have a suspicion, send that instead of sitting on it.
|
||||
|
||||
You can also report privately through GitHub's
|
||||
[security advisory form](https://github.com/Expressive-Tea/green-tea/security/advisories/new),
|
||||
which reaches the same people.
|
||||
|
||||
## What happens next
|
||||
|
||||
Acknowledgement within **5 working days**. A verdict on whether we agree it is a vulnerability
|
||||
within **15**. If we agree, you get the fix timeline and a heads-up before the advisory goes
|
||||
public. If we don't, you get the reasoning rather than silence.
|
||||
|
||||
Those numbers are deliberately slower than the 24 to 48 hours you will see quoted elsewhere.
|
||||
That figure comes from the CERT Guide to Coordinated Vulnerability Disclosure and describes
|
||||
vendors and coordinators — organizations with someone on rotation. This project is one person.
|
||||
A number that only holds in a good week is worse than an honest one.
|
||||
|
||||
Which is why there is an escape hatch, and you should use it. **If you have no acknowledgement
|
||||
after 10 working days**, write directly to diego.resendez@expressive-tea.io. If that is also
|
||||
met with silence, consider yourself released from any embargo and disclose as you see fit. You
|
||||
will not have done anything wrong: a project that goes quiet on a security report has spent
|
||||
whatever claim it had on your patience.
|
||||
|
||||
## Disclosure window
|
||||
|
||||
We ask for **90 days** from your report before public disclosure, or until the fix ships,
|
||||
whichever comes first. That is the industry default and we are not asking you for more than
|
||||
anyone else does. If the fix is out in a week, so is the advisory.
|
||||
|
||||
If a vulnerability is being actively exploited, the window is however long it takes us to ship,
|
||||
and we will say so rather than hold you to 90 days while users are being attacked.
|
||||
|
||||
We publish a GitHub advisory for anything that affects a released version, and credit you by
|
||||
the name you ask for. Say so if you would rather not be named.
|
||||
|
||||
There is no bug bounty and no money, which we would rather state here than leave you to find
|
||||
out after the work.
|
||||
|
||||
## Supported versions
|
||||
|
||||
While the package is in beta, only the most recent `26.x.y-beta.N` receives fixes. There is no
|
||||
backport channel yet; when the first stable ships, this section gets the real table.
|
||||
|
||||
## Scope
|
||||
|
||||
In scope: anything in `src/` that ships in the published package — route matching, the request
|
||||
pipeline, body parsing and its limits, the security headers and CORS handling, TLS setup, the
|
||||
WebSocket upgrade path, the mesh wire protocol, static file serving and view rendering.
|
||||
|
||||
Out of scope: the benchmarks in `bench/`, the docs site in `website/`, dev-only tooling, and
|
||||
anything that requires an attacker to already control your application code. Advisories in
|
||||
build-time dependencies are worth telling us about, but they are not vulnerabilities in
|
||||
green-tea and we handle them as ordinary dependency updates.
|
||||
|
||||
A denial of service that needs no authentication is in scope. Reports that amount to "this
|
||||
endpoint is slow under load" generally are not — but if you are unsure which one you have,
|
||||
send it and let us decide.
|
||||
+3
-2
@@ -3,13 +3,14 @@
|
||||
"version": "26.8.0-beta.0",
|
||||
"description": "A zen, opinionated, type-safe framework \u2014 your API is a graph, not a middleware chain.",
|
||||
"license": "MIT",
|
||||
"author": "green-tea contributors",
|
||||
"author": "green-tea contributors <projects@expressive-tea.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Expressive-Tea/green-tea.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Expressive-Tea/green-tea/issues"
|
||||
"url": "https://github.com/Expressive-Tea/green-tea/issues",
|
||||
"email": "projects@expressive-tea.io"
|
||||
},
|
||||
"homepage": "https://green-tea.expressive-tea.io/docs/",
|
||||
"keywords": [
|
||||
|
||||
@@ -10,8 +10,10 @@ interface PackageMetadata {
|
||||
};
|
||||
readonly bugs?: {
|
||||
readonly url?: string;
|
||||
readonly email?: string;
|
||||
};
|
||||
readonly homepage?: string;
|
||||
readonly author?: string;
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(readFileSync(resolve(process.cwd(), 'package.json'), 'utf8')) as PackageMetadata;
|
||||
@@ -27,7 +29,14 @@ describe('package publication metadata', () => {
|
||||
it('links npm consumers to support and documentation', () => {
|
||||
expect(packageJson.bugs).toEqual({
|
||||
url: 'https://github.com/Expressive-Tea/green-tea/issues',
|
||||
email: 'projects@expressive-tea.io',
|
||||
});
|
||||
expect(packageJson.homepage).toBe('https://green-tea.expressive-tea.io/docs/');
|
||||
});
|
||||
|
||||
// A published package whose only contact is a GitHub URL is unreachable to anyone without
|
||||
// an account, so the address is pinned here rather than left to drift back out.
|
||||
it('gives npm an address to show for the package', () => {
|
||||
expect(packageJson.author).toBe('green-tea contributors <projects@expressive-tea.io>');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user