0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-03 14:29:39 +01:00
gitea/routers/web/repo
wxiaoguang 6b33152b7d
Decouple the different contexts from each other (#24786)
Replace #16455

Close #21803

Mixing different Gitea contexts together causes some problems:

1. Unable to respond proper content when error occurs, eg: Web should
respond HTML while API should respond JSON
2. Unclear dependency, eg: it's unclear when Context is used in
APIContext, which fields should be initialized, which methods are
necessary.


To make things clear, this PR introduces a Base context, it only
provides basic Req/Resp/Data features.

This PR mainly moves code. There are still many legacy problems and
TODOs in code, leave unrelated changes to future PRs.
2023-05-21 09:50:53 +08:00
..
actions Implement actions artifacts (#22738) 2023-05-19 21:37:57 +08:00
setting
activity.go
attachment.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
blame.go
branch.go
cherry_pick.go
commit.go
compare.go
download.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
editor_test.go
editor.go
find.go
helper_test.go
helper.go
http_test.go
http.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
issue_content_history.go
issue_dependency.go
issue_label_test.go
issue_label.go
issue_lock.go
issue_stopwatch.go
issue_test.go
issue_timetrack.go
issue_watch.go
issue.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
lfs.go
main_test.go
middlewares.go
migrate.go Make repo migration cancelable and fix various bugs (#24605) 2023-05-11 08:25:46 +00:00
milestone.go
packages.go
patch.go
projects_test.go
projects.go
pull_review.go
pull.go Support for status check pattern (#24633) 2023-05-17 16:11:13 +08:00
release_test.go fix: release page for empty or non-existing target (#24470) 2023-05-10 11:43:55 +08:00
release.go fix: release page for empty or non-existing target (#24470) 2023-05-10 11:43:55 +08:00
render.go
repo.go Remove the parallelizing when loading repo for dashboard (#24705) 2023-05-14 21:45:47 +08:00
search.go
setting_protected_branch.go Support for status check pattern (#24633) 2023-05-17 16:11:13 +08:00
setting.go Refactor Pull Mirror and fix out-of-sync bugs (#24732) 2023-05-15 19:02:10 +00:00
settings_test.go
tag.go
topic.go
treelist.go
view_test.go
view.go
webhook.go Reenable creating default webhooks. (#24626) 2023-05-11 10:10:57 +08:00
wiki_test.go
wiki.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00