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

Problems with approach #3

Closed
jayvdb opened this issue Aug 13, 2018 · 11 comments
Closed

Problems with approach #3

jayvdb opened this issue Aug 13, 2018 · 11 comments
Assignees

Comments

@jayvdb
Copy link

jayvdb commented Aug 13, 2018

Using the created_commits undocumented API means it does not capture activity unless the user has met the criteria for the commits to appear on their profile.

https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/#commits

This can mean many commits are omitted.

e.g. I suspect that all commits in https://github.com/coala/gh-board will be omitted due to the top set of rules.

Also @wikimedia committers will have most of their commits omitted because they are done in gerrit and sync'd to GitHub, and they would need to star the relevant repos for those commtis to be included.

Some extra documentation in the README or elsewhere would be appropriate.

Perhaps this tool doesnt want to solve this problem, and that is ok.

@jayvdb
Copy link
Author

jayvdb commented Aug 13, 2018

Interesting ... coala/gh-board turned up in @li-boxuan 's data, so GitHub's rules are not so clear as they seem.
(Ah, that may have been doing to PRs and issues, not commits , ...)

@jayvdb
Copy link
Author

jayvdb commented Aug 13, 2018

Confirming @wikimedia problem...

Here is some merged commits by a GSoC student for this year

https://gerrit.wikimedia.org/r/#/q/author:%22Hagar+Shilo+%253Cstrayblues%2540gmail.com%253E%22+is:merged

which are these two sets of commits that are not appearing in the results

@li-boxuan has kindly provided me with the following GraphQL which can be used (e.g. with https://developer.github.com/v4/explorer/ ) to find the repos someone has contributed to

query($login: String!, $before: String){
  user(login:$login) {
    repositoriesContributedTo(last: 100, before: $before, includeUserRepositories: true) {
      pageInfo {
        startCursor
        hasPreviousPage
      }
      nodes {
        owner {
          login
        }
        name
      }
    }
  }
}

(graphql updated to include user's own repositories)

@lourot
Copy link
Member

lourot commented Aug 13, 2018

Wow, thanks a lot @jayvdb for the thorough analysis!

1. Criteria for contributions

Actually I'm fine with these criteria, especially:

1.1. we don't want to detect commits to forks, we want to detect real contributions (anyone can fork and commit, but the real challenge is to get your work accepted upstream). Although it's debatable and ghuser.io additionally queries forks through the official API to see if some forks happen to be successful (by having stars on their own).

1.2. you have to be either a collaborator or have made pull requests: this is fine as there is no other possible way to get your commits into a repo, right? Either you have push-rights or you make a pull request. The only edge case I see is if you were collaborator but you're not anymore. Well and there is of course the case you described in ghuser-io/ghuser.io#96, which we want to solve differently (commits won't be detected but declared and reviewed).

Some extra documentation in the README or elsewhere would be appropriate.

Indeed!

2. The @wikimedia case

I'll look into it :)

3. GraphQL's repositoriesContributedTo

Unfortunately the documentation says

repositoriesContributedTo (RepositoryConnection!)
A list of repositories that the user recently contributed to.

@lourot lourot self-assigned this Aug 13, 2018
@jayvdb
Copy link
Author

jayvdb commented Aug 13, 2018 via email

@jayvdb
Copy link
Author

jayvdb commented Aug 14, 2018

Ah, I see ghuser-io/ghuser.io#22 already sort of covers this for the end-user of ghuser .

@lourot
Copy link
Member

lourot commented Aug 14, 2018

I'm looking into the @wikimedia case. I think we're now on the same page:

Let's take the first commit of @strayblues's commits on gerrit: Create 2 OOUI tutorials and an index page. This was made yesterday and I can see that github is crediting it to @strayblues: https://github.com/wikimedia/oojs-ui/commits?author=strayblues

So the git author/committer isn't the problem here, but as we know this doesn't count as a contribution, so it doesn't show up on her profile: https://github.com/strayblues

And so github-contribs can't discover it. I wonder if it would magically pop up on her profile if she starred that repo now. @strayblues do you mind giving a star to https://github.com/wikimedia/oojs-ui ? Thanks a lot!

@jayvdb
Copy link
Author

jayvdb commented Aug 14, 2018

@AurelienLourot , it is not a @wikimedia specific case, and you do not need to ping people to ask them to help you see the problem, and I intentionally didnt ping her . I only used an example so you could see it, and didnt reject it. It was part of a training module I ran, with hundreds of participants. It is real. You can do some translations in @weblate to see it for yourself. You need to star or fork repos , per GitHub help pages.

@lourot
Copy link
Member

lourot commented Aug 14, 2018

You need to star or fork repos , per GitHub help pages.

yes but it would have been interesting to know if starring after a contribution makes that contribution appear on the profile, or if it was necessary to star before the contribution.

It's easier for strayblues to give a star than for me to search for some translation work to do. We're comparing one single click with hours of work here. I would have appreciated the help. Sorry if I bothered her with my mention. I understand, it won't happen again, I'll take it from here. Thanks for your time and help.

@jayvdb
Copy link
Author

jayvdb commented Aug 14, 2018

As mentioned, you can experiment yourself.

But in my experience , starring afterwards does make it appear. The docs also say that works.

What is less clear is what happens if someone unstars a repo that they have never interacted with except via commits which occurred via oauth or sync's via other means. Never tried that.

@lourot
Copy link
Member

lourot commented Aug 14, 2018

For the record she just starred it (thanks!) and the commit popped up at the author date (July 7th) on her profile, so for sure if she unstars the repo then the contrib will go away again.

The docs also say that works.

Do they? If you search for star in the corresponding page, there is only one match. I also couldn't find a sentence saying that if you do things afterwards (like starring), "old" contributions would appear on your profile.

@strayblues
Copy link

strayblues commented Aug 14, 2018 via email

lourot added a commit that referenced this issue Aug 14, 2018
@lourot lourot closed this as completed Aug 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants