Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSoC 2024: GitHub Discussion UI at Home, Discussion and Contributor's route #463

Merged
merged 82 commits into from
Jul 25, 2024

Conversation

dgparmar14
Copy link
Contributor

@dgparmar14 dgparmar14 commented Jul 12, 2024

Pull Request Description

Overview

This PR introduces a comprehensive update to display GitHub Discussions across various routes: Home, Discussions, and Profile. It also adds functionality to filter discussions based on their category and creation date. Additionally, discussions will be integrated with activities on the contributor's route.

Fixes - #212

Changes

New Routes and Components

  1. New Discussions Route:

    • Created a new route to display all discussions (currently limited to GitHub Discussions).
  2. New Components:

    • GitHub Discussions: Displays all discussions and handles their filtering.
    • GitHub Discussion: A discussion card showcasing the title, author, timeline, description, and participants.
    • Filter Discussions: Filters discussions using SearchParams. Includes:
      • Discussions Category
      • Date Range Picker (reuses the existing component)
    • DiscussionsMarkdown: A client-side markdown component for experimental purposes. It is intended to potentially replace the existing server-side component if proven effective.

Library Update

  • lib/discussion.ts: Contains two functions:
    • fetchGithubDiscussionForUser()
    • fetchGithubDiscussion(): Fetches a specified number of discussions. If no number is provided, it returns all discussions.

Discussions UI

Desktop View

Untitled.video.-.Made.with.Clipchamp.mp4

Mobile View

Untitled.video.-.Made.with.Clipchamp.2.mp4

1. Discussions Route:

Discussions Route

2. Home Route:

Home Route

3. Contributors Profile Route:

Contributors Profile Route

My Tasks

  • Refactor Python scraper into TypeScript using the GitHub Octokit GraphQL API.
  • Scrape and parse GitHub discussions using Octokit and GraphQL.
  • Create a new discussion route to display all GitHub discussions.
  • Display the top 5 discussions with a "Show More" option on the home page of the leaderboard.
  • Add discussions with contributor activity data.
  • Enable calculation of points based on discussions created, discussions answered, and comments created in discussions.
  • Implement a reward system for discussion .

Mid Term Evaluation PR : Refactor Scraper

dgparmar14 and others added 30 commits June 6, 2024 10:32
scraper/src/github-scraper/discussion.ts Outdated Show resolved Hide resolved
scraper/src/github-scraper/discussion.ts Outdated Show resolved Hide resolved
scraper/src/github-scraper/discussion.ts Outdated Show resolved Hide resolved
scraper/src/github-scraper/discussion.ts Outdated Show resolved Hide resolved
scraper/src/github-scraper/discussion.ts Outdated Show resolved Hide resolved
scraper/src/github-scraper/discussion.ts Outdated Show resolved Hide resolved
tests/github-discussion-schema.test.mjs Outdated Show resolved Hide resolved
@dgparmar14 dgparmar14 requested a review from rithviknishad July 23, 2024 05:01
@rithviknishad rithviknishad changed the base branch from gsoc/gh-discussions to main July 23, 2024 05:03
Copy link

vercel bot commented Jul 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
leaderboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2024 7:08am

@rithviknishad
Copy link
Member

@dgparmar14 Builds failing when there is no discussion directory (which happens when no discussions were scraped so far and none were present to be scrapped in the last 24 hours or the given scraping time range)

image

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes: LGTM ✅

Tested discussions locally and workflow in https://github.com/coronasafe/leaderboard-data-test/actions/runs/10089604078. Working as expected! ✅

Nice work @dgparmar14

@rithviknishad rithviknishad requested a review from sainak July 25, 2024 07:14
@rithviknishad rithviknishad merged commit 2a56d9b into ohcnetwork:main Jul 25, 2024
3 checks passed
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.

Support for showing GitHub discussions Enable reward for activity in GitHub discussion
3 participants