Github Badges are not working. Its hard to see if I do something wrong or if the plugin is not working

It seems there is no way to add issues to:

Somehow the Badges do not seem to work. Is there something I do wrong?
Do you need the actual repo clone URL or the project URL?
Can you add an example for possible URLs to the readme?
Can I just add an organization and all public repos are considered for the badges?
Is there any visual feedback that could tell me if I do something wrong or right?

3 Likes

Also can you explain exactly how you find the user association with the Github commits?
Does this work via email matching or name matching? What should I tell my community to do to earn Github Badges? Do they have to login via Github?

Sorry for the delay in answering your question. I am testing the plugin now by configuring it following this guide: https://meta.discourse.org/t/discourse-github/99895.

One difference between the guide and the plugin’s README is that the guide says that a GitHub access token needs to be generated for badges to be granted. That access token needs to be added to your site’s github linkback access token setting before badges will be granted.

To create an access token, go to Sign in to GitHub · GitHub. If you are only using the token for granting badges, you should not need to select any scopes. Just scroll to the bottom of the page and click the Generate Token button.

The other thing that needs to be set for badges is the github badges repo site setting. Enter the full URL of each of your Github repositories that you would like badges to be granted for. The URL that you see in your browser’s address bar will work for this.

The plugin creates 6 badges:

  • Contributor
  • Great contributor
  • Amazing contributor
  • Committer
  • Frequent committer
  • Amazing committer

The first three badges in the list are enabled when they are created by the plugin. The last three badges in the list need to be manually enabled from your Admin / Badges page.

The number of commits required for the Frequent committer and Amazing committer badges can be set with the github silver badge min commits and github gold badge min commits site settings.

One last thing to note about the badges is that they are granted through a background job that is run every 4 hours. This means that you can expect up to a 4 hour delay from the time the user was active on Github and the time they are granted the badge.

Users are found based on the email address of the Github commit. For most cases, this will be the user’s email address. For users who have configured git to use the Github no-reply email address (<username>@users.noreply.github.com), the plugin attempts to find the user based on the username part of that email address. It does this by searching the Discourse GithubUserInfo table for a username match. Users will only be found in this way if they have previously logged into Discourse via Github.

I am also looking at the plugin’s linkback functionality. I will update the plugin’s README and the plugin’s guide on Meta very soon.

If you are configuring the plugin on a site that we host, you can get private support for this by sending an email to the support address that is given on your site’s admin dashboard.

3 Likes

Thank you very much for this detailed explanation. That really helped a lot.

I have one suggestion for a plugin addition thats probably not to difficult to implement.
As an Admin, I am aware of key engineers that my team interacts on GitHub and in the forum. So we do know both identities. Do you think it would be possible for us to associate a discourse user manually with a github account via the plugin settings? This way you would enable this plugin even when it can not find the user automatically.

1 Like