Skip to content

Different behavior of "Mark PR as manually merged" and "Autodetect manual merge" #19528

Open
@IT-AlexKor

Description

@IT-AlexKor

Description

Main problem - after extranl merge I can't see any changes in PR even if I set it to Manually merged (via UI, not autodetect). I know about feature "Autodetect manual merge", but there is some note that it can misjudge in some special cases , but no details in which one.

While researching about these options, I found a different behavior on how "Mark PR as manually merged" and "Autodetect manual merge" are working. While "Autodetect manual merge" changing the merge_base commit (in pull_request table), option "Mark PR as manually merged" wasn't. I think it's a bug - I can't see any reasons why it shouldn't work. When user from tells Gitea (from UI) in which commit current PR was merged, Gitea can detect merge_base and change it.

Steps to reproduce:

  1. Use repo with disabled "Mark PR as manually merged" and "Autodetect manual merge"
  2. create 2 branches from master with changes and create PR's for each one
  3. Enable "Mark PR as manually merged" in repo
  4. Merge branch 1 to master externally (not from UI) and push changes to Gitea
  5. Set for PR 1 Mark that it was merged manually and set appropriated commit hash
  6. Now PR 1 marked as manually merged and you can't see any changes (commits, files changed) in PR UI, because merge_base wasn't changed
  7. Enable "Autodetect manual merge" in repo
  8. Merge branch 2 to master externally (not from UI) and push changes to Gitea
  9. Now PR 2 marked as manually merged (autodetected) and you can see changes (commits, files changed) in PR UI, because merge_base was changed in DB

Gitea Version

1.16.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.21.0

Operating System

Debian 11.3

How are you running Gitea?

RUN_MODE = prod
APP_NAME = Gitea

[indexer]
REPO_INDEXER_TYPE      = elasticsearch
REPO_INDEXER_PATH      = indexers/repos.bleve
REPO_INDEXER_CONN_STR  = http://<ERASED>:9200/
UPDATE_BUFFER_LEN      = 20
REPO_INDEXER_EXCLUDE   = resources/bin/**
MAX_FILE_SIZE          = 1.048576e+06
ISSUE_INDEXER_NAME     = gitea_issues
ISSUE_INDEXER_PATH     = indexers/issues.bleve
REPO_INDEXER_NAME      = gitea_codes
STARTUP_TIMEOUT        = 30s
ISSUE_INDEXER_TYPE     = elasticsearch
ISSUE_INDEXER_CONN_STR = http://<ERASED>:9200/
REPO_INDEXER_ENABLED   = true

[service]
ENABLE_CAPTCHA                    = false
DEFAULT_ENABLE_TIMETRACKING       = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = false
REQUIRE_SIGNIN_VIEW               = true
REGISTER_EMAIL_CONFIRM            = false
NO_REPLY_ADDRESS                  = noreply.localhost
ENABLE_TIMETRACKING               = false
ENABLE_NOTIFY_MAIL                = true
DISABLE_REGISTRATION              = true
ENABLE_USER_HEATMAP               = false
AUTO_WATCH_NEW_REPOS              = false
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
AUTO_WATCH_ON_CHANGES             = true
DEFAULT_KEEP_EMAIL_PRIVATE        = false

[server]
LFS_JWT_SECRET   = <ERASED>
APP_DATA_PATH    = /data/gitea
SSH_DOMAIN       = <ERASED>
SSH_ROOT_PATH    = /data/git/.ssh
PROTOCOL         = http
HTTP_PORT        = 3000
ROOT_URL         = https://<ERASED>
SSH_LISTEN_PORT  = 22
DISABLE_SSH      = false
OFFLINE_MODE     = false
LFS_START_SERVER = true
SSH_PORT         = 22
ENABLE_PPROF     = false
DOMAIN           = <ERASED>

[log]
ROUTER    = file,console
MODE      = file,console
ROOT_PATH = /data/gitea/log
LEVEL     = trace
DB_TYPE   = postgres

[cron.delete_old_actions]
ENABLED    = true
SCHEDULE   = 0 0 0 * * *
OLDER_THAN = 192h

[mailer]
HOST    = <ERASED>:25
ENABLED = true
FROM    = <ERASED>

[database]
LOG_SQL = true
DB_TYPE = postgres
HOST    = <ERASED>:5432
PASSWD  = <ERASED>
NAME    = gitea_db
CHARSET = utf8
SCHEMA  = public
USER    = gitea

[security]
IMPORT_LOCAL_PATHS = true
DISABLE_GIT_HOOKS  = false
PASSWORD_HASH_ALGO = pbkdf2
INSTALL_LOCK       = true
SECRET_KEY         = <ERASED>
INTERNAL_TOKEN     = <ERASED>

[openid]
ENABLE_OPENID_SIGNUP = false
ENABLE_OPENID_SIGNIN = false

[lfs]
PATH = /data/gitea/lfs

[admin]
DEFAULT_EMAIL_NOTIFICATIONS = onmention

[git.timeout]
MIRROR  = 600
MIGRATE = 600

[mirror]
MIN_INTERVAL = 1m

[repository]
ROOT = /data/git/gitea-repositories

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = true

[session]
PROVIDER = file

[metrics]
ENABLED = true

[oauth2]
JWT_SECRET = <ERASED>

[webhook]
ALLOWED_HOST_LIST = <ERASED>,<ERASED>

[markup.jupyter]
RENDER_COMMAND  = jupyter nbconvert --stdin --stdout --to html --template basic
IS_INPUT_FILE   = false
FILE_EXTENSIONS = .ipynb
ENABLED         = true

[migrations]
ALLOW_LOCALNETWORKS = true
ALLOWED_DOMAINS     = <ERASED>,<ERASED>,<ERASED>

[ui]
ISSUE_PAGING_NUM = 25

Database

PostgreSQL

Metadata

Metadata

Assignees

Labels

type/questionIssue needs no code to be fixed, only a description on how to fix it yourself.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions