Hacking Fedora badges into Discourse' badge system

Continuing the discussion from Getting Started Introductions:

Sure! Right now, it’s in proof of concept stage (see Fedora Discussion), but I’d like to take it further.

The basic thing is: Discourse’s badging system is great if forum activity is your community activity.[1] They’re all geared around that, and, worse[2] have default names like “Enthusiast”, “New User of the Month”, and even “Leader” which are kind of problematic if they’re not really connected to the community’s more-than-the-forum activities.

Meanwhile, Fedora has our own Badges system for things all across the project. It’s pretty awesome, but… 1) it’s based on the effectively-defunct Mozilla Open Badges project[3], and desperately needs a code update and 2) it’s not well-connected into the rest of our infrastructure, so it’s less visible than it would be useful to be.

So the basic idea is: what if we replace the existing Fedora Badges frontend with just … Discourse Badges? (Possibly also eventually replacing the existing database which currently holds who-has-what and making Discourse’s database authoritative.)

Fortunately, we have a single-sign on (keyed to username) that’s the same for both the Discourse forum and the existing badges system. So I made a little script which checks with the existing Badge system API for what badges each user should have, and the uses the Discourse API to create and assign corresponding Discourse badges.

There are a couple of small things that would be nice to make better (presentation of badges in the overview doesn’t really scale nicely to 600+ distinct badges, and even more so for the user pages — performance is okay, but it’s overwhelming). But there are also a few big things to overcome:

  1. Not a problem starting from scratch or as things go on, but we have a lot of people with hundreds of existing badges. Discourse has no way to skip notification when awarding a badge, or to give one “you’ve got 100 badges!” notification. We need a solution there or otherwise it’ll be really annoying.
  2. The leaderboard (see e.g. top users this week by topic count on this site) can’t show badge count. And gamification needs leaderboards. (A quick look at the code shows that it’s not trivial to add, since the badge count information isn’t in the table that the other values come from; it’s probably not a huge change, but it’s not a one-liner or anything.)

I know Linux Foundation uses Credly, which also has an API — it shouldn’t be terribly hard to a similar thing here. And maybe multiple people asking for the above changes (and other future enhancements) would inspire the needed dev work. (Or… if anyone reading this is interested in helping out!)

  1. It might be too late here, and not the end of the world anyway (names are hard, so, whatever) but I really think it’s better to not use “community.example.org” as the URL for a discussion forum for your community. I can expand that thought if you like, but it’s a big tangent. ↩︎

  2. I mean “worse” from this particular perspective, of course! ↩︎

  3. I know the standard lives on in some way, but it’s basically all proprietary — I’m not aware of any significant open source options around it anymore. ↩︎


Thanks so much for writing this up, @mattdm! As always, you do such awesome work!

It is funny, this is a similar implementation to when I built Ubuntu Accomplishments, which interestingly, just got revived.

When you say “badge system API”, do you mean the Discourse API?

Ahhh, do you mean when you bulk assign badges, Discourse will send notification spam of new badges?

This is just my personal opinion, but I am not sure badge count is that critical in this context. In my mind it is the specific badge accomplishments (e.g. people rising up trust levels) that are most critical. What do you think?

Yeah, I can’t speak for the LF, but I think there is some huge potential for a broader, integrated badging effort across multiple projects. I think there could be some potential for collaboration here. :slight_smile:


Oooh, interesting! I’ll check that out!

In this case, I meant our existing badge system API — which for the proof-of-concept is just the public JSON endpoints on the badges server, e.g. https://badges.fedoraproject.org/badge/building-the-outer-ring-copr-build-iii/json. But there is also a low-level API for that system’s database which we’ll need to integrate with, update, and/or replace.

Yeah, we definitely would also want to show that in a useful way. We’ve found some people are really driven by the raw-count leaderboard though, and I wouldn’t want to disappoint them.

I’m thinking about ways to show specific accomplishments to tell a story rather than the current gigantic list on Discourse user pages. But I am now wondering also about ways to show those same kind of things in a list of a active users this week. What’s important and new, as well as past accomplishments, by something other than count. I’d love to hear ideas on that!

Definitely! It’d be amazing to see something that isn’t just “collect in multiple places” but which actually encourages and celebrates cross-distro collaboration.

1 Like