|
|
Mads Kiilerich
|
05406c312342
|
5 years ago
|
|
pytype: add Python type annotations where necessary to guide pytype
Mute pytype warnings:
File "kallithea/lib/auth.py", line 142, in _cached_perms_data: No attribute 'DEFAULT_USER_ID' on module 'kallithea' [module-attr] File "kallithea/lib/vcs/backends/base.py", line 73, in ...: No attribute '...' on BaseRepository [attribute-error] File "kallithea/lib/vcs/backends/base.py", line 405, in ...: No attribute '...' on BaseChangeset [attribute-error] File "kallithea/tests/api/api_base.py", line 2397, in test_api_get_changeset: No attribute 'TEST_REVISION' on _BaseTestApi [attribute-error] File "kallithea/tests/api/api_base.py", line 2445, in test_api_get_pullrequest: No attribute 'TEST_PR_DST' on _BaseTestApi [attribute-error] File "kallithea/tests/api/api_base.py", line 2445, in test_api_get_pullrequest: No attribute 'TEST_PR_SRC' on _BaseTestApi [attribute-error] File "kallithea/tests/api/api_base.py", line 2467, in test_api_get_pullrequest: No attribute 'TEST_PR_REVISIONS' on _BaseTestApi [attribute-error] File "kallithea/tests/api/api_base.py", line 67, in api_call: No attribute 'app' on _BaseTestApi [attribute-error] File "kallithea/tests/base.py", line 154, in log_user: No attribute 'app' on TestController [attribute-error] File "kallithea/tests/base.py", line 169, in _get_logged_user: No attribute '_logged_username' on TestController [attribute-error]
|
|
|
Mads Kiilerich
|
aafca212c8e2
|
5 years ago
|
|
celery: move send_email task to a better home in notification model
Avoid bundling everything from many different layers in one big task library.
This is more feasible now when we don't need kallithea.CELERY_APP set at import time.
|
|
|
Mads Kiilerich
|
1d3b67443aac
|
5 years ago
|
|
celery: move repo create tasks to repo model - that's where it belongs
Avoid bundling everything from many different layers in one big task library.
This is more feasible now when we don't need kallithea.CELERY_APP set at import time.
The whole thing about model classes and instantiation is just trouble - we will get rid of that soon.
|
|
|
Mads Kiilerich
|
1f92cded1bd2
|
5 years ago
|
|
celery: move Whoosh indexing task to whoosh library where it belongs
Avoid bundling everything from many different layers in one big task library.
This is more feasible now when we don't need kallithea.CELERY_APP set at import time.
|
|
|
Mads Kiilerich
|
c76638100ca0
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
4a18e6bf6b87
|
5 years ago
|
|
model: simplify how get_commits_stats task group on author
Avoid using the caching h.person . We want to get rid of the model dependency on helpers.
The stats are persisted, and any temporary incorrectness in the long term cached h.person will thus remain forever. It is thus arguably better to avoid using it in this place.
get_commits_stats is also a long running task, so speed is not *that* critical. And generally, processing commits in order will have a lot of the same committers, so a local cache will have a good hit rate.
(Alternatively, h.person could perhaps be in user model ... but that's not how it is now.)
|
|
|
Mads Kiilerich
|
a36a8804e7be
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
4f0de9468da3
|
5 years ago
|
|
controllers: move controllers base class from lib/base to controllers
TG quickstart put it in lib/base.py , but it fits better on the controllers layer as a base there.
The contributing docs were a bit ahead of time ... but with a typo.
|
|
|
Mads Kiilerich
|
341e4bb9e227
|
5 years ago
|
|
|
|
|
Mads Kiilerich
|
52816813cbec
|
5 years ago
|
|
docs: describe, visualize, and verify internal code structure and layering
Try to describe something that isn't entirely there yet.
deps.py will help track and minimize violations through checks and visualization in deps.svg .
|