feat(22d): admin endpoint POST /admin/scrape/kn-catalog-objects #338
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#338
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/22d-catalog-objects-admin-endpoint"
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
Manual trigger endpoint для catalog-object scraper из PR #335. Без него ad-hoc запуск возможен только через
docker exec celery callна VPS.Pattern follows existing scrape triggers (
POST /kn,POST /pzz-sync,POST /ekburg-permits).max_objects=null→ берёт default из task (300).max_objects=3→ smoke-тест.Test plan
task_id)SELECT wall_type, energy_eff, ceiling_height_m FROM domrf_kn_objects WHERE catalog_scraped_at IS NOT NULL LIMIT 3returns dataFollow-up: PR #335 merged (catalog-object scraper). Migration 118 applied 21:29:52Z.
Deep Code Review — verdict APPROVE
Summary
backend/app/api/v1/admin_scrape.py)1e08cd0cPattern consistency
trigger_ekburg_permits(admin_scrape.py:1229) exactly:BaseModelbody,AdminTokenAuthdep, lazy import of task module,apply_asyncthen return{task_id, ..., queued_at: "now"}.AdminTokenAuthshared dependency (used in 20+ endpoints in same file) — auth check is centralized, not bypassed.Conventions
psycopg2, norequests, noprint, no hardcoded secrets — clean.intandint | NonewithField(ge=, le=)bounds — noEmailStr/HttpUrl/AnyUrl, so no risk of the email-validator dep crash that hit #330 (fixed in #337).::typeinjection vector.from app.workers.tasks.scrape_kn_catalog_objects import scrape_kn_catalog_objects— target module exists onmainfrom PR #335.Cross-file impact
backend/app/workers/tasks/scrape_kn_catalog_objects.pypresent onforgejo/main@7611287.region_code+ optionalmax_objectskwargs — signature matches handler kwargs build./kn-catalog-objectsdoes not collide with existing siblings (/kn,/pzz-sync,/ekburg-permits).Risk
X-Admin-Token.max_objectsbounded[1, 2000].region_codebounded[1, 99]. No DB writes from handler — only Celery enqueue.Merging.