mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
Both are Django apps, and both pin `label` in apps.py — "stamp" and "review". django_migrations keys a row on (app_label, name), and app_label comes from that pin and not from the import path, so moving the directory does not orphan a single migration. All six stay where they are, untouched. products/stamphog -> products/stamp name = products.stamp.backend products/review_hog -> products/review name = products.review.backend StamphogScene/ -> StampScene/, and stamphogSceneLogic.ts with it 189 files follow. An earlier attempt at this move failed twice for reasons worth recording: `git mv A B` where B exists puts A INSIDE B, and a stray products/stamp/node_modules from an abandoned run was enough to make B exist — the app ended up nested two deep. And `git ls-files` does not list a file moved with plain mv and not yet staged, so a pass over "every tracked file" silently skips it; that is how StampScene.tsx kept importing ./stampSceneLogic after the file beside it had been renamed back. bin/check-imports-are-committed: all first-party imports across 15,843 files resolve. Co-authored-by: Hanzo Dev <[email protected]>
44 lines
1.8 KiB
Python
44 lines
1.8 KiB
Python
"""Facade re-export for the stamp Celery surface.
|
|
|
|
Core's central beat wiring (``insights/tasks/scheduled.py``) registers the daily digest fan-out
|
|
from here rather than reaching into the product's internals, and review's inbox trigger
|
|
queues the initial self-driving PR review from here. Lives apart from ``api.py`` so the task
|
|
modules' heavy imports (GitHub client, temporal client) stay off that module, which review's
|
|
settings serializer imports on every request.
|
|
"""
|
|
|
|
from products.stamp.backend.tasks.digest import send_daily_digests
|
|
from products.stamp.backend.tasks.schedules import DAILY_DIGEST_CRONTAB
|
|
from products.stamp.backend.tasks.tasks import process_inbox_pr_review
|
|
|
|
__all__ = ["DAILY_DIGEST_CRONTAB", "queue_inbox_pr_review", "send_daily_digests"]
|
|
|
|
|
|
def queue_inbox_pr_review(
|
|
*,
|
|
team_id: int,
|
|
pr_url: str,
|
|
repository: str,
|
|
acting_user_id: int,
|
|
signal_report_id: str,
|
|
task_run_id: str,
|
|
) -> None:
|
|
"""Queue the first hosted Stamp review of a self-driving inbox PR, without waiting for it.
|
|
|
|
Called by review's inbox trigger, which has already found an assigned reviewer with the
|
|
``stamp_review_inbox_prs`` toggle on. ``repository`` is the linked task's own repo, and the
|
|
PR must be in it, because the task-to-PR link this rides on (``TaskRun.output.pr_url``) is
|
|
writable through the task-run API. The Celery task does the rest: resolve a synced and enabled
|
|
repo config (no-op without one), fetch the PR, re-check that the App machine user authored it,
|
|
create the run with inbox provenance, start the workflow. That keeps GitHub and the product DB
|
|
off the caller's save path.
|
|
"""
|
|
process_inbox_pr_review.delay(
|
|
team_id=team_id,
|
|
pr_url=pr_url,
|
|
repository=repository,
|
|
acting_user_id=acting_user_id,
|
|
signal_report_id=signal_report_id,
|
|
task_run_id=task_run_id,
|
|
)
|