Skip to content

Commit a738c0a

Browse files
committed
docs, ci: Route contributions through issues
Split public contributor guidance from collaborator workflow. CONTRIBUTING now points public bug reports, fix proposals, feature requests, and design proposals to issues and discussions, while COLLABORATORS keeps the setup, check, commit, and pull request mechanics for approved collaborators. Add GitHub templates and a pull_request_target workflow that closes outside pull requests unless they come from a repository collaborator, an allowed bot, or carry the allow-pr label.
1 parent cfa51ba commit a738c0a

9 files changed

Lines changed: 275 additions & 168 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
labels: []
2+
body:
3+
- type: textarea
4+
id: proposal
5+
attributes:
6+
label: Proposal
7+
value: |
8+
# Summary
9+
10+
A brief explanation of the proposal.
11+
12+
# Background and motivation
13+
14+
Include the context that explains why this proposal matters.
15+
What problem are you trying to solve? Who is affected?
16+
17+
# Goals
18+
19+
List the outcomes this proposal should achieve.
20+
21+
-
22+
23+
# Example
24+
25+
If the proposal changes an API or workflow, include a small example.
26+
Otherwise, omit this section.
27+
validations:
28+
required: true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### Describe the bug
2+
3+
<!-- A clear and concise description of what the bug is. -->
4+
5+
### Expected behavior
6+
7+
<!-- What did you expect to happen instead? -->
8+
9+
### Steps to reproduce
10+
11+
<!-- Start from one of the examples in `examples/`, or from a basic hello world. Include commands, code, and any relevant output. -->
12+
13+
1.
14+
2.
15+
3.
16+
17+
### Environment
18+
19+
<!-- Include the package version, runtime, operating system, and any relevant Cloudflare Workers or Containers setup. -->

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Feature request or design discussion
4+
url: https://github.com/cloudflare/computer/discussions/new?category=feature-request
5+
about: Propose and discuss new features, improvements, and design changes.

.github/pull_request_template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Thanks for your interest in Cloudflare Computer.
2+
3+
This repository does not accept unsolicited pull requests. Please open one of the accepted contribution types instead:
4+
5+
- Bug reports and fixes: https://github.com/cloudflare/computer/issues
6+
- Feature requests and design proposals: https://github.com/cloudflare/computer/discussions
7+
8+
Maintainers may close pull requests that do not come from an approved collaborator. If a maintainer asked you to open this pull request, they can add the `allow-pr` label and reopen it.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Close unrequested pull requests
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened]
6+
7+
permissions:
8+
contents: read
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
close:
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- name: Close pull requests from unapproved contributors
17+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
18+
with:
19+
script: |
20+
const pullRequest = context.payload.pull_request;
21+
const allowedAssociations = new Set(['OWNER', 'MEMBER', 'COLLABORATOR']);
22+
const allowedBots = new Set(['dependabot[bot]', 'renovate[bot]']);
23+
const allowedLabels = new Set(['allow-pr']);
24+
25+
if (allowedAssociations.has(pullRequest.author_association)) {
26+
return;
27+
}
28+
29+
if (allowedBots.has(pullRequest.user.login)) {
30+
return;
31+
}
32+
33+
const labels = (pullRequest.labels || []).map((label) => label.name);
34+
if (labels.some((label) => allowedLabels.has(label))) {
35+
return;
36+
}
37+
38+
const { owner, repo } = context.repo;
39+
const issue_number = pullRequest.number;
40+
const body = [
41+
'Thanks for your interest in Cloudflare Computer.',
42+
'',
43+
'This repository does not accept unsolicited pull requests. Please use one of the accepted contribution paths instead:',
44+
'',
45+
'- Bug reports, regressions, and fix proposals: https://github.com/cloudflare/computer/issues/new/choose',
46+
'- Feature requests, enhancements, and design proposals: https://github.com/cloudflare/computer/discussions',
47+
'',
48+
'If a maintainer asked you to open this pull request, they can add the `allow-pr` label and reopen it.'
49+
].join('\n');
50+
51+
await github.rest.issues.createComment({ owner, repo, issue_number, body });
52+
await github.rest.pulls.update({ owner, repo, pull_number: issue_number, state: 'closed' });

