No Create Merge Commit button #9652

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

Originally created by @TokisanGames on GitHub (Oct 3, 2022).

Description

I can't get a Create merge commit button on the PR page. I can't see any of the options shown in PR #19648. No matter which merge style or signing verification setting I chose, or whether I put in a key or not.

No console errors on the PR page.

It works on the demo site, but that uses v1.18.

Linux binary 1.17.2 running through an Nginx proxy available under https//domain/git.

Removing all templates doesn't fix the problem.

An incognito window doesn't help.

Debug Info

On the demo server, this div is populated: <div id="pull-request-merge-form"></div>. On mine, it is not.

Above that div is some javascript that does run. I get no javascript console errors except for blocking gravatar. If I add console.log(JSON.stringify(mergeForm, null, 4)); to pull.tmpl, I get the dictionary below. I experimented with adjusting the boolean values such as allowing manual merge, not hiding messages, but that changed nothing.

{
    "baseLink": "/git/repo/test-repo/pulls/2",
    "textCancel": "Cancel",
    "textDeleteBranch": "Delete Branch 'test-create-branch'",
    "textAutoMergeButtonWhenSucceed": "(When checks succeed)",
    "textAutoMergeWhenSucceed": "Auto merge when all checks succeed",
    "textAutoMergeCancelSchedule": "Cancel auto merge",
    "canMergeNow": true,
    "allOverridableChecksOk": true,
    "emptyCommit": false,
    "pullHeadCommitID": "2d21983c92a1afa21e2a246533848f93515b4c64",
    "isPullBranchDeletable": true,
    "defaultMergeStyle": "merge",
    "defaultDeleteBranchAfterMerge": false,
    "mergeMessageFieldPlaceHolder": "Add an optional extended description…",
    "hasPendingPullRequestMerge": false,
    "hasPendingPullRequestMergeTip": "",
    "mergeStyles": [
        {
            "name": "merge",
            "allowed": true,
            "textDoMerge": "Create merge commit",
            "mergeTitleFieldText": "Merge pull request 'Upload test files' (#2) from test-create-branch into dev",
            "mergeMessageFieldText": "Reviewed-on: https://domain/git/repo/test-repo/pulls/2\n",
            "hideAutoMerge": true
        },
        {
            "name": "rebase",
            "allowed": true,
            "textDoMerge": "Rebase then fast-forward",
            "hideMergeMessageTexts": true,
            "hideAutoMerge": true
        },
        {
            "name": "rebase-merge",
            "allowed": true,
            "textDoMerge": "Rebase then create merge commit",
            "mergeTitleFieldText": "Merge pull request 'Upload test files' (#2) from test-create-branch into dev",
            "mergeMessageFieldText": "Reviewed-on: https://domain/git/repo/test-repo/pulls/2\n",
            "hideAutoMerge": true
        },
        {
            "name": "squash",
            "allowed": true,
            "textDoMerge": "Create squash commit",
            "mergeTitleFieldText": "Upload test files (#2)",
            "mergeMessageFieldText": "test PR\n\nCo-authored-by: user...\nReviewed-on: https://domain/git/repo/test-repo/pulls/2\n",
            "hideAutoMerge": true
        },
        {
            "name": "manually-merged",
            "allowed": false,
            "textDoMerge": "Manually merged",
            "hideMergeMessageTexts": true,
            "hideAutoMerge": true
        }
    ]
}

Screenshots

Mine with a key or not:
image

This makes it look like I cannot merge anything unless I have a signed key. But that goes down a rabbit hole of confusing documentation and github issues where there is intentionally no official recommendation on how to set up and sign GPG keys. But the problem isn't the keys.

Expected:
image

Gitea Version

1.17.2 Linux binary

Can you reproduce the bug on the Gitea demo site?

No

Operating System

Win11/64

Browser Version

Edge 105.0.1343.53

Database

Mysql

Originally created by @TokisanGames on GitHub (Oct 3, 2022). ### Description I can't get a `Create merge commit` button on the PR page. I can't see any of the options shown in PR #19648. No matter which merge style or signing verification setting I chose, or whether I put in a key or not. No console errors on the PR page. It works on the demo site, but that uses v1.18. Linux binary 1.17.2 running through an Nginx proxy available under https//domain/git. Removing all templates doesn't fix the problem. An incognito window doesn't help. ### Debug Info On the demo server, this div is populated: `<div id="pull-request-merge-form"></div>`. On mine, it is not. Above that div is some javascript that does run. I get no javascript console errors except for blocking gravatar. If I add `console.log(JSON.stringify(mergeForm, null, 4));` to pull.tmpl, I get the dictionary below. I experimented with adjusting the boolean values such as allowing manual merge, not hiding messages, but that changed nothing. ``` { "baseLink": "/git/repo/test-repo/pulls/2", "textCancel": "Cancel", "textDeleteBranch": "Delete Branch 'test-create-branch'", "textAutoMergeButtonWhenSucceed": "(When checks succeed)", "textAutoMergeWhenSucceed": "Auto merge when all checks succeed", "textAutoMergeCancelSchedule": "Cancel auto merge", "canMergeNow": true, "allOverridableChecksOk": true, "emptyCommit": false, "pullHeadCommitID": "2d21983c92a1afa21e2a246533848f93515b4c64", "isPullBranchDeletable": true, "defaultMergeStyle": "merge", "defaultDeleteBranchAfterMerge": false, "mergeMessageFieldPlaceHolder": "Add an optional extended description…", "hasPendingPullRequestMerge": false, "hasPendingPullRequestMergeTip": "", "mergeStyles": [ { "name": "merge", "allowed": true, "textDoMerge": "Create merge commit", "mergeTitleFieldText": "Merge pull request 'Upload test files' (#2) from test-create-branch into dev", "mergeMessageFieldText": "Reviewed-on: https://domain/git/repo/test-repo/pulls/2\n", "hideAutoMerge": true }, { "name": "rebase", "allowed": true, "textDoMerge": "Rebase then fast-forward", "hideMergeMessageTexts": true, "hideAutoMerge": true }, { "name": "rebase-merge", "allowed": true, "textDoMerge": "Rebase then create merge commit", "mergeTitleFieldText": "Merge pull request 'Upload test files' (#2) from test-create-branch into dev", "mergeMessageFieldText": "Reviewed-on: https://domain/git/repo/test-repo/pulls/2\n", "hideAutoMerge": true }, { "name": "squash", "allowed": true, "textDoMerge": "Create squash commit", "mergeTitleFieldText": "Upload test files (#2)", "mergeMessageFieldText": "test PR\n\nCo-authored-by: user...\nReviewed-on: https://domain/git/repo/test-repo/pulls/2\n", "hideAutoMerge": true }, { "name": "manually-merged", "allowed": false, "textDoMerge": "Manually merged", "hideMergeMessageTexts": true, "hideAutoMerge": true } ] } ``` ### Screenshots Mine with a key or not: ![image](https://user-images.githubusercontent.com/632766/193674897-0a8270a2-f5fd-44ea-a6a7-b91b3fd5c2db.png) This makes it look like I cannot merge anything unless I have a signed key. But that goes down a rabbit hole of confusing documentation and github issues where there is intentionally no official recommendation on how to set up and sign GPG keys. But the problem isn't the keys. Expected: ![image](https://user-images.githubusercontent.com/632766/193675008-070b9e6c-1d95-4d86-a412-df4c6cfba055.png) ### Gitea Version 1.17.2 Linux binary ### Can you reproduce the bug on the Gitea demo site? No ### Operating System Win11/64 ### Browser Version Edge 105.0.1343.53 ### Database Mysql
GiteaMirror added the issue/needs-feedback label 2025-11-02 08:45:34 -06:00
Author
Owner

@TokisanGames commented on GitHub (Oct 3, 2022):

It appears I'm not the only one who has had this issue:

belliash — 07/25/2022
Hey, I've got a simple question. I created a new branch in my project and then MR, but I couldn't accept my own merge 
request. This is of course something good, but since I am the only developer, there is no-one else who could do this. 
I cannot find an option which allows to change this behavior. Is it possible to tell Gitea that 1 specific group 
(eg. Owners) can do whatever it wants?

lunny — 07/25/2022
I think one could merge hisself pull request. We don't name it MR but PR.

belliash — 07/25/2022
I couldn't even choose reviewer

https://discord.com/channels/322538954119184384/561007778139734027/1026557311453507635

@TokisanGames commented on GitHub (Oct 3, 2022): It appears I'm not the only one who has had this issue: ``` belliash — 07/25/2022 Hey, I've got a simple question. I created a new branch in my project and then MR, but I couldn't accept my own merge request. This is of course something good, but since I am the only developer, there is no-one else who could do this. I cannot find an option which allows to change this behavior. Is it possible to tell Gitea that 1 specific group (eg. Owners) can do whatever it wants? lunny — 07/25/2022 I think one could merge hisself pull request. We don't name it MR but PR. belliash — 07/25/2022 I couldn't even choose reviewer ``` https://discord.com/channels/322538954119184384/561007778139734027/1026557311453507635
Author
Owner

@wxiaoguang commented on GitHub (Oct 6, 2022):

Do you have the problem on try.gitea.io ?

@wxiaoguang commented on GitHub (Oct 6, 2022): Do you have the problem on try.gitea.io ?
Author
Owner

@TokisanGames commented on GitHub (Oct 6, 2022):

No, as mentioned above and shown in the dark themed screenshot the demo site shows the buttons, but that site is using v1.18.
I have no console errors, no buttons, and nothing populating the div that should contain it.

@TokisanGames commented on GitHub (Oct 6, 2022): No, as mentioned above and shown in the dark themed screenshot the demo site shows the buttons, but that site is using v1.18. I have no console errors, no buttons, and nothing populating the div that should contain it.
Author
Owner

@wxiaoguang commented on GitHub (Oct 6, 2022):

A lot of users are using Gitea 1.17.x, no other has such problem, it doesn't seem to be a Gitea's problem.

Since I know nothing about your environment, I couldn't provide more helps besides:

  • Remove all your customized templates
  • Check your CDN/reserse-proxy/cache to make sure all files are served correctly
  • Take a few minutes to setup a simple Gitea instance with default and visit 127.0.0.1:3000, it should work well. Then check what are the differences from your environment.
@wxiaoguang commented on GitHub (Oct 6, 2022): A lot of users are using Gitea 1.17.x, no other has such problem, it doesn't seem to be a Gitea's problem. Since I know nothing about your environment, I couldn't provide more helps besides: * Remove all your customized templates * Check your CDN/reserse-proxy/cache to make sure all files are served correctly * Take a few minutes to setup a simple Gitea instance with default and visit 127.0.0.1:3000, it should work well. Then check what are the differences from your environment.
Author
Owner

@wxiaoguang commented on GitHub (Oct 7, 2022):

Since it doesn't seem to be a Gitea bug, I will close this issue.

Feel free to re-open if you can reproduce it with a fresh setup and confirm it's a bug, or if you would propose some solutions for the edge cases or update the documents to help to future users to get rid of similar problems.

@wxiaoguang commented on GitHub (Oct 7, 2022): Since it doesn't seem to be a Gitea bug, I will close this issue. Feel free to re-open if you can reproduce it with a fresh setup and confirm it's a bug, or if you would propose some solutions for the edge cases or update the documents to help to future users to get rid of similar problems.
Author
Owner

@TokisanGames commented on GitHub (Oct 7, 2022):

Indeed, I found the problem was due to using public files from an older release. I'm serving via proxy and had upgraded the binary without updating the static files. Now I've learned my lesson. Thanks for your help.

Note that the proxy page has information that is outdated and/or doesn't work for me:
https://docs.gitea.io/en-us/reverse-proxies/#nginx-and-serve-static-resources-directly

  1. This says, Download a snapshot of the Gitea source repository... Run make frontend...You will need to have Node with npm

The public folder is fortunately already included in the source download, so there's no reason to run make frontend, which says 'nothing to do' anyway. I can just download and move the public folder. Thanks for including a pre-built version.

  1. The page says to use alias. I couldn't get it to work.

Here is what I had to do to get static files and proxy to work for accessing on https://mydomain.com/git

App.ini:
ROOT_URL         = https://mydomain.com/git/
STATIC_URL_PREFIX = /git/

Nginx.conf
    location ^~ /git/assets/ {
        access_log  /var/lib/gitea/log/nginx_access.log;
        error_log   /var/lib/gitea/log/nginx_error.log;
        root        /var/lib/gitea/public;
        rewrite     ^/git/assets/(.*)$ /$1 break;
        try_files   $uri =404;
    }

    location /git/ {
        access_log  /var/lib/gitea/log/nginx_access.log;
        error_log   /var/lib/gitea/log/nginx_error.log;
        rewrite     ^/git/(.*)$ /$1 break;
        proxy_pass  http://localhost:3000;
        proxy_read_timeout  90;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        client_max_body_size 4096m;
    }

@TokisanGames commented on GitHub (Oct 7, 2022): Indeed, I found the problem was due to using public files from an older release. I'm serving via proxy and had upgraded the binary without updating the static files. Now I've learned my lesson. Thanks for your help. Note that the proxy page has information that is outdated and/or doesn't work for me: https://docs.gitea.io/en-us/reverse-proxies/#nginx-and-serve-static-resources-directly 1. This says, `Download a snapshot of the Gitea source repository... Run make frontend...You will need to have Node with npm` The public folder is fortunately already included in the source download, so there's no reason to run `make frontend`, which says 'nothing to do' anyway. I can just download and move the public folder. Thanks for including a pre-built version. 1. The page says to use alias. I couldn't get it to work. Here is what I had to do to get static files and proxy to work for accessing on https://mydomain.com/git ``` App.ini: ROOT_URL = https://mydomain.com/git/ STATIC_URL_PREFIX = /git/ Nginx.conf location ^~ /git/assets/ { access_log /var/lib/gitea/log/nginx_access.log; error_log /var/lib/gitea/log/nginx_error.log; root /var/lib/gitea/public; rewrite ^/git/assets/(.*)$ /$1 break; try_files $uri =404; } location /git/ { access_log /var/lib/gitea/log/nginx_access.log; error_log /var/lib/gitea/log/nginx_error.log; rewrite ^/git/(.*)$ /$1 break; proxy_pass http://localhost:3000; proxy_read_timeout 90; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; client_max_body_size 4096m; } ```
Author
Owner

@wxiaoguang commented on GitHub (Oct 7, 2022):

You do not need to do that.

The document is clear:

Note: Trailing slash

image

@wxiaoguang commented on GitHub (Oct 7, 2022): You do not need to do that. The document is clear: # Note: Trailing slash ![image](https://user-images.githubusercontent.com/2114189/194576276-ea5f3381-d34d-4115-aeac-f5542307d97f.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9652