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:
+3
-3
@@ -685,11 +685,11 @@ def test_feed_guest_reply_disabled(page, app_server):
|
||||
assert card.locator(".post-card-comments [data-action='reply']").first.is_disabled()
|
||||
|
||||
|
||||
def test_feed_signals_topic(alice):
|
||||
def test_feed_politics_topic(alice):
|
||||
page, _ = alice
|
||||
page.goto(f"{BASE_URL}/feed", wait_until="domcontentloaded")
|
||||
signals_link = page.locator(".sidebar-nav a:has-text('Signals')")
|
||||
assert signals_link.is_visible()
|
||||
politics_link = page.locator(".sidebar-nav a:has-text('Politics')")
|
||||
assert politics_link.is_visible()
|
||||
|
||||
|
||||
def test_create_post_cancel_modal(alice):
|
||||
|
||||
+1
-1
@@ -337,7 +337,7 @@ def test_comment_create_scrolls_to_anchor(alice):
|
||||
|
||||
def test_post_across_all_topics(alice):
|
||||
page, _ = alice
|
||||
topics = ["devlog", "showcase", "question", "rant", "fun", "signals"]
|
||||
topics = ["devlog", "showcase", "question", "rant", "fun", "politics"]
|
||||
for topic in topics:
|
||||
create_post(page, topic, f"Topic test post for {topic}")
|
||||
badge = page.locator(f".badge-{topic}")
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -283,8 +283,8 @@ def test_run_as_uid_drives_pravda_env(env):
|
||||
env, name="runas", run_as_uid=env["user"]["uid"], autostart=False
|
||||
)
|
||||
pravda = api.pravda_env(inst)
|
||||
assert pravda["PRAVDA_API_KEY"] == key
|
||||
assert pravda["PRAVDA_USER_UID"] == env["user"]["uid"]
|
||||
assert pravda["DEVPLACE_API_KEY"] == key
|
||||
assert pravda["DEVPLACE_USER_UID"] == env["user"]["uid"]
|
||||
|
||||
|
||||
def test_run_as_uid_rejects_unknown_user(env):
|
||||
|
||||
Reference in New Issue
Block a user