Skip to content
Discussions/Outreach/Tighter integration between Discuss and GitHub?Forum ↗

Tighter integration between Discuss and GitHub?

Outreach6 posts487 views1 likesLast activity May 2020
AN
anthonyOP
Apr 2020

Do we want tighter integration between the forum and GitHub? User Levels 1+ please vote here.

We have access to the features that this plugin provides, namely:

  • GitHub Linkback: If someone mentions a PR/Commit here then have a bot automatically make a comment including a link to the Discuss thread as a comment in the respective PR/Commit
  • GitHub Badges: Allows for automatic badges based on contributions to repos

Both of the above are able to be limited to specific orgs/repos.

  • Yes to both
  • Linkback only
  • Badges only
  • Neither

0 voters

AN
anthony
Apr 2020

Added GitHub integration, you’ll now see the user discuss-daml make comments in PRs and commits on GitHub if you reference them here.

Badges are also enabled so if you have enough commits to digital-asset/daml you should get badges but I’m not sure how it ties together users yet (maybe email) so we’ll see if it works :slight_smile:

EDIT: Looks like it does email and screenname matching so hopefully this works out well enough.

github.com

discourse/discourse-github/blob/07248f6442868c307aa3f7130d1d0ccc5ce73e0d/app/lib/github_badges.rb#L23

  1. class Granter
  2. def initialize(emails)
  3. @emails = emails
  4. @badges = []
  5. end
  6. def add_badge(badge, as_title:, threshold:)
  7. @badges << [badge, as_title, threshold]
  8. end
  9. def grant!
  10. email_commits = @emails.group_by { |e| e }.map { |k, l| [k, l.count] }.to_h
  11. regular_emails = []
  12. github_name_email = {}
  13. @emails.each do |email|
  14. match = email.match(/\A(\d+\+)?(?<name>.+)@users.noreply.github.com\Z/)
  15. if match
  16. name = match[:name]
  17. github_name_email[name] = email
DT
dtanabe
May 2020

Does this have any impact on some people not being able to include GitHub URLs at all? I’m trying to create a separate topic with some GitHub links and am getting an error: “Sorry you cannot post a link to that host.”

AN
anthony
May 2020

You got flagged by an anti-spam measure because you’re a new user posting too many links to github too fast. You should be all good to go now.

← Back to Discussions