feat: add ISSLOP AI usage analysis CLI commands, game router, and politics topic

- Add `cmd_isslop_prune`, `cmd_isslop_clear`, `cmd_isslop_analyze` CLI commands for AI usage analysis job management
- Register `/game` router with `index` and `farm` endpoints for Code Farm idle game
- Add `politics` to allowed TOPICS constant replacing `signals`
- Introduce `ISSLOP_DIR`, `ISSLOP_WORKSPACES_DIR`, `ISSLOP_RUNS_DIR`, `ISSLOP_MEDIA_DIR` config paths
- Add `clear_user_stars` and `clear_user_projects_cache` calls on vote and project create/delete
- Update `make prod` to use `nproc` workers via `DEVPLACE_WEB_WORKERS` env var
- Convert `database.py` and `utils.py` to packages for modular structure
- Add `devplace apikey` and `devplace token` CLI subcommands for API key and access token management
This commit is contained in:
2026-07-06 03:57:47 +00:00
parent f1bdefd834
commit 9a8046ab2a
110 changed files with 1466 additions and 374 deletions
+27
View File
@@ -18,3 +18,30 @@ def test_game_legacy_form_rejects_empty_key():
def test_game_legacy_form_rejects_overlong_key():
with pytest.raises(ValidationError):
GameLegacyForm(key="x" * 41)
def test_isslop_run_form_accepts_git_and_http_sources():
from devplacepy.models import IsslopRunForm
assert IsslopRunForm(url="https://github.com/owner/repo").url == "https://github.com/owner/repo"
assert IsslopRunForm(url="git@github.com:owner/repo.git").url == "git@github.com:owner/repo.git"
assert IsslopRunForm(url=" https://example.com ").url == "https://example.com"
def test_isslop_run_form_rejects_other_schemes():
from devplacepy.models import IsslopRunForm
for bad in ("ftp://example.com/file", "javascript:alert(1)//aaa", "file:///etc/passwd"):
with pytest.raises(ValidationError):
IsslopRunForm(url=bad)
def test_isslop_run_form_normalizes_typos_and_bare_domains():
from devplacepy.models import IsslopRunForm
assert (
IsslopRunForm(url="https:/retoor.molodetz.nl/retoor/devplacepy").url
== "https://retoor.molodetz.nl/retoor/devplacepy"
)
assert IsslopRunForm(url="example.com/owner/repo").url == "https://example.com/owner/repo"
assert IsslopRunForm(url="http:/x.dev/a").url == "http://x.dev/a"