incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Bug][GitHub] GraphQL API gets different data from REST API

Open gabrielenosso opened this issue 1 year ago • 5 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

What happened

I tried to use the data from a repository with GraphQL and I got completely different data. REST API works fine.

Maybe the difference is that REST API gets the default branch, while GraphQL gets the "master" or "main" branch.

What do you expect to happen

GraphQL to return the same data of REST API, using the default branch for a repo.

How to reproduce

Select GraphQL API for GitHub and collect data

Anything else

No response

Version

1.0.5 beta

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

gabrielenosso avatar Apr 26 '24 15:04 gabrielenosso

What kind of data were you collecting? commits? Could you provide more details? It is really hard to understand what was wrong with the current information. I don't know how to reproduce the problem and where to look 😂

klesh avatar Apr 28 '24 02:04 klesh

All data related to contributors is different.Yes I was getting commits.You can find the charts with different data in the Components metrics dashboard. Da: "Klesh Wong" @.*** A: "apache/incubator-devlake" @.*** Cc: "Gabriele Nosso" @.,"Author" @. Data: Sat, 27 Apr 2024 19:59:19 -0700 Oggetto: Re: [apache/incubator-devlake] [Bug][GitHub] GraphQL API gets different data from REST API (Issue #7396)

What kind of data were you collecting? commits? Could you provide more details? It is really hard to understand what was wrong with the current information. I don't know how to reproduce the problem and where to look 😂

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

gabrielenosso avatar Apr 28 '24 09:04 gabrielenosso

Hi @gabrielenosso , there are many (known or unknown) differences between the results of GitHub's GraphQL or REST APIs. Considering

  1. the cost to make them consistent, and the long-term maintenance cost (because the API results change)
  2. AND we encourage users to use GraphQL and might not support REST APIs in the future because it's 10x+ slower than GraphQL.

I prefer not changing the status quo here.

Startrekzky avatar Apr 28 '24 10:04 Startrekzky

I would also prefer to use GraphQL API.. point is the information I get in Grafana are not from the default branch of the repository... Da: "Louis.z" @.*** A: "apache/incubator-devlake" @.*** Cc: "Gabriele Nosso" @.,"Mention" @. Data: Sun, 28 Apr 2024 03:15:28 -0700 Oggetto: Re: [apache/incubator-devlake] [Bug][GitHub] GraphQL API gets different data from REST API (Issue #7396)

Hi @gabrielenosso , there are many (known or unknown) differences between the results of GitHub's GraphQL or REST APIs. Considering

the cost to make them consistent, and the long-term maintenance cost (because the API results change) AND we encourage users to use GraphQL and might not support REST APIs in the future because it's 10x+ slower than GraphQL.

I prefer not changing the status quo here.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

gabrielenosso avatar Apr 28 '24 10:04 gabrielenosso

Hi @gabrielenosso , we collect commits via the gitextractor plugin, not GitHub's REST APIs or GraphQL, so the difference between the commit data collected by the two APIs is not a problem.

Unless you were talking about the differences between pull requests collected by the two APIs?

Startrekzky avatar May 06 '24 11:05 Startrekzky

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Jul 06 '24 00:07 github-actions[bot]

This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.

github-actions[bot] avatar Jul 13 '24 00:07 github-actions[bot]