AGENTS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
- [`README.md`](README.md) — what this repo is and how the pieces
66
fit together.
7-
- [`CONTRIBUTING.md`](CONTRIBUTING.md) — setup, checks, commit and
7+
- [`CONTRIBUTING.md`](CONTRIBUTING.md) — public contribution paths.
8+
- [`COLLABORATORS.md`](COLLABORATORS.md) — setup, checks, commit and
89
pull request conventions. The canonical source for the day-to-day
910
workflow.
1011
- [`docs/README.md`](docs/README.md) — design specification. Forward-
@@ -103,11 +104,11 @@ npm test --workspace @cloudflare/dofs -- src/foo.test.ts # one file
103104
```
104105

105106
Full details, including typecheck and build commands, are in
106-
[`CONTRIBUTING.md`](CONTRIBUTING.md).
107+
[`COLLABORATORS.md`](COLLABORATORS.md).
107108

108109
## Commits and pull requests
109110

110-
Follow [`CONTRIBUTING.md`](CONTRIBUTING.md). The short version:
111+
Follow [`COLLABORATORS.md`](COLLABORATORS.md). The short version:
111112

112113
- One logical change per commit.
113114
- Imperative subject prefixed with the scope (`dofs:`, `rpc:`, `computer:`,

COLLABORATORS.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Collaborator guide
2+
3+
This document is for approved collaborators with pull request access. Public contribution paths are documented in [`CONTRIBUTING.md`](CONTRIBUTING.md).
4+
5+
It covers the day-to-day mechanics: how to set up the repo, how to run checks, and how to shape commits and pull requests.
6+
7+
## Setup
8+
9+
Requirements:
10+
11+
- Node 22 or newer. `packages/computerd` declares `"engines": { "node": ">=22" }`.
12+
- npm. This repo uses npm workspaces, not pnpm or yarn.
13+
- Linux with FUSE if you want to run `packages/computerd` end-to-end. The rest of the workspace builds and tests on macOS as well.
14+
- Docker, optionally, for `examples/container`.
15+
16+
Clone and install from the repo root:
17+
18+
```bash
19+
git clone https://github.com/cloudflare/computer.git
20+
cd computer
21+
npm install
22+
```
23+
24+
`npm install` resolves all workspaces in one pass. Do not run `npm install` inside a single package. It creates a nested lockfile and confuses the workspace resolver.
25+
26+
## Repository layout
27+
28+
The repo is a small monorepo. Each package owns its own `README.md` with package-specific status and usage notes:
29+
30+
- [`packages/dofs`](packages/dofs/) — Durable Object SQLite-backed virtual filesystem, sync protocol building blocks, and a `@platformatic/vfs` provider for Node.
31+
- [`packages/rpc`](packages/rpc/) — capnweb-based wire types and server/client helpers shared between the Durable Object and `computerd`.
32+
- [`packages/computerd`](packages/computerd/) — the `computerd` daemon: a FUSE mount plus HTTP/WebSocket RPC server that runs inside the sandbox container.
33+
- [`packages/computer`](packages/computer/) — the top-level `@cloudflare/computer` package consumed by Durable Objects.
34+
- [`packages/computer-computerd-linux-x64`](packages/computer-computerd-linux-x64/) — the prebuilt `computerd` binary for linux-x64, distributed for use in container images.
35+
36+
[`docs/`](docs/) holds the design specification. It is forward-looking and has diverged from `main` in places. Treat it as intent, not as a description of the code today.
37+
38+
## Code changes
39+
40+
Touch the package that owns the behavior. Cross-package changes are fine, but group them into one logical change per commit.
41+
42+
When you finish a task:
43+
44+
- Update the affected package's `README.md` if its implementation status changes.
45+
- Run the checks below.
46+
47+
## Formatting and linting
48+
49+
Biome handles both formatting and linting. From the repo root:
50+
51+
```bash
52+
npm run format # biome format --write .
53+
npm run check # biome lint + formatter verification
54+
```
55+
56+
`npm run format` is allowed to rewrite files. `npm run check` must exit zero before you push. If `check` complains, fix the underlying issue rather than silencing the rule. Disabled rules need a real justification.
57+
58+
## Tests
59+
60+
Run the package-level tests for whatever you touched. For the whole workspace:
61+
62+
```bash
63+
npm test
64+
```
65+
66+
For a single package:
67+
68+
```bash
69+
npm test --workspace @cloudflare/dofs
70+
```
71+
72+
For a single test file inside a package:
73+
74+
```bash
75+
npm test --workspace @cloudflare/dofs -- src/path/to/file.test.ts
76+
```
77+
78+
`packages/computerd` includes FUSE-backed tests that only run on Linux. On other platforms they are skipped automatically.
79+
80+
New behavior needs a test. Bug fixes need a reproduction test that failed before the fix. See [`.agents/skills/test-driven-development/SKILL.md`](.agents/skills/test-driven-development/SKILL.md) for the testing approach this repo follows.
81+
82+
## Typecheck and build
83+
84+
```bash
85+
npm run typecheck # tsc --noEmit across workspaces
86+
npm run build # library builds
87+
npm run build:all # libraries, bundled binaries, docker images
88+
```
89+
90+
`build:all` is the union of `build`, `build:bin`, and `build:docker`. Only run it if you need the binary or Docker artifacts. It is slow.
91+
92+
## Commit messages
93+
94+
Commit messages are read out of context, years later, by people with no memory of the change. Write them for that reader.
95+
96+
The full guidance lives in [`.agents/skills/prose/SKILL.md`](.agents/skills/prose/SKILL.md). The short version:
97+
98+
- **Subject line.** Imperative mood, 50 characters or fewer where possible, 72 hard maximum. No trailing period. Prefix with the package or scope: `dofs:`, `rpc:`, `computer:`, `computerd:`, `examples/think:`, `docs:`, `ci:`. Multiple scopes are joined with commas, as in `computerd, rpc: …`.
99+
- **Blank line**, then a body wrapped at 72 characters. Explain what and why, not how. The diff already shows how.
100+
- **One logical change per commit.** Do not bundle unrelated edits.
101+
- **Self-contained.** No references to chat history, agent sessions, review threads, or sibling commit SHAs. A reader on `main` in five years should understand the commit from its message alone.
102+
- **No marketing voice, no emojis, no headings or bulleted lists in the body.** Prose paragraphs.
103+
- **American English** in prose. Code identifiers keep their original spelling.
104+
105+
`git log` is the canonical style reference. Skim a page of it before your first commit.
106+
107+
## Pull requests
108+
109+
A pull request tells the story behind a set of commits. Full guidance lives in [`.agents/skills/pull-requests/SKILL.md`](.agents/skills/pull-requests/SKILL.md). The shape is:
110+
111+
1. The problem the change is solving, with a link to the issue if one exists.
112+
2. The solution and how it addresses the problem.
113+
3. How a reviewer can verify it locally: a command, a snippet, or a description of the manual test.
114+
4. The testing strategy: what is covered and what is not.
115+
5. Documentation changes, if any.
116+
6. Known follow-ups.
117+
118+
Keep pull requests scoped to one logical change where you can. Do not include lists of changed files. The diff is right there.
119+
120+
External pull requests are closed automatically unless they come from an owner, member, collaborator, Dependabot, Renovate, or carry the `allow-pr` label. Add `allow-pr` before reopening an external pull request that should go through review.
121+
122+
## What not to commit
123+
124+
- `node_modules/`, `dist/`, `artifacts/`. These are already ignored, but double-check `git status` before staging.
125+
- `.env` and `.dev.vars`. Local secrets and per-developer settings stay on your machine.
126+
- Editor or operating system scratch files. Add them to your global gitignore rather than to this repo's `.gitignore`.
127+
- Generated `worker-configuration.d.ts` files, except for the copies checked in under `examples/`.

0 commit comments

Comments
 (0)