Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

META: Create web app to better structure email interactions with github re: this issue tracker #94

Open
patcon opened this issue Sep 7, 2013 · 8 comments

Comments

@patcon
Copy link

patcon commented Sep 7, 2013

On reflection of @whit537's documentation and interaction process (specifically in #93):

To help others engage most effectively with this issue tracker, perhaps we could build an app that would automatically send emails to the appropriate github support email when an issue is opened, providing a reply-to header that will be used to update the issue itself (and forwarded to the submitting github user's email).

Obviously this could be very simple or a little more full-featured. Not sure if you guys think this is overkill, or whether it would help demonstrate that github users are serious in their desire for some open solution for feature and issue tracking.

Instead of diving into depth on what this could be, anyone else think there's merit in the premise?

cc: @balupton

@balupton
Copy link

balupton commented Sep 7, 2013

Seems good. I'd love to see a mailing list that syncs to a github repo issues.

@brock
Copy link

brock commented Sep 7, 2013

I like this idea, so I did some digging just to answer the questions of "what's possible". Here's what I found as one possible option:

The test uses the following mechanisms:

  • a webhook on this repo whenever a new issue is created
  • the webhook posts the payload to a Sinatra app
  • the sinatra app uses the pony gem to send the emails

The webhook could be setup for IssuesEvents or an IssueCommentEvent. I'd think an IssueEvent would suffice.

Here's how I setup the webhook:

POST to https://api.github.com/repos/brockangelo/passport-localapikey/hooks using my oath token:

{
  "name": "web",
  "active": true,
  "events": ["issues"],
  "config": {
    "url": "http://requestb.in/u6i2q7u6"
  }
}

Feel free to post an issue to my repo and view the requestbin payload if you like. Its not sending to Github support yet.

New issues created include these pertinent details in the payload: (pseudo-json)

payload: 
    action: opened
    issue.html_url: https://github.com/brockangelo/passport-localapikey/issues/2
    issue.title: test issue
    issue.body: test issue reporting
    sender.login: brockangelo
    sender.html_url: https://github.com/brockangelo 

You can see the full payload at requestb.in

Then I setup a webhook to post to a sinatra app. Here's the general idea for the app:

class ReportIssues
  post '/post' do
    # we'd set a hidden param so this only processes if an included key is sent

    # parse the payload
    issue = JSON.parse(params[:payload])
    sender = issue.sender.login  # brockangelo

    # email isn't included in the payload, so get it from the github api
    email = httparty.get(... using `sender` from above )

    # only send if the payload if from this repo's issues  
    if issue.html_url =~ /https:\/\/github.com\/brockangelo\/passport-localapikey\/issues\/\d+'
          // send email
          Pony.mail( :to => [email protected], :from => `sender`...)
    end
  end
end

Some notes:

I'd probably want another set of eyes on the sinatra app so we can prevent someone from posting payloads and spamming support and getting us (me) banned. But as a proof of concept, it could work.

@patcon
Copy link
Author

patcon commented Sep 8, 2013

Nice! That's awesome! (FYI, the requestbin is private to you browser, apparently: http://requestb.in/u6i2q7u6?inspect)

That sounds like a great flow and approach. Thoughts on handling support replies? Should the app have a simple mailbox so that support can reply to an address like [email protected] and have that automatically be posted to the appropriate issue?

I agree that IssueEvent should do the trick. Comment events would likely make it too tricky to avoid spamming them.

Regardless, curious how edited messages are handled, or whether any hook fires for an edit.

@brock
Copy link

brock commented Sep 8, 2013

thanks @patcon I updated my webhooks and added a new requestbin here: http://requestb.in/1im2zyj1 That should fire if you want to test another issue just to see the payload.

Ya, one possibility might be to send these messages from a new gmail address, then setup our sinatra app to also process gmail replies from [email protected] and post them to the relevant issue thread. Might take some trial and error, but could probably work.

@patcon
Copy link
Author

patcon commented Oct 13, 2013

FYI, seems the idea of a bridge was discussed 2 months prior in #6 (comment)

GitHub staff respectfully requested that no one build it. Not sure how I feel about that... :/

@patcon
Copy link
Author

patcon commented Apr 21, 2014

I might pick this up again. Lots of people are now sending emails to [email protected] when they open tickets here, but I think they usually don't link the ticket, so it's not obvious to those on support how important this repo is to the issue at hand

@patcon
Copy link
Author

patcon commented Apr 21, 2014

Oh, just reread my own prior message. Rats.

@stuartpb
Copy link

stuartpb commented Jan 8, 2015

Well, I've made a userscript that automatically suggests creating an issue on isaacs/github after you send an email to support via https://github.com/contact: https://github.com/ghes/isaacs-github-contact-xposter

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants