Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 469140

Summary: [webhook] Prioritize Github user name instead of email
Product: Community Reporter: Denis Roy <denis.roy>
Component: GitHubAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: joakim.erdfelt
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://github.com/eclipse/eclipse-webhook/pull/19
Whiteboard:

Description Denis Roy CLA 2015-06-02 09:33:42 EDT
When checking a PR for committers, we look at email addresses.  Some committers have different a different email address on GH, but their GH username is tied to their Eclipse account.

Let's use the username instead to avoid false validation.
Comment 1 Denis Roy CLA 2015-06-02 09:34:29 EDT
https://github.com/eclipse/xtext/pull/264 is an example of two committers who effectively fail the validation.
Comment 2 Denis Roy CLA 2015-06-04 10:36:34 EDT
The Commits of a pull request look like this:

[
  {
    "sha": "4a9319c677015ddb5f2c60af2f9300e84623d22c",
    "commit": {
      "author": {
        "name": "Sebastian Zarnekow",
        "email": "(email)"
      },
      "committer": {
        "name": "Sebastian Zarnekow",
        "email": "(email)"
      },
    "message": "[466330] Provide straight f...\n\nSigned-off-by: szarnekow <Some.Email@email.com>
    "author": {
      "login": "szarnekow",
      "id": 375492,
    },
    "committer": {
      "login": "szarnekow",
      "id": 375492,
    },
  }
]


So the "commit" section contains the pure-git info on the committer and author, as well as the commit message. The author and committer potion contain GitHub-specific info.

I will enhance the isCommitterOfRepo() check to accept an email address or a GitHub login name.
Comment 3 Eclipse Genie CLA 2015-06-04 10:46:06 EDT
GitHub Pull Request 19 created by [eclipsewebmaster]
https://github.com/eclipse/eclipse-webhook/pull/19
Comment 4 Eclipse Genie CLA 2015-06-04 10:59:31 EDT
GitHub Pull Request 19 created by [eclipsewebmaster]
https://github.com/eclipse/eclipse-webhook/pull/19
Comment 5 Eclipse Genie CLA 2015-06-04 10:59:52 EDT
GitHub Pull Request 19 created by [eclipsewebmaster]
https://github.com/eclipse/eclipse-webhook/pull/19
Comment 6 Denis Roy CLA 2015-06-04 11:02:32 EDT
> I will enhance the isCommitterOfRepo() check to accept an email address or a
> GitHub login name.

I decided against that.

I've merged this in.
Comment 7 Joakim Erdfelt CLA 2015-10-01 13:26:11 EDT
Something isn't working with this fix.

Example: https://github.com/eclipse/jetty.project/pull/54

The user used their @gmail.com address in the PR, but the webhook is somehow getting a different email address for this github user.

The users @gmail address is valid, per CLA lookup tool at
https://projects.eclipse.org/user/cla/validate
Comment 8 Denis Roy CLA 2015-10-01 15:24:36 EDT
(In reply to Joakim Erdfelt from comment #7)
> Something isn't working with this fix.
> 
> Example: https://github.com/eclipse/jetty.project/pull/54
> 
> The user used their @gmail.com address in the PR, but the webhook is somehow
> getting a different email address for this github user.

This bug is about looking up the GitHUB ID (jentfoo in this case). I can't find any Eclipse account that has a GitHUB ID of jentfoo.

So we're extracting the email address from the GitHub account, which does not match their Eclipse account.

Anyone can write anything in the Commit message, whereas the GitHub credentials have at least been verified.

In this case, they can log into https://dev.eclipse.org/site_login/ and configure their account to link to their GitHUB ID. There would then be no confusion.