Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ ADMIN_GITHUB_LOGINS=

# --- Local development only -------------------------------------------------

# The synthetic fixture set (fixtures/): tasks in every state, guides, users,
# and settings. Local instances only; existing records are left untouched.
#LOCAL_SEED=fixtures

# One or more JSON task files (comma-separated) loaded as the starting pool —
# the curated event lists or the admin bulk-import shape.
# Idempotent: entries already loaded are left untouched.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ Both run in CI on every push and pull request, alongside `vite build`.

Useful env vars for local dev (in `.env`):

- `LOCAL_SEED=fixtures` — loads the synthetic fixture set in [`fixtures/`](fixtures/README.md):
tasks in every state (claimed, completed, flagged…), guides, users (an admin, attendees, a
banned and a timed-out user), and settings. Idempotent across restarts, and runs on local
instances only.
- `LOCAL_DATA_FILE=data/contribution-tasks.json` — loads a JSON task file (the curated
event list, or the bulk-import shape) as the starting pool. Idempotent across restarts;
entries may pin their own `id`.
Expand Down
27 changes: 27 additions & 0 deletions fixtures/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Fixtures

Synthetic data for local development and tests. Nothing here is a real event, task, or person.
Real event data never goes in this repository; it lives in the production database.

| File | What |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tasks.json` | 19 tasks: every status (open, claimed, completed, flagged, removed), three themes, every difficulty, and both import shapes (the app shape and the curated `detail`/`tier` shape) |
| `guides.json` | one guide per theme: `example-refactor`, `example-tests`, `example-docs` |
| `users.json` | `fx_ada` (admin), `fx_alice`, `fx_bob`, `fx_erin` (attendees), `fx_carol` (banned), `fx_dave` (timed out) |
| `settings.json` | the announcement banner and an open pool |

The states are consistent with each other: `fx_alice` holds `fx-refactor-03`, `fx_erin` holds
`fx-tests-03` (assigned by `fx_ada`), and the banned and timed-out users hold nothing.

Every login contains an underscore, which GitHub doesn't allow in usernames, so a fixture account
can never match a real GitHub user.

## Loading

Set `LOCAL_SEED=fixtures` (in `.env` or your shell) and start the app. Everything loads with its
state intact, and existing records are never overwritten, so restarts keep your changes. Seeding
only runs on a local instance: if `OAUTH_REDIRECT_URI` points anywhere but localhost, it is
skipped with an error in the log.

`tasks.json` and `guides.json` also paste into **Admin → Bulk import** (guides first), for example
on staging. Imported tasks start open, and users and settings aren't imported that way.
22 changes: 22 additions & 0 deletions fixtures/guides.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"guides": [
{
"id": "example-refactor",
"title": "Refactoring a fixture file",
"summary": "How to make a small, behavior-preserving change to one file.",
"body": "Each task in this theme names one file. Make the change it describes and nothing else.\n\n1. Read the file and the task's notes.\n2. Make the change.\n3. Run the file's check:\n\n```bash\nnpm test -- path/to/example-file.test.js\n```\n\nKeep the change small; reviewers merge small diffs faster."
},
{
"id": "example-tests",
"title": "Improving a fixture test",
"summary": "How to tighten or split a test without changing what it checks.",
"body": "Tests in this theme check the right thing but report failures poorly, or bundle too much.\n\n- Preserve what each test asserts.\n- Prefer one scenario per test.\n\n```js\nimport { test } from 'node:test';\nimport assert from 'node:assert';\n\ntest('example scenario', () => {\n assert.strictEqual(1 + 1, 2);\n});\n```"
},
{
"id": "example-docs",
"title": "Fixing a fixture doc page",
"summary": "How to correct a documentation page and check the rendered result.",
"body": "Doc tasks point at one page and list what is wrong with it.\n\n1. Fix each listed item.\n2. Render the page locally and check it reads correctly.\n\nDocs changes use the `doc:` commit prefix."
}
]
}
14 changes: 14 additions & 0 deletions fixtures/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"settings": [
{
"id": "announcement",
"value": {
"enabled": true,
"level": "info",
"title": "Fixture data",
"body": "You're looking at synthetic fixtures, not a real event."
}
},
{ "id": "claims", "value": { "paused": false, "hidden": false, "message": "" } }
]
}
253 changes: 253 additions & 0 deletions fixtures/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
{
"tasks": [
{
"id": "fx-refactor-01",
"title": "Replace a manual loop in example/refactor-one.js",
"summary": "Swap an index-based loop for for...of.",
"description": "`example/refactor-one.js` walks an array with an index-based `for` loop. Replace it with `for...of`.",
"theme": "example-refactor",
"difficulty": "beginner",
"area": "example",
"skills": ["javascript"],
"estimatedMinutes": 20,
"links": [{ "label": "Example file", "url": "https://example.com/refactor-one.js" }]
},
{
"id": "fx-refactor-02",
"title": "Remove an unused variable in example/refactor-two.js",
"summary": "Delete a variable that is assigned but never read.",
"description": "`example/refactor-two.js` declares `unused` and never reads it. Remove it.",
"theme": "example-refactor",
"difficulty": "beginner",
"area": "example",
"skills": ["javascript"],
"estimatedMinutes": 15,
"links": []
},
{
"id": "fx-refactor-03",
"title": "Inline a one-line helper in example/refactor-three.js",
"summary": "Inline a helper that is only called once.",
"description": "`formatName()` in `example/refactor-three.js` is called once. Inline it.",
"theme": "example-refactor",
"difficulty": "beginner",
"area": "example",
"skills": ["javascript"],
"estimatedMinutes": 20,
"links": [],
"status": "claimed",
"assignedTo": "fx_alice",
"assignedName": "Alice (fixture attendee)",
"assignedAt": 1767229200000
},
{
"id": "fx-refactor-04",
"title": "Use optional chaining in example/refactor-four.js",
"summary": "Collapse a nested null check.",
"description": "Replace `a && a.b && a.b.c` in `example/refactor-four.js` with `a?.b?.c`.",
"theme": "example-refactor",
"difficulty": "beginner",
"area": "example",
"skills": ["javascript"],
"estimatedMinutes": 15,
"links": [],
"status": "completed",
"completedBy": "fx_bob",
"completedAt": 1767232800000,
"evidenceUrl": "https://github.com/example/example/pull/1"
},
{
"id": "fx-refactor-05",
"title": "Convert callbacks to async/await in example/refactor-five.js",
"summary": "Rewrite one callback chain with async/await.",
"description": "`readConfig()` in `example/refactor-five.js` nests three callbacks. Rewrite it with `async`/`await`, keeping the same error handling.",
"theme": "example-refactor",
"difficulty": "intermediate",
"area": "example",
"skills": ["javascript", "async"],
"estimatedMinutes": 45,
"links": []
},
{
"id": "fx-tests-01",
"title": "Split example/test-big.js into focused tests",
"summary": "Break one large test file into one file per scenario.",
"description": "`example/test-big.js` covers four unrelated scenarios. Split it into four files and delete the original.",
"theme": "example-tests",
"difficulty": "intermediate",
"area": "test",
"skills": ["testing"],
"estimatedMinutes": 60,
"links": []
},
{
"id": "fx-tests-02",
"title": "Assert on output in example/test-output.js",
"summary": "Check the child's output, not just its exit code.",
"description": "`example/test-output.js` only checks the exit code. Also assert on stdout.",
"theme": "example-tests",
"difficulty": "intermediate",
"area": "test",
"skills": ["testing", "child_process"],
"estimatedMinutes": 45,
"links": []
},
{
"id": "fx-tests-03",
"title": "Use strict assertions in example/test-strict.js",
"summary": "Swap loose equality assertions for strict ones.",
"description": "Replace `assert.equal` with `assert.strictEqual` in `example/test-strict.js`.",
"theme": "example-tests",
"difficulty": "beginner",
"area": "test",
"skills": ["testing"],
"estimatedMinutes": 20,
"links": [],
"status": "claimed",
"assignedTo": "fx_erin",
"assignedName": "Erin (fixture attendee)",
"assignedAt": 1767229800000,
"assignedBy": "fx_ada"
},
{
"id": "fx-tests-04",
"title": "Remove a timing dependency in example/test-timing.js",
"summary": "Replace a fixed sleep with an event wait.",
"description": "`example/test-timing.js` sleeps 500 ms before asserting. Wait for the `ready` event instead.",
"theme": "example-tests",
"difficulty": "advanced",
"area": "test",
"skills": ["testing", "events"],
"estimatedMinutes": 90,
"links": [],
"status": "flagged",
"uncompletableReason": "Fixture: the file was already changed upstream",
"uncompletableBy": "fx_bob",
"uncompletableAt": 1767236400000
},
{
"id": "fx-tests-05",
"title": "Name the anonymous tests in example/test-names.js",
"summary": "Give every test a descriptive name.",
"description": "Three tests in `example/test-names.js` have no name. Name each after what it checks.",
"theme": "example-tests",
"difficulty": "beginner",
"area": "test",
"skills": ["testing"],
"estimatedMinutes": 15,
"links": []
},
{
"id": "fx-docs-01",
"title": "Fix return types in example/docs-api.md",
"summary": "Correct two functions documented as returning undefined.",
"description": "In `example/docs-api.md`:\n\n- `parse()` returns `{Object}`, not `undefined`.\n- `format()` returns `{string}`, not `undefined`.",
"theme": "example-docs",
"difficulty": "beginner",
"area": "docs",
"skills": ["markdown"],
"estimatedMinutes": 20,
"links": []
},
{
"id": "fx-docs-02",
"title": "Add a missing example to example/docs-guide.md",
"summary": "Add a short usage example to one section.",
"description": "The \"Getting started\" section of `example/docs-guide.md` has no code example. Add one.",
"theme": "example-docs",
"difficulty": "beginner",
"area": "docs",
"skills": ["markdown"],
"estimatedMinutes": 25,
"links": [],
"status": "completed",
"completedBy": "fx_alice",
"completedAt": 1767226500000,
"evidenceUrl": "https://github.com/example/example/pull/2"
},
{
"id": "fx-docs-03",
"title": "Document a removed option in example/docs-options.md",
"summary": "Note that an option was removed.",
"description": "`--legacy` was removed. Note the removal in `example/docs-options.md`.",
"theme": "example-docs",
"difficulty": "beginner",
"area": "docs",
"skills": ["markdown"],
"estimatedMinutes": 15,
"links": [],
"status": "uncompletable",
"uncompletableReason": "Removed by an organizer.",
"uncompletableBy": "fx_ada",
"uncompletableAt": 1767238200000
},
{
"id": "fx-docs-04",
"title": "Fix broken links in example/docs-links.md",
"summary": "Repair two links that point at moved pages.",
"description": "Two links in `example/docs-links.md` point at pages that moved. Update them.",
"theme": "example-docs",
"difficulty": "beginner",
"area": "docs",
"skills": ["markdown"],
"estimatedMinutes": 15,
"links": []
},
{
"id": "fx-manual-01",
"title": "Profile a slow example endpoint",
"summary": "Find and fix the slowest step in an example request handler.",
"description": "The `/example` endpoint takes 2 s. Profile it, find the slowest step, and fix it.\n\nNo theme guide: this task stands on its own.",
"difficulty": "advanced",
"area": "core",
"skills": ["performance", "profiling"],
"estimatedMinutes": 120,
"links": [{ "label": "Example issue", "url": "https://example.com/issues/1" }]
},
{
"id": "fx-manual-02",
"title": "Add a dark-mode screenshot to the example site",
"summary": "Capture and add one screenshot.",
"description": "The example site's README shows only light mode. Add a dark-mode screenshot.",
"difficulty": "beginner",
"area": "website",
"skills": ["design"],
"estimatedMinutes": 30,
"links": [{ "label": "Example site", "url": "https://example.com/" }]
},
{
"id": "fx-manual-03",
"title": "Add a progress message to the example CLI",
"summary": "Print progress while a long command runs.",
"description": "`example-cli build` prints nothing for 30 s. Print a progress line for each step.",
"difficulty": "intermediate",
"area": "tooling",
"skills": ["javascript", "cli"],
"estimatedMinutes": 60,
"links": []
},
{
"id": "fx-curated-01",
"theme": "example-tests",
"tier": "easy",
"subsystem": "fixtures",
"title": "Use node:test in example/test-legacy.js",
"commitPrefix": "test:",
"files": ["example/test-legacy.js"],
"detail": "`example/test-legacy.js` uses a hand-rolled test harness. Port it to `node:test`.",
"verifyCommand": "node --test example/test-legacy.js"
},
{
"id": "fx-curated-02",
"theme": "example-refactor",
"tier": "medium",
"subsystem": "fixtures",
"title": "Remove a deprecated API call in example/legacy-api.js",
"commitPrefix": "lib:",
"files": ["example/legacy-api.js", "example/legacy-api.test.js"],
"detail": "`example/legacy-api.js` calls the deprecated `oldParse()`. Switch it to `parse()` and update its test.",
"verifyCommand": "node --test example/legacy-api.test.js",
"gotcha": "`parse()` throws on empty input where `oldParse()` returned null."
}
]
}
23 changes: 23 additions & 0 deletions fixtures/users.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"users": [
{ "id": "fx_ada", "name": "Ada (fixture admin)", "avatarUrl": null, "isAdmin": true },
{ "id": "fx_alice", "name": "Alice (fixture attendee)", "avatarUrl": null, "isAdmin": false },
{ "id": "fx_bob", "name": "Bob (fixture attendee)", "avatarUrl": null, "isAdmin": false },
{
"id": "fx_carol",
"name": "Carol (fixture, banned)",
"avatarUrl": null,
"isAdmin": false,
"bannedAt": 1767225600000,
"banReason": "Fixture: opened spam pull requests"
},
{
"id": "fx_dave",
"name": "Dave (fixture, timed out)",
"avatarUrl": null,
"isAdmin": false,
"timeoutUntil": 4102444800000
},
{ "id": "fx_erin", "name": "Erin (fixture attendee)", "avatarUrl": null, "isAdmin": false }
]
}
Loading
Loading