# Code forge profile fields, and subsequent Github plugin improvement

**URL:** https://meta.discourse.org/t/code-forge-profile-fields-and-subsequent-github-plugin-improvement/169576
**Category:** Feature
**Created:** [November 9, 2020, 6:20am UTC](https://meta.discourse.org/t/code-forge-profile-fields-and-subsequent-github-plugin-improvement/169576 "2020-11-09T06:20:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![aschrijver](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aschrijver/32/92004_2.png) [@aschrijver](https://meta.discourse.org/u/aschrijver)
#### Post date: [November 9, 2020, 6:20am UTC](https://meta.discourse.org/t/code-forge-profile-fields-and-subsequent-github-plugin-improvement/169576/1 "2020-11-09T06:20:10Z")

</div>

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 🤗

Discourse has the great official [Discourse GitHub](https://meta.discourse.org/t/discourse-github/99895) 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:

> [@Github Badges are not working. Its hard to see if I do something wrong or if the plugin is not working](https://meta.discourse.org/t/github-badges-are-not-working-its-hard-to-see-if-i-do-something-wrong-or-if-the-plugin-is-not-working/148036/4):
>
> 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.

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](https://community.humanetech.com) 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](https://forgefed.peers.community/), 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](https://codeberg.org) most often, and have accounts on Gitlab, various self-hosted gitlab / gitea instances, etc. [Feneas](https://talk.feneas.org), 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:

 ![mastodon-humanetech-profile-snapshot](https://global.discourse-cdn.com/meta/original/3X/c/a/ca20b5c75861177810eab257500c33a256712e1b.png)

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