-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·419 lines (333 loc) · 10 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·419 lines (333 loc) · 10 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
#!/bin/bash
# Code Orange Grad Contribution Pipeline Setup
echo "=== Code Orange Grad Contribution Pipeline ==="
mkdir -p code-orange-grad-pipeline
cd code-orange-grad-pipeline
# Create directory structure
mkdir -p {issues,grads,prs,scripts,templates}
echo "1. Creating issue templates..."
# Issue template for grads
cat > templates/grad-issue-template.md << 'EOF'
# 🍊 Code Orange Grad Issue
**Issue:** #[NUMBER]
**Repo:** [REPO]
**Upstream:** [UPSTREAM_URL]
**Difficulty:** [BEGINNER|INTERMEDIATE|ADVANCED]
**Language:** [LANGUAGE]
**Skills:** [SKILLS]
## Description
[BRIEF_DESCRIPTION]
## Tasks
- [ ] Fork the repo to your GitHub account
- [ ] Clone locally: `git clone https://github.com/YOUR_USERNAME/[REPO].git`
- [ ] Create branch: `git checkout -b fix/[ISSUE_NUMBER]-[DESCRIPTION]`
- [ ] Implement the fix/feature
- [ ] Add tests
- [ ] Run tests: `make test` or equivalent
- [ ] Commit with good message
- [ ] Push: `git push origin fix/[ISSUE_NUMBER]-[DESCRIPTION]`
- [ ] Submit PR to upstream
- [ ] Update tracking dashboard
## Resources
- [Contributing Guide](CONTRIBUTING_URL)
- [Code Style Guide](STYLE_GUIDE_URL)
- [Related Issues](RELATED_ISSUES)
## Mentor
@keypleb
## Questions?
Ask in [Discord](https://discord.gg/xd6dmPF9bA) #dev-help channel
---
🍊 Code Orange Dev School
EOF
# Grad onboarding template
cat > templates/grad-onboarding.md << 'EOF'
# 🍊 Welcome to Code Orange OSS Contributions!
## Your First Contribution
### Step 1: Setup
1. Create GitHub account
2. Fork the target repo to your account
3. Join [Code Orange Discord](https://discord.gg/xd6dmPF9bA)
4. Introduce yourself in #introductions
### Step 2: Pick an Issue
1. Check the [Issue Board](https://github.com/code-orange-dev/grad-issues)
2. Pick issue matching your skills
3. Comment "🍊 Taking this" on the issue
4. Wait for assignment
### Step 3: Work on It
1. Clone your fork
2. Create branch
3. Implement fix
4. Test thoroughly
5. Commit & push
### Step 4: Submit PR
1. Create PR to upstream (not your fork)
2. Use PR template
3. Reference Code Orange
4. Request review from mentor
### Step 5: Iterate
1. Respond to feedback
2. Make changes
3. Get approval
4. Merge! 🎉
## Support
- **Technical help:** Discord #dev-help
- **Mentor:** @keypleb
- **Weekly sync:** Bitcoin House Bali, Sundays 2pm
## Recognition
- PR merged → Code Orange certificate
- 3 PRs merged → "Contributor" badge
- 10 PRs merged → "Core Contributor" status
- Featured on [PR Tracking Dashboard](https://github.com/code-orange-dev/PR-tracking-dashboard)
---
Ready to start? Pick your first issue! 🚀
EOF
echo "2. Creating grad tracking system..."
# Grad database
cat > grads/grads.json << 'EOF'
{
"grads": [
{
"github": "example-grad",
"name": "Example Grad",
"country": "Indonesia",
"skills": ["Go", "Bitcoin"],
"joined": "2026-04-26",
"prs_submitted": 0,
"prs_merged": 0,
"issues_completed": [],
"status": "active"
}
]
}
EOF
# Issue database
cat > issues/open-issues.json << 'EOF'
{
"issues": [
{
"id": "LND-10271",
"repo": "lnd",
"upstream_issue": 10271,
"title": "Add change_addr to SendCoins",
"difficulty": "beginner",
"language": "Go",
"skills": ["Go", "Protobuf", "CLI"],
"status": "in-progress",
"assigned_to": "code-orange-dev",
"pr_url": "https://github.com/lightningnetwork/lnd/pull/10769"
},
{
"id": "LND-9952",
"repo": "lnd",
"upstream_issue": 9952,
"title": "MPP record support for QueryRoutes",
"difficulty": "intermediate",
"language": "Go",
"skills": ["Go", "Protobuf", "Lightning"],
"status": "in-progress",
"assigned_to": "code-orange-dev",
"pr_url": "https://github.com/lightningnetwork/lnd/pull/10770"
},
{
"id": "BDK-1936",
"repo": "bdk",
"upstream_issue": 1936,
"title": "Move TxTemplate to bdk_testenv",
"difficulty": "beginner",
"language": "Rust",
"skills": ["Rust", "Testing"],
"status": "in-progress",
"assigned_to": "code-orange-dev",
"pr_url": "https://github.com/bitcoindevkit/bdk/pull/2191"
},
{
"id": "RUST-BTC-1802",
"repo": "rust-bitcoin",
"upstream_issue": 1802,
"title": "TryFrom<&str> for FromStr types",
"difficulty": "beginner",
"language": "Rust",
"skills": ["Rust", "Traits"],
"status": "in-progress",
"assigned_to": "code-orange-dev",
"pr_url": "https://github.com/rust-bitcoin/rust-bitcoin/pull/6083"
}
]
}
EOF
echo "3. Creating automation scripts..."
# Script to assign issue to grad
cat > scripts/assign-issue.sh << 'SCRIPT_EOF'
#!/bin/bash
# Assign an issue to a grad
ISSUE_ID=$1
GRAD_GITHUB=$2
if [ -z "$ISSUE_ID" ] || [ -z "$GRAD_GITHUB" ]; then
echo "Usage: ./assign-issue.sh <issue-id> <grad-github-username>"
exit 1
fi
echo "Assigning $ISSUE_ID to @$GRAD_GITHUB..."
# Update issues database
jq --arg id "$ISSUE_ID" --arg grad "$GRAD_GITHUB" \
'.issues |= map(if .id == $id then .assigned_to = $grad else . end)' \
issues/open-issues.json > issues/open-issues.json.tmp
mv issues/open-issues.json.tmp issues/open-issues.json
echo "✅ Issue assigned"
echo "Next steps:"
echo "1. Create issue in code-orange-dev/grad-issues"
echo "2. Notify grad on Discord"
echo "3. Add to tracking dashboard"
SCRIPT_EOF
chmod +x scripts/assign-issue.sh
# Script to track PR status
cat > scripts/track-prs.sh << 'SCRIPT_EOF'
#!/bin/bash
# Track status of all grad PRs
export GITHUB_TOKEN="${GITHUB_TOKEN:-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}"
echo "=== Code Orange PR Tracker ==="
echo "Date: $(date -u)"
echo ""
# Read issues and check PR status
jq -r '.issues[] | select(.pr_url != null) | "\(.id)|\(.pr_url)"' issues/open-issues.json | \
while IFS='|' read -r id pr_url; do
echo "--- $id ---"
# Extract repo and PR number from URL
repo=$(echo "$pr_url" | sed 's|https://github.com/||' | sed 's|/pull/.*||')
pr_num=$(echo "$pr_url" | sed 's|.*/pull/||')
# Get PR status
status=$(gh pr view "$pr_num" --repo "$repo" --json state -q '.state' 2>/dev/null || echo "unknown")
echo " PR: $pr_url"
echo " Status: $status"
if [ "$status" = "MERGED" ]; then
echo " 🎉 MERGED! Update grad stats."
elif [ "$status" = "CLOSED" ]; then
echo " ⚠️ Closed. Check why."
else
echo " 🔄 Open. Awaiting review."
fi
echo ""
done
echo "=== Tracking Complete ==="
SCRIPT_EOF
chmod +x scripts/track-prs.sh
# Script to onboard new grad
cat > scripts/onboard-grad.sh << 'SCRIPT_EOF'
#!/bin/bash
# Onboard a new grad
GRAD_GITHUB=$1
GRAD_NAME=$2
GRAD_COUNTRY=$3
if [ -z "$GRAD_GITHUB" ] || [ -z "$GRAD_NAME" ]; then
echo "Usage: ./onboard-grad.sh <github-username> <full-name> [country]"
exit 1
fi
echo "🍊 Onboarding $GRAD_NAME (@$GRAD_GITHUB)..."
# Add to grads database
jq --arg gh "$GRAD_GITHUB" --arg name "$GRAD_NAME" --arg country "${GRAD_COUNTRY:-Unknown}" \
'.grads += [{"github": $gh, "name": $name, "country": $country, "skills": [], "joined": "'$(date -I)'", "prs_submitted": 0, "prs_merged": 0, "issues_completed": [], "status": "active"}]' \
grads/grads.json > grads/grads.json.tmp
mv grads/grads.json.tmp grads/grads.json
echo "✅ Grad added to database"
echo ""
echo "Next steps:"
echo "1. Send onboarding template: templates/grad-onboarding.md"
echo "2. Add to Discord #grads channel"
echo "3. Schedule intro call"
echo "4. Assign first issue"
SCRIPT_EOF
chmod +x scripts/onboard-grad.sh
echo "4. Creating PR template..."
cat > templates/pr-template.md << 'EOF'
## Summary
[Brief description of changes]
## Changes
- [ ] Change 1
- [ ] Change 2
- [ ] Change 3
## Testing
- [ ] Unit tests added
- [ ] Integration tests pass
- [ ] Manual testing completed
## Related Issues
Fixes [upstream#issue-number]
## Checklist
- [ ] Code follows project style
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] CHANGELOG updated (if applicable)
---
🍊 [Code Orange Dev School](https://github.com/code-orange-dev) contribution
- Grad: @GRAD_GITHUB
- Mentor: @keypleb
- Cohort: [COHORT_NAME]
EOF
echo "5. Creating README..."
cat > README.md << 'EOF'
# 🍊 Code Orange Grad Contribution Pipeline
Automated system for managing Code Orange grad contributions to Bitcoin OSS.
## Directory Structure
```
code-orange-grad-pipeline/
├── grads/ # Grad database
├── issues/ # Issue tracking
├── prs/ # PR tracking
├── scripts/ # Automation scripts
├── templates/ # Issue/PR templates
└── README.md # This file
```
## Quick Start
### Onboard a New Grad
```bash
./scripts/onboard-grad.sh github-username "Full Name" "Country"
```
### Assign an Issue
```bash
./scripts/assign-issue.sh ISSUE-ID grad-github-username
```
### Track PR Status
```bash
./scripts/track-prs.sh
```
## Workflows
### 1. New Grad Onboarding
1. Run `onboard-grad.sh`
2. Send `templates/grad-onboarding.md`
3. Add to Discord
4. Pick first issue
### 2. Issue Assignment
1. Grad picks issue from board
2. Run `assign-issue.sh`
3. Create tracking issue
4. Monitor progress
### 3. PR Submission
1. Grad submits PR using `templates/pr-template.md`
2. Mentor reviews
3. Address feedback
4. Merge!
### 4. Recognition
- PR merged → Certificate
- 3 PRs → Contributor badge
- 10 PRs → Core Contributor
## Active Issues
See `issues/open-issues.json` for current assignments.
## Grads
See `grads/grads.json` for grad database.
## Integration
This pipeline integrates with:
- GitHub (PRs, issues)
- Discord (notifications)
- [PR Tracking Dashboard](https://github.com/code-orange-dev/PR-tracking-dashboard)
---
🍊 Code Orange Dev School - Training Bitcoin OSS contributors from Southeast Asia
EOF
echo ""
echo "=== Pipeline Setup Complete ==="
echo ""
ls -la
echo ""
echo "Next steps:"
echo "1. Review README.md"
echo "2. Add real grad data to grads/grads.json"
echo "3. Run ./scripts/track-prs.sh to check current PRs"
echo "4. Create GitHub repo: code-orange-dev/grad-pipeline"
echo "5. Push this directory to that repo"