Feature : Automatic Goal Progress Syncing with GitHub Events#436
Feature : Automatic Goal Progress Syncing with GitHub Events#436vivek0369 wants to merge 15 commits into
Conversation
…s and GET refresh
|
@vivek0369 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
There was a problem hiding this comment.
Thanks for your first PR on DevTrack! 🎉
A maintainer will review it within 48 hours. While you wait:
- Make sure CI is passing (type-check + lint)
- Double-check the PR description is filled out and the issue is linked
- Feel free to ask questions in Discussions if you need help
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
Conflicts with open PR #202 which also adds automatic goal syncing from GitHub commit data and touches the same files (api/goals/route.ts, api/webhooks/github/route.ts). Resolve #202 first before this can be reviewed.
Additional blockers:
-
Double-counting between pull-sync and push-sync — the GET route sets
currentto the absolute total from GitHub Search API. The webhook handler addscommitCountincrementally viaMath.min(goal.current + commitCount, goal.target). After a push,currentincrements; on next page load, the GET overwrites it with the absolute total. These two mechanisms fight each other and will produce incorrect values. -
N+1 GitHub API calls on every GET /api/goals — for a user with 5 goals and 3 accounts = 15 Search API calls per page load. GitHub Search API rate limit is 30 req/min. This will hit limits under normal use. Cache the results or batch the calls.
-
Missing migration for
period_startcolumn — the code referencesgoal.period_startbut no migration adds this column. Goals will fall back to epoch date causing inflated counts. -
Missing EOF newlines on modified files.
…on logic, and cache api queries
…o feat/automatic-goal-syncing
📝 Detailed Description
This PR introduces a fully automated GitHub Goal Progress Syncing System for DevTrack, enabling developer goals to stay synchronized with real GitHub activity in real time.
Previously, users had to manually update their goals for:
which created unnecessary friction and reduced engagement.
This implementation transforms the goal system into a dynamic developer productivity tracker by integrating:
The system now intelligently updates active goals whenever users:
🎯 Core Objectives Achieved
✅ Real-Time Goal Synchronization
Developer goals now automatically progress based on actual GitHub activity instead of manual input.
✅ Hybrid Sync Architecture
Implemented two synchronization strategies for reliability and scalability:
1️⃣ Pull-Based Syncing
When users:
the backend:
This guarantees data consistency even if webhook events are missed.
2️⃣ Push-Based Syncing
Implemented real-time webhook listeners that instantly update goals whenever GitHub emits events.
Supported events:
pushpull_requestissuesThis provides immediate UI feedback and live goal progression.
🛠️ Major Backend Enhancements
📌 Enhanced GitHub Webhook Route
Modified:
Features Added:
Secure webhook event parsing
Commit count extraction
Pull request event handling
Linked account resolution
Goal lookup based on:
Atomic Supabase updates
Duplicate event prevention
Error-safe processing
📌 Automated Goal Sync Utility
Added:
Responsibilities:
This utility centralizes all synchronization logic for maintainability and future scalability.
📌 Goal API Refactor
Modified:
Improvements:
🎨 Frontend Improvements
📌 GoalTracker UI Enhancements
Modified:
New Features:
The UI now clearly communicates synchronization status to users.
⚡ Performance Optimizations
✅ GitHub API Rate Limit Protection
Implemented:
This significantly reduces unnecessary API usage.
✅ Efficient Database Updates
Optimized:
This prevents race conditions and ensures accurate goal progression.
🔒 Reliability & Edge Cases
Implemented protections for:
🧠 Architecture Decisions
No Database Migrations Required
The implementation leverages the existing schema structure by:
This minimizes migration complexity and deployment risks.
📸 Screenshots & Demo
🖥️ Dashboard Auto Goal Sync
⚡ E2E Sync Video Demo
🧪 Testing & Verification
✅ Backend Verification
✅ Frontend Verification
✅ Build Validation
All checks pass successfully with zero errors.
📂 Files Modified
Backend
Frontend
🌟 Impact
This feature significantly improves:
It transforms DevTrack from a manual tracker into an intelligent developer activity platform.
✅ PR Checklist
🏷️ Labels
GSSoC'26type:featuretype:performancetype:devopstype:refactorlevel:advancedDifficulty: Hardquality:exceptional🔗 Related Issue
Closes #397