: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
chore(commands): rename the github_commands product to commands (#116831)
Julian Bezd0ebb94f1fb7
diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.ymlindex 80f10e4c3ef9..cbb29236d2ca 100644--- a/.github/workflows/ci-python.yml+++ b/.github/workflows/ci-python.yml@@ -136,8 +136,8 @@ jobs:- 'packages/agent/packages/agent-contracts/src/model-catalog.generated.ts'- 'services/mcp/src/lib/oauth-scopes.generated.ts'- 'frontend/src/lib/oauthScopes.generated.ts'- - 'products/github_commands/commands.generated.json'- - 'products/github_commands/COMMANDS.generated.md'+ - 'products/commands/commands.generated.json'+ - 'products/commands/COMMANDS.generated.md'# hogli CLI changes need validation- 'tools/hogli/**'- 'tools/hogli-commands/hogli_commands/**'diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 7fed4cef3536..7217a9fe571b 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -2918,6 +2918,8 @@ importers:specifier: 'catalog:'version: 0.2.4([email protected](patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5)([email protected]))+ products/commands: {}+products/context_layer: {}products/conversations:@@ -3792,8 +3794,6 @@ importers:specifier: ^14.3.1- products/github_commands: {}-products/groups:dependencies:'@posthog/icons':diff --git a/posthog/ingress/README.md b/posthog/ingress/README.mdindex f00b42b9062f..a5c36564fa3e 100644--- a/posthog/ingress/README.md+++ b/posthog/ingress/README.md@@ -65,20 +65,20 @@ Three duties fall on the incarnation rather than on `BearerJwt`, and none is enf## Endpoints-| Provider | Path | App | Consumers | Product code |-| ------------ | ------------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |-| `github` | `/webhooks/github`, `/webhooks/github/pr` | `posthog` | `installation_lifecycle`, `installation_repositories` (core), `conversations`, `error_tracking_external_references`, `github_commands`, `loops`, `review_hog_authored_prs`, `tasks_pr_backstop`, `tasks_pr_review`, `workflows` | `products/{tasks,conversations,error_tracking,github_commands,review_hog,workflows}/backend/webhook_consumers.py` |-| `github` | `/webhooks/stamphog/github` | `stamphog` | `stamphog_review` | `products/stamphog/backend/webhook_consumers.py` |-| `slack` | `/api/conversations/v1/slack/events` | `supporthog` | `conversations_slack` | `products/conversations/backend/webhook_consumers.py` |-| `slack` | `/api/conversations/v1/slack/interactivity` | `supporthog_interactivity` | `conversations_slack_interactivity` | `products/conversations/backend/webhook_consumers.py` |-| `teams` | `/api/conversations/v1/teams/events` | `supporthog` | `conversations_teams` | `products/conversations/backend/webhook_consumers.py` |-| `pandadoc` | `/api/legal_documents/pandadoc` | `default` | `legal_documents_signatures` | `products/legal_documents/backend/webhook_consumers.py` |-| `mailgun` | `/api/conversations/v1/email/inbound` | `inbound` | `conversations_email_inbound` | `products/conversations/backend/webhook_consumers.py` |-| `mailgun` | `/api/conversations/v1/email/outbound` | `outbound` | `conversations_email_outbound` | `products/conversations/backend/webhook_consumers.py` |-| `mailgun` | `/api/conversations/v1/email/capture` | `capture` | `conversations_email_capture` | `products/conversations/backend/webhook_consumers.py` |-| `sns` | `/webhooks/workflows/ses-events` | `default` | `workflows_ses_events` | `products/workflows/backend/webhook_consumers.py` |-| `customerio` | `/api/projects/<team_id>/messaging/customerio/webhook/` | none | none, it is the DRF adapter path | `products/messaging/backend/api/customerio_webhook.py` |-| `vercel` | `/webhooks/vercel` | `marketplace` | `vercel_marketplace` | `ee/api/vercel/webhook_consumers.py` |+| Provider | Path | App | Consumers | Product code |+| ------------ | ------------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |+| `github` | `/webhooks/github`, `/webhooks/github/pr` | `posthog` | `installation_lifecycle`, `installation_repositories` (core), `commands`, `conversations`, `error_tracking_external_references`, `loops`, `review_hog_authored_prs`, `tasks_pr_backstop`, `tasks_pr_review`, `workflows` | `products/{commands,conversations,error_tracking,review_hog,tasks,workflows}/backend/webhook_consumers.py` |+| `github` | `/webhooks/stamphog/github` | `stamphog` | `stamphog_review` | `products/stamphog/backend/webhook_consumers.py` |+| `slack` | `/api/conversations/v1/slack/events` | `supporthog` | `conversations_slack` | `products/conversations/backend/webhook_consumers.py` |+| `slack` | `/api/conversations/v1/slack/interactivity` | `supporthog_interactivity` | `conversations_slack_interactivity` | `products/conversations/backend/webhook_consumers.py` |+| `teams` | `/api/conversations/v1/teams/events` | `supporthog` | `conversations_teams` | `products/conversations/backend/webhook_consumers.py` |+| `pandadoc` | `/api/legal_documents/pandadoc` | `default` | `legal_documents_signatures` | `products/legal_documents/backend/webhook_consumers.py` |+| `mailgun` | `/api/conversations/v1/email/inbound` | `inbound` | `conversations_email_inbound` | `products/conversations/backend/webhook_consumers.py` |+| `mailgun` | `/api/conversations/v1/email/outbound` | `outbound` | `conversations_email_outbound` | `products/conversations/backend/webhook_consumers.py` |+| `mailgun` | `/api/conversations/v1/email/capture` | `capture` | `conversations_email_capture` | `products/conversations/backend/webhook_consumers.py` |+| `sns` | `/webhooks/workflows/ses-events` | `default` | `workflows_ses_events` | `products/workflows/backend/webhook_consumers.py` |+| `customerio` | `/api/projects/<team_id>/messaging/customerio/webhook/` | none | none, it is the DRF adapter path | `products/messaging/backend/api/customerio_webhook.py` |+| `vercel` | `/webhooks/vercel` | `marketplace` | `vercel_marketplace` | `ee/api/vercel/webhook_consumers.py` |The owner of the third-party App registration owns the route.The customer-facing GitHub App is shared across products, so its two endpoints are declared in `posthog/urls.py`.diff --git a/posthog/ingress/github/README.md b/posthog/ingress/github/README.mdindex ea8c064f56d0..b5a6c7e0aa11 100644--- a/posthog/ingress/github/README.md+++ b/posthog/ingress/github/README.md@@ -44,7 +44,7 @@ See [Regional forwarding](../README.md#regional-forwarding) for the lane the pro## Consumers- `posthog/ingress/github/provider.py` registers `installation_lifecycle` and `installation_repositories` on the `posthog` app.-- `products/{tasks,conversations,error_tracking,github_commands,review_hog,workflows}/backend/webhook_consumers.py` register the product consumers on the `posthog` app.+- `products/{commands,conversations,error_tracking,review_hog,tasks,workflows}/backend/webhook_consumers.py` register the product consumers on the `posthog` app.- `products/stamphog/backend/webhook_consumers.py` registers `stamphog_review` on the `stamphog` app.The Error Tracking consumer handles opened and edited issues and pull requests from repository owners, members, and collaborators.@@ -52,9 +52,9 @@ It scans descriptions for direct issue links and fingerprint permalinks on the cRepeated links and deliveries reuse an existing reference.Removing a link from a later description does not remove the reference.-The GitHub commands consumer reads `@posthog <command>` lines in new pull request comments from repository owners, members and collaborators, and queues one task per command.+The commands consumer reads `@posthog <command>` lines in new pull request comments from repository owners, members and collaborators, and queues one task per command.The task checks the commenter's write access with GitHub and their linked PostHog account before any command runs.-See `products/github_commands/README.md`.+See `products/commands/README.md`.### Picking the projectdiff --git a/posthog/settings/web.py b/posthog/settings/web.pyindex 1a9431ad0cb8..42c00071d6b8 100644--- a/posthog/settings/web.py+++ b/posthog/settings/web.py@@ -99,7 +99,7 @@ PRODUCTS_APPS = ["products.platform_features.backend.apps.PlatformFeaturesConfig","products.streamlit_apps.backend.apps.StreamlitAppsConfig","products.legal_documents.backend.apps.LegalDocumentsConfig",- "products.github_commands.backend.apps.GithubCommandsConfig",+ "products.commands.backend.apps.CommandsConfig","products.access_control.backend.apps.AccessControlConfig","products.warehouse_sources_queue.backend.apps.WarehouseSourcesQueueConfig","products.business_knowledge.backend.apps.BusinessKnowledgeConfig",diff --git a/products/github_commands/COMMANDS.generated.md b/products/commands/COMMANDS.generated.mdsimilarity index 100%rename from products/github_commands/COMMANDS.generated.mdrename to products/commands/COMMANDS.generated.mddiff --git a/products/github_commands/README.md b/products/commands/README.mdsimilarity index 97%rename from products/github_commands/README.mdrename to products/commands/README.mdindex 74d3716b56c2..be5f3e7c4421 100644--- a/products/github_commands/README.md+++ b/products/commands/README.md@@ -1,4 +1,4 @@-# GitHub commands+# CommandsPeople with write access to a repository can ask PostHog to do something on a pull request by commenting a command on it:@@ -29,7 +29,7 @@ Both are generated from `backend/logic/schema.py`, like the `@posthog help` repl## How a comment becomes a command-1. `backend/webhook_consumers.py` registers the `github_commands` consumer for `issue_comment` on the customer-facing GitHub App endpoint.+1. `backend/webhook_consumers.py` registers the `commands` consumer for `issue_comment` on the customer-facing GitHub App endpoint.2. `logic/intake.py` reads the payload inside the webhook request, with no database and no API call. It drops everything that is not a new command comment and queues a task for the rest. `logic/parsing.py` finds the command: the CommonMark reference parser gives the comment's block structure, and a command fires only from a top-level paragraph.3. `logic/dispatch.py` runs in the task. It applies every check (listed in its module docstring), then calls the command's handler.4. `logic/handlers.py` calls the target product's facade and returns the text of the reply.diff --git a/products/github_commands/__init__.py b/products/commands/__init__.pysimilarity index 100%rename from products/github_commands/__init__.pyrename to products/commands/__init__.pydiff --git a/products/github_commands/backend/__init__.py b/products/commands/backend/__init__.pysimilarity index 100%rename from products/github_commands/backend/__init__.pyrename to products/commands/backend/__init__.pydiff --git a/products/commands/backend/apps.py b/products/commands/backend/apps.pynew file mode 100644index 000000000000..166ccb3f0c22--- /dev/null+++ b/products/commands/backend/apps.py@@ -0,0 +1,8 @@+"""Django app configuration for commands."""++from django.apps import AppConfig+++class CommandsConfig(AppConfig):+ name = "products.commands.backend"+ label = "commands"diff --git a/products/github_commands/backend/commands_projection.py b/products/commands/backend/commands_projection.pysimilarity index 76%rename from products/github_commands/backend/commands_projection.pyrename to products/commands/backend/commands_projection.pyindex 5983ae6071f5..4f4224d1ee9c 100644--- a/products/github_commands/backend/commands_projection.py+++ b/products/commands/backend/commands_projection.py@@ -10,10 +10,10 @@ Registered in `tools/hogli-commands/hogli_commands/projections.py`; runimport json-from products.github_commands.backend.logic.schema import help_table, signature+from products.commands.backend.logic.schema import help_table, signature-JSON_OUTPUT = "products/github_commands/commands.generated.json"-MARKDOWN_OUTPUT = "products/github_commands/COMMANDS.generated.md"+JSON_OUTPUT = "products/commands/commands.generated.json"+MARKDOWN_OUTPUT = "products/commands/COMMANDS.generated.md"def render() -> dict[str, str]:diff --git a/products/github_commands/backend/facade/__init__.py b/products/commands/backend/facade/__init__.pysimilarity index 100%rename from products/github_commands/backend/facade/__init__.pyrename to products/commands/backend/facade/__init__.pydiff --git a/products/github_commands/backend/facade/api.py b/products/commands/backend/facade/api.pysimilarity index 98%rename from products/github_commands/backend/facade/api.pyrename to products/commands/backend/facade/api.pyindex f8abeb9ac83a..aac1a778f342 100644--- a/products/github_commands/backend/facade/api.py+++ b/products/commands/backend/facade/api.py@@ -1,4 +1,4 @@-"""Facade for github_commands.+"""Facade for commands.The ONLY module other products and core may import. It stays cheap to import, because the webhookconsumer calls it inside the request for every comment on every pull request.diff --git a/products/github_commands/backend/facade/contracts.py b/products/commands/backend/facade/contracts.pysimilarity index 78%rename from products/github_commands/backend/facade/contracts.pyrename to products/commands/backend/facade/contracts.pyindex 366416b0a7ee..362011b2881c 100644--- a/products/github_commands/backend/facade/contracts.py+++ b/products/commands/backend/facade/contracts.py@@ -1,4 +1,4 @@-"""Contract types for github_commands.+"""Contract types for commands.The product exposes no data to other products yet: its only cross-product surface is the webhookconsumer's entry point in ``api.py``.diff --git a/products/commands/backend/logic/__init__.py b/products/commands/backend/logic/__init__.pynew file mode 100644index 000000000000..0288eba4278e--- /dev/null+++ b/products/commands/backend/logic/__init__.py@@ -0,0 +1 @@+"""Business logic for commands."""diff --git a/products/github_commands/backend/logic/commands.py b/products/commands/backend/logic/commands.pysimilarity index 100%rename from products/github_commands/backend/logic/commands.pyrename to products/commands/backend/logic/commands.pydiff --git a/products/github_commands/backend/logic/dispatch.py b/products/commands/backend/logic/dispatch.pysimilarity index 98%rename from products/github_commands/backend/logic/dispatch.pyrename to products/commands/backend/logic/dispatch.pyindex 278e35efdfbb..8bc033ef144e 100644--- a/products/github_commands/backend/logic/dispatch.py+++ b/products/commands/backend/logic/dispatch.py@@ -82,8 +82,8 @@ DispatchOutcome = Literal["failed",]-GITHUB_COMMANDS_TOTAL = Counter(- "posthog_github_commands_total",+COMMANDS_TOTAL = Counter(+ "posthog_commands_total","Pull request comment commands, by command and what dispatch did with them",labelnames=["verb", "outcome"],)@@ -96,7 +96,7 @@ def dispatch_comment_command(request: CommentCommandRequest, *, github: CommandG# Unknown verbs share one label value, so a comment cannot mint a metric series. Aliases count# under their canonical verb.verb_label = spec.declaration.verb if spec else (HELP_VERB if request.verb == HELP_VERB else "unknown")- GITHUB_COMMANDS_TOTAL.labels(verb=verb_label, outcome=outcome).inc()+ COMMANDS_TOTAL.labels(verb=verb_label, outcome=outcome).inc()logger.info("github_command_dispatched",verb=verb_label,@@ -276,7 +276,7 @@ def _reply_body(request: CommentCommandRequest, message: str) -> str:def _claim_key(comment_id: int) -> str:- return f"github_commands:comment:{comment_id}"+ return f"commands:github_comment:{comment_id}"def _claim_comment(comment_id: int) -> DispatchOutcome | None:@@ -299,7 +299,7 @@ def _release_comment(comment_id: int) -> None:def _within_rate_limit(github_user_id: int) -> bool:- decision = consume(f"github_commands:commenter:{github_user_id}", _COMMENTER_BUDGET)+ decision = consume(f"commands:github_commenter:{github_user_id}", _COMMENTER_BUDGET)# Fail open when Redis can't answer, like the other per-caller buckets.return not isinstance(decision, BucketDecision) or decision.alloweddiff --git a/products/github_commands/backend/logic/github.py b/products/commands/backend/logic/github.pysimilarity index 99%rename from products/github_commands/backend/logic/github.pyrename to products/commands/backend/logic/github.pyindex f24000ef6c21..3c611eff21fb 100644--- a/products/github_commands/backend/logic/github.py+++ b/products/commands/backend/logic/github.py@@ -22,7 +22,7 @@ logger = structlog.get_logger(__name__)Reaction = Literal["eyes", "rocket"]-_SOURCE = "github_commands"+_SOURCE = "commands"# The branch name goes into an agent prompt and a loop payload, so only a plain identifier passes._BRANCH_NAME_RE = re.compile(r"[A-Za-z0-9._/-]{1,255}")diff --git a/products/github_commands/backend/logic/handlers.py b/products/commands/backend/logic/handlers.pysimilarity index 100%rename from products/github_commands/backend/logic/handlers.pyrename to products/commands/backend/logic/handlers.pydiff --git a/products/github_commands/backend/logic/identity.py b/products/commands/backend/logic/identity.pysimilarity index 100%rename from products/github_commands/backend/logic/identity.pyrename to products/commands/backend/logic/identity.pydiff --git a/products/github_commands/backend/logic/intake.py b/products/commands/backend/logic/intake.pysimilarity index 100%rename from products/github_commands/backend/logic/intake.pyrename to products/commands/backend/logic/intake.pydiff --git a/products/github_commands/backend/logic/parsing.py b/products/commands/backend/logic/parsing.pysimilarity index 100%rename from products/github_commands/backend/logic/parsing.pyrename to products/commands/backend/logic/parsing.pydiff --git a/products/github_commands/backend/logic/registry.py b/products/commands/backend/logic/registry.pysimilarity index 100%rename from products/github_commands/backend/logic/registry.pyrename to products/commands/backend/logic/registry.pydiff --git a/products/github_commands/backend/logic/schema.py b/products/commands/backend/logic/schema.pysimilarity index 100%rename from products/github_commands/backend/logic/schema.pyrename to products/commands/backend/logic/schema.pydiff --git a/products/github_commands/backend/tasks/__init__.py b/products/commands/backend/tasks/__init__.pysimilarity index 62%rename from products/github_commands/backend/tasks/__init__.pyrename to products/commands/backend/tasks/__init__.pyindex cbb522dada10..c9ff24d75841 100644--- a/products/github_commands/backend/tasks/__init__.py+++ b/products/commands/backend/tasks/__init__.py@@ -1,7 +1,7 @@-"""GitHub commands Celery tasks.+"""Commands Celery tasks.Import the task-defining submodules here so Celery's ``autodiscover_tasks`` (which imports theapp's ``tasks`` package) registers every ``@shared_task`` on workers."""-from products.github_commands.backend.tasks import tasks # noqa: F401+from products.commands.backend.tasks import tasks # noqa: F401diff --git a/products/github_commands/backend/tasks/tasks.py b/products/commands/backend/tasks/tasks.pysimilarity index 96%rename from products/github_commands/backend/tasks/tasks.pyrename to products/commands/backend/tasks/tasks.pyindex c37c0e2e91b8..9826b0a44484 100644--- a/products/github_commands/backend/tasks/tasks.py+++ b/products/commands/backend/tasks/tasks.py@@ -1,4 +1,4 @@-"""Celery tasks for github_commands."""+"""Celery tasks for commands."""from celery import shared_taskdiff --git a/products/github_commands/backend/tests/__init__.py b/products/commands/backend/tests/__init__.pysimilarity index 100%rename from products/github_commands/backend/tests/__init__.pyrename to products/commands/backend/tests/__init__.pydiff --git a/products/github_commands/backend/tests/conftest.py b/products/commands/backend/tests/conftest.pysimilarity index 100%rename from products/github_commands/backend/tests/conftest.pyrename to products/commands/backend/tests/conftest.pydiff --git a/products/github_commands/backend/tests/test_dispatch.py b/products/commands/backend/tests/test_dispatch.pysimilarity index 92%rename from products/github_commands/backend/tests/test_dispatch.pyrename to products/commands/backend/tests/test_dispatch.pyindex 1baad53940c1..1747a6b74164 100644--- a/products/github_commands/backend/tests/test_dispatch.py+++ b/products/commands/backend/tests/test_dispatch.py@@ -26,12 +26,12 @@ from posthog.models.user_integration import UserIntegrationfrom posthog.token_bucket import BucketDecisionfrom products.access_control.backend.facade.testing import create_access_control-from products.github_commands.backend.logic.commands import CommandContext, ProjectMember, PullRequestFacts-from products.github_commands.backend.logic.dispatch import dispatch_comment_command-from products.github_commands.backend.logic.github import InstallationGitHub, Reaction, UnsupportedPullRequest-from products.github_commands.backend.logic.handlers import handle_loop, handle_qa, handle_review-from products.github_commands.backend.logic.intake import CommentCommandRequest-from products.github_commands.backend.logic.schema import LoopArgs, QaArgs, ReviewArgs+from products.commands.backend.logic.commands import CommandContext, ProjectMember, PullRequestFacts+from products.commands.backend.logic.dispatch import dispatch_comment_command+from products.commands.backend.logic.github import InstallationGitHub, Reaction, UnsupportedPullRequest+from products.commands.backend.logic.handlers import handle_loop, handle_qa, handle_review+from products.commands.backend.logic.intake import CommentCommandRequest+from products.commands.backend.logic.schema import LoopArgs, QaArgs, ReviewArgsfrom products.review_hog.backend.facade.reviews import (RUN_MODE_FLASH,RUN_MODE_REVIEW,@@ -43,16 +43,16 @@ from products.tasks.backend.facade.access import DesktopAccessDecisionINSTALLATION_ID = "31337"REPOSITORY = "acme/widgets"-FLAG = "products.github_commands.backend.logic.dispatch.posthog_feature_flag_enabled"-REQUEST_STAMPHOG_REVIEW = "products.github_commands.backend.logic.handlers.stamphog_requests.request_review"-DESKTOP_ACCESS = "products.github_commands.backend.logic.handlers.tasks_access.get_desktop_access_decision"-CREATE_TASK = "products.github_commands.backend.logic.handlers.tasks_facade.create_and_run_task"-USAGE_LIMITED = "products.github_commands.backend.logic.handlers.tasks_usage.task_run_usage_limited"-REQUEST_PR_REVIEW = "products.github_commands.backend.logic.handlers.review_hog_facade.request_pr_review"-OWNING_TEAM_ID = "products.github_commands.backend.logic.handlers.review_hog_github.owning_team_id"-CLAIM_CACHE = "products.github_commands.backend.logic.dispatch.cache"-CONSUME_BUDGET = "products.github_commands.backend.logic.dispatch.consume"-RUN_COMMENT_COMMAND = "products.github_commands.backend.tasks.tasks.run_comment_command.delay"+FLAG = "products.commands.backend.logic.dispatch.posthog_feature_flag_enabled"+REQUEST_STAMPHOG_REVIEW = "products.commands.backend.logic.handlers.stamphog_requests.request_review"+DESKTOP_ACCESS = "products.commands.backend.logic.handlers.tasks_access.get_desktop_access_decision"+CREATE_TASK = "products.commands.backend.logic.handlers.tasks_facade.create_and_run_task"+USAGE_LIMITED = "products.commands.backend.logic.handlers.tasks_usage.task_run_usage_limited"+REQUEST_PR_REVIEW = "products.commands.backend.logic.handlers.review_hog_facade.request_pr_review"+OWNING_TEAM_ID = "products.commands.backend.logic.handlers.review_hog_github.owning_team_id"+CLAIM_CACHE = "products.commands.backend.logic.dispatch.cache"+CONSUME_BUDGET = "products.commands.backend.logic.dispatch.consume"+RUN_COMMENT_COMMAND = "products.commands.backend.tasks.tasks.run_comment_command.delay"# Each test gets its own commenter, so the per-commenter rate limit in Redis never carries over._github_ids = count(10_000)@@ -189,7 +189,7 @@ class TestDispatchCommentCommand(BaseTest):github = FakeGitHub()with (- patch("products.github_commands.backend.logic.identity.access_refused", return_value=True),+ patch("products.commands.backend.logic.identity.access_refused", return_value=True),patch(REQUEST_STAMPHOG_REVIEW) as request_review,):outcome = dispatch_comment_command(self._request(), github=github)@@ -233,7 +233,7 @@ class TestDispatchCommentCommand(BaseTest):with (patch(- "products.github_commands.backend.logic.identity.access_refused",+ "products.commands.backend.logic.identity.access_refused",side_effect=lambda subject, *_args, **_kwargs: second_refused and subject.email == second_user.email,),patch(OWNING_TEAM_ID, return_value=owner_team.id),diff --git a/products/github_commands/backend/tests/test_intake.py b/products/commands/backend/tests/test_intake.pysimilarity index 97%rename from products/github_commands/backend/tests/test_intake.pyrename to products/commands/backend/tests/test_intake.pyindex 41f193420d72..f382f20ed0f7 100644--- a/products/github_commands/backend/tests/test_intake.py+++ b/products/commands/backend/tests/test_intake.py@@ -3,8 +3,8 @@ from typing import Anyimport pytest-from products.github_commands.backend.logic.intake import CommentCommandRequest, Dropped, read_comment_command-from products.github_commands.backend.logic.parsing import (+from products.commands.backend.logic.intake import CommentCommandRequest, Dropped, read_comment_command+from products.commands.backend.logic.parsing import (MAX_ARGUMENT_LENGTH,MAX_BODY_LENGTH,AmbiguousCommand,diff --git a/products/github_commands/backend/tests/test_schema.py b/products/commands/backend/tests/test_schema.pysimilarity index 98%rename from products/github_commands/backend/tests/test_schema.pyrename to products/commands/backend/tests/test_schema.pyindex 22c1018ea920..f0cbc53ed2bf 100644--- a/products/github_commands/backend/tests/test_schema.py+++ b/products/commands/backend/tests/test_schema.py@@ -4,7 +4,7 @@ import pytestfrom posthog.dataclasses import frozen-from products.github_commands.backend.logic.schema import (+from products.commands.backend.logic.schema import (COMMAND_DECLARATIONS,HELP,LOOP,diff --git a/products/github_commands/backend/webhook_consumers.py b/products/commands/backend/webhook_consumers.pysimilarity index 73%rename from products/github_commands/backend/webhook_consumers.pyrename to products/commands/backend/webhook_consumers.pyindex 5e9d636e9880..facb8709c263 100644--- a/products/github_commands/backend/webhook_consumers.py+++ b/products/commands/backend/webhook_consumers.py@@ -1,4 +1,4 @@-"""GitHub commands' consumer on the customer-facing GitHub App endpoint.+"""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 thefacade import, and the facade defers the task import until a comment holds a command.@@ -8,14 +8,14 @@ from posthog.ingress.contracts import WebhookConsumer, WebhookDeliverydef _accept_comment(delivery: WebhookDelivery) -> None:- from products.github_commands.backend.facade.api import accept_issue_comment # noqa: PLC0415+ from products.commands.backend.facade.api import accept_issue_comment # noqa: PLC0415accept_issue_comment(delivery.payload)WEBHOOK_CONSUMERS = (WebhookConsumer(- name="github_commands",+ name="commands",provider="github",app="posthog",event_types=frozenset({"issue_comment"}),diff --git a/products/github_commands/commands.generated.json b/products/commands/commands.generated.jsonsimilarity index 100%rename from products/github_commands/commands.generated.jsonrename to products/commands/commands.generated.jsondiff --git a/products/github_commands/manifest.tsx b/products/commands/manifest.tsxsimilarity index 83%rename from products/github_commands/manifest.tsxrename to products/commands/manifest.tsxindex 16c51be6de91..b531bdbaa8b5 100644--- a/products/github_commands/manifest.tsx+++ b/products/commands/manifest.tsx@@ -1,12 +1,12 @@/**- * Product manifest for github_commands.+ * Product manifest for commands.** The product has no frontend: it answers `@posthog` commands in GitHub pull request comments.*/import { ProductManifest } from '../../frontend/src/types'export const manifest: ProductManifest = {- name: 'GitHub commands',+ name: 'Commands',scenes: {},routes: {},redirects: {},diff --git a/products/github_commands/package.json b/products/commands/package.jsonsimilarity index 79%rename from products/github_commands/package.jsonrename to products/commands/package.jsonindex 48b4c523e348..6dd056cd2cc5 100644--- a/products/github_commands/package.json+++ b/products/commands/package.json@@ -1,5 +1,5 @@{- "name": "@posthog/products-github-commands",+ "name": "@posthog/products-commands","scripts": {"backend:test": "pytest -c ../../pytest.ini --rootdir ../.. backend/tests -v --tb=short","backend:contract-check": "echo 'Contract files unchanged'"diff --git a/products/github_commands/product.yaml b/products/commands/product.yamlsimilarity index 53%rename from products/github_commands/product.yamlrename to products/commands/product.yamlindex 9791255f1e7c..db11d5ff9fcf 100644--- a/products/github_commands/product.yaml+++ b/products/commands/product.yaml@@ -1,3 +1,3 @@-name: GitHub commands+name: Commandsowners:- team-devexdiff --git a/products/github_commands/tsconfig.json b/products/commands/tsconfig.jsonsimilarity index 100%rename from products/github_commands/tsconfig.jsonrename to products/commands/tsconfig.jsondiff --git a/products/github_commands/turbo.json b/products/commands/turbo.jsonsimilarity index 100%rename from products/github_commands/turbo.jsonrename to products/commands/turbo.jsondiff --git a/products/github_commands/backend/apps.py b/products/github_commands/backend/apps.pydeleted file mode 100644index 945749e2f7bb..000000000000--- a/products/github_commands/backend/apps.py+++ /dev/null@@ -1,8 +0,0 @@-"""Django app configuration for github_commands."""--from django.apps import AppConfig---class GithubCommandsConfig(AppConfig):- name = "products.github_commands.backend"- label = "github_commands"diff --git a/products/github_commands/backend/logic/__init__.py b/products/github_commands/backend/logic/__init__.pydeleted file mode 100644index 215c21ef2cbc..000000000000--- a/products/github_commands/backend/logic/__init__.py+++ /dev/null@@ -1 +0,0 @@-"""Business logic for github_commands."""diff --git a/products/review_hog/backend/label_reviews.py b/products/review_hog/backend/label_reviews.pyindex 45bccad1a96c..1ed457f1c40c 100644--- a/products/review_hog/backend/label_reviews.py+++ b/products/review_hog/backend/label_reviews.py@@ -49,8 +49,8 @@ BOT_LABEL_COMMENT = ("so the label was removed. Add the label yourself to start a review.")-# The rollout flag of `@posthog` pull request comments (products/github_commands). Read here by key,-# because github_commands already depends on this product.+# The rollout flag of `@posthog` pull request comments (products/commands). Read here by key,+# because the commands product already depends on this product.COMMENT_COMMANDS_FLAG = "github-commands"diff --git a/products/tasks/backend/temporal/babysit_pr/snapshot.py b/products/tasks/backend/temporal/babysit_pr/snapshot.pyindex cb46b2bdc032..15a963b521be 100644--- a/products/tasks/backend/temporal/babysit_pr/snapshot.py+++ b/products/tasks/backend/temporal/babysit_pr/snapshot.py@@ -9,7 +9,7 @@ BODY_EXCERPT_MAX_CHARS = 1500CONFLICT_KEY = "merge-conflict"-# `@posthog <command>` lines belong to the pull request comment dispatcher (products/github_commands),+# `@posthog <command>` lines belong to the pull request comment dispatcher (products/commands),# which also marks its replies. Neither is feedback for this loop, and acting on a command such as# `@posthog stamp` here would run it a second time._DISPATCHER_COMMAND_LINE_RE = re.compile(r"^ {0,3}@posthog(?![\w-])", re.IGNORECASE)diff --git a/tach.toml b/tach.tomlindex fbc41806039e..b01c05ec7d8c 100644--- a/tach.toml+++ b/tach.toml@@ -1734,7 +1734,7 @@ from = [][[modules]]-path = "products.github_commands"+path = "products.commands"# Facade-only (enforced by each product's [[interfaces]] block): pull request comment commands# dispatch into these products.depends_on = ["posthog", "products.review_hog", "products.security", "products.stamphog", "products.tasks"]@@ -1745,7 +1745,7 @@ expose = ["backend\\.facade.*",]from = [- "products.github_commands",+ "products.commands",][[modules]]diff --git a/tools/hogli-commands/hogli_commands/projections.py b/tools/hogli-commands/hogli_commands/projections.pyindex 175ad1adb0fb..fe250461a1a1 100644--- a/tools/hogli-commands/hogli_commands/projections.py+++ b/tools/hogli-commands/hogli_commands/projections.py@@ -93,15 +93,15 @@ PROJECTIONS: tuple[Projection, ...] = (),),Projection(- name="github-commands",- renderer="products/github_commands/backend/commands_projection.py",+ name="commands",+ renderer="products/commands/backend/commands_projection.py",inputs=(- "products/github_commands/backend/logic/schema.py",- "products/github_commands/backend/logic/parsing.py",+ "products/commands/backend/logic/schema.py",+ "products/commands/backend/logic/parsing.py",),outputs=(- "products/github_commands/commands.generated.json",- "products/github_commands/COMMANDS.generated.md",+ "products/commands/commands.generated.json",+ "products/commands/COMMANDS.generated.md",),),)