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

Unable to Create Pull Request in Forked Repo #26193

Closed
SoulSeekkor opened this issue Jul 27, 2023 · 12 comments · Fixed by #26785
Closed

Unable to Create Pull Request in Forked Repo #26193

SoulSeekkor opened this issue Jul 27, 2023 · 12 comments · Fixed by #26785
Labels

Comments

@SoulSeekkor
Copy link

Description

Unable to test this on the demo site since you can't create orgs on it.

I have an organization on my Gitea (Bitwarden) which as the server repo which is a mirror of the repo on GitHub. I have forked that repo to my user and that's where I create modified branches and things to test with. Before I go to create a new modified branch I create a new pull request to pull changes in from the mirror to my fork... With 1.20.1 this is broken and only lets me pull changes from the repo into itself (and doesn't let me choose the source repo that the repo was forked from).

Gitea Version

1.20.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Broken Pull Request

Git Version

2.40.1

Operating System

Ubuntu 18.04.6 LTS

How are you running Gitea?

Binary download from release ran as a service with systemd.

Database

MySQL

@CaiCandong
Copy link
Member

Can you give me detailed steps to reproduce this bug?

@SoulSeekkor
Copy link
Author

Sure! So on my instance I have the following repo mirrored:
https://github.com/bitwarden/server

Then fork that repo to your personal user as the owner. Try to create a new Pull Request on your forked repo and (for me at least) the pull into and pull from will both be only your personal forked repo with no ability to change the pull from to be that mirrored repo (which I've been able to do in the past and is a necessary action).

@CaiCandong
Copy link
Member

I don't quite understand what you mean, I tried following your tips and my tests resulted in being able to create PRs.
image

image

@SoulSeekkor
Copy link
Author

Okay, so now fork that mirror you created. On that fork try to create a PR to pull in changes from the local mirror, the only option you should see on the pull from dropdown is the fork itself making the PR unusable.

@CaiCandong
Copy link
Member

I'm sorry I still can't reproduce the problem you're talking about, are you able to provide a video showing the problem you're talking about?

@SoulSeekkor
Copy link
Author

SoulSeekkor commented Aug 1, 2023

I can see about a video potentially, never had to make one so I will have to get something to do that. But in the meantime here's a step-by-step that hopefully allows you to reproduce the problem:

  1. Create a new org called 'Test' (name doesn't matter, take defaults).
  2. Create a new migration from GitHub of the following repo (https://github.com/MysticRyuujin/guac-install.git) with the new org you created in step 1 as the owner, take defaults but mark it as a mirror.
  3. After the migration is complete, fork this repo with your user as the owner, take defaults.
  4. Create a PR on this forked repo, note that the merge into and pull from are the same, making it useless. Typing in 'main' for the branch to attempt to display the main branch from the source mirror repo (have had to do this on older Gitea) yields nothing but the current forked repo still.

Screenshot 2023-08-01 135153

@Jaffex
Copy link

Jaffex commented Aug 2, 2023

Possible duplicate of #24585

@yp05327
Copy link
Contributor

yp05327 commented Aug 3, 2023

It seems that you want to create a pr to a mirror repo?
If you access the mirror repo, you can see that there's no PR unit. So of cause you can not select the main branch of this mirror repo.
image

Wait. In this mirror repo's setting, PR unit is enabled. Can we create PRs in a mirror repo?
image

@Jaffex
Copy link

Jaffex commented Aug 3, 2023

I think the issue here is that we're unable to create a pull request from the mirror repo, less so to the mirror repo.

@SoulSeekkor
Copy link
Author

I think the issue here is that we're unable to create a pull request from the mirror repo, less so to the mirror repo.

This! We used to be able to, according to the linked issue above it appears this broke in a dot fix for 1.19 (I haven't done it for a while).

@catfromplan9
Copy link

it broke when i updated to latest gitea, please fix

lafriks pushed a commit that referenced this issue Aug 29, 2023
…ource. (#26785)

## Description 
Sometimes, we need to use an upstream mirror repository to update the
current development repository, but mirror repositories are prohibited
from PR. It should not appear in `merge to,` but it can appear in `pull
from.`
Fix #24585 #26193 #26781
Related #24183

Many thanks to @apnote  for assisting me in reproducing this bug!

## ScreenShot
---
### Before

<img
src="https://github.com/go-gitea/gitea/assets/50507092/3d76c376-1f54-45b9-80c9-6ba8319d6a9a"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/fbfd9f7f-421f-4a2e-9a3e-f2958bbf3312"
width="400px">

### After

<img
src="https://github.com/go-gitea/gitea/assets/50507092/e6984524-4f61-4310-b795-4d8598bd8963"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/04065b44-78d7-4721-bf31-0f1674150727"
width="400px">
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Aug 29, 2023
…ource. (go-gitea#26785)

## Description 
Sometimes, we need to use an upstream mirror repository to update the
current development repository, but mirror repositories are prohibited
from PR. It should not appear in `merge to,` but it can appear in `pull
from.`
Fix go-gitea#24585 go-gitea#26193 go-gitea#26781
Related go-gitea#24183

Many thanks to @apnote  for assisting me in reproducing this bug!

## ScreenShot
---
### Before

<img
src="https://github.com/go-gitea/gitea/assets/50507092/3d76c376-1f54-45b9-80c9-6ba8319d6a9a"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/fbfd9f7f-421f-4a2e-9a3e-f2958bbf3312"
width="400px">

### After

<img
src="https://github.com/go-gitea/gitea/assets/50507092/e6984524-4f61-4310-b795-4d8598bd8963"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/04065b44-78d7-4721-bf31-0f1674150727"
width="400px">
@CaiCandong
Copy link
Member

Fixed by #26785

lunny pushed a commit that referenced this issue Aug 29, 2023
…ource. (#26785) (#26790)

Backport #26785 by @CaiCandong

## Description 
Sometimes, we need to use an upstream mirror repository to update the
current development repository, but mirror repositories are prohibited
from PR. It should not appear in `merge to,` but it can appear in `pull
from.`
Fix #24585 #26193 #26781
Related #24183

Many thanks to @apnote  for assisting me in reproducing this bug!

## ScreenShot
---
### Before

<img
src="https://github.com/go-gitea/gitea/assets/50507092/3d76c376-1f54-45b9-80c9-6ba8319d6a9a"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/fbfd9f7f-421f-4a2e-9a3e-f2958bbf3312"
width="400px">

### After

<img
src="https://github.com/go-gitea/gitea/assets/50507092/e6984524-4f61-4310-b795-4d8598bd8963"
width="400px">

<img
src="https://github.com/go-gitea/gitea/assets/50507092/04065b44-78d7-4721-bf31-0f1674150727"
width="400px">

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants