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

[1.17/1.18] 500 Error viewing branch after PR merge with non-numeric External Issue Tracker enabled #20109

Closed
jared-nussbaum-frbb opened this issue Jun 23, 2022 · 2 comments · Fixed by #20277
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Milestone

Comments

@jared-nussbaum-frbb
Copy link

jared-nussbaum-frbb commented Jun 23, 2022

Description

When I merge branch through a PR the branch receiving the merge commit seems to be unable to render. The originating branch renders fine. The logs that show up are the following:

2022/06/23 10:26:40 ...s/context/context.go:231:HTML() [E] [62b47820] Render failed: template: repo/view_list:29:105: executing "repo/view_list" at <RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas>: error calling RenderCommitMessageLinkSubject: runtime error: invalid memory address or nil pointer dereference
2022/06/23 10:26:40 [62b47820] router: completed GET /{user}/Gitea-Demo/src/branch/main for REDACTED:42376, 500 Internal Server Error in 502.1ms @ repo/view.go:732(repo.Home)

When I force push on main with a commit before the PR, the rendering of main continues fine. It also doesn't seem to effect traversal into the repository's folders, just the top level view. Edit: This 500 error only occurs when an external issue tracker is used with Alphanumeric selected when the PR is created. I think it might have to do with the (!9) added to the commit name.

500 error can be seen here: https://try.gitea.io/jared-nussbaum-frbb/Gitea-Demo

Steps to reproduce:

  1. Create a new repository in Gitea 1.17 or later
  2. Go into the repository settings and select Use External Issue Tracker
  3. Fill in any URLs for the External Issue Tracker URLs.
  4. Select Alphanumeric
  5. Create a PR with a merge commit that includes the (!<number>) in the commit name.
  6. Navigate to the "Code" section of the repo and go to the branch that you created the merge commit in
  7. You should see the 500 Error on the screen.
  8. Navigate back to the settings URL directly
  9. Change the Alphanumeric setting to Numeric
  10. Navigate to the "Code" section of the repo and go to the branch that you created the merge commit in
  11. You should see your repo page again without a 500 error

Gitea Version

1.17.0+rc1
1.18.0+dev-47-g91b21473a (on demo site)

Can you reproduce the bug on the Gitea demo site?

No YES https://try.gitea.io/jared-nussbaum-frbb/Gitea-Demo

Log Gist

No response

Screenshots

No response

Git Version

git version 2.36.1

Operating System

No response

How are you running Gitea?

I am running Gitea through docker.

Database

SQLite

@lunny lunny added this to the 1.17.0 milestone Jun 23, 2022
@jared-nussbaum-frbb
Copy link
Author

I did some more testing and realized that when the External Issue Tracker is turned off, the issue goes away. I can now reproduce the issue on try.gitea.io (https://try.gitea.io/jared-nussbaum-frbb/Gitea-Demo)

@jared-nussbaum-frbb jared-nussbaum-frbb changed the title [1.17.0+rc1] 500 Error viewing branch after PR merge [1.17.0+rc1] 500 Error viewing branch after PR merge with External Issue Tracker Enabled Jun 27, 2022
@jared-nussbaum-frbb jared-nussbaum-frbb changed the title [1.17.0+rc1] 500 Error viewing branch after PR merge with External Issue Tracker Enabled [1.17/1.18] 500 Error viewing branch after PR merge with Alphanumeric External Issue Tracker Enabled Jun 28, 2022
@jared-nussbaum-frbb jared-nussbaum-frbb changed the title [1.17/1.18] 500 Error viewing branch after PR merge with Alphanumeric External Issue Tracker Enabled [1.17/1.18] 500 Error viewing branch after PR merge with non-numeric External Issue Tracker enabled Jun 28, 2022
@jared-nussbaum-frbb
Copy link
Author

After further investigation I figured out that any non-numeric issue format (Alphanumeric/Alphanumeric Regex) with the external tracking setting will break the code page If referencing the numeric PR number with the (!) in the commit name.

@wxiaoguang wxiaoguang added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Jun 28, 2022
Gusted pushed a commit to Gusted/gitea that referenced this issue Jul 7, 2022
- This code is only valid when `refNumeric` exist(otherwise we didn't find
such numeric PR and can skip that check) and give a free-pas to the  "BEFORE" check when
`ref` is nil.
- Resolves go-gitea#20109
Gusted pushed a commit to Gusted/gitea that referenced this issue Jul 7, 2022
- Backport (go-gitea#20277
  - This code is only valid when `refNumeric` exist(otherwise we didn't find such numeric PR and can skip that check) and give a free-pas to the  "BEFORE" check when `ref` is nil.
  - Resolves go-gitea#20109
lunny pushed a commit that referenced this issue Jul 7, 2022
- Backport (#20277
  - This code is only valid when `refNumeric` exist(otherwise we didn't find such numeric PR and can skip that check) and give a free-pas to the  "BEFORE" check when `ref` is nil.
  - Resolves #20109
6543 pushed a commit that referenced this issue Jul 7, 2022
- This code is only valid when `refNumeric` exist(otherwise we didn't find
such numeric PR and can skip that check) and give a free-pas to the  "BEFORE" check when
`ref` is nil.
- Resolves #20109
dineshsalunke pushed a commit to dineshsalunke/gitea that referenced this issue Jul 9, 2022
- This code is only valid when `refNumeric` exist(otherwise we didn't find
such numeric PR and can skip that check) and give a free-pas to the  "BEFORE" check when
`ref` is nil.
- Resolves go-gitea#20109
vsysoev pushed a commit to IntegraSDL/gitea that referenced this issue Aug 10, 2022
- This code is only valid when `refNumeric` exist(otherwise we didn't find
such numeric PR and can skip that check) and give a free-pas to the  "BEFORE" check when
`ref` is nil.
- Resolves go-gitea#20109
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants