Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to GitHub GraphQL API #73

Open
freak4pc opened this issue Mar 8, 2018 · 2 comments
Open

Migrate to GitHub GraphQL API #73

freak4pc opened this issue Mar 8, 2018 · 2 comments

Comments

@freak4pc
Copy link
Member

freak4pc commented Mar 8, 2018

The motivation for this is an issue (that GitHub claims as a feature) in their regular API.

You might or might not have noticed but the "last updated" date (By which the repos are sorted) isn't actually the date of the last pushed commit on master (or to the repo). This is very confusing since the field we're reading is actually pushed_at. When chatting with GitHub this was the response I got:

When a pull request is created, a hidden ref is created in the base repository to track that pull request. That hidden ref is automatically updated as the branch from which the pull request was created is updated.

Every one of these automatic update triggers a push. So any update to pull requests from forks will also update the pushed_at value for the base repository due to these hidden refs.

You can see these hidden refs mentioned here:

https://help.github.com/articles/checking-out-pull-requests-locally/#modifying-an-inactive-pull-request-locally

As it relates to your repository, it's likely that another user pushed commits to fork of that repository which subsequently updates the pushed_at value for this repository.

I agree that's confusing if you're trying to figure out how the pushed_at works. We have an internal issue open to see what the team thinks about this and if we'd consider changing this so that only pushes to user-defined branches and tags are counted towards the updated_at. I can't make any promises about this, but we'll followup with you when there's any news (I don't expect any news in the near future since changes like these are not that simple to make).

Besides, there are few more piece of information we would probably want to get for the community website later on.

Meaning, pushed_at isn't specific to only the repos, but also to its forks, which make the date unreliable.

Later, through this discussion, GH suggested we'd examine their GraphQL to pull the repo information with the top commit. I'll want to look into this later on but still not sure when.

Also, If the GraphQL API will still force us in doing two queries (one for the repo and one for the latest commit), it doesn't provide that much added value and we can keep using the regular API in this case .

@ashfurrow
Copy link
Member

That's so strange, I didn't realize that 😞

@ashfurrow
Copy link
Member

But GraphQL is amazing though, have fun!

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

No branches or pull requests

2 participants