gitea icon indicating copy to clipboard operation
gitea copied to clipboard

Add badge capabilities to users

Open techknowlogick opened this issue 3 years ago • 6 comments

Similar to how github profiles have badges/acheivements, this adds the capabilities to Gitea to be able to utilize that in the future

techknowlogick avatar Aug 02 '22 01:08 techknowlogick

I don't get it, whats the use case for this?

noerw avatar Aug 02 '22 21:08 noerw

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.

techknowlogick avatar Aug 03 '22 16:08 techknowlogick

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.

noerw avatar Aug 04 '22 10:08 noerw

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.

lafriks avatar Aug 04 '22 11:08 lafriks

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

noerw avatar Aug 04 '22 12:08 noerw

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.

silverwind avatar Aug 04 '22 13:08 silverwind

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@82f89ff). Click here to learn what that means. The diff coverage is 80.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.

codecov-commenter avatar Aug 16 '22 18:08 codecov-commenter

Could you put a screenshot?

lunny avatar Aug 17 '22 01:08 lunny

Could you put a screenshot?

updated with a screenshot

techknowlogick avatar Aug 17 '22 18:08 techknowlogick

Would be nice to have followup PR to add API that would be accessible only for admin to define badges and add user badges

lafriks avatar Aug 17 '22 23:08 lafriks

Is this released? I haven't found it on the release notes

bauermarkus avatar Mar 03 '23 04:03 bauermarkus

@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.

techknowlogick avatar Mar 03 '23 05:03 techknowlogick