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

Closing a PR fails (404 web page) if external issue tracker enabled, or no issue tracker enabled #2447

Closed
2 of 7 tasks
smckown opened this issue Sep 1, 2017 · 8 comments · Fixed by #2710
Closed
2 of 7 tasks
Labels
Milestone

Comments

@smckown
Copy link

smckown commented Sep 1, 2017

  • Gitea version (or commit ref): 1.2.0-rc1 (binary install)
  • Git version: 2.11.0
  • Operating system: Ubuntu Linux 16.04 amd64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
2017/09/01 11:47:16 [...ules/context/repo.go:527 func1()] [E] CheckUnit: You are not allowed to visit this repository unit: 2

Description

  • Start with a repository that is configured for no issue tracker, or an external issue tracker
  • Create a PR
  • Press the Close button on the PR page
  • Result: 404 web page, and log message shown above
  • PR is not removed

The problem does not appear if the builtin issue tracker is enabled. In fact, to close the PR I can:

  • Change to the builtin issue tracker
  • Go close the PR
  • Return to original issue settings (either no issue tracker, or external issue tracker)

Thanks!

@lafriks lafriks added this to the 1.x.x milestone Sep 1, 2017
@lunny
Copy link
Member

lunny commented Sep 2, 2017

A PR is also an issue. So if we closed the issues, then maybe all the PR related features should be hidden also.

@lafriks
Copy link
Member

lafriks commented Sep 2, 2017

I don't think so. PR should still work even if issues is disabled

@lunny
Copy link
Member

lunny commented Sep 3, 2017

So we still have Issues tab and only list all the Pull Requests?

@lafriks
Copy link
Member

lafriks commented Sep 3, 2017

No do not have issues tab, just PR tab but we have to function them properly

@smckown
Copy link
Author

smckown commented Sep 4, 2017

I suspect the following behavior is related to the same root cause.

With external issues enabled, and trying to create (or edit) a PR comment to add an issue reference of the form #NNNN, the Preview pane shows the comment as one might expect. Yet on Save, gitea logs the message below and does not save the PR comment.

2017/09/04 07:20:31 [...ules/context/repo.go:527 func1()] [E] CheckUnit: You are not allowed to visit this repository unit: 2

If I enable builtin issues, add/edit a PR comment to include #NNNN, Save the comment, then re-enable external issues, then the PR comment displays correctly.

This behavior does not appear to apply to references of the form:

<org>/<repo>/#N

The above extended reference format seems to allow me to refer to one PR from another PR comment even when external issues are enabled.

@iamnumbersix
Copy link

iamnumbersix commented Sep 6, 2017

Also a 404 on 1.2.0+rc2 if there is no issue tracker. Even without a PR. Might be related.
I can only access Repositories with issue trackers (internal) enabled.

2017/09/06 20:50:41 [...routers/repo/view.go:274 Home()] [E] Home: Cannot find any unit on this repository which you are allowed to access

@lunny
Copy link
Member

lunny commented Sep 7, 2017

@iamnumbersix your problem should be different from this one.

@webjoel
Copy link
Contributor

webjoel commented Oct 6, 2017

Comment, start time tracker and add time tracker, error page 404 is returned too.

In my opinion, using external or internal issue tracker should not be related to the functionality of the pull request, the comment part is undisputed, in the case of the time tracker I may want to record activities in the pull request with no relation to an issue, just record of the work itself. However if this is not accepted, at least the time tracker options in the pull request should be hidden as well as enabled external tracker issue.

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