Skip to content

Commit 2c9aeb1

Browse files
final resolved
1 parent 99c77fd commit 2c9aeb1

8 files changed

Lines changed: 82 additions & 7 deletions

File tree

.github/scripts/issue-management/claim-handler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async function handleClaim({ github, context }) {
8989
owner,
9090
repo,
9191
issue_number: issueNumber,
92-
body: `🎉 **Assigned!** Welcome to the project, @${commenter}.\n\n⏳ **Reminder:** You have **3 days** to submit a Pull Request. After 3 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! 🚀`,
92+
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! 🚀`,
9393
});
9494
}
9595

.github/scripts/issue-management/stale-assignment.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
async function handleStaleAssignments({ github, context, core }) {
22
const { owner, repo } = context.repo;
3-
const THREE_DAYS_MS = 3 * 24 * 60 * 60 * 1000;
3+
const TWO_DAYS_MS = 2 * 24 * 60 * 60 * 1000;
44
const now = new Date();
55

66
console.log(`Starting stale assignment check for ${owner}/${repo}`);
@@ -27,7 +27,7 @@ async function handleStaleAssignments({ github, context, core }) {
2727
const updatedAt = new Date(issue.updated_at);
2828
const timeSinceUpdate = now.getTime() - updatedAt.getTime();
2929

30-
if (timeSinceUpdate > THREE_DAYS_MS) {
30+
if (timeSinceUpdate > TWO_DAYS_MS) {
3131
console.log(
3232
`Issue #${issue.number} has been inactive since ${issue.updated_at}. Removing assignees.`
3333
);

.github/workflows/assign-request-reminder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
`## 📋 A Few Things to Know`,
9595
``,
9696
`- You can hold a **maximum of 3 open issues** at a time.`,
97-
`- If there's **no activity for 3 days**, the assignment will automatically expire so others can pick it up.`,
97+
`- If there's **no activity for 2 days**, the assignment will automatically expire so others can pick it up.`,
9898
`- Make sure to read our **[CONTRIBUTING.md](https://github.com/${owner}/${repo}/blob/main/CONTRIBUTING.md)** before you start — it covers code style, commit conventions, and the PR checklist.`,
9999
``,
100100
`## 💬 Join Our Discord`,

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Our automation runs entirely through issue comments. Here is how you interact wi
241241

242242
To keep the project moving, assignments are not permanent.
243243

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.
244+
- **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.
245245
- **What counts as activity?** Posting a comment, opening a linked PR, or a maintainer adding a label.
246246
- **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!
247247

@@ -250,7 +250,7 @@ To keep the project moving, assignments are not permanent.
250250
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).
251251
2. Comment `/claim` on the issue to lock it in.
252252
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.
253+
4. Work on your code and submit a PR within 2 days to avoid expiry.
254254
5. Once your PR is merged and the issue is closed, you can create and `/claim` your next one!
255255

256256
### 🆘 Troubleshooting & Edge Cases

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ We built an anti-hoarding, self-service automation layer right into the reposito
420420
- **Structured Issue Templates:** We use specific templates for Bug Reports and Feature Requests to maintain high quality and clarity.
421421
- **Self-Claiming:** Issue authors can grab their issues instantly by commenting `/claim` (only the author of the issue can claim it, unless it was authored by `jhasourav07`, in which case anyone can claim it).
422422
- **Fair Play:** A strict one-active-issue-per-contributor rule prevents issue hoarding.
423-
- **Stale Expiry:** A scheduled chron job automatically unassigns inactive contributors after 3 days.
423+
- **Stale Expiry:** A scheduled chron job automatically unassigns inactive contributors after 2 days.
424424
- **Self-Service Labels:** Anyone can tag issues using `/addlabel <tag>`.
425425
- **Semantic Duplicate Detection:** An AI-powered duplicate detector automatically scans open issues using the Google Gemini API (`gemini-embedding-001`) to generate vector embeddings. It calculates cosine similarity and flags potential duplicate issues with a comment and a `possible-duplicate` label.
426426

