Slack and telegram routes to test chatops-proxy v3 (#3723)

This commit is contained in:
Innokentii Konstantinov 2024-01-22 13:48:19 +08:00 committed by GitHub
parent 4a02d83fd1
commit f7df1ad5e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 11 deletions

View file

@ -19,6 +19,7 @@ urlpatterns = [
path("signup_redirect/<str:subscription>/<str:utm>/", SignupRedirectView.as_view()),
# Trailing / is missing here on purpose. QA the feature if you want to add it. No idea why doesn't it work with it.
path("reset_slack", ResetSlackView.as_view(), name="reset-slack"),
path("v3/event_api_endpoint/", SlackEventApiEndpointView.as_view()),
path("v3/interactive_api_endpoint/", SlackEventApiEndpointView.as_view()),
# urls for chatops-proxy v3. Currently, they are experimental.
path("events/", SlackEventApiEndpointView.as_view()),
path("interactive/", SlackEventApiEndpointView.as_view()),
]

View file

@ -41,7 +41,7 @@ class TelegramClient:
# Hack to test chatops-proxy v3, remove once v3 is release.
if settings.CHATOPS_V3:
webhook_url = webhook_url or create_engine_url(
"/telegram/v3/", override_base=live_settings.TELEGRAM_WEBHOOK_HOST
"api/v3/webhook/telegram/", override_base=live_settings.TELEGRAM_WEBHOOK_HOST
)
else:
webhook_url = webhook_url or create_engine_url(

View file

@ -6,5 +6,4 @@ app_name = "telegram"
urlpatterns = [
path("", WebHookView.as_view(), name="incoming_webhook"),
path("v3/", WebHookView.as_view(), name="v3_incoming_webhook"),
]

View file

@ -50,17 +50,19 @@ if settings.FEATURE_PROMETHEUS_EXPORTER_ENABLED:
path("metrics/", include("apps.metrics_exporter.urls")),
]
if settings.FEATURE_TELEGRAM_INTEGRATION_ENABLED:
urlpatterns += [
path("telegram/", include("apps.telegram.urls")),
# urls for chatops-proxy v3. Currently, they are experimental.
path("api/v3/webhook/telegram/", include("apps.telegram.urls"), name="telegram_api_v3"),
]
if settings.FEATURE_SLACK_INTEGRATION_ENABLED:
urlpatterns += [
path("api/internal/v1/slack/", include("apps.slack.urls")),
]
if settings.FEATURE_TELEGRAM_INTEGRATION_ENABLED:
urlpatterns += [path("telegram/", include("apps.telegram.urls"))]
if settings.FEATURE_SLACK_INTEGRATION_ENABLED:
urlpatterns += [
path("slack/", include("apps.slack.urls")),
# urls for chatops-proxy v3. Currently, they are experimental.
path("api/v3/webhook/slack/", include("apps.slack.urls"), name="slack_api_v3"),
]
if settings.IS_OPEN_SOURCE: