Skip to content

Commit bd26066

Browse files
Merge branch 'main' into fix/repo-pagination
2 parents 989d210 + 32007b6 commit bd26066

78 files changed

Lines changed: 6452 additions & 1783 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,9 @@ LEADERBOARD_USER_CONCURRENCY=5
110110
# calling a sync endpoint manually (e.g. curl -H "Authorization: Bearer ...").
111111
# Generate with: openssl rand -hex 32
112112
CRON_SECRET=your_cron_secret
113+
114+
# Trusted proxy configuration for IP-based rate limiting.
115+
# Set to "vercel" when deploying on Vercel (auto-detected via VERCEL=1).
116+
# Set to "cloudflare" when behind Cloudflare. Set to "none" for self-hosted.
117+
# Without this, forwarding headers are ignored to prevent IP spoofing.
118+
TRUSTED_PROXY=vercel
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Refactor / Code Quality
2+
description: Propose a refactor, performance fix, or code quality improvement
3+
title: "refactor: "
4+
labels: ["needs-triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Before opening this issue, **search existing issues** (open AND closed) to make sure this improvement has not already been proposed. Duplicate issues will be closed immediately.
10+
11+
- type: checkboxes
12+
id: duplicate-check
13+
attributes:
14+
label: Duplicate Check
15+
description: Confirm you searched for existing issues.
16+
options:
17+
- label: I have searched open and closed issues and confirmed this is not a duplicate.
18+
required: true
19+
20+
- type: dropdown
21+
id: type
22+
attributes:
23+
label: Type of Improvement
24+
options:
25+
- Refactor / Simplification
26+
- Performance
27+
- Bug Fix
28+
- Documentation
29+
- DevOps / CI
30+
- Accessibility
31+
validations:
32+
required: true
33+
34+
- type: textarea
35+
id: description
36+
attributes:
37+
label: Description
38+
description: What needs to change and why?
39+
validations:
40+
required: true
41+
42+
- type: textarea
43+
id: files
44+
attributes:
45+
label: Files Affected
46+
description: Which files will this change touch?
47+
placeholder: "src/lib/example.ts, src/components/Example.tsx"
48+
validations:
49+
required: true
50+
51+
- type: textarea
52+
id: context
53+
attributes:
54+
label: Additional Context
55+
validations:
56+
required: false
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Test Coverage
2+
description: Propose adding or improving tests for a module
3+
title: "test: "
4+
labels: ["type:testing", "needs-triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Before opening this issue, **search existing issues** (open AND closed) to make sure a test issue for this module does not already exist. Duplicate issues will be closed immediately.
10+
11+
- type: checkboxes
12+
id: duplicate-check
13+
attributes:
14+
label: Duplicate Check
15+
description: Confirm you searched for existing issues.
16+
options:
17+
- label: I have searched open and closed issues and confirmed this is not a duplicate.
18+
required: true
19+
20+
- type: input
21+
id: module
22+
attributes:
23+
label: Module / File Path
24+
description: Which source file needs tests?
25+
placeholder: "src/lib/example.ts"
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: existing-coverage
31+
attributes:
32+
label: Existing Coverage
33+
description: Does a test file already exist? If so, what is missing?
34+
placeholder: "test/example.test.ts exists but does not cover edge cases for negative input."
35+
validations:
36+
required: true
37+
38+
- type: textarea
39+
id: proposed-tests
40+
attributes:
41+
label: Proposed Test Cases
42+
description: List the specific scenarios you plan to test.
43+
placeholder: |
44+
- returns empty array for null input
45+
- throws on invalid date format
46+
- handles timezone edge case
47+
validations:
48+
required: true
49+
50+
- type: textarea
51+
id: context
52+
attributes:
53+
label: Additional Context
54+
description: Any relevant background (related bugs, tricky logic, etc.)
55+
validations:
56+
required: false

.github/workflows/automated-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Checkout Code Repository Layers
1616
uses: actions/checkout@v7
1717

18-
- uses: pnpm/action-setup@v3
18+
- uses: pnpm/action-setup@v6
1919
with:
2020
version: 11
2121

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v7
2121

22-
- uses: pnpm/action-setup@v3
22+
- uses: pnpm/action-setup@v6
2323
with:
2424
version: 11
2525
- uses: actions/setup-node@v6
@@ -39,7 +39,7 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v7
4141

42-
- uses: pnpm/action-setup@v3
42+
- uses: pnpm/action-setup@v6
4343
with:
4444
version: 11
4545
- uses: actions/setup-node@v6
@@ -62,7 +62,7 @@ jobs:
6262
steps:
6363
- uses: actions/checkout@v7
6464

65-
- uses: pnpm/action-setup@v3
65+
- uses: pnpm/action-setup@v6
6666
with:
6767
version: 11
6868
- uses: actions/setup-node@v6
@@ -108,7 +108,7 @@ jobs:
108108
steps:
109109
- uses: actions/checkout@v7
110110

111-
- uses: pnpm/action-setup@v3
111+
- uses: pnpm/action-setup@v6
112112
with:
113113
version: 11
114114
- uses: actions/setup-node@v6
@@ -128,7 +128,7 @@ jobs:
128128
steps:
129129
- uses: actions/checkout@v7
130130

131-
- uses: pnpm/action-setup@v3
131+
- uses: pnpm/action-setup@v6
132132
with:
133133
version: 11
134134
- uses: actions/setup-node@v6
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Duplicate Issue Check
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
check-duplicate:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check for duplicate issues
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
const issue = context.payload.issue;
19+
const title = issue.title.toLowerCase().replace(/[^a-z0-9\s]/g, '').trim();
20+
21+
// Extract core topic from test issue titles
22+
// "test: add unit tests for foo.ts" → "foo"
23+
const testMatch = title.match(/test\s*add\s*(?:unit\s*)?tests?\s*(?:for|of)\s*(.+)/);
24+
const topic = testMatch ? testMatch[1].replace(/\.ts$/, '').trim() : null;
25+
26+
if (!topic) return; // Only check test issues for now
27+
28+
// Search open AND recently closed issues with similar titles
29+
const { data: openIssues } = await github.rest.issues.listForRepo({
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
state: 'all',
33+
per_page: 100,
34+
sort: 'created',
35+
direction: 'desc'
36+
});
37+
38+
const duplicates = openIssues.filter(i => {
39+
if (i.number === issue.number) return false;
40+
if (i.pull_request) return false;
41+
const otherTitle = i.title.toLowerCase().replace(/[^a-z0-9\s]/g, '').trim();
42+
const otherMatch = otherTitle.match(/test\s*add\s*(?:unit\s*)?tests?\s*(?:for|of)\s*(.+)/);
43+
if (!otherMatch) return false;
44+
const otherTopic = otherMatch[1].replace(/ts$/, '').trim();
45+
return otherTopic === topic || otherTopic.includes(topic) || topic.includes(otherTopic);
46+
});
47+
48+
if (duplicates.length > 0) {
49+
const refs = duplicates.slice(0, 5).map(d => `#${d.number} (${d.state})`).join(', ');
50+
await github.rest.issues.createComment({
51+
owner: context.repo.owner,
52+
repo: context.repo.repo,
53+
issue_number: issue.number,
54+
body: `Duplicate detected — the following issue(s) already cover this topic: ${refs}.\n\nPlease search existing issues (open **and** closed) before opening a new one. Closing this issue.`
55+
});
56+
await github.rest.issues.update({
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
issue_number: issue.number,
60+
state: 'closed',
61+
labels: [...issue.labels.map(l => l.name), 'duplicate']
62+
});
63+
}

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v7
3030

31-
- uses: pnpm/action-setup@v3
31+
- uses: pnpm/action-setup@v6
3232
with:
3333
version: 11
3434
- uses: actions/setup-node@v6

.github/workflows/visual-regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Checkout
4343
uses: actions/checkout@v7
4444

45-
- uses: pnpm/action-setup@v3
45+
- uses: pnpm/action-setup@v6
4646
with:
4747
version: 11
4848

0 commit comments

Comments
 (0)