Skip to content
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

Fix bug in getting merged pull request by commit #32079

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Zettat123
Copy link
Contributor

Fix #32027


This is actually a bug. But I'm worried that some users are already using this API to get unmerged PRs, and fixing it might be a breaking change.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 19, 2024
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 19, 2024
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Sep 19, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 19, 2024
@lunny lunny added type/bug backport/v1.22 This PR should be backported to Gitea 1.22 labels Sep 19, 2024
@lunny
Copy link
Member

lunny commented Sep 19, 2024

Maybe we can say it's just a documentation problem. The implementation hasn't been changed. So I marked it as backportable.

@@ -325,11 +325,11 @@ func DownloadCommitDiffOrPatch(ctx *context.APIContext) {
}
}

// GetCommitPullRequest returns the pull request of the commit
// GetCommitPullRequest returns the merged pull request of the commit
func GetCommitPullRequest(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/commits/{sha}/pull repository repoGetCommitPullRequest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// swagger:operation GET /repos/{owner}/{repo}/commits/{sha}/pull repository repoGetCommitPullRequest
// swagger:operation GET /repos/{owner}/{repo}/commits/{ref}/pull repository repoGetCommitPullRequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API shows unexpected PR for a commit
3 participants