You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
body: `✅ Successfully assigned issue to @${commenter}\n\n> 💡 Please read [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md) if you haven't already. Good luck! 🚀`,
93
+
body: `🎉 **Assigned!** Welcome to the project, @${commenter}.\n\n⏳ **Reminder:** You have **2 days** to submit a Pull Request. After 2 days of inactivity, you will be automatically unassigned to give others a chance (as per our GSSoC anti-hoarding policy).\n\n> 💡 Please read [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md) if you haven't already.\n\nHappy coding! 🚀`,
This section covers everything you need to verify your changes work correctly **before opening a PR**. There are two layers of testing: visual browser preview and the automated test suite.
95
+
96
+
### 1. Visual Browser Preview
97
+
98
+
With your dev server running (`npm run dev`), open your browser and visit these URLs to preview the SVG output directly:
> **⚠️ Browser XML error warning:** If your browser shows an `EntityRef: expecting ';'` error instead of rendering the SVG, it means an unescaped `&` character exists somewhere in the SVG output. All `&` characters inside SVG `<style>` blocks (e.g. in Google Fonts `@import` URLs) must be written as `&`. Check `lib/svg/generator.ts` for any raw `&` in template literals.
131
+
132
+
> **💡 Tip:** For a cleaner SVG preview, open the URL in **Firefox** — it renders SVG directly in the browser with no wrapper page. Chrome wraps it in an XML viewer which can show false parse warnings.
133
+
134
+
### 2. Running the Vitest Test Suite
135
+
136
+
CommitPulse uses **Vitest** for unit and integration tests. Run the full test suite with:
137
+
138
+
```bash
139
+
npm run test
140
+
```
141
+
142
+
To run tests in watch mode while you develop (reruns on every file save):
143
+
144
+
```bash
145
+
npm run test -- --watch
146
+
```
147
+
148
+
To run only a specific test file:
149
+
150
+
```bash
151
+
npm run test -- lib/calculate.test.ts
152
+
```
153
+
154
+
**What a passing run looks like:**
155
+
156
+
```
157
+
✓ lib/calculate.test.ts (12 tests)
158
+
✓ lib/svg/generator.test.ts (8 tests)
159
+
✓ app/api/streak/route.test.ts (6 tests)
160
+
161
+
Test Files 3 passed (3)
162
+
Tests 26 passed (26)
163
+
```
164
+
165
+
> **🚨 All tests must pass before you open a PR.** The CI pipeline runs `npm run test` automatically on every pull request and will block merging if any test fails.
166
+
167
+
### 3. Interpreting SVG Output in the Browser
168
+
169
+
When you open a badge URL in your browser, here is what each response means:
| Animated isometric city renders correctly | ✅ Everything is working |
174
+
| Ghost-city badge with "NOT FOUND" label | ✅ Working — the username doesn't exist on GitHub |
175
+
| Styled error card with "Invalid username" | ✅ Working — the username format was invalid |
176
+
| Raw JSON `{"error":"Invalid parameters"...}`| ❌ Bug — validation errors must return SVG, not JSON |
177
+
| Browser XML parse error / blank white page | ❌ Bug — unescaped `&` or malformed SVG in generator |
178
+
|`401 Unauthorized` in the terminal | ❌ Your `GITHUB_PAT` in `.env.local` is missing or invalid |
179
+
180
+
### 4. Lint and Format
181
+
182
+
Run these before every commit:
183
+
184
+
```bash
185
+
# Auto-format all files
186
+
npm run format
187
+
188
+
# Check for linting errors
189
+
npm run lint
190
+
```
191
+
192
+
Fix every error before pushing. CI will fail if either check reports issues.
193
+
194
+
---
195
+
91
196
## 🤝 Contributor Onboarding
92
197
93
198
### 📁 Project Structure
@@ -241,7 +346,7 @@ Our automation runs entirely through issue comments. Here is how you interact wi
241
346
242
347
To keep the project moving, assignments are not permanent.
243
348
244
-
-**The 3-Day Rule:** If an issue has an assignee but sees **no activity for 3 days**, our automated background job will remove the assignment.
349
+
-**The 2-Day Rule:** If an issue has an assignee but sees **no activity for 2 days**, our automated background job will remove the assignment.
245
350
-**What counts as activity?** Posting a comment, opening a linked PR, or a maintainer adding a label.
246
351
-**Why?** It frees up stale issues so other active contributors can pick them up. If your issue expires, you can always `/claim` it again if it's still available!
247
352
@@ -250,7 +355,7 @@ To keep the project moving, assignments are not permanent.
250
355
1. Create a new issue describing the bug or feature request you want to work on using our **Structured Issue Templates** (or find an open issue you authored).
251
356
2. Comment `/claim` on the issue to lock it in.
252
357
3. Need labels? Comment `/addlabel good-first-issue` (labels must already exist in the repo).
253
-
4. Work on your code and submit a PR within 3 days to avoid expiry.
358
+
4. Work on your code and submit a PR within 2 days to avoid expiry.
254
359
5. Once your PR is merged and the issue is closed, you can create and `/claim` your next one!
0 commit comments