This repository has been archived on 2024-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
forgejo/models
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 ref to trigger Actions (#22679) 2023-01-31 22:45:25 +00:00
activities Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
admin
asymkey Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
auth Support scoped access tokens (#20908) 2023-01-17 15:46:03 -06:00
avatars Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
db Move delete user to service (#22478) 2023-02-13 13:11:41 +08:00
dbfs Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
fixtures Provide the ability to set password hash algorithm parameters (#22942) 2023-02-19 15:35:20 +08:00
git Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
issues Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
migrations Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
organization Rename GetUnits to LoadUnits (#22970) 2023-02-19 16:31:39 +08:00
packages Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2023-02-06 12:09:18 -06:00
perm Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
project Preview images for Issue cards in Project Board view (#22112) 2023-02-11 16:12:41 +08:00
pull
repo Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
secret
system Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
unit Repositories: by default disable all units except code and pulls on forks (#22541) 2023-02-04 14:48:38 +08:00
unittest Implement actions (#21937) 2023-01-31 09:45:19 +08:00
user Provide the ability to set password hash algorithm parameters (#22942) 2023-02-19 15:35:20 +08:00
webhook Support system hook API (#14537) 2023-01-28 19:12:10 +01:00
error.go
fixture_generation.go
fixture_test.go
main_test.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
migrate.go
migrate_test.go
org.go
org_team.go
org_team_test.go
org_test.go
repo.go Implement actions (#21937) 2023-01-31 09:45:19 +08:00
repo_collaboration.go
repo_collaboration_test.go Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
repo_test.go
repo_transfer.go
repo_transfer_test.go