feat(rankings): add Top Contributors ranking for open source contributions#29
Conversation
…tions Add a first-class "Top Contributors" ranking, on par with the existing rankings (Top Performers, Guiding Stars, etc.), for points earned by contributing to Codam's open source projects. - Add a dedicated `contribution` fixed point type (variable amount, decided per contribution by staff). - Add the `Top Contributors` ranking definition (slug `top_contributors`, title `Top Contributor %login`) fed by the `contribution` fixed type, so it automatically gets season-end snapshots and title awards like the others. - Show a Top Contributors card on the home page below the "Contribute to the coalition system" card, driven by the standard ranking system. Exclude it from the main rankings list (it has its own card). The generic /rankings/:ranking_type route serves /rankings/top_contributors. - Add an admin form (and assign route) to award contribution points, tagging them with the `contribution` fixed type so they count towards the ranking. - Add dev scripts: create_contributors_ranking.ts (idempotently create just this ranking without recreating the others) and migrate_contribution_scores.ts (tag pre-existing custom contribution scores with the new fixed type).
|
Thank you for the PR! I will have a look at it likely by the end of next week. At first glance it looks good though, but I want to make absolutely sure before making such a drastic change to the points system. Then for next season (starting in 2 weeks) we can also add a ranking bonus for this type. |
FreekBes
left a comment
There was a problem hiding this comment.
Almost there, can be merged after the requested changes have been made. Could make those changes myself, but maybe there was a reason for some of them that I failed to see so I will wait for your input.
Address review feedback: - Render the top_contributors ranking through the standard rankings loop on the home page instead of a separate bespoke card - Remove create_contributors_ranking.ts dev script; the ranking can be created via the web interface
|
Thanks for the review @FreekBes! I've pushed the requested changes in 9ecab3d:
Also merged in the latest |
|
🎉 This PR is included in version 1.60.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Summary
Adds a first-class Top Contributors ranking, on par with the existing rankings (Top Performers, Guiding Stars, etc.), for points earned by contributing to Codam's open source projects.
Previously there was no structured way to recognise students who contribute to the coalition system and other Codam repositories. This routes those contributions through the same ranking machinery as everything else, so they automatically get season-end snapshots and the
Top Contributor %logintitle award.Changes
contributionfixed point type — variable amount, decided per contribution by staff.Top Contributorsranking (slugtop_contributors, titleTop Contributor %login) fed by thecontributionfixed type./rankings/:ranking_typeroute serves/rankings/top_contributors.contributionfixed type so they count towards the ranking.create_contributors_ranking.ts— idempotently creates just this ranking, without recreating the others (unlikecreate_rankings.ts).migrate_contribution_scores.ts— tags pre-existing manually-awarded contribution scores (custom scores whose reason contains "contributed") with the new fixed type so they count.Deploy notes
contributionfixed point type is created.node build/dev/create_contributors_ranking.jsto register the ranking (non-destructive).node build/dev/migrate_contribution_scores.jsto fold in pre-existing contribution scores.bonus_pointsis set to0(no automatic hourly bonus); staff can adjust it via the admin rankings UI if desired.Testing
tscbuilds cleanly./rankings/top_contributors, and the admin contribution form all render (HTTP 200).