gitea
                                
                                
                                
                                    gitea copied to clipboard
                            
                            
                            
                        Add badge capabilities to users
Similar to how github profiles have badges/acheivements, this adds the capabilities to Gitea to be able to utilize that in the future
I don't get it, whats the use case for this?
I don't get it, whats the use case for this?
@noerw for community instances, where they may wish to "award" some badge for certain situations.
I don't get it, whats the use case for this?
@noerw for community instances, where they may wish to "award" some badge for certain situations.
Sorry to be that guy, but this feels very feature-creepy to me. Gamification as a network effect multiplier kinda makes sense for a platform like GitHub, but should this really be a Gitea feature? (yes I'm biased; i don't like gamification).
Currently this PR is rather slim LoC-wise, but until it's a working feature (configure badges via UI or config file, updating badges via cron task or adding hooks into every other route), I'd estimate some extra 500LoC, lower bound.
Badges can be useful also in private instances to motivate developers etc I don't think we need UI in gitea to manage that, only API. Service to manage badges and add for users can be developed outside of Gitea core.
Badges can be useful also in private instances to motivate developers etc
Developers do meaningful work when they are intrinsically motivated, not by some made up metric or status icon. But what do I know.
I don't think we need UI in gitea to manage that, only API. Service to manage badges and add for users can be developed outside of Gitea core.
Doing hundreds of API calls to check if a badge should be applied seems more than wasteful to me.
I'll shut up, seems like I'm in the minority here
It's probably not the best way to reward developers, but I see no problem in at least supporting it on a invisible api- or even database-only level.
Codecov Report
:exclamation: No coverage uploaded for pull request base (
main@82f89ff). Click here to learn what that means. The diff coverage is80.00%.
:exclamation: Current head 0145a5e differs from pull request most recent head bf0763a. Consider uploading reports for the commit bf0763a to get more accurate results
@@           Coverage Diff           @@
##             main   #20607   +/-   ##
=======================================
  Coverage        ?   47.07%           
=======================================
  Files           ?      989           
  Lines           ?   136380           
  Branches        ?        0           
=======================================
  Hits            ?    64202           
  Misses          ?    64302           
  Partials        ?     7876           
| Impacted Files | Coverage Δ | |
|---|---|---|
| routers/web/user/profile.go | 46.74% <42.85%> (ø) | 
|
| models/user.go | 32.84% <100.00%> (ø) | 
|
| models/user/badge.go | 100.00% <100.00%> (ø) | 
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Could you put a screenshot?
Could you put a screenshot?
updated with a screenshot
Would be nice to have followup PR to add API that would be accessible only for admin to define badges and add user badges
Is this released? I haven't found it on the release notes
@bauermarkus yup, it's in 1.18, however it's just the absolute base code needed to present badges stored in the DB to show on user's profiles. I have a followup PR where you can manage badges with the API.