:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
"""The commands consumer on the customer-facing GitHub App endpoint.
The registry imports this module on the first delivery, so it stays cheap: the handler defers the
facade import, and the facade defers the task import until a comment holds a command.
"""
from posthog.ingress.contracts import WebhookConsumer, WebhookDelivery
def _accept_comment(delivery: WebhookDelivery) -> None:
from products.commands.backend.facade.api import accept_issue_comment # noqa: PLC0415
accept_issue_comment(delivery.payload)
WEBHOOK_CONSUMERS = (
WebhookConsumer(
name="commands",
provider="github",
app="posthog",
event_types=frozenset({"issue_comment"}),
handler=_accept_comment,
),
)