Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upstream branch missing in drop-down lists when creating pull request #24585

Closed
rh101 opened this issue May 8, 2023 · 13 comments · Fixed by #26785
Closed

Upstream branch missing in drop-down lists when creating pull request #24585

rh101 opened this issue May 8, 2023 · 13 comments · Fixed by #26785
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP type/bug

Comments

@rh101
Copy link

rh101 commented May 8, 2023

Description

This issue occurred after the update of Gitea from v1.19.1 to v1.19.3.

A mirror of a github project was created in Gitea, as shown below:
image

A fork to an organization account was created from the "dev" branch of that mirrored repository, still under the same username:
image

Now, if I am in the TEST_ORG/axmol fork, and I try to create a new pull request for the purpose of synchronising the fork with the latest changes from the upstream, I no longer see the upstream branch listed in the "merge into" and "pull from" drop-down lists:

image

In v1.19.1, it would have displayed the upstream "testuser/axmol:dev" as an option. Once Gitea was updated to v1.19.3, it no longer shows the upstream link.

Is this a bug, or is there some setting that I need to change to get this working?

Gitea Version

1.19.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/rh101/8912193d230f8f89a9cc6437620f8795

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Running Gitea in Docker, from https://registry.hub.docker.com/r/gitea/gitea

Database

PostgreSQL

@rh101 rh101 added the type/bug label May 8, 2023
@rh101 rh101 changed the title Upstream branch missing in "from pull" dropdown when creating pull request Upstream branch missing in "pull from" dropdown when creating pull request May 8, 2023
@lunny
Copy link
Member

lunny commented May 9, 2023

Which repository did the last screenshot come from?

@rh101
Copy link
Author

rh101 commented May 9, 2023

Which repository did the last screenshot come from?

Mirrored repository is testuser/axmol

Fork of testuser/axmol is TEST_ORG/axmol.

The last screenshot is from a pull request being created in the TEST_ORG/axmol fork. In Gitea 1.19.1, that drop-down would display the testuser/axmol repository branches, such as testuser/axmol:dev and testuser/axmol:release, but in 1.19.3, it does not display any of them.

I also tried deleting the TEST_ORG/axmol fork, then re-creating it from testuser/axmol, but the issue remains.

@rh101
Copy link
Author

rh101 commented May 11, 2023

If I go to the following address, all branches appear from both repositories in both the left and right drop-down lists:

https://[gitea.server]/TEST_ORG/axmol/compare/dev...testuser/axmol:dev

But, if I click on any item in either the "merge into" or "pull from" drop-downs, where the "merge into" repository matches the "pull from" repository, the contents of the drop-downs change to reflect only that specific repository, so the other repository disappears from both lists.

@rh101 rh101 changed the title Upstream branch missing in "pull from" dropdown when creating pull request Upstream branch missing in drop-down lists when creating pull request May 11, 2023
@lunny lunny added the issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP label Jul 27, 2023
@Eddcapone
Copy link

Eddcapone commented Aug 2, 2023

We are also affected (tested on v1.20.2).
We created a mirror to a repository on bitbucket and forked that mirror.
Today I tried to update the master branch of my fork with the master branch from the mirror, but I only see the branches from my fork.

I found a workaround: If I change the URL to the state which I would expect after changing the list, then it works:

https://git.company.de/company/company-xy/compare/master...company:master

@rh101
Copy link
Author

rh101 commented Aug 2, 2023

@Eddcapone For the time being, and to avoid messing with the URL etc, you can work-around the issue by doing everything via the CLI:

### After cloning the repo from your gitea server:
git remote add mirrored_repo https://MIRRORED_REPO_ADDRESS (in your case bitbucket repo address)
git checkout [YOUR_BRANCH]
git fetch mirrored_repo (or git fetch --all)
git merge mirrored_repo/[BRANCH_TO_MERGE]
git push

That will push the changes to your gitea repo.

@catfromplan9
Copy link

catfromplan9 commented Aug 29, 2023

Is this ever getting fixed? Its been months

@CaiCandong
Copy link
Member

CaiCandong commented Aug 29, 2023

Is this ever getting fixed? Its been months

It's not a bug, because it's a private repository and you don't have access to the repository, so you can't raise PRs. you need to grant access/add collaborators accordingly, and you'll be fine.

@wxiaoguang
Copy link
Contributor

Is this ever getting fixed? Its been months

It's not a bug, because it's a private repository and you don't have access to the repository, so you can't raise PRs. you need to grant access/add collaborators accordingly, and you'll be fine.

Are you sure? See the comment #24585 (comment) and the new issue: "Derived warehouse cannot be merged with original warehouse #26781"

@CaiCandong
Copy link
Member

CaiCandong commented Aug 29, 2023

Are you sure? See the comment #24585 (comment) and the new issue: "Derived warehouse cannot be merged with original warehouse #26781"

Sorry, I'm wrong.

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">
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>
@catfromplan9
Copy link

Is this ever getting fixed? Its been months

It's not a bug, because it's a private repository and you don't have access to the repository, so you can't raise PRs. you need to grant access/add collaborators accordingly, and you'll be fine.

not a private repo, its a public mirror i made using an organization i created. i find this the most convenient way to fork projects from github and have them on my gitea

@CaiCandong
Copy link
Member

not a private repo, its a public mirror i made using an organization i created. i find this the most convenient way to fork projects from github and have them on my gitea

Maybe it's been fixed and you can try it. #26785

@catfromplan9
Copy link

not a private repo, its a public mirror i made using an organization i created. i find this the most convenient way to fork projects from github and have them on my gitea

Maybe it's been fixed and you can try it. #26785

thank you very much, i'll wait for the release though. if you dont mind, tag me here when the release that includes your fix is out

@CaiCandong
Copy link
Member

Already backported
image

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2023
project-mirrors-bot-tu bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this issue Jan 23, 2025
…ource. (go-gitea#26785) (go-gitea#26790)

Backport go-gitea#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 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">

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
(cherry picked from commit 3bab204)
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants