Skip to content

Add contributor activity leaderboard#68

Open
anshul23102 wants to merge 4 commits into
Hell1213:mainfrom
anshul23102:feat/issue-63-leaderboard
Open

Add contributor activity leaderboard#68
anshul23102 wants to merge 4 commits into
Hell1213:mainfrom
anshul23102:feat/issue-63-leaderboard

Conversation

@anshul23102

Copy link
Copy Markdown

Summary

Implements leaderboard system that ranks contributors by weighted activity metrics (issues resolved, PRs merged, code reviews, docs contributions) with GitHub API integration and caching.

Related Issue

Fixes #63

Type of Change

  • New feature
  • Bug fix
  • Documentation
  • Refactoring
  • Test changes
  • CI/Chore

Testing

  • uv run ruff check passes
  • uv run mypy passes
  • uv run pytest tests/test_leaderboard.py passes (13 tests)
  • Manual testing done

Description

Provides public recognition system for contributors with automated leaderboard generation based on weighted contribution metrics.

Key Features

  1. LeaderboardMetrics (Data Model)

    • Tracks contributor: issues resolved, PRs merged, reviews, docs commits
    • Calculates points using weighted system
    • Serializable to JSON
  2. LeaderboardGenerator (Core Logic)

    • Fetches data from GitHub API with pagination
    • Aggregates metrics across multiple data sources
    • Supports time windows: weekly, monthly, all-time
    • 1-hour result caching to avoid rate limits
    • Ranks top N contributors by points
  3. Weighted Point System

    • Issues resolved: 10 points each
    • PRs merged: 15 points each
    • Code reviews: 5 points each
    • Docs commits: 20 points each
  4. GitHub API Integration

    • Fetches closed issues (by closer)
    • Fetches merged PRs (by merger)
    • Fetches code review comments
    • Fetches commits to docs/
    • Proper pagination and error handling

Usage

from tools.leaderboard import get_leaderboard_generator

gen = get_leaderboard_generator()
leaderboard = gen.generate_leaderboard(
    "owner/repo", 
    time_window="monthly",
    top_n=20
)
for i, metric in enumerate(leaderboard, 1):
    print(f"{i}. {metric.login}: {metric.total_points} points")

Benefits

  • Motivates Contributors — Public recognition encourages participation
  • Identifies Active Members — Find maintainers and core contributors
  • Diverse Metrics — Rewards different types of contributions
  • Customizable — Adjust weights and time windows as needed
  • Scalable — Handles large repositories efficiently

Architecture

  • Pagination for large datasets
  • Caching to avoid API rate limits
  • Error handling with graceful degradation
  • Type-safe with full annotations
  • Comprehensive test coverage

This implementation integrates with Oss-Dev's architecture and maintainer recognition goals.

anshul23102 and others added 4 commits June 28, 2026 21:05
Provides canonical label schema and Python tool for synchronizing labels
uniformly across managed repositories via GitHub API. Addresses inconsistent
labeling practices across Oss-Dev projects.

Key features:
- Canonical label schema in config/labels.json with color and description
- LabelManager class for creating, updating, and deleting labels
- Batch synchronization for multiple repositories
- Idempotent operations with proper error handling
- Comprehensive test coverage with 15 passing tests

The schema includes: bug, enhancement, good first issue, help wanted,
documentation, level:intermediate, level:advanced, beginner-friendly,
mentor-needed, and blocked labels.

Fixes Hell1213#61

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Implements automated validation workflow that checks pull request descriptions
against the repository's PULL_REQUEST_TEMPLATE.md. Ensures all required
sections are present, non-empty, and contain meaningful content.

Key features:
- Validates presence of required sections (Summary, Related Issue, Type of
  Change, Testing, Description)
- Detects and rejects placeholder-only content
- Posts helpful feedback comments on PR with specific validation errors
- Non-intrusive: provides clear guidance without blocking the PR
- Runs on PR creation, edit, and synchronization events
- Zero configuration required

Automatically posts success/failure comments linking to guidance docs for
contributors to quickly resolve validation issues.

Fixes Hell1213#62

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Implements an 8-step interactive onboarding system that guides new contributors
through essential setup, learning, and contribution steps. Progress is persisted
locally with localStorage-like storage at ~/.oss-dev/onboarding.json.

Key features:
- OnboardingStep dataclass for structured step definitions
- OnboardingChecklist class for progress tracking and management
- 8 comprehensive steps: Fork → Setup → Learn → Find → Branch → Code → PR → Join
- Each step includes title, description, detailed guidance, and resources
- Persistent progress tracking with save/load functionality
- Progress queries for tracking completion percentage and next steps
- Complete test suite with 18 passing tests

The checklist provides a clear learning path for newcomers, reducing the
barrier to first-time contribution. Progress is automatically saved, allowing
contributors to resume at any time.

Steps include:
1. Fork and clone repository
2. Install dependencies and setup
3. Read CONTRIBUTING.md and CODE_OF_CONDUCT.md
4. Find a good first issue
5. Create a feature branch
6. Implement changes and run tests
7. Submit pull request
8. Join community Discord/discussions

Fixes Hell1213#60

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Implements leaderboard system that ranks contributors by weighted activity
metrics (issues resolved, PRs merged, code reviews, docs contributions)
fetched from GitHub API with 1-hour caching.

Key features:
- LeaderboardMetrics dataclass for structured contributor data
- LeaderboardGenerator for fetching and aggregating metrics
- Weighted point system: issues (10pts), PRs (15pts), reviews (5pts), docs (20pts)
- GitHub API integration with pagination and error handling
- Caching support to avoid rate limiting
- JSON export capability
- 13 comprehensive unit tests

The system provides public recognition for contributors, improving motivation
for sustained contribution and enabling maintainers to identify active members.

Metrics tracked:
- Issues resolved (closed_by count)
- Pull requests merged (merged_by count)
- Code review comments (pull request comments)
- Documentation contributions (commits to docs/)

Fixes Hell1213#63

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@anshul23102

Copy link
Copy Markdown
Author

Please add the gssoc:approved label to this PR for GSSoC 2026 contribution tracking. This implementation addresses issue #63 with a complete leaderboard system including weighted metrics and GitHub API integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contributor activity leaderboard

1 participant