Closed Bug 896137 Opened 11 years ago Closed 11 years ago

add badge infrastructure

Categories

(support.mozilla.org :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
2013Q3

People

(Reporter: willkg, Assigned: willkg)

References

Details

(Whiteboard: u=contributor c=badges p=3 s=2013.17)

This is the implementation bug for bug #889884. It covers the following: 1. adding the django-badger app 2. setting up a badge to test issuing with 3. setting up any additional infrastructure bits This is a rough sketch of the requirements. We'll learn more after someone spends some time working on django-badger and updating it as well as the requirements for badges for SUMO.
kkool :willkg please don't hesitate to ping me or kadir if you need help or further clarification from our end
putting into next sprint. is this a million pts?
Priority: -- → P2
Whiteboard: u=contributor c=badges p= s=2013.15
Target Milestone: --- → 2013Q3
Mmm... I really think someone needs to spend a week on django-badger to get it into better shape before we do this. I can spend half a sprint on Input and the other half on django-badger and then we could put this in the following sprint. Would that work?
(In reply to Will Kahn-Greene [:willkg] from comment #3) > I can spend half a sprint on Input and the other half on django-badger and > then we could put this in the following sprint. Would that work? Definitely! I was kind of including that time in this bug which is why I joked about a million points. But we can do that separately since it's not strictly kitsune work.
Pushing back a sprint so we give some TLC to django-badger.
Whiteboard: u=contributor c=badges p= s=2013.15 → u=contributor c=badges p= s=2013.16
:willkg, I'm thinking this is *at least* a 3pt?
Whiteboard: u=contributor c=badges p= s=2013.16 → u=contributor c=badges p=3 s=2013.16
Assignee: nobody → willkg
This bug is pretty nebulous so far because I haven't had a chance to spend a week on django-badger, yet. Regardless, I'm going to flesh out the description so this bug covers the following minimal stuff with the expectation that additional things can come in later bugs: 1. Add the django-badger app to vendor/. 2. Create a badge for "contributing to the kitsune codebase". 3. Implement manual badge awarding mechanis. Is there an admin page? Do we need to build a page? If it's complicated, spin this off into a new bug. 4. Add badge display to the user profile page. If this is complicated, spin it off into a new bug. 5. When someone gets a badge, do they get an email from somewhere (kitsune or badge backpack)? How do they get informed? If this is complicated, spin it off into a new bug. 6. Is there a page covering recent badge awards across the site? If not, write one. If it's complicated, spin it off into a new bug. I think that covers the basics. I fully expect this to kick up new bugs. For now, if only because this is still somewhat nebulous, let's call it 3 points and make sure to spin off new bugs liberally.
One more thing: 7. Need a way to revoke badges. Is there an admin page? Do we have to reach into the backpack to revoke it there, too? This probably needs a new bug.
I'm working on django-browser stuff now. I'm not going to get to this bug until next sprint, so I'm pushing it off now. Sorry I keep kicking this can down the road.
Whiteboard: u=contributor c=badges p=3 s=2013.16 → u=contributor c=badges p=3 s=2013.17
One more thing: 8. Make sure we pull strings into our .po files so badge stuff can be localized.
My $0.02 from spare time at a work week :) (In reply to Will Kahn-Greene [:willkg] from comment #7) > 1. Add the django-badger app to vendor/. +1 > 2. Create a badge for "contributing to the kitsune codebase". +1 > 3. Implement manual badge awarding mechanis. Is there an admin page? Do we > need to build a page? If it's complicated, spin this off into a new bug. > > 4. Add badge display to the user profile page. If this is complicated, spin > it off into a new bug. > > 6. Is there a page covering recent badge awards across the site? If not, > write one. If it's complicated, spin it off into a new bug. There should be views for these in django-badger, but your mileage may vary & require customization. > 5. When someone gets a badge, do they get an email from somewhere (kitsune > or badge backpack)? How do they get informed? If this is complicated, spin > it off into a new bug. django-badger mostly outsources notifications like this to django-notification. That could be a horrible idea. If django-notification is not available, it skips sending them. Alternatively, you could hook into Django signals to handle notifications your own way. > I think that covers the basics. I fully expect this to kick up new bugs. > > For now, if only because this is still somewhat nebulous, let's call it 3 > points and make sure to spin off new bugs liberally.
I'm (finally) working on this. I'm updating django-badger docs as I go along.
(In reply to Les Orchard [:lorchard] from comment #11) > My $0.02 from spare time at a work week :) > > (In reply to Will Kahn-Greene [:willkg] from comment #7) > > 6. Is there a page covering recent badge awards across the site? If not, > > write one. If it's complicated, spin it off into a new bug. > > There should be views for these in django-badger, but your mileage may vary > & require customization. We're probably going to want to show the recent award list in different ways: across all contributors, across a locale team, .... I'll definitely base the SUMO views on the existing django-badger views, though. > > 5. When someone gets a badge, do they get an email from somewhere (kitsune > > or badge backpack)? How do they get informed? If this is complicated, spin > > it off into a new bug. > > django-badger mostly outsources notifications like this to > django-notification. That could be a horrible idea. If django-notification > is not available, it skips sending them. > > Alternatively, you could hook into Django signals to handle notifications > your own way. I looked at the django-notification stuff and I don't think it helps us much. At a minimum, I can't find a compelling reason to bring in another library. It's easier to reuse the existing infrastructure we have for notifications. https://django-badger.readthedocs.org/en/latest/api.html#module-badger.signals That covers all the signals available. We're not doing nominations right now, so I'll skip those. I'll add a receiver for the badge_was_awarded signal that uses django-tidings to send an email. Thank you Les!
(In reply to Will Kahn-Greene [:willkg] from comment #13) > We're probably going to want to show the recent award list in different > ways: across all contributors, across a locale team, .... I'll definitely > base the SUMO views on the existing django-badger views, though. For what it's worth, I have another Django app I've started: https://github.com/lmorchard/django-teamwork/ That may or may not be helpful here or to SUMO in general. For badges.mozilla.org, I was planning to add an optional "team" field to badges using django-teamwork. That would allow groups to manage nominations & awards, and other interesting things. > I looked at the django-notification stuff and I don't think it helps us > much. At a minimum, I can't find a compelling reason to bring in another > library. It's easier to reuse the existing infrastructure we have for > notifications. > > https://django-badger.readthedocs.org/en/latest/api.html#module-badger. > signals > > That covers all the signals available. We're not doing nominations right > now, so I'll skip those. I'll add a receiver for the badge_was_awarded > signal that uses django-tidings to send an email. Fair enough - we might even want to think about purging the optional django-notifications requirement from django-badger proper, and make responding to signals be the recommended / documented way to go. Something like badges.mozilla.org can just take on using django-notification, or switch to a better approach
In my local instance, I created a badge in the admin and awarded it to myself. I can see the list of recently awarded badges in a view (that looks like shite) and can see the award details in a view (that also looks like shite). So I'm done items 1 and 8. I've got 6 working, but it looks like shite. Pretty sure I've got item 5 (notification by email) close to working. I've got a couple of issues: 1. I can create a Badge in the admin and award it to someone. I'm not sure offhand how to get to that award into the user's backpack, though. I plan to look at badg.us and badges.mozilla.org, but haven't had a chance to, yet. 2. Badge title and descriptions are in the database which means they'll be in English. We can extract them from the db and have them go through the regular routes, but I'll need to add some infrastructure to get the translated versions. Also, Badges aren't tied to a locale, so if we start creating locale-specific badges, that might get weird. Do we want to translate these?
(In reply to Will Kahn-Greene [:willkg] from comment #15) > 1. I can create a Badge in the admin and award it to someone. I'm not sure > offhand how to get to that award into the user's backpack, though. I plan to > look at badg.us and badges.mozilla.org, but haven't had a chance to, yet. So, the Backpack offers a JS-based API that uses iframes & window.postmessage: https://github.com/mozilla/openbadges/wiki/Issuer-API There's also a newer thing called Backpack Connect that I haven't explored yet: https://github.com/mozilla/openbadges/wiki/Backpack-Connect:-Issuer-Documentation Backpack Connect, I think, is meant to set up an OAuth-y dance that enables automatically pushing badges to the Backpack. Otherwise, the original "push" API requires a button click from the user for each awarded badge. > 2. Badge title and descriptions are in the database which means they'll be > in English. We can extract them from the db and have them go through the > regular routes, but I'll need to add some infrastructure to get the > translated versions. > > Also, Badges aren't tied to a locale, so if we start creating > locale-specific badges, that might get weird. > > Do we want to translate these? I don't have a great story here. I think we would like to have this stuff localized, but I dunno how best to do it. I was looking at some options for localizing dynamic content in Django in general, but didn't quite find anything I liked. We could add a locale field to badges, and just require that "localized badge" means separate badge per locale. We could also find some way to cluster localized strings under the same badge, which would be great for other reasons.
In a PR: https://github.com/mozilla/kitsune/pull/1592 I'm going to spin off bugs for everything else. Les: Thank you so much for your help!
IN PRODUCTION! YAY!
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.