Code forge profile fields, and subsequent Github plugin improvement

Note: This is just an idea I want to leave behind for y’all to muse on, and not an ‘official’ feature request of mine :hugs:

Discourse has the great official Discourse GitHub plugin. Based on Settings you can reward forum members for their PR contributions. But it may not always be possible to assign them, because the members cannot be associated to the Github account:

If I understand correctly if your Github commit email and/or username does not match to a forum account, there may be no match, and no badge.

In our Humane Tech Community we’ve long had no Github-based logins enabled (I added this very recently), but we have a Github organization where we collaborate on repositories. Hence as an informative measure we always had a ‘Github Account’ custom profile field, for members to fill in.

The additional feature in Discourse proposed here consists of two parts:

  1. Support for an official ‘Code Forge’ profile field, enabled in a admin settings.
  2. If enabled, check (verified?) ‘Code Forge’ field first when doing badge assignment.

Note: The Code Forge terminology is taken from ForgeFed, the ActivityPub protocol extension aiming for federated forge integration to any repository regardless of location and software used (github, gitlab, gitea, sourcehut, etc.).

Verified Code Forge profile field

Intro: For me, and many people I work with (I might extend to the free software movement in general, I think), using Github for OSS development is no longer a given. Github is not the logical first-choice go-to place to host code repo’s anymore. For instance I use Codeberg most often, and have accounts on Gitlab, various self-hosted gitlab / gitea instances, etc. Feneas, where I’m moderator, uses Gitlab only. I would like to be able to express these different choices of code forge within Discourse, and to the community members.

Feature: In admin settings I can configure the code forges that are related to my community, and enable them as profile fields. I can also specify that I want the field to be verified and/or that it is required (a further extension to this feature, can be omitted). When a member fills in the field it serves its informative purpose to other members. Optionally (when enabled) the verification takes place, i.e. the person is redirected to the configured code forge (probably using an OAuth flow, similar to GH login, so admin settings for that must be present; the ‘login with GH’ or other forge need not be enabled), confirms, and is taken back to Discourse. The profile field now shows a nice verification checkmark. It can be similar UI-wise to what you have on Mastodon (though the verification method with rel-"me" is very different), where you can add up to 4 custom profile fields:


Relation to the Discourse Github plugin

If the profile field is present, and especially if is required and/or verified, then I imagine it can be used as the first location to check for Code Forge badge assignment. The badge assignments are based on all the code forges that have been configured and not limited to just github.

Edit: I’ve taken Badge assignment as an example for Github plugin improvement. But the plugin itself could become the official Code Forge plugin, in support of all the configured forges.