0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-05-18 03:14:09 +02:00
gitea/modules
Lunny Xiao c53ad052d8
Refactor the setting to make unit test easier (#22405)
Some bugs caused by less unit tests in fundamental packages. This PR
refactor `setting` package so that create a unit test will be easier
than before.

- All `LoadFromXXX` files has been splited as two functions, one is
`InitProviderFromXXX` and `LoadCommonSettings`. The first functions will
only include the code to create or new a ini file. The second function
will load common settings.
- It also renames all functions in setting from `newXXXService` to
`loadXXXSetting` or `loadXXXFrom` to make the function name less
confusing.
- Move `XORMLog` to `SQLLog` because it's a better name for that.

Maybe we should finally move these `loadXXXSetting` into the `XXXInit`
function? Any idea?

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: delvh <dev.lh@web.de>
2023-02-20 00:12:01 +08:00
..
actions Fix actions workflow branches match bug (#22724) 2023-02-02 20:40:08 +08:00
activitypub Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
analyze Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
auth Provide the ability to set password hash algorithm parameters (#22942) 2023-02-19 15:35:20 +08:00
avatar Unify hashing for avatar (#22289) 2023-01-02 22:46:39 +01:00
base Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
cache Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
charset Fix isAllowed of escapeStreamer (#22814) 2023-02-09 20:51:36 +08:00
container Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
context Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
csv Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
doctor Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
emoji Fix unstable emoji sort (#22346) 2023-01-05 13:58:51 +02:00
eventsource Move convert package to services (#22264) 2022-12-29 10:57:15 +08:00
generate Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
git Remember to attach the parent tree when converting TreeEntry() -> Tree() (#22902) 2023-02-14 21:23:04 +00:00
gitgraph Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
graceful Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
hcaptcha Consume hcaptcha and pwn deps (#22610) 2023-01-29 09:49:51 -06:00
highlight Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
hostmatcher Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
html Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
httpcache Add some comments for recent code (#22725) 2023-02-02 11:39:38 -06:00
httplib Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
indexer Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
issue/template Allow issue templates to not render title (#22589) 2023-01-26 22:45:49 -06:00
json Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00
lfs escape filename when assemble URL (#22850) 2023-02-12 09:31:14 +08:00
log Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
markup Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
mcaptcha Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
metrics include build info in Prometheus metrics (#22819) 2023-02-08 19:54:01 +02:00
migration Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
mirror Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
nosql Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
notification Implement actions (#21937) 2023-01-31 09:45:19 +08:00
options Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
packages Use import of OCI structs (#22765) 2023-02-06 10:07:09 +00:00
paginator Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00
pprof Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
private Implement actions (#21937) 2023-01-31 09:45:19 +08:00
process Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
proxy Use proxy for pull mirror (#22771) 2023-02-11 08:39:50 +08:00
proxyprotocol Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
public Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
queue Correctly handle select on multiple channels in Queues (#22146) 2022-12-30 02:06:47 +02:00
recaptcha Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
references Use correct captured group range when parsing cross-reference (#22672) 2023-01-31 10:08:05 +01:00
regexplru Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repository Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
secret Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
session Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00
setting Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
sitemap Fix sitemap (#22272) 2022-12-30 23:31:00 +08:00
ssh Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
storage Implement actions (#21937) 2023-01-31 09:45:19 +08:00
structs Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
svg Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
sync Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
system Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
templates Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
test Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
timeutil Check for zero time instant in TimeStamp.IsZero() (#22171) 2022-12-20 10:04:55 +08:00
translation Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
turnstile Add new captcha: cloudflare turnstile (#22369) 2023-02-05 15:29:03 +08:00
typesniffer Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
updatechecker Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
upload Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
uri Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
user Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
util Move IsReadmeFile* from modules/markup/ to modules/util (#22877) 2023-02-13 15:01:09 -05:00
validation Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
watcher Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
web Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
webhook Restructure webhook module (#22256) 2023-01-01 23:23:15 +08:00