GitHub integration for contributors

I thought the GitHub integration looked interesting

Our tight integration with GitHub automates contributor badges and linking between Discourse topics and GitHub issues.
(Free Hosting for Open Source v2)

it has two functions

Assign badges to your users based on GitHub contributions.

  • A small thing but I like the idea of recognising contributors. meta.discourse uses this (screenshot below)

Create a link from a Github pull request or commit back to a Discourse post where it is mentioned.

  • Seems helpful?

These both seem like low impact in that they do no generate additional mailing list messages.

the Discourse GitHub plugin:

https://meta.discourse.org/badges:

1 Like

Looks interesting. Does it require privileges on the github side?

requires configuration of a GitHub Access Token as follows;

GitHub Access Token

In order for the linkback feature to work and the badges to be granted to your users, you need to provide a Github access token. You can generate your token here: https://github.com/settings/tokens/new .

The linkback feature requires the public_repo scope, and granting badges requires no scope (leave everything unchecked if you only want badges). Since the public_repo scope grants write access to repositories, we recommend you create a throwaway Github account that has access to no repositories and use it just to generate a token.

-- https://meta.discourse.org/t/discourse-github/99895#github-access-token-9

Yes, that looks pretty low-risk. @samth any opinions?

I don't have any opinions here.

I believe I've enabled this, though I don't actually see any evidence of it working yet WRT badges. Let's try linkback:

Wow, what an awesome issue. It's my favorite.

1 Like

Yes, okay, that worked. Yay! Still haven't seen any evidence of the badges.

1 Like

Doesn’t look like the badges are enabled on
https://racket.discourse.group/badges

Was expecting a development section like

https://meta.discourse.org/badges

Looks like it may be working now?

1 Like

Looks awesome :tada:

There are quite a lot of contributors!

1 Like

What about racket/math, racket/draw, racket/gui etc.?

How does the plugin find the connection between the Discourse and the Github user?

For the badges

Add one or more URLs of the GitHub repos to scan for contributions to the github badges repos site setting.

For the link backs

Finally, add the projects you wish to post to in the github linkback projects site setting in the formats:
.username/repository for specific repositories
. username/* for all repositories of a certain user

It’s documented at https://meta.discourse.org/t/discourse-github/99895

1 Like

@spdegabrielle

Instructions unclear :slight_smile:

Is the user, the Discourse maintainer or the Github repo owner that needs to do something?

It’s a discourse admin setting from what I can tell from the docs.

There also seemed to be some lag so I’m guessing it is something like a nightly cron job, so maybe give it a chance to catch up.

Details: I think there are two fairly separate pieces of functionality here. I think the linkback one is the simpler one, and perhaps you've already observed it. If you mention a github issue in a discussion on discourse, like this:

Then the discourse bot adds a public comment to that issue that links back to this discussion. This should currently be enabled for all of the racket/* repos at github.

The 'badge' piece seems to be almost entirely separate; I believe the github plugin is actually a rewritten combination of two older plugins. For this plugin it appears that we have to add each repo of interest one at a time, no wildcards. (And at this point, I've only added the one repo, racket/racket.) However, you ask a really good question about badge linkage; I have to assume that it's done by email address; that is, the email address associated with the commit has to be the same one associated with the discourse account. I realize that many people (such as myself!) use many different email addresses, and my guess is that in this case, the badges won't work.

I think linkbacks could wind up being useful. The badges... well, we'll see.

John

1 Like

Added a bunch more repos for badge consideration, in order of most-recently-updated. There's no really fair way to do this that doesn't involve adding dozens and dozens of repos.

1 Like