feat(22d): admin UI buttons (skip/force) + reduce catalog jitter 800→300ms #352
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#352
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/22d-catalog-ui-buttons-fast-jitter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up к PR #348 (который уже замержен): добавляет admin UI и ускоряет catalog scraper.
frontend/src/app/admin/scrape/page.tsx): новая секция "📦 Catalog-object (SSR)" с двумя кнопками:force=false(основной режим — пропускает уже сегодня обработанные)force=trueчерезconfirm()(нагружает весь snapshot)max_objects(default 300).backend/app/services/scrapers/domrf_catalog_object.py:193):jitter_sleep(800, 1500)→jitter_sleep(300, 700). Catalog-page менее sensitive чем kn-API, держала batch 300 без 429.Effect
Full sweep 1532 obj: ~50 мин → ~22 мин (jitter 1.15s avg → 0.5s avg, ~2.3× speedup).
Test plan
ruff checkcleantsc --noEmitдля изменённой страницы без ошибок (остальные TS errors в репо — pre-existing, не из этого PR)/admin/scrape, проверить что новая секция рендерится; нажать "Грузить (skip today)" с max_objects=3 → task ставится в очередь; нажать "Загрузить ВСЕ" → confirm → task ставится.force=Falseпри первой кнопке,force=Trueпри второй.UI (frontend/src/app/admin/scrape/page.tsx): Новая секция "Catalog-object (SSR)" на /admin/scrape с: - input max_objects (default 300) - кнопка "Грузить (skip today)" — POST с force=false (пропускает уже сегодня) - кнопка "⚡ Загрузить ВСЕ (force)" — POST с force=true (через confirm()) Backend (services/scrapers/domrf_catalog_object.py): jitter_sleep между запросами 800-1500ms → 300-700ms (~2.3x speedup). Catalog page менее sensitive чем kn-API; стабильно держала batch 300 без 429/WAF на bookkeeping тесте. Effect: full sweep 1532 obj ~50 min → ~22 min. Повторный запуск с skip-today вернёт 0 obj если всё уже сегодня обновлено.Deep Code Review — APPROVE
Status: APPROVE
Files: 2 (P2:
page.tsx, P1:domrf_catalog_object.py) · +143/-2Findings
Frontend (
frontend/src/app/admin/scrape/page.tsx)headers: { "X-Admin-Token": token }) — no auth bypass.disabled={!token || catalogTrigger.isPending}— UX guard от пустого токена и double-submit.confirm()text упоминаетforce=true, "Игнорирует skip-today", "нагрузка на DOM.РФ выше" — impact covered (можно было упомянуть ~22min sweep, но не блокирующее).task_idрендерится как React node ({catalogTrigger.data.task_id}) — XSS невозможен, nodangerouslySetInnerHTML.CatalogTriggerRespproperly typed, noany,catalogMaxObjects: number | ""с bounds min=1/max=2000.queryClient.invalidateQueriesдляscrape-runs+scrape-queue— корректно.Backend (
backend/app/services/scrapers/domrf_catalog_object.py)jitter_sleep(800, 1500)→(300, 700)+ docstring sync на line 415.(600, 1000)follow-up PR.Conventions
psycopg v3, httpx, TS strict, ruff line ≤100 — все OK.
Risk
Merging via deep-code-reviewer.