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

[Bug][GitHub] Only the first 250 commits of a pull request are retrieved

Open danieljuhasz93 opened this issue 1 year ago • 4 comments

Search before asking

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

What happened

Context: We use the GitFlow branching strategy in our team. This means that we only merge the changes to the main branch when we are ready for a (internal) release. Because of this pull requests from the develop to the main branch can include several commits.

Issue: We encountered an issue with the calculation of the Lead Time for Changes DORA metric. If a pull request has more than 250 commits, then only the first 250 commits are retrieved, and the oldest retrieved commit is treated as the first commit of the pull request. This leads to the incorrect calculation of the PR coding time and PR change lead time.

What do you expect to happen

I would expect that all of the commits in a PR are retrieved instead of only the first 250 commits.

How to reproduce

Prerequisites: a merged PR with more than 250 commits should exist in the repository.

  1. Collect data from the beforementioned repository with the DORA option enabled
  2. Inspect the Lead Time for Changes values on the built-in DORA dashboard.

Anything else

The issue occurs every time, if we have a PR with more than 250 commits.

Version

v0.18.0

Are you willing to submit PR?

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

Code of Conduct

danieljuhasz93 avatar Dec 15 '23 12:12 danieljuhasz93

Thanks for reporting the problem, this is indeed a bug.

klesh avatar Dec 20 '23 09:12 klesh

@danieljuhasz93 I'm sorry, this is a limitation imposed by GitHub itself, and unfortunately, we can't resolve it. Although you can retrieve all commit data through another interface using 'list commits,' there is still no direct way to obtain all commits through a pull request."

Additionally, this is an issue that someone else has raised with GitHub, and it is still in an open status.

abeizn avatar Dec 21 '23 07:12 abeizn

Is this limitation still imposed by GitHub if pagination is used?

danieljuhasz93 avatar Jan 13 '24 11:01 danieljuhasz93

@danieljuhasz93 Unfortunately, pagination have been supported since long long time ago https://github.com/apache/incubator-devlake/blob/main/backend/plugins/github/tasks/pr_commit_collector.go#L108 . 😂

klesh avatar Jan 15 '24 01:01 klesh

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 Mar 16 '24 00:03 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 Mar 23 '24 00:03 github-actions[bot]