components/dashboard/DashboardClient.test.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,22 @@ const mockSecondData = {
172172
commitClock: [],
173173
};
174174

175+
const initialDataWithHigherStreak = {
176+
...mockInitialData,
177+
stats: {
178+
...mockInitialData.stats,
179+
peakStreak: 50,
180+
},
181+
};
182+
183+
const secondDataWithLowerStreak = {
184+
...mockSecondData,
185+
stats: {
186+
...mockSecondData.stats,
187+
peakStreak: 10,
188+
},
189+
};
190+
175191
describe('DashboardClient', () => {
176192
beforeEach(() => {
177193
vi.restoreAllMocks();
@@ -312,3 +328,27 @@ describe('DashboardClient', () => {
312328
});
313329
});
314330
});
331+
it('shows Most Consistent badge for profile with higher peak streak in compare mode', async () => {
332+
const mockFetch = vi.fn().mockResolvedValue({
333+
ok: true,
334+
json: async () => secondDataWithLowerStreak,
335+
});
336+
337+
vi.stubGlobal('fetch', mockFetch);
338+
339+
render(<DashboardClient initialData={initialDataWithHigherStreak} username="Shivangi1515" />);
340+
341+
fireEvent.click(screen.getByText('Compare Profile'));
342+
343+
fireEvent.change(screen.getByPlaceholderText('Enter GitHub Username'), {
344+
target: { value: 'JhaSourav07' },
345+
});
346+
347+
fireEvent.click(screen.getByText('Compare'));
348+
349+
await waitFor(() => {
350+
expect(screen.getByText('Exit Compare Mode')).toBeDefined();
351+
});
352+
353+
expect(screen.getByText(/Most Consistent/i)).toBeDefined();
354+
});

components/dashboard/RadarChart.test.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,16 @@ describe('RadarChart', () => {
6666
expect(screen.getAllByText('JavaScript')).toBeDefined();
6767
expect(screen.getAllByText('Python')).toBeDefined();
6868
});
69+
70+
it('verify at least 3 axes are always shown via padding when fewer are provided', () => {
71+
const singleLang = [{ name: 'TypeScript', percentage: 100, color: '#3178c6' }];
72+
73+
render(
74+
<RadarChart languagesA={singleLang} languagesB={singleLang} labelA="User A" labelB="User B" />
75+
);
76+
77+
expect(screen.getAllByText('TypeScript')).toBeDefined();
78+
expect(screen.getAllByText('JavaScript')).toBeDefined();
79+
expect(screen.getAllByText('Python')).toBeDefined();
80+
});
6981
});

lib/calculate.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,4 +509,27 @@ describe('calculateWrappedStats', () => {
509509
expect(result.busiestMonth).toBe('2024-01');
510510
expect(result.weekendRatio).toBe(100);
511511
});
512+
// =========================================================================
513+
// ISSUE OBJECTIVE: Verify weekendRatio is 100 when all commits are on weekends
514+
// =========================================================================
515+
it('returns weekendRatio === 100 when all contributions are on weekends', () => {
516+
// Note: 2026-05-02 is a Saturday, 2026-05-03 is a Sunday, 2026-05-04 is a Monday
517+
const weekendCalendar = {
518+
totalContributions: 10,
519+
weeks: [
520+
{
521+
contributionDays: [
522+
{ date: '2026-05-02', contributionCount: 5 }, // Saturday (Weekend)
523+
{ date: '2026-05-03', contributionCount: 5 }, // Sunday (Weekend)
524+
{ date: '2026-05-04', contributionCount: 0 }, // Monday (Weekday - 0 commits)
525+
],
526+
},
527+
],
528+
} as Parameters<typeof calculateWrappedStats>[0]; // Safely infers the exact type the function expects!
529+
530+
const result = calculateWrappedStats(weekendCalendar);
531+
532+
// Assert the ratio is exactly 100%
533+
expect(result.weekendRatio).toBe(100);
534+
});
512535
});

0 commit comments

Comments
 (0)