go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.12k stars 5.49k forks source link

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

Closed rh101 closed 1 year ago

rh101 commented 1 year ago

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

lunny commented 1 year ago

Which repository did the last screenshot come from?

rh101 commented 1 year ago

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 commented 1 year ago

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.

Eddcapone commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

Is this ever getting fixed? Its been months

CaiCandong commented 1 year ago

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 commented 1 year ago

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 https://github.com/go-gitea/gitea/issues/24585#issuecomment-1539268136 and the new issue: "Derived warehouse cannot be merged with original warehouse #26781"

CaiCandong commented 1 year ago

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.

catfromplan9 commented 1 year ago

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 commented 1 year ago

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. https://github.com/go-gitea/gitea/pull/26785

catfromplan9 commented 1 year ago

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 commented 1 year ago

Already backported image