incubator-devlake
incubator-devlake copied to clipboard
[Bug][GitHub] Only the first 250 commits of a pull request are retrieved
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.
- Collect data from the beforementioned repository with the DORA option enabled
- 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
- [X] I agree to follow this project's Code of Conduct
Thanks for reporting the problem, this is indeed a bug.
@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.
Is this limitation still imposed by GitHub if pagination is used?
@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 . 😂
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.
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.