Skip to content

feat: add community leaderboard with nightly CI update#2710

Open
Maanvi212006 wants to merge 17 commits into
meshery:masterfrom
Maanvi212006:community-leaderboard
Open

feat: add community leaderboard with nightly CI update#2710
Maanvi212006 wants to merge 17 commits into
meshery:masterfrom
Maanvi212006:community-leaderboard

Conversation

@Maanvi212006

@Maanvi212006 Maanvi212006 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Description
This PR fixes #947

Adds a community leaderboard to meshery.io that ranks members of the Layer5 discussion forum based on their contributions.

Inspired by Lee's PR #6773 : [Docs] Integrate Discussion Forum with Posts by Tag which introduced the static data + nightly CI pattern for integrating Discourse forum data into Meshery sites, this PR follows the same approach.

How it works:

  • Nightly CI workflow — fetches data from the Discourse API, computes scores using the official formula (posts ×1 + likes ×2 + solutions ×3), and commits the result to _data/leaderboard.json
  • Jekyll include_includes/leaderboard.html reads the pre-computed data and renders a ranked table with avatars, usernames, and scores
  • New page — accessible at /community/leaderboard
screen-capture.mp4

Files added:

  • .github/scripts/fetch-leaderboard.js — scoring logic
  • .github/workflows/update-leaderboard.yml — nightly CI
  • _data/leaderboard.json — pre-computed leaderboard data
  • _includes/leaderboard.html — UI
  • leaderboard.md — page

Notes for Reviewers

  • I checked. The workflow is running properly
image
  • The current approach uses static data refreshed nightly via CI, following the pattern from meshery/meshery#6773. A live client-side fetch can be explored as a follow-up to increase data freshness.
  • The DISCOURSE_API_KEY secret will need to be added to the main repo's secrets after merge
  • I plan to further improve this in follow-up PRs by adding a period filter (weekly/monthly/all time toggle), pagination for the full user list, enhanced mobile responsiveness, and graceful fallbacks for missing avatars or API failures

Signed commits

  • Yes, I signed my commits.

Maanvi212006 and others added 3 commits May 31, 2026 06:28
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
@netlify

netlify Bot commented May 31, 2026

Copy link
Copy Markdown

Deploy Preview for mesheryio-preview ready!

Name Link
🔨 Latest commit 72bf0ff
🔍 Latest deploy log https://app.netlify.com/projects/mesheryio-preview/deploys/6a2d55e3309e050008e82d8d
😎 Deploy Preview https://deploy-preview-2710--mesheryio-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added area/ci Continuous integration | Build and release area/docs Improvements or additions to documentation area/website labels May 31, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a community leaderboard feature by adding a script to fetch user metrics from the Discourse API, a Jekyll template to display the leaderboard with filtering capabilities, and a markdown page to host it. The review feedback highlights several critical improvements: utilizing the fetched DISCOURSE_API_KEY in the API request headers, adding defensive checks and default values in the script to prevent crashes or NaN values from unexpected API payloads, and preventing an infinite loop in the avatar image's onerror handler by setting it to null.

Comment thread .github/scripts/fetch-leaderboard.js
Comment thread .github/scripts/fetch-leaderboard.js
Comment thread .github/scripts/fetch-leaderboard.js
Comment thread _includes/leaderboard.html Outdated
@github-actions

github-actions Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview deployment: https://meshery.github.io/meshery.io/pr-preview/pr-2710/

Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment here

@Maanvi212006 Maanvi212006 force-pushed the community-leaderboard branch from 884d6e6 to 0713649 Compare May 31, 2026 05:59
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
@Maanvi212006 Maanvi212006 force-pushed the community-leaderboard branch from cdcdcfd to 5700d6d Compare May 31, 2026 06:14
@Maanvi212006

Copy link
Copy Markdown
Contributor Author

The failing DCO check is on commit 19705b1, which was created automatically by the GitHub Actions bot during a test run of the nightly workflow. This is not a contributor commit — it was generated by the CI itself.
The workflow has been updated to include -s signoff for future automated commits.

Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>

@rishiraj38 rishiraj38 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you also add a screenshot of the UI changes for reference?

@Maanvi212006

Copy link
Copy Markdown
Contributor Author

Could you also add a screenshot of the UI changes for reference?

Done @rishiraj38

@Bhumikagarggg Bhumikagarggg added the issue/dco Commit signoff instructions label May 31, 2026
@Bhumikagarggg

Copy link
Copy Markdown
Contributor

@Maanvi212006 Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Alert! Git Police! We couldn’t help but notice that one or more of your commits is missing a sign-off. A what? A commit sign-off (your email address).

To amend the commits in this PR with your signoff using the instructions provided in the DCO check.

To configure your dev environment to automatically signoff on your commits in the future, see these instructions.


        Be sure to join the community, if you haven't yet and please leave a ⭐ star on the project 😄

Comment thread .gitignore
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
@Maanvi212006

Maanvi212006 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Hi @CodexRaunak
So i actually just tried moving .github/scripts/fetch-leaderboard.js to the script tag in _includes/leaderboard.html (as discussed in the websites weekly call on 1st June)— got Uncaught ReferenceError: require is not defined in the console (looked it up - makes sense, require is Node.js only, doesn't exist in the browser). Leaderboard still renders fine since it's reading from the pre-built JSON, but yeah the script itself can't live in the HTML. keeping it in .github/scripts/ as is!

@Bhumikagarggg

Copy link
Copy Markdown
Contributor

@Maanvi212006 Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

Comment thread .github/workflows/update-leaderboard.yml Outdated
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
@Bhumikagarggg

Copy link
Copy Markdown
Contributor

@Maanvi212006 Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

@rishiraj38 rishiraj38 requested a review from CodexRaunak June 14, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Continuous integration | Build and release area/docs Improvements or additions to documentation area/website issue/dco Commit signoff instructions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discussion Forum Integration: Create solutions leaderboard

5 participants