How are Contributor and Great Contributor badges assigned?

(cpradio) #1

So I have quite a few accepted PRs, but I’m not seeing how these are being assigned.

I did verify that my email address here matches the one I use on GitHub.

I’m wondering if I need to re-login using GitHub here on Meta to refresh some data. As I did recently alter one of my GitHub email addresses.

(Gerhard Schlager) #2

Did you use your current Discourse email address for all your commits? It doesn’t matter which email you use for authentication on Github. The only thing that matters is the email address that you include in your commits. When you commit as "Foo Bar <>" then you need to use "" here on meta too.

You won’t get the badge as long as your email addresses do not match. But I guess someone from the team could grant to the badge manually. :slight_smile:

Take a look at the plugin source in order to see what’s happening. I highlighted the important parts:

BTW: Didn’t you ask the same a long time ago? :wink:

(cpradio) #3

Seems I did, but obviously it worked and now it is gone again…oh well, probably show how the same issue.

(Gerhard Schlager) #4

Yeah, all the badges were lost about two weeks ago and had to be granted again…

(cpradio) #5

No, it definitely isn’t that… As I see many others with the badges, but it must something with the way the prior commits are. So there is likely nothing I can do about it now.

(Gerhard Schlager) #6

Well, they can certainly award it manually. :wink:

But the plugin will need an update anyway since some of the pull requests are not recognized anymore. The “Merge pull request” commits are missing… Maybe it’s time to use the Github API. :slight_smile:

Oh, and this simple script lists the number of pull requests and the corresponding email addresses the same way as the plugin does:

emails = []
path = '/path/to/discourse/repo'

`cd #{path} && git log --merges --pretty=format:%p --grep='Merge pull request'`.each_line do |m|
  emails << (`cd #{path} && git log -1 --format=%ce #{m.split(' ')[1].strip}`.strip)

email_commits = emails.group_by { |e| e }
                  .map { |k, l| [k, l.count] }
                  .sort { |a,b| a[1] <=> b[1] }

email_commits.each do |email, commits|
  print "#{commits}\t#{email}\n"

(cpradio) #7

lol, that is exactly what I was “recreating” locally right now. Fairly certain there isn’t much I can do. As the email address I started with (over a year ago), I won’t be re-enabling.

Edit: Just confirmed that is what it is… oh well.

(Michael Downey) #8

If anyone wants to improve this plugin, see also: