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

No Create Merge Commit button #21329

Closed
TokisanGames opened this issue Oct 3, 2022 · 7 comments
Closed

No Create Merge Commit button #21329

TokisanGames opened this issue Oct 3, 2022 · 7 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@TokisanGames
Copy link

TokisanGames commented 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

@TokisanGames TokisanGames added type/bug topic/ui Change the appearance of the Gitea UI labels Oct 3, 2022
@TokisanGames
Copy link
Author

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

@wxiaoguang
Copy link
Contributor

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

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug topic/ui Change the appearance of the Gitea UI labels Oct 6, 2022
@TokisanGames
Copy link
Author

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.

@wxiaoguang
Copy link
Contributor

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
Copy link
Contributor

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.

@TokisanGames
Copy link
Author

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;
    }

@wxiaoguang
Copy link
Contributor

You do not need to do that.

The document is clear:

Note: Trailing slash

image

@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/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

2 participants