Skip to content

: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.

chore(devex): lint url naming for api paths and app routes (#105024)

Julian Bez5f5fc40f15f4
diff --git a/.semgrep/rules/devex/url-naming.py b/.semgrep/rules/devex/url-naming.py
new file mode 100644
index 000000000000..7481f924d0c3
--- /dev/null
+++ b/.semgrep/rules/devex/url-naming.py
@@ -0,0 +1,74 @@
+# Test cases for the url-naming rules.
+# ruff: noqa
+
+
+class ExampleViewSet:
+ # ruleid: api-path-underscore
+ @action(methods=["POST"], detail=True, url_path="add-snapshots")
+ def add_snapshots(self, request, **kwargs): ...
+
+ # ruleid: api-path-underscore
+ @action(methods=["GET"], detail=False, url_path="channel-pages/(?P<channel_id>[^/.]+)")
+ def channel_pages(self, request, **kwargs): ...
+
+ # ruleid: api-path-underscore
+ @action(methods=["GET"], detail=False, url_path=r"(?P<run_id>[^/.]+)/check-result")
+ def check_result(self, request, **kwargs): ...
+
+ # ruleid: api-path-underscore
+ @decorators.action(methods=["GET"], detail=False, url_path="sso-callback")
+ def sso_callback(self, request, **kwargs): ...
+
+ # ok: api-path-underscore
+ @action(methods=["POST"], detail=True, url_path="add_snapshots")
+ def add_snapshots_ok(self, request, **kwargs): ...
+
+ # A hyphen inside a regex character class is not a literal segment.
+ # ok: api-path-underscore
+ @action(methods=["GET"], detail=False, url_path=r"api/v1/(?P<path>[A-Za-z0-9_./-]+)")
+ def proxy(self, request, **kwargs): ...
+
+ # ok: api-path-underscore
+ @action(methods=["GET"], detail=False)
+ def bulk_state(self, request, **kwargs): ...
+
+ # nosemgrep: api-path-underscore
+ @action(methods=["POST"], detail=True, url_path="cancel-deletion")
+ def cancel_deletion(self, request, **kwargs): ...
+
+ def list(self, request, **kwargs):
+ # ruleid: api-query-param-underscore
+ request.query_params.get("date-from")
+ # ruleid: api-query-param-underscore
+ request.GET.get("no-cache", False)
+ # ruleid: api-query-param-underscore
+ request.query_params["date-to"]
+ # ruleid: api-query-param-underscore
+ request.query_params.getlist("event-names")
+ # ruleid: api-query-param-underscore
+ request.GET.getlist("event-names")
+ # ok: api-query-param-underscore
+ request.query_params.get("date_from")
+ # ok: api-query-param-underscore
+ request.headers.get("X-Request-Id")
+
+
+# ruleid: api-query-param-underscore
+OpenApiParameter("date-from", OpenApiTypes.STR)
+# ruleid: api-query-param-underscore
+OpenApiParameter(name="date-to", type=OpenApiTypes.STR)
+# ok: api-query-param-underscore
+OpenApiParameter(name="date_to", type=OpenApiTypes.STR)
+# ok: api-query-param-underscore
+OpenApiParameter(name="X-Request-Id", type=OpenApiTypes.STR, location=OpenApiParameter.HEADER)
+# ok: api-query-param-underscore
+OpenApiParameter("X-Request-Id", str, OpenApiParameter.HEADER)
+
+
+def register_routes(routers):
+ # ruleid: api-path-underscore
+ routers.environments.register(r"sandbox-pricing", SandboxPricingViewSet, "sandbox_pricing")
+ # ruleid: api-path-underscore
+ routers.projects.register(r"error_tracking/git-provider-file-links", LinksViewSet, "links")
+ # ok: api-path-underscore
+ routers.projects.register(r"error_tracking/symbol_sets", SymbolSetViewSet, "symbol_sets")
diff --git a/.semgrep/rules/devex/url-naming.test.ts b/.semgrep/rules/devex/url-naming.test.ts
new file mode 100644
index 000000000000..760177dc6655
--- /dev/null
+++ b/.semgrep/rules/devex/url-naming.test.ts
@@ -0,0 +1,51 @@
+// @ts-nocheck
+// Test cases for the url-naming rules. Semgrep ignores `paths:` in test mode, so the urls.ts rule
+// also sees the manifest-shaped lines here.
+
+export const manifest = {
+ routes: {
+ // ruleid: frontend-route-hyphen, frontend-url-hyphen
+ '/visual_review': ['VisualReviewIndex', 'visualReviewIndex'],
+ // ruleid: frontend-route-hyphen, frontend-url-hyphen
+ '/visual-review/repos/:repoId/snapshot_overview': ['VisualReviewSnapshotOverview', 'overview'],
+ // ok: frontend-route-hyphen
+ '/visual-review/repos/:repo_id/runs': ['VisualReviewRuns', 'visualReviewRepoRuns'],
+ // ok: frontend-route-hyphen
+ '/data-management/*': ['DataManagement', 'dataManagement'],
+ },
+ redirects: {
+ // A redirect keeps an old path alive on purpose, so only the generic urls.ts rule fires here.
+ // ruleid: frontend-url-hyphen
+ '/user_interviews': '/user-research',
+ },
+}
+
+export const urls = {
+ // ruleid: frontend-url-hyphen
+ deadLetterQueue: (): string => '/instance/dead_letter_queue',
+ // ruleid: frontend-url-hyphen
+ productTour: (id: string): string => `/product_tours/${id}`,
+ // ruleid: frontend-url-hyphen
+ login2FASetup: (): string => '/login/2fa_setup',
+ // ruleid: frontend-url-hyphen
+ savedView: (id: string): string => `/items/${id}/saved_view`,
+ // ok: frontend-url-hyphen
+ savedViewHyphen: (item_id: string): string => `/items/${item_id}/saved-view`,
+ // ok: frontend-url-hyphen
+ hogFunction: (id: string, tab?: string): string => `/functions/${id}${tab ? `?tab=${tab}` : ''}`,
+ // ok: frontend-url-hyphen
+ featureFlagStaff: (teamId: string): string => `/feature-flags/staff?team_id=${teamId}`,
+ // ok: frontend-url-hyphen
+ insightAlert: (id: string, alertId: string): string => `/insights/${id}/alerts?alert_id=${alertId}`,
+ // ok: frontend-url-hyphen
+ dataManagement: (): string => '/data-management#section_one',
+ // nosemgrep: frontend-url-hyphen
+ verifyEmail: (): string => '/verify_email',
+}
+
+export const settings = [
+ // ruleid: settings-id-hyphen
+ { level: 'project', id: 'project_details', title: 'General' },
+ // ok: settings-id-hyphen
+ { level: 'project', id: 'project-details', title: 'General' },
+]
diff --git a/.semgrep/rules/devex/url-naming.yaml b/.semgrep/rules/devex/url-naming.yaml
new file mode 100644
index 000000000000..47407a239524
--- /dev/null
+++ b/.semgrep/rules/devex/url-naming.yaml
@@ -0,0 +1,137 @@
+rules:
+ - id: api-path-underscore
+ message: |
+ This API path segment uses a hyphen. API paths use underscores (`add_snapshots`, not
+ `add-snapshots`), so that the URL, the viewset method name, and the query params and
+ JSON fields all read the same way.
+
+ Change the literal to use underscores. An `@action` without `url_path=` takes the method
+ name as its path, which is already correct.
+
+ A hyphenated path that has already shipped keeps its name, because SDKs, MCP tools and
+ customer scripts call it. It carries `# nosemgrep: api-path-underscore` on the line
+ above. Use the same comment, with a reason, only when an external contract dictates
+ the path.
+ severity: ERROR
+ languages: [python]
+ paths:
+ include:
+ - 'ee/**/*.py'
+ - 'posthog/**/*.py'
+ - 'products/**/*.py'
+ exclude:
+ - '**/test/**'
+ - '**/tests/**'
+ - '**/test_*.py'
+ patterns:
+ - pattern-either:
+ - pattern: action(..., url_path="$PATH", ...)
+ - pattern: $MODULE.action(..., url_path="$PATH", ...)
+ - pattern: $ROUTER.register("$PATH", ...)
+ # Semgrep anchors the regex at the start of the value. Check only literal segments: a
+ # segment starts at a `/` and ends at a `/`, a regex group or the end, so a character
+ # class such as `[A-Za-z0-9_./-]` inside a group does not match.
+ - metavariable-regex:
+ metavariable: $PATH
+ regex: '^(?:.*/)?[A-Za-z0-9_]+-[A-Za-z0-9_-]*(?=/|\(|$)'
+ metadata:
+ category: best-practice
+
+ - id: api-query-param-underscore
+ message: |
+ This API query parameter uses a hyphen. API query parameters use underscores
+ (`date_from`, not `date-from`), the same as the JSON fields they sit next to.
+
+ A hyphenated parameter that has already shipped keeps its name, because clients send
+ it. It carries `# nosemgrep: api-query-param-underscore` on the line above.
+ severity: ERROR
+ languages: [python]
+ paths:
+ include:
+ - 'ee/**/*.py'
+ - 'posthog/**/*.py'
+ - 'products/**/*.py'
+ exclude:
+ - '**/test/**'
+ - '**/tests/**'
+ - '**/test_*.py'
+ patterns:
+ - pattern-either:
+ - pattern: $REQ.query_params.get("$NAME", ...)
+ - pattern: $REQ.query_params.getlist("$NAME", ...)
+ - pattern: $REQ.query_params["$NAME"]
+ - pattern: $REQ.GET.get("$NAME", ...)
+ - pattern: $REQ.GET.getlist("$NAME", ...)
+ - pattern: $REQ.GET["$NAME"]
+ - pattern: OpenApiParameter("$NAME", ...)
+ - pattern: OpenApiParameter(..., name="$NAME", ...)
+ # HTTP header names use hyphens by spec.
+ - pattern-not: OpenApiParameter(..., location=OpenApiParameter.HEADER, ...)
+ - pattern-not: OpenApiParameter($ARG, $TYPE, OpenApiParameter.HEADER, ...)
+ - pattern-not: OpenApiParameter(..., location="header", ...)
+ - metavariable-regex:
+ metavariable: $NAME
+ regex: '.*-'
+ metadata:
+ category: best-practice
+
+ - id: frontend-route-hyphen
+ message: |
+ This scene route uses an underscore in a path segment. App URLs use hyphens
+ (`/data-management`, not `/data_management`), because people read, share and
+ bookmark them.
+
+ Change the segment to use hyphens, and change the matching builder in `urls`. Route
+ params such as `:runId` are not checked.
+
+ A route that has already shipped keeps its path, because links to it exist. It carries
+ `// nosemgrep: frontend-route-hyphen` on the line above. To rename one, move the old
+ path to `redirects` so that old links still work.
+ severity: ERROR
+ languages: [typescript]
+ paths:
+ include:
+ - 'products/*/manifest.tsx'
+ # A route key maps to a `[Scene, sceneKey]` array. Redirect keys map to a string or a
+ # function, so this skips them: a redirect keeps an old path alive on purpose.
+ pattern-regex: '''(?:/(?::[\w-]+|[\w.*-]*))*?/[A-Za-z0-9.*-]*_[\w.*-]*(?:/[^'']*)?''\s*:\s*\['
+ metadata:
+ category: best-practice
+
+ - id: frontend-url-hyphen
+ message: |
+ This app URL uses an underscore in a path segment. App URLs use hyphens
+ (`/data-management`, not `/data_management`), because people read, share and
+ bookmark them. Query parameters after `?` are not checked.
+
+ A URL that has already shipped keeps its path, because links to it exist. It carries
+ `// nosemgrep: frontend-url-hyphen` on the line above. To rename one, add the old path
+ to the scene `redirects` so that old links still work.
+ severity: ERROR
+ languages: [typescript]
+ paths:
+ include:
+ - 'frontend/src/scenes/urls.ts'
+ # Match a string or template literal that starts with `/`. Walk its segments up to the
+ # first `?` or `#`, and flag a segment that is not a `:param` and has an underscore in its
+ # literal text. A simple `${expr}` counts as part of a segment, so the walk continues past it.
+ # An interpolation with nested braces or backticks, such as a conditional query string, ends
+ # the walk.
+ pattern-regex: '[`''"](?:/(?::[\w-]+|(?:[\w.*-]|\$\{[^{}`]*\})*))*?/(?:[A-Za-z0-9.*-]|\$\{[^{}`]*\})*_[\w.*-]*(?=[/`''"?#$])'
+ metadata:
+ category: best-practice
+
+ - id: settings-id-hyphen
+ message: |
+ This settings section or setting id uses an underscore. Settings ids appear in the URL
+ (`/settings/<section>#<setting>`), and every existing id uses hyphens.
+
+ Change the id to use hyphens.
+ severity: ERROR
+ languages: [typescript]
+ paths:
+ include:
+ - 'frontend/src/scenes/settings/SettingsMap.tsx'
+ pattern-regex: '\bid:\s*''[a-z0-9-]*_[a-z0-9_-]*'''
+ metadata:
+ category: best-practice
diff --git a/ee/api/billing.py b/ee/api/billing.py
index 03e2f9ee95da..cdcf48fa4d01 100644
--- a/ee/api/billing.py
+++ b/ee/api/billing.py
@@ -830,6 +830,7 @@ class BillingViewset(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
return self.list(request, *args, **kwargs)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["POST"],
detail=False,
diff --git a/ee/api/subscription.py b/ee/api/subscription.py
index f9ec9363ebf0..a57c5086b991 100644
--- a/ee/api/subscription.py
+++ b/ee/api/subscription.py
@@ -1880,6 +1880,7 @@ class SubscriptionViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.M
request=None,
responses={202: OpenApiResponse(description="Test delivery workflow started")},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["POST"],
detail=True,
diff --git a/frontend/src/scenes/urls.ts b/frontend/src/scenes/urls.ts
index f1916f8b6c71..5383c155b5b4 100644
--- a/frontend/src/scenes/urls.ts
+++ b/frontend/src/scenes/urls.ts
@@ -183,6 +183,7 @@ export const urls = {
// Onboarding / setup routes
login: (): string => '/login',
login2FA: (): string => '/login/2fa',
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
login2FASetup: (): string => '/login/2fa_setup',
/** After linking a social provider to an existing session (OAuth `next`; see posthog/api/authentication.py sso_login). */
accountSocialConnected: (): string => '/account/social-connected',
@@ -200,9 +201,11 @@ export const urls = {
liveDebugger: (): string => '/live-debugger',
passwordReset: (): string => '/reset',
passwordResetComplete: (userUuid: string, token: string): string => `/reset/${userUuid}/${token}`,
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
twoFactorReset: (userUuid: string, token: string): string => `/reset_2fa/${userUuid}/${token}`,
preflight: (): string => '/preflight',
signup: (): string => '/signup',
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
verifyEmail: (userUuid: string = ''): string => `/verify_email${userUuid ? `/${userUuid}` : ''}`,
vercelConnect: (): string => '/connect/vercel/link',
vercelLinkError: (): string => '/integrations/vercel/link-error',
@@ -253,16 +256,23 @@ export const urls = {
combineUrl(`/organization/billing/${section}`).url,
organizationBillingRealTimeUsage: (): string => '/organization/billing/real-time-usage',
advancedActivityLogs: (): string => '/activity-logs',
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
billingAuthorizationStatus: (): string => `/billing/authorization_status`,
// Self-hosted only
instanceStatus: (): string => '/instance/status',
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
instanceStaffUsers: (): string => '/instance/staff_users',
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
instanceKafkaInspector: (): string => '/instance/kafka_inspector',
instanceSettings: (): string => '/instance/settings',
instanceMetrics: (): string => `/instance/metrics`,
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
asyncMigrations: (): string => '/instance/async_migrations',
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
asyncMigrationsFuture: (): string => '/instance/async_migrations/future',
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
asyncMigrationsSettings: (): string => '/instance/async_migrations/settings',
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
deadLetterQueue: (): string => '/instance/dead_letter_queue',
experimentsStaffTools: (): string => '/experiments/staff',
materializedColumns: (): string => '/data-management/materialized-columns',
@@ -318,8 +328,10 @@ export const urls = {
legacyPlugin: (id: string): string => `/pipeline/plugins/${id}`,
hogFunction: (id: string, tab?: HogFunctionSceneTab): string => `/functions/${id}${tab ? `?tab=${tab}` : ''}`,
hogFunctionNew: (templateId: string): string => `/functions/new/${templateId}`,
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
productTours: (): string => '/product_tours',
productTour: (id: string, params?: string): string =>
+ // nosemgrep: frontend-url-hyphen -- shipped app URL, existing links point here
`/product_tours/${id}${params ? `?${params.startsWith('?') ? params.slice(1) : params}` : ''}`,
organizationDeactivated: (): string => '/organization-deactivated',
organizationPendingDeletion: (): string => '/organization-pending-deletion',
diff --git a/posthog/api/cli_auth.py b/posthog/api/cli_auth.py
index fbb0b322c510..873b9f3e8d33 100644
--- a/posthog/api/cli_auth.py
+++ b/posthog/api/cli_auth.py
@@ -143,6 +143,7 @@ class CLIAuthViewSet(viewsets.ViewSet):
return []
@extend_schema(request=None, responses={200: DeviceCodeResponseSerializer})
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["POST"], detail=False, url_path="device-code")
def device_code(self, request):
"""
diff --git a/posthog/api/integration.py b/posthog/api/integration.py
index fce891e2ec6b..97ddf17a91ad 100644
--- a/posthog/api/integration.py
+++ b/posthog/api/integration.py
@@ -2300,6 +2300,7 @@ class IntegrationViewSet(
return Response(IntegrationSerializer(email.integration).data)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["GET"], detail=False, url_path="domain-connect/check")
def domain_connect_check(self, request: Request, *args: Any, **kwargs: Any) -> Response:
domain = request.query_params.get("domain", "")
@@ -2317,6 +2318,7 @@ class IntegrationViewSet(
}
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["POST"], detail=False, url_path="domain-connect/apply-url")
def domain_connect_apply_url(self, request: Request, *args: Any, **kwargs: Any) -> Response:
"""Unified endpoint for generating Domain Connect apply URLs.
diff --git a/posthog/api/organization_integration.py b/posthog/api/organization_integration.py
index 44f69bcf1869..eb86860e3f8d 100644
--- a/posthog/api/organization_integration.py
+++ b/posthog/api/organization_integration.py
@@ -135,6 +135,7 @@ class OrganizationIntegrationViewSet(
)
instance.delete()
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=True, methods=["patch"], url_path="environment-mapping")
def environment_mapping(self, request: Request, **kwargs) -> Response:
integration = self.get_object()
diff --git a/posthog/api/project.py b/posthog/api/project.py
index 6972267e039a..895175b67b86 100644
--- a/posthog/api/project.py
+++ b/posthog/api/project.py
@@ -1699,6 +1699,7 @@ class ProjectViewSet(
request=None,
responses={200: ProjectSerializer},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["POST"],
detail=True,
diff --git a/posthog/api/query_performance_proxy.py b/posthog/api/query_performance_proxy.py
index 713701a523e5..1d324cb412da 100644
--- a/posthog/api/query_performance_proxy.py
+++ b/posthog/api/query_performance_proxy.py
@@ -61,6 +61,7 @@ class QueryPerformanceProxyViewSet(viewsets.ViewSet):
"execution lands in a follow-up PR. Currently returns an empty response."
),
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["POST"], url_path="execute-test")
def execute_test(self, request: Request) -> Response:
serializer = ExecuteTestClusterRequestSerializer(data=request.data)
diff --git a/posthog/api/rest_router.py b/posthog/api/rest_router.py
index 6cfbf10a8b73..2b5f8ed906f7 100644
--- a/posthog/api/rest_router.py
+++ b/posthog/api/rest_router.py
@@ -355,11 +355,13 @@ router.register(r"login", authentication.LoginViewSet, "login")
router.register(r"login/dev", authentication.DevLoginViewSet, "login_dev")
router.register(r"login/token", authentication.TwoFactorViewSet, "login_token")
router.register(r"login/precheck", authentication.LoginPrecheckViewSet, "login_precheck")
+# nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
router.register(
r"login/code-based-verification", authentication.CodeBasedVerificationViewSet, "login_code_based_verification"
)
router.register(r"login/2fa/passkey", authentication.TwoFactorPasskeyViewSet, "login_2fa_passkey")
router.register(r"webauthn/register", webauthn.WebAuthnRegistrationViewSet, "webauthn_register")
+# nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
router.register(r"webauthn/signup-register", webauthn.WebAuthnSignupRegistrationViewSet, "webauthn_signup_register")
router.register(r"webauthn/login", webauthn.WebAuthnLoginViewSet, "webauthn_login")
router.register(r"webauthn/credentials", webauthn.WebAuthnCredentialViewSet, "webauthn_credentials")
@@ -388,6 +390,7 @@ router.register(
"user_facet_settings",
)
router.register(r"personal_api_keys", personal_api_key.PersonalAPIKeyViewSet, "personal_api_keys")
+# nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
router.register(r"cli-auth", cli_auth.CLIAuthViewSet, "cli_auth")
router.register(r"instance_status", instance_status.InstanceStatusViewSet, "instance_status")
router.register(r"dead_letter_queue", dead_letter_queue.DeadLetterQueueViewSet, "dead_letter_queue")
@@ -543,6 +546,7 @@ projects_router.register(
router.register(r"wizard", wizard.SetupWizardViewSet, "wizard")
+# nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
projects_router.register(
r"csp-reporting",
CSPReportingViewSet,
@@ -551,6 +555,7 @@ projects_router.register(
)
+# nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
projects_router.register(r"js-snippet", JsSnippetViewSet, "project_js_snippet", ["team_id"])
diff --git a/posthog/utils.py b/posthog/utils.py
index 414bf17ea0ee..4516c3ee4fae 100644
--- a/posthog/utils.py
+++ b/posthog/utils.py
@@ -578,6 +578,7 @@ def _build_template_context(
posthog_distinct_id: Optional[str] = None
# Set the frontend app context
+ # nosemgrep: api-query-param-underscore -- shipped public API param, a rename breaks clients
if not request.GET.get("no-preloaded-app-context"):
from posthog.api.file_system.user_product_list import UserProductListSerializer
from posthog.api.project import ProjectSerializer
diff --git a/products/alerts/backend/presentation/views/alert.py b/products/alerts/backend/presentation/views/alert.py
index 8bd23e65bab0..ed716aa709f7 100644
--- a/products/alerts/backend/presentation/views/alert.py
+++ b/products/alerts/backend/presentation/views/alert.py
@@ -1633,6 +1633,7 @@ class AlertViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):
responses={202: AlertTestDeliveryResponseSerializer},
description="Send a synthetic test notification to subscribed users and every active destination on this alert.",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["POST"],
diff --git a/products/autoresearch/backend/presentation/views/views.py b/products/autoresearch/backend/presentation/views/views.py
index e5c945f53291..ab7d976d7800 100644
--- a/products/autoresearch/backend/presentation/views/views.py
+++ b/products/autoresearch/backend/presentation/views/views.py
@@ -302,6 +302,7 @@ class AutoresearchPipelineViewSet(TeamAndOrgViewSetMixin, _FacadePaginationMixin
"then autoresearch-create to create the pipeline."
),
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=False,
methods=["post"],
@@ -577,6 +578,7 @@ class AutoresearchTrainingRunViewSet(TeamAndOrgViewSetMixin, _FacadePaginationMi
"there is no 500-row cap. Read the returned paths with pd.read_parquet and iterate in Python."
),
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["post"],
diff --git a/products/canvas/backend/presentation/views.py b/products/canvas/backend/presentation/views.py
index c63e76c6b1d2..67ca9308dab3 100644
--- a/products/canvas/backend/presentation/views.py
+++ b/products/canvas/backend/presentation/views.py
@@ -855,6 +855,7 @@ class CanvasViewSet(CanvasAccessMixin, viewsets.ModelViewSet):
429: OpenApiResponse(description="The team's build capacity is exhausted; retry shortly."),
},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["POST"], detail=True, url_path="publish-current-version")
def publish_current_version(self, request: Request, *args: Any, **kwargs: Any) -> Response:
"""Queue a build for the current source version without changing source or metadata."""
diff --git a/products/cohorts/manifest.tsx b/products/cohorts/manifest.tsx
index 8c19aeacf230..82e046116803 100644
--- a/products/cohorts/manifest.tsx
+++ b/products/cohorts/manifest.tsx
@@ -14,6 +14,7 @@ export const manifest: ProductManifest = {
},
},
routes: {
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/feature_flags/staff/cohorts': ['CohortsStaffTools', 'cohortsStaffTools'],
},
urls: {
diff --git a/products/context_layer/backend/presentation/views.py b/products/context_layer/backend/presentation/views.py
index 72ad4f838e59..07899f3b7362 100644
--- a/products/context_layer/backend/presentation/views.py
+++ b/products/context_layer/backend/presentation/views.py
@@ -475,6 +475,7 @@ class ContextLayerViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
},
summary="Resolve a channel's wiki page",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["GET"], detail=False, url_path=r"channel-pages/(?P<channel_id>[^/.]+)")
def channel_page(self, request: Request, channel_id: str, **kwargs) -> Response:
return _read_channel_page(self.organization.id, channel_id)
@@ -673,6 +674,7 @@ class ContextLayerAgentViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
"path to create it at and `exists: false`."
),
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["GET"], detail=False, url_path=r"channel-pages/(?P<channel_id>[^/.]+)")
def channel_page(self, request: Request, channel_id: str, **kwargs) -> Response:
# Unlike the organization route, a miss proposes a create path: a loop
diff --git a/products/customer_analytics/manifest.tsx b/products/customer_analytics/manifest.tsx
index 024719e08e29..2861be8e95d2 100644
--- a/products/customer_analytics/manifest.tsx
+++ b/products/customer_analytics/manifest.tsx
@@ -52,23 +52,39 @@ export const manifest: ProductManifest = {
},
},
routes: {
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/dashboard': ['CustomerAnalytics', 'customerAnalyticsDashboard'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/accounts': ['CustomerAnalytics', 'customerAnalyticsAccounts'],
// Match before UUID routes; the wildcard also accepts characters excluded from named segments.
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/accounts/by-external-id/*': ['CustomerAnalyticsAccount', 'customerAnalyticsAccount'],
// The detail scene serves these paths behind its flag and falls back to the list for legacy deep links.
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/accounts/:accountId': ['CustomerAnalyticsAccount', 'customerAnalyticsAccount'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/accounts/:accountId/:tab': ['CustomerAnalyticsAccount', 'customerAnalyticsAccount'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/notes': ['CustomerAnalytics', 'customerAnalyticsNotes'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/announcements': ['CustomerAnalytics', 'customerAnalyticsAnnouncements'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/feed': ['CustomerAnalytics', 'customerAnalyticsFeed'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/tasks': ['CustomerAnalytics', 'customerAnalyticsTasks'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/feature-requests': ['CustomerAnalytics', 'customerAnalyticsFeatureRequests'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/feature-requests/:requestId': ['CustomerAnalytics', 'customerAnalyticsFeatureRequests'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/journeys/new': ['CustomerJourneyBuilder', 'customerJourneyBuilder'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/journeys/templates': ['CustomerJourneyTemplates', 'customerJourneyTemplates'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/journeys/:id/edit': ['CustomerJourneyBuilder', 'customerJourneyEdit'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/journeys': ['CustomerAnalytics', 'customerAnalyticsJourneys'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/customer_analytics/configuration': ['CustomerAnalyticsConfiguration', 'customerAnalyticsConfiguration'],
'/data-management/warehouse-properties': ['WarehouseProperties', 'warehouseProperties'],
'/data-management/warehouse-properties/:tab': ['WarehouseProperties', 'warehouseProperties'],
diff --git a/products/data_warehouse/backend/presentation/views/data_warehouse.py b/products/data_warehouse/backend/presentation/views/data_warehouse.py
index 0fde3b6b9ea1..dce786f0e00d 100644
--- a/products/data_warehouse/backend/presentation/views/data_warehouse.py
+++ b/products/data_warehouse/backend/presentation/views/data_warehouse.py
@@ -1058,6 +1058,7 @@ class DataWarehouseViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
)
},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["POST"], detail=False, url_path="onboard-team", required_scopes=["warehouse_view:write"])
def onboard_team(self, request: Request, **kwargs) -> Response:
"""Onboard this project onto the organization's existing managed warehouse.
@@ -1112,6 +1113,7 @@ class DataWarehouseViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
)
},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["DELETE"], detail=False, url_path="delete-org", required_scopes=["warehouse_view:write"])
def delete_org(self, request: Request, **kwargs) -> Response:
"""Remove the organization's provisioning record after teardown, freeing its warehouse name.
@@ -1206,6 +1208,7 @@ class DataWarehouseViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
summary="Get managed warehouse monitoring snapshot",
description="Get tenant-safe live worker, session, queue, and capacity data for the current organization.",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["GET"],
detail=False,
@@ -1244,6 +1247,7 @@ class DataWarehouseViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
summary="Get managed warehouse monitoring time series",
description="Get one allow-listed monitoring metric for the current organization and trailing time window.",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["GET"],
detail=False,
@@ -1281,6 +1285,7 @@ class DataWarehouseViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
return Response(data)
@extend_schema(responses={200: ManagedWarehouseDataStatusResponseSerializer})
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["GET"],
detail=False,
@@ -1298,6 +1303,7 @@ class DataWarehouseViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
description="Per-schema backfill and live import status for one source, for the Overview tab's "
"drill-down modal — the main status endpoint only returns a per-source rollup.",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["GET"],
detail=False,
@@ -1325,6 +1331,7 @@ class DataWarehouseViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
)
},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["POST"], detail=False, url_path="reset-password", required_scopes=["warehouse_view:write"])
def reset_password(self, request: Request, **kwargs) -> Response:
"""Reset the root password for the managed warehouse."""
@@ -1350,6 +1357,7 @@ class DataWarehouseViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
)
},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["GET"], detail=False, url_path="check-database-name")
def check_database_name(self, request: Request, **kwargs) -> Response:
"""Check if a database name is available."""
@@ -1374,6 +1382,7 @@ class DataWarehouseViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
)
},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["GET"], detail=False, url_path="check-schema-name")
def check_schema_name(self, request: Request, **kwargs) -> Response:
"""Check if a schema name is free within the organization's managed warehouse."""
diff --git a/products/early_access_features/manifest.tsx b/products/early_access_features/manifest.tsx
index 00fa5ab337ff..9f43c3d0e07c 100644
--- a/products/early_access_features/manifest.tsx
+++ b/products/early_access_features/manifest.tsx
@@ -22,7 +22,9 @@ export const manifest: ProductManifest = {
},
},
routes: {
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/early_access_features': ['EarlyAccessFeatures', 'earlyAccessFeatures'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/early_access_features/:id': ['EarlyAccessFeature', 'earlyAccessFeature'],
},
redirects: {},
diff --git a/products/engineering_analytics/backend/presentation/views/ci_signals.py b/products/engineering_analytics/backend/presentation/views/ci_signals.py
index a257dde5ab0c..3cdfb36a9d68 100644
--- a/products/engineering_analytics/backend/presentation/views/ci_signals.py
+++ b/products/engineering_analytics/backend/presentation/views/ci_signals.py
@@ -31,6 +31,7 @@ class CISignalsConfigMixin(EngineeringAnalyticsViewSetBase):
responses={200: CISignalsConfigSerializer},
description="Return the atomic CI Signals configuration and aggregate GitHub warehouse sync status.",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["get"], url_path="ci-signals-config", pagination_class=None)
def ci_signals_config(self, request: Request, **kwargs) -> Response:
result = api.get_ci_signals_config(team=self.team, user_access_control=self.user_access_control)
diff --git a/products/error_tracking/backend/routes.py b/products/error_tracking/backend/routes.py
index a1383e6c6b33..5fcdebb32d46 100644
--- a/products/error_tracking/backend/routes.py
+++ b/products/error_tracking/backend/routes.py
@@ -107,6 +107,7 @@ def register_routes(routers: RouterRegistry) -> None:
"project_error_tracking_spike_events",
["team_id"],
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
routers.projects.register(
r"error_tracking/git-provider-file-links",
GitProviderFileLinksViewSet,
diff --git a/products/error_tracking/manifest.tsx b/products/error_tracking/manifest.tsx
index b42d5bcb98e9..6e77db8ffef2 100644
--- a/products/error_tracking/manifest.tsx
+++ b/products/error_tracking/manifest.tsx
@@ -31,10 +31,15 @@ export const manifest: ProductManifest = {
},
},
routes: {
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/error_tracking': ['ErrorTracking', 'errorTracking'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/error_tracking/fingerprint/*': ['ErrorTrackingFingerprint', 'errorTrackingFingerprint'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/error_tracking/alerts/new/:templateId': ['HogFunction', 'errorTrackingAlertNew'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/error_tracking/alerts/:id': ['HogFunction', 'errorTrackingAlert'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/error_tracking/:id': ['ErrorTrackingIssue', 'errorTrackingIssue'],
},
redirects: {
diff --git a/products/feature_flags/manifest.tsx b/products/feature_flags/manifest.tsx
index ef3e4c40fb53..c82dfe0c439a 100644
--- a/products/feature_flags/manifest.tsx
+++ b/products/feature_flags/manifest.tsx
@@ -19,7 +19,9 @@ export const manifest: ProductManifest = {
},
},
routes: {
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/feature_flags/templates': ['FeatureFlagTemplates', 'featureFlagTemplates'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/feature_flags/staff': ['FeatureFlagsStaffTools', 'featureFlagsStaffTools'],
},
urls: {
diff --git a/products/logs/backend/presentation/views/api.py b/products/logs/backend/presentation/views/api.py
index 1a42462fda64..c15b16e0a280 100644
--- a/products/logs/backend/presentation/views/api.py
+++ b/products/logs/backend/presentation/views/api.py
@@ -1632,6 +1632,7 @@ class LogsViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet):
request=_LogsCountRangesRequestSerializer,
responses={200: _LogsCountRangesResponseSerializer},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["POST"], required_scopes=["logs:read"], url_path="count-ranges")
def count_ranges(self, request: Request, *args, **kwargs) -> Response:
tag_queries(product=Product.LOGS, feature=Feature.QUERY)
@@ -1794,6 +1795,7 @@ class LogsViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet):
return Response(results, status=status.HTTP_200_OK)
@extend_schema(request=_LogsGroupByRequestSerializer, responses={200: _LogsGroupByResponseSerializer})
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["POST"], required_scopes=["logs:read"], url_path="group-by")
def group_by(self, request: Request, *args, **kwargs) -> Response:
tag_queries(product=Product.LOGS, feature=Feature.QUERY)
diff --git a/products/managed_migrations/manifest.tsx b/products/managed_migrations/manifest.tsx
index 002753412931..9246242a9d58 100644
--- a/products/managed_migrations/manifest.tsx
+++ b/products/managed_migrations/manifest.tsx
@@ -18,7 +18,9 @@ export const manifest: ProductManifest = {
},
},
routes: {
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/managed_migrations': ['ManagedMigration', 'managedMigration'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/managed_migrations/new': ['ManagedMigration', 'managedMigration'],
},
urls: {
diff --git a/products/notebooks/backend/presentation/views/reusable_widget.py b/products/notebooks/backend/presentation/views/reusable_widget.py
index e19e8b1e4775..35df7bc8e721 100644
--- a/products/notebooks/backend/presentation/views/reusable_widget.py
+++ b/products/notebooks/backend/presentation/views/reusable_widget.py
@@ -222,6 +222,7 @@ class ReusableWidgetViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
409: WidgetErrorSerializer,
},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["POST"], detail=True, url_path="demo-data", required_scopes=["notebook:write", "query:read"])
def update_demo_data(self, request: Request, **kwargs) -> Response:
self._require_feature()
@@ -323,6 +324,7 @@ class ReusableWidgetViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
409: WidgetErrorSerializer,
},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["POST"], detail=True, url_path="save-version", required_scopes=["notebook:write"])
def save_version(self, request: Request, **kwargs) -> Response:
self._require_feature()
@@ -353,6 +355,7 @@ class ReusableWidgetViewSet(TeamAndOrgViewSetMixin, viewsets.ViewSet):
409: WidgetErrorSerializer,
},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["POST"], detail=True, url_path="discard-version", required_scopes=["notebook:write"])
def discard_version(self, request: Request, **kwargs) -> Response:
self._require_feature()
diff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.py
index c8cfa4289fa3..e4fe3af151d4 100644
--- a/products/signals/backend/scout_harness/views.py
+++ b/products/signals/backend/scout_harness/views.py
@@ -684,6 +684,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_runs_recent_per_scout",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=False,
methods=["get"],
@@ -981,6 +982,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_runs_token_costs",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=False,
methods=["post"],
@@ -1062,6 +1064,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_emit_signal",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["post"],
@@ -1212,6 +1215,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_emit_report",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["post"],
@@ -1285,6 +1289,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_edit_report",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["post"],
@@ -1375,6 +1380,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_record_output",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["post"],
@@ -1456,6 +1462,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_lighthouse_audit",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["post"],
@@ -1597,6 +1604,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_report_check_create",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["post"],
@@ -1644,6 +1652,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_report_checks_list",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["get"],
@@ -1681,6 +1690,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_report_check_cancel",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["post"],
@@ -1723,6 +1733,7 @@ class SignalScoutRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
operation_id="signals_scout_record_check_result",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=True,
methods=["post"],
diff --git a/products/signals/backend/views.py b/products/signals/backend/views.py
index 78d1565a0f50..9d56aef3db27 100644
--- a/products/signals/backend/views.py
+++ b/products/signals/backend/views.py
@@ -3025,6 +3025,7 @@ class SignalReportViewSet(
request=SignalReportBulkStateRequestSerializer,
responses={200: SignalReportBulkStateResponseSerializer},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["post"], url_path="bulk-state", required_scopes=["task:write"])
def bulk_state(self, request, **kwargs):
"""
@@ -3322,6 +3323,7 @@ class SignalReportViewSet(
),
operation_id="signals_reports_refund_summary_retrieve",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["get"], url_path="refund-summary", required_scopes=["task:read"])
def refund_summary(self, request: Request, **kwargs):
# Two independent flags can each make this endpoint matter: refunds (the netting numbers)
diff --git a/products/skills/backend/api/marketplace_views.py b/products/skills/backend/api/marketplace_views.py
index 238ab3b35b65..f46bb84272ba 100644
--- a/products/skills/backend/api/marketplace_views.py
+++ b/products/skills/backend/api/marketplace_views.py
@@ -107,6 +107,7 @@ class LLMSkillMarketplaceViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet
)
@extend_schema(exclude=True)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["POST"], detail=False, url_path="git-upload-pack")
def marketplace_upload_pack(self, request: Request, **kwargs: Any) -> HttpResponse:
# GitProtocolParser consumed the stream into request.data (a latin-1 str), so request.body
diff --git a/products/skills/backend/api/skills.py b/products/skills/backend/api/skills.py
index 201ff24e8266..d79f09369cec 100644
--- a/products/skills/backend/api/skills.py
+++ b/products/skills/backend/api/skills.py
@@ -1253,6 +1253,7 @@ class LLMSkillViewSet(
parameters=[LLMSkillFetchQuerySerializer],
responses={200: LLMSkillMarkdownSerializer},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["GET"],
detail=False,
@@ -1521,6 +1522,7 @@ class LLMSkillViewSet(
}
@extend_schema(responses={200: LLMSkillMarketplaceCommandSerializer})
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["GET"], detail=False, url_path="marketplace/install-command")
@llma_track_latency("llma_skills_marketplace_command")
@monitor(feature=None, endpoint="llma_skills_marketplace_command", method="GET")
@@ -1751,6 +1753,7 @@ class LLMSkillViewSet(
request=LLMSkillPublishToCommunitySerializer,
responses={201: CommunitySkillPublishResultSerializer, 409: LLMSkillPublishConflictSerializer},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["POST"],
detail=False,
@@ -2032,6 +2035,7 @@ class LLMSkillViewSet(
return Response(self._serialize_skill(published_skill))
@extend_schema(request=LLMSkillFileRenameSerializer, responses={200: LLMSkillSerializer})
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
methods=["POST"],
detail=False,
diff --git a/products/surveys/backend/api/survey.py b/products/surveys/backend/api/survey.py
index af23fd53f70c..1014ed9bf896 100644
--- a/products/surveys/backend/api/survey.py
+++ b/products/surveys/backend/api/survey.py
@@ -2682,6 +2682,7 @@ class SurveyViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, viewsets.
return Response(status.HTTP_200_OK)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(methods=["GET"], detail=True, url_path="archived-response-uuids", required_scopes=["survey:read"])
def archived_response_uuids(self, request: request.Request, **kwargs) -> Response:
"""
diff --git a/products/tasks/backend/presentation/views/api.py b/products/tasks/backend/presentation/views/api.py
index 76d297e2e853..1824aa37d504 100644
--- a/products/tasks/backend/presentation/views/api.py
+++ b/products/tasks/backend/presentation/views/api.py
@@ -2837,6 +2837,7 @@ class TaskRunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
),
strict_request_validation=True,
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=True, methods=["post"], url_path="analysis-activity", required_scopes=["task:write"])
def analysis_activity(self, request, pk=None, **kwargs):
task_id = self._ensure_task_accessible()
@@ -4339,6 +4340,7 @@ class LegacyDesktopAccessViewSet(viewsets.ViewSet):
summary="Check PostHog Desktop access",
description="Compatibility endpoint for released PostHog Desktop clients.",
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["get"], url_path="check-access")
def check_access(self, request, **kwargs):
team = getattr(request.user, "team", None)
diff --git a/products/tasks/backend/routes.py b/products/tasks/backend/routes.py
index 20f1b4163704..c3a9798cba40 100644
--- a/products/tasks/backend/routes.py
+++ b/products/tasks/backend/routes.py
@@ -69,6 +69,7 @@ def register_routes(routers: RouterRegistry) -> None:
r"sandbox_custom_images", tasks.SandboxCustomImageViewSet, "project_sandbox_custom_images", ["team_id"]
)
routers.root.register(r"code/invites", tasks.LegacyDesktopAccessViewSet, "code_invites")
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
routers.root.register(
r"code/sandbox-pricing", sandbox_pricing.SandboxComputePricingViewSet, "sandbox_compute_pricing"
)
diff --git a/products/tracing/backend/presentation/views.py b/products/tracing/backend/presentation/views.py
index a787d9774ff8..9b539060a337 100644
--- a/products/tracing/backend/presentation/views.py
+++ b/products/tracing/backend/presentation/views.py
@@ -1154,6 +1154,7 @@ class SpansViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet)
)
# Both scopes: the response is Error Tracking data, so a token scoped to tracing alone must
# not reach it. Scopes gate the token; the access-control check below gates the user.
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(
detail=False,
methods=["POST"],
@@ -1197,6 +1198,7 @@ class SpansViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet)
parameters=[_TracingServiceNamesQuerySerializer],
responses={200: _TracingServiceNamesResponseSerializer},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["GET"], url_path="service-names", required_scopes=["tracing:read"])
def service_names(self, request: Request, *args, **kwargs) -> Response:
tag_queries(product=ProductKey.TRACING, feature=Feature.QUERY)
@@ -1410,6 +1412,7 @@ class SpansViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet)
return self._run_scalar_span_query(request, run_impact_query, event_name="tracing impact queried")
@extend_schema(request=_SymbolStatsRequestSerializer, responses={200: _SymbolStatsResponseSerializer})
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["POST"], url_path="symbol-stats", required_scopes=["tracing:read"])
def symbol_stats(self, request: Request, *args, **kwargs) -> Response:
tag_queries(product=ProductKey.TRACING, feature=Feature.QUERY)
@@ -1519,6 +1522,7 @@ class SpansViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet)
request=_TracingDurationHistogramRequestSerializer,
responses={200: _TracingDurationHistogramResponseSerializer},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["POST"], url_path="duration-histogram", required_scopes=["tracing:read"])
def duration_histogram(self, request: Request, *args, **kwargs) -> Response:
tag_queries(product=ProductKey.TRACING, feature=Feature.QUERY)
@@ -1562,6 +1566,7 @@ class SpansViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet)
request=_TracingLatencyHeatmapRequestSerializer,
responses={200: _TracingLatencyHeatmapResponseSerializer},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["POST"], url_path="latency-heatmap", required_scopes=["tracing:read"])
def latency_heatmap(self, request: Request, *args, **kwargs) -> Response:
tag_queries(product=ProductKey.TRACING, feature=Feature.QUERY)
@@ -1713,6 +1718,7 @@ class SpansViewSet(TeamAndOrgViewSetMixin, PydanticModelMixin, viewsets.ViewSet)
request=_TracingAttributeBreakdownRequestSerializer,
responses={200: _TracingAttributeBreakdownResponseSerializer},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=False, methods=["POST"], url_path="attribute-breakdown", required_scopes=["tracing:read"])
def attribute_breakdown(self, request: Request, *args, **kwargs) -> Response:
tag_queries(product=ProductKey.TRACING, feature=Feature.QUERY)
diff --git a/products/user_interviews/manifest.tsx b/products/user_interviews/manifest.tsx
index e8a48218d546..93c631fa2724 100644
--- a/products/user_interviews/manifest.tsx
+++ b/products/user_interviews/manifest.tsx
@@ -30,8 +30,11 @@ export const manifest: ProductManifest = {
},
},
routes: {
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/user_research': ['UserInterviews', 'userInterviews'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/user_research/:topicId/response/:responseId': ['UserInterviewResponse', 'userInterviewResponse'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/user_research/:id': ['UserInterview', 'userInterview'],
},
redirects: {
diff --git a/products/visual_review/backend/presentation/views.py b/products/visual_review/backend/presentation/views.py
index 65f7fd19d9e3..9aa4b35a553e 100644
--- a/products/visual_review/backend/presentation/views.py
+++ b/products/visual_review/backend/presentation/views.py
@@ -409,6 +409,7 @@ class RepoViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
query_serializer=TolerationPileupsQuerySerializer,
responses={200: OpenApiResponse(response=TolerationPileupsSerializer)},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=True, methods=["get"], url_path="toleration-pileups", pagination_class=None)
def toleration_pileups(self, request: TypedRequest, pk: str, **kwargs) -> Response:
repo_id = _parse_uuid(pk)
@@ -672,6 +673,7 @@ class RunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
],
responses={200: ToleratedHashEntrySerializer(many=True)},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=True, methods=["get"], url_path="tolerated-hashes")
def tolerated_hashes(self, request: Request, pk: str, **kwargs) -> Response:
"""List known tolerated hashes for a snapshot identifier."""
@@ -689,6 +691,7 @@ class RunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
return Response(ToleratedHashEntrySerializer(instance=entries, many=True).data)
@extend_schema(request=AddSnapshotsInputSerializer, responses={200: AddSnapshotsResultSerializer})
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=True, methods=["post"], url_path="add-snapshots")
@validated_request(AddSnapshotsInputSerializer)
def add_snapshots(self, request: TypedRequest[AddSnapshotsInput], pk: str, **kwargs) -> Response:
@@ -712,6 +715,7 @@ class RunViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
],
responses={200: SnapshotHistoryEntrySerializer(many=True)},
)
+ # nosemgrep: api-path-underscore -- shipped public API path, a rename breaks clients
@action(detail=True, methods=["get"], url_path="snapshot-history")
def snapshot_history(self, request: Request, pk: str, **kwargs) -> Response:
"""Recent change history for a snapshot identifier across runs."""
diff --git a/products/visual_review/manifest.tsx b/products/visual_review/manifest.tsx
index 6b34fe190ef1..51883b8ec8c6 100644
--- a/products/visual_review/manifest.tsx
+++ b/products/visual_review/manifest.tsx
@@ -62,12 +62,19 @@ export const manifest: ProductManifest = {
},
},
routes: {
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/visual_review': ['VisualReviewIndex', 'visualReviewIndex'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/visual_review/settings': ['VisualReviewSettings', 'visualReviewSettings'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/visual_review/runs/:runId': ['VisualReviewRun', 'visualReviewRun'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/visual_review/repos/:repoId/runs': ['VisualReviewRuns', 'visualReviewRepoRuns'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/visual_review/repos/:repoId/snapshots': ['VisualReviewSnapshotOverview', 'visualReviewSnapshotOverview'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/visual_review/repos/:repoId/flakiness': ['VisualReviewFlakiness', 'visualReviewFlakiness'],
+ // nosemgrep: frontend-route-hyphen -- shipped app URL, existing links point here
'/visual_review/repos/:repoId/:runType/snapshots/:identifier': [
'VisualReviewSnapshotHistory',
'visualReviewSnapshotHistory',