Compare button on upstream repo leads to 404 #1655

Closed
opened 2025-11-02 04:08:34 -06:00 by GiteaMirror · 17 comments
Owner

Originally created by @mxmehl on GitHub (Mar 27, 2018).

  • Gitea version (or commit ref): 1.4.0
  • Git version: 2.1.4
  • Operating system: Debian 8
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant: does not work

Description

Scenario: I, user joe, forked repository repo of another user called upstream.

Now, if I am on joe/repo and click on the green compare button, everything works as expected and I see the "Compare Changes" window. However, this doesn't work on upstream/repo, there I see a 404 error.

I noted that the 404 does not appear if I'm owner of the upstream repository's organisation.

The links of the button look like this:

https://git.example.org/upstream/repo/compare/master...joe:master from forked repo -> works
https://git.example.org/upstream/repo/compare/master...upstream:master from upstream repo -> doesn't work

I cannot check how the links looked like in 1.3, but I was told by a user on my Gitea instance that it worked before.

Originally created by @mxmehl on GitHub (Mar 27, 2018). - Gitea version (or commit ref): 1.4.0 - Git version: 2.1.4 - Operating system: Debian 8 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant: does not work ## Description Scenario: I, user `joe`, forked repository `repo` of another user called `upstream`. Now, if I am on joe/repo and click on the green compare button, everything works as expected and I see the "Compare Changes" window. However, this doesn't work on upstream/repo, there I see a 404 error. I noted that the 404 does not appear if I'm owner of the upstream repository's organisation. The links of the button look like this: `https://git.example.org/upstream/repo/compare/master...joe:master` from forked repo -> works `https://git.example.org/upstream/repo/compare/master...upstream:master` from upstream repo -> doesn't work I cannot check how the links looked like in 1.3, but I was told by a user on my Gitea instance that it worked before.
GiteaMirror added the issue/confirmedtopic/uitype/bug labels 2025-11-02 04:08:34 -06:00
Author
Owner

@ghost commented on GitHub (Mar 27, 2018):

I cannot check how the links looked like in 1.3, but I was told by a user on my Gitea instance that it worked before.

I can confirm that.

@ghost commented on GitHub (Mar 27, 2018): > I cannot check how the links looked like in 1.3, but I was told by a user on my Gitea instance that it worked before. I can confirm that.
Author
Owner

@lafriks commented on GitHub (Mar 27, 2018):

Does link https://git.example.org/upstream/repo/compare/master...master work?

@lafriks commented on GitHub (Mar 27, 2018): Does link `https://git.example.org/upstream/repo/compare/master...master` work?
Author
Owner

@mxmehl commented on GitHub (Mar 27, 2018):

Does link https://git.example.org/upstream/repo/compare/master...master work?

No, this also generates an 404. As repo or organisation owner it seems to work though.

@mxmehl commented on GitHub (Mar 27, 2018): > Does link https://git.example.org/upstream/repo/compare/master...master work? No, this also generates an 404. As repo or organisation owner it seems to work though.
Author
Owner

@lafriks commented on GitHub (Mar 28, 2018):

What rights does user joe does for upstream repo? Is it private or public?

@lafriks commented on GitHub (Mar 28, 2018): What rights does user `joe` does for upstream repo? Is it private or public?
Author
Owner

@ghost commented on GitHub (Mar 29, 2018):

Please note that the 'New Pull Request' button in the Pull Requests tab works perfectly and generates this link:

https://git.example.org/upstream/repo/compare/master...joe:master
@ghost commented on GitHub (Mar 29, 2018): Please note that the 'New Pull Request' button in the Pull Requests tab works perfectly and generates this link: ``` https://git.example.org/upstream/repo/compare/master...joe:master ```
Author
Owner

@mxmehl commented on GitHub (Mar 29, 2018):

What rights does user joe does for upstream repo? Is it private or public?

No specific permissions (i.e. no organisation or team member, or collaborator). The repo is public.

@mxmehl commented on GitHub (Mar 29, 2018): > What rights does user `joe` does for upstream repo? Is it private or public? No specific permissions (i.e. no organisation or team member, or collaborator). The repo is public.
Author
Owner

@Infern1 commented on GitHub (Apr 19, 2018):

Seeing the same problem

When clicking pull request this url is generated

http://git.server.com/git/APCS-WEB/WEB_MasterLmpc/compare/master...my_username:master

