You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules/setting
zeripath 198342efe4
Add setting to disable the git apply step in test patch (#22130) (#22170)
Backport #22130

For a long time Gitea has tested PR patches using a git apply --check
method, and in fact prior to the introduction of a read-tree assisted
three-way merge in #18004, this was the only way of checking patches.

Since #18004, the git apply --check method has been a fallback method,
only used when the read-tree three-way merge method has detected a
conflict. The read-tree assisted three-way merge method is much faster
and less resource intensive method of detecting conflicts. #18004 kept
the git apply method around because it was thought possible that this
fallback might be able to rectify conflicts that the read-tree three-way
merge detected. I am not certain if this could ever be the case.

Given the uncertainty here and the now relative stability of the
read-tree method - this PR makes using this fallback optional but
enables it by default. A `log.Critical` has been added which will alert
if the `git apply --check` method was successful at checking a PR that
`read-tree` failed on.

The hope is that none of these log.Critical messages will be found and
there will be no significant difference in conflict detection. Thus we
will be able to remove the git apply fallback in future, and/or improve
the read-tree three-way merge method to catch any conflicts that git
apply method might have been able to fix.

An additional benefit for anyone who disables the check method is that
patch checking should be significantly less resource intensive and much
quicker.

(See
https://github.com/go-gitea/gitea/issues/22083\#issuecomment-1347961737)

Ref #22083

Signed-off-by: Andrew Thornton <art27@cantab.net>

<!--

Please check the following:

1. Make sure you are targeting the `main` branch, pull requests on
release branches are only allowed for bug fixes.
2. Read contributing guidelines:
https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md
3. Describe what your pull request does and which issue you're targeting
(if any)

-->

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2 years ago
..
attachment.go Update default allowed attachment types (#20192) 3 years ago
cache.go format with gofumpt (#18184) 3 years ago
cors.go format with gofumpt (#18184) 3 years ago
cron.go
cron_test.go format with gofumpt (#18184) 3 years ago
database.go Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) 2 years ago
database_sqlite.go Remove legacy `+build:` constraint (#19582) 3 years ago
database_test.go
directory.go Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) 2 years ago
federation.go Add more linters to improve code readability (#19989) 3 years ago
git.go Use git.HOME_PATH for Git HOME directory (#20114) 3 years ago
i18n.go Remove support for sr-SP (#20155) 3 years ago
indexer.go format with gofumpt (#18184) 3 years ago
indexer_test.go format with gofumpt (#18184) 3 years ago
lfs.go Allow specifying SECRET_KEY_URI, similar to INTERNAL_TOKEN_URI (#19663) 2 years ago
log.go Add more linters to improve code readability (#19989) 3 years ago
mailer.go Correct the fallbacks for mailer configuration (#21945) (#21953) 2 years ago
markup.go Allow render HTML with css/js external links (#19017) 3 years ago
migrations.go format with gofumpt (#18184) 3 years ago
mime_type_map.go format with gofumpt (#18184) 3 years ago
mirror.go format with gofumpt (#18184) 3 years ago
oauth2_client.go OAuth2 login: Set account link to "login" as default behavior (#15768) 4 years ago
packages.go Fixed registry host value. (#19363) 3 years ago
picture.go Add system setting table with cache and also add cache supports for user setting (#18058) 2 years ago
project.go
proxy.go format with gofumpt (#18184) 3 years ago
queue.go Add generic set type (#21408) 2 years ago
repository.go Add setting to disable the git apply step in test patch (#22130) (#22170) 2 years ago
service.go auth/reverseproxy: Add support for full name (#20776) 3 years ago
session.go format with gofumpt (#18184) 3 years ago
setting.go Make gitea work using cmd.exe again (#22073) (#22133) 2 years ago
setting_test.go Add an abstract json layout to make it's easier to change json library (#16528) 4 years ago
storage.go Rework repository archive (#14723) 4 years ago
storage_test.go more test case for STORAGE_TYPE overrides (and fixes) (#14096) 4 years ago
task.go Enable deprecation error for v1.17.0 (#18341) 3 years ago
webhook.go Add packagist webhook (#18224) 3 years ago