-
Notifications
You must be signed in to change notification settings - Fork 5k
api: add GET /api/v1/{owner}/{repo}/commits
endpoint
#6574
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
Conversation
Hi @unknwon, Is there any way I can get a review/approval for this PR? Best, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Left few comments.
Thank you for the review! The comments should be addressed 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the followup!
GET /api/v1/{owner}/{repo}/commits
endpoint
Codecov Report
@@ Coverage Diff @@
## main #6574 +/- ##
=====================================
Coverage 8.82% 8.82%
=====================================
Files 96 96
Lines 13194 13194
=====================================
Hits 1165 1165
Misses 11867 11867
Partials 162 162 |
The lint is failing for things that are not related to this PR, I will merge and fix it in another commit. |
This pull request targets issue #6573.
It provides a new API endpoint:
/api/v1/repos/{org}/{repo}/commits?pageSize=<int>
with a default page size of 30 commits (the same as the UI).This implementation currently only focuses on the main/master branch of the repository, and does not provide the ability to return commit history for other branches.
GetAllCommits
andGetSingleCommit
, I decided to pull the code out into a helper function,gitCommitToAPICommit(commit, context)
.