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 PR creation via api between branches of same repo with head field namespaced (#26986) #29857

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

GiteaBot
Copy link
Contributor

Backport #26986 by @norohind

Fix #20175

Current implementation of API does not allow creating pull requests between branches of the same
repo when you specify namespace (owner of the repo) in head field in http request body.


Although GitHub implementation of API allows performing such action and since Gitea targeting
compatibility with GitHub API I see it as an appropriate change.

I'm proposing a fix to the described problem and test case which covers this logic.

My use-case just in case: #20175 (comment)

… namespaced (go-gitea#26986)

Fix go-gitea#20175

Current implementation of API does not allow creating pull requests
between branches of the same
repo when you specify *namespace* (owner of the repo) in `head` field in
http request body.

--- 

Although GitHub implementation of API allows performing such action and
since Gitea targeting
compatibility with GitHub API I see it as an appropriate change.

I'm proposing a fix to the described problem and test case which covers
this logic.

My use-case just in case:
go-gitea#20175 (comment)
@GiteaBot GiteaBot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code type/bug lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 17, 2024
@GiteaBot GiteaBot added this to the 1.21.9 milestone Mar 17, 2024
@GiteaBot GiteaBot requested review from lunny and wolfogre March 17, 2024 03:56
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 17, 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 Mar 17, 2024
Copy link
Member

@denyskon denyskon left a comment

Choose a reason for hiding this comment

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

Test failure seems related.... maybe an outdated dependency version?

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 17, 2024
@norohind
Copy link
Contributor

I think it's because in 1.21 (where my PR is being backported, as far as I understand) there is no support .AddAuthToken method for the request. And the auth token is required to be send as url parameter. Basically, you should revert this commit from my initial PR 4daa422 and it should work.

@lunny lunny removed the lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged label Mar 18, 2024
@lunny lunny requested a review from denyskon March 19, 2024 03:38
@GiteaBot GiteaBot added the lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged label Mar 19, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels Mar 19, 2024
@denyskon denyskon added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 19, 2024
@lunny lunny merged commit 408c929 into go-gitea:release/v1.21 Mar 20, 2024
27 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 20, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. 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.

4 participants