-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Get commits of a pull request #10918 #12118
Get commits of a pull request #10918 #12118
Conversation
routers/api/v1/repo/pull.go
Outdated
ctx.InternalServerError(err) | ||
return | ||
} | ||
if err := pr.LoadHeadRepo(); err != nil { |
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.
In fact, head repository may missed, but we should still allow to get the pull request commits.
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.
You're correct, and in fact headRepo isn't used from what I can see. Removing that section.
apiCommits := make([]*api.Commit, commits.Len()) | ||
|
||
i := 0 | ||
for commitPointer := commits.Front(); commitPointer != nil; commitPointer = commitPointer.Next() { |
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.
How did you do the pagination?
|
api_issue_test.go:156: Error: should have 9 item(s), but has 10 |
Why not use existing test repos? |
assert.NoError(t, pullIssue.LoadIssue()) | ||
repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: pullIssue.HeadRepoID}).(*models.Repository) | ||
|
||
// test ListPullReviews |
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.
?
@AndrewBezold I think you should just use the existing testdata |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
This pull request has been automatically closed because of inactivity. You can re-open it if needed. |
Add an API endpoint to get commits of a pull request, similar to Github's.
Proposed endpoint is
GET /repos/{owner}/{repo}/pulls/{index}/commits
Fix #10918