fix: ensure moving all commits in a pull request for pagure migration (#12433)

While the changes were conveyed in the pull request in its entirety, the commit
history of a pull request having more than one commit was bugged and the log
would have shown just the presence of the most recent commit event, having the
entire changes contained in a pull request.

This is a problem that was mostly noticed in the closed pull request, so it is
not as bad as it looks. Even then, if we are migrating closed pull requests, we
should do it the right way. We do not want to retain these pull requests for
archival purposes if they are not accurate.

Signed-off-by: Akashdeep Dhar <akashdeep.dhar@gmail.com>

Fixes https://forge.fedoraproject.org/forge/forge/issues/556

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12433
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
Akashdeep Dhar 2026-05-08 04:43:33 +02:00 committed by Gusted
parent 115f8594cf
commit ffd10d37a6

View file

@ -153,6 +153,7 @@ type PagurePRResponse struct {
Requests []struct { Requests []struct {
Branch string `json:"branch"` Branch string `json:"branch"`
BranchFrom string `json:"branch_from"` BranchFrom string `json:"branch_from"`
CommitStart string `json:"commit_start"`
CommitStop string `json:"commit_stop"` CommitStop string `json:"commit_stop"`
DateCreated string `json:"date_created"` DateCreated string `json:"date_created"`
FullURL string `json:"full_url"` FullURL string `json:"full_url"`
@ -560,7 +561,7 @@ func (d *PagureDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque
} }
mergedtime := processDate(&pr.ClosedAt) mergedtime := processDate(&pr.ClosedAt)
err = d.callAPI("/api/0/"+d.repoName+"/c/"+pr.CommitStop+"/info", nil, &commit) err = d.callAPI("/api/0/"+d.repoName+"/c/"+pr.CommitStart+"/info", nil, &commit)
if err != nil { if err != nil {
return nil, false, err return nil, false, err
} }