BUG: "Propose file change" from UI sends PR to same repo #3911

Closed
opened 2025-11-02 05:30:22 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @guillep2k on GitHub (Sep 6, 2019).

  • Gitea version (or commit ref): 1.9.2 + 1.10.0+dev-254-g5fcef38f7
  • Git version: 2.22.0
  • Operating system: N/A
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL) (N/A)
    • No
    • Not relevant
  • Log gist:

Edit: please read summary in this comment.

Description

When I edit a file from the web UI, select Create a new branch for this commit and start a pull request and click on the [Propose file change] button , the new pull request page only lets me request a merge to branches on the same repository, even when it is a fork.

I don't know if this is the intended behavior, but I believe it's a bug.

Screenshots / how to reproduce in try.gitea.io

First I logged into try.gitea.io and went to:

https://try.gitea.io/gitea/gitea

Then I used the [Fork] button and created:

https://try.gitea.io/guillep2k/gitea-fork

Next, I went into editing README.md from master in my fork:

https://try.gitea.io/guillep2k/gitea-fork/_edit/master/README.md

I then created a new branch:

image

The next page allows me to start the pull request, but the only merge options are for the same repository:

https://try.gitea.io/guillep2k/gitea-fork/compare/master...guillep2k-patch-1

image

image

The above URL should have been:

https://try.gitea.io/gitea/gitea/compare/master...guillep2k:guillep2k-patch-1

If I try that URL, the correct page is rendered.

In addition, using the [New pull request] from the home page, some times work (goes to the correct URL) and some times don't (goes to my own fork URL); I couldn't establish a pattern for that.

https://try.gitea.io/guillep2k/gitea-fork/src/branch/guillep2k-patch-1

image

Originally created by @guillep2k on GitHub (Sep 6, 2019). - Gitea version (or commit ref): 1.9.2 + 1.10.0+dev-254-g5fcef38f7 - Git version: 2.22.0 - Operating system: N/A - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) (N/A) - [ ] No - [ ] Not relevant - Log gist: ## Edit: please read summary in [this comment](https://github.com/go-gitea/gitea/issues/8111#issuecomment-529036267). ## Description When I edit a file from the web UI, select `Create a new branch for this commit and start a pull request` and click on the `[Propose file change]` button , the new pull request page only lets me request a merge to branches on the same repository, even when it is a fork. I don't know if this is the intended behavior, but I believe it's a bug. ## Screenshots / how to reproduce in try.gitea.io First I logged into [try.gitea.io](http://try.gitea.io) and went to: https://try.gitea.io/gitea/gitea Then I used the `[Fork]` button and created: https://try.gitea.io/guillep2k/gitea-fork Next, I went into editing `README.md` from `master` in my fork: https://try.gitea.io/guillep2k/gitea-fork/_edit/master/README.md I then created a new branch: ![image](https://user-images.githubusercontent.com/18600385/64393084-364f1d80-d026-11e9-88b4-dbc41f25dc22.png) The next page allows me to start the pull request, but the only merge options are for the same repository: https://try.gitea.io/guillep2k/gitea-fork/compare/master...guillep2k-patch-1 ![image](https://user-images.githubusercontent.com/18600385/64393113-5252bf00-d026-11e9-9bdb-6e7d6ea39ba5.png) ![image](https://user-images.githubusercontent.com/18600385/64393122-57b00980-d026-11e9-833a-4da9329b3c8e.png) The above URL should have been: https://try.gitea.io/gitea/gitea/compare/master...guillep2k:guillep2k-patch-1 If I try that URL, the correct page is rendered. In addition, using the `[New pull request]` from the home page, **some times** work (goes to the correct URL) and some times don't (goes to my own fork URL); I couldn't establish a pattern for that. https://try.gitea.io/guillep2k/gitea-fork/src/branch/guillep2k-patch-1 ![image](https://user-images.githubusercontent.com/18600385/64393175-89c16b80-d026-11e9-8fd3-08de4b385e80.png)
GiteaMirror added the type/bug label 2025-11-02 05:30:22 -06:00
Author
Owner

@guillep2k commented on GitHub (Sep 6, 2019):

@lunny I think this should be [kind/bug]. The title "Propose file change..." is the option in Gitea that has the bug.

@guillep2k commented on GitHub (Sep 6, 2019): @lunny I think this should be `[kind/bug]`. The title "Propose file change..." is the option in Gitea that has the bug.
Author
Owner

@guillep2k commented on GitHub (Sep 6, 2019):

OK, I've finally figured out the "problem": the user has no PR access to the source repository, so Gitea is routing the PR to the forked repo:

  • repo_fork owner is a collaborator of repo_orig ==> [New pull request] routes to PR creation for repo_orig
  • repo_fork owner is not collaborator of repo_orig ==> [New pull request] routes to PR creation for repo_fork (why?)

I don't know if this intended (I don't understand why it is like this), so I'll leave this issue open.

@guillep2k commented on GitHub (Sep 6, 2019): OK, I've finally figured out the "problem": the user has no PR access to the source repository, so Gitea is routing the PR to the forked repo: * `repo_fork` owner is a collaborator of `repo_orig` ==> [New pull request] routes to PR creation for `repo_orig` * `repo_fork` owner is **not** collaborator of `repo_orig` ==> [New pull request] routes to PR creation for `repo_fork` **(why?)** I don't know if this intended (I don't understand why it is like this), so I'll leave this issue open.
Author
Owner

@guillep2k commented on GitHub (Sep 6, 2019):

Sorry. I really need to read the docs. 🤦‍♂

@guillep2k commented on GitHub (Sep 6, 2019): Sorry. I really need to read the docs. 🤦‍♂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3911