and returns a 404
If I change the url to
http://git.server.com/git/APCS-WEB/WEB_MasterLmpc/compare/master...develop

it works

Isn't this same error, fixed:
afab38b0d7
?

@Infern1 commented on GitHub (Apr 19, 2018): Seeing the same problem When clicking pull request this url is generated `http://git.server.com/git/APCS-WEB/WEB_MasterLmpc/compare/master...my_username:master` and returns a 404 If I change the url to `http://git.server.com/git/APCS-WEB/WEB_MasterLmpc/compare/master...develop` it works Isn't this same error, fixed: https://github.com/gogits/gogs/commit/afab38b0d74c65e1deb4348a411cd3a13a641b74 ?
Author
Owner

@stale[bot] commented on GitHub (Jan 28, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 28, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@adelowo commented on GitHub (Jan 28, 2019):

Sent a PR for this already

@adelowo commented on GitHub (Jan 28, 2019): Sent a PR for this already
Author
Owner

@notgood commented on GitHub (Feb 1, 2019):

Broken for me since today upgrade to 1.7.1.

My scenario: repo owned by organization, no forks, green compare button generates link /orgname/reponame/compare/master...MyUsername:master, which is failing horribly with 404.
Going through Pull Requests->New Pull Request generates /orgname/reponame/compare/master...master, working as expected.

@notgood commented on GitHub (Feb 1, 2019): Broken for me since today upgrade to 1.7.1. My scenario: repo owned by organization, no forks, green compare button generates link /orgname/reponame/compare/master...MyUsername:master, which is failing horribly with 404. Going through Pull Requests->New Pull Request generates /orgname/reponame/compare/master...master, working as expected.
Author
Owner

@zeripath commented on GitHub (Feb 1, 2019):

Argh. We need better UI tests.

@adelowo do you think we should just revert your patch.

@zeripath commented on GitHub (Feb 1, 2019): Argh. We need better UI tests. @adelowo do you think we should just revert your patch.
Author
Owner

@adelowo commented on GitHub (Feb 1, 2019):

@zeripath Argh, yes, my bad, I didn't test all scenarios

I will look at this again during the weekend but it should be reverted in the main time

@adelowo commented on GitHub (Feb 1, 2019): @zeripath Argh, yes, my bad, I didn't test all scenarios I will look at this again during the weekend but it should be reverted in the main time
Author
Owner

@adelowo commented on GitHub (Feb 1, 2019):

See https://github.com/go-gitea/gitea/issues/5924#issuecomment-459868372

@adelowo commented on GitHub (Feb 1, 2019): See https://github.com/go-gitea/gitea/issues/5924#issuecomment-459868372
Author
Owner

@dmolineus commented on GitHub (Feb 22, 2019):

Another thing, I see here. The given url does not url encode the branch name which leads to another 404 even if user prefix wouldn't be there.

  1. Expected link customer-projects/***-photo/compare/master...hotfix%2Fphp-7-compatiblity
  2. Acutal link customer-projects/***-photo/compare/master...username:hotfix/php-7-compatiblity
@dmolineus commented on GitHub (Feb 22, 2019): Another thing, I see here. The given url does not url encode the branch name which leads to another 404 even if user prefix wouldn't be there. 1. Expected link `customer-projects/***-photo/compare/master...hotfix%2Fphp-7-compatiblity` 2. Acutal link `customer-projects/***-photo/compare/master...username:hotfix/php-7-compatiblity`
Author
Owner

@lunny commented on GitHub (Feb 23, 2019):

@dmolineus which version are you using? I think this has been resolved by #6098

@lunny commented on GitHub (Feb 23, 2019): @dmolineus which version are you using? I think this has been resolved by #6098
Author
Owner

@dmolineus commented on GitHub (Feb 25, 2019):

@lunny Im using 1.7.2 built with go1.11.5. The mentioned PR isn't released yet, so maybe it's resolved. Thanks for pointing it out.

@dmolineus commented on GitHub (Feb 25, 2019): @lunny Im using `1.7.2 built with go1.11.5`. The mentioned PR isn't released yet, so maybe it's resolved. Thanks for pointing it out.
Author
Owner

@mrsdizzie commented on GitHub (Sep 7, 2020):

Should be resolved from linked PRs

@mrsdizzie commented on GitHub (Sep 7, 2020): Should be resolved from linked PRs
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1655