integrations: Add documentation for the event filtering system.

We create "event-filter-instruction.md" and add it to
"create-bot-construct-url.md". This allows the user to keep track of the
supported event types for most of the integrations that implement this
feature. Note that not all integrations use "create-bot-construct-url.md".

We also need to rename "function" to "view_function" to make this change
type-check.

This is relevant to #18392.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li
2022-08-16 15:27:45 -04:00
committed by Tim Abbott
parent 0cd76d17d7
commit 6b527dfa61
5 changed files with 33 additions and 2 deletions

View File

@@ -307,6 +307,11 @@ def integration_doc(request: HttpRequest, integration_name: str = REQ()) -> Http
context["recommended_stream_name"] = integration.stream_name
if isinstance(integration, WebhookIntegration):
context["integration_url"] = integration.url[3:]
if (
hasattr(integration.function, "_all_event_types")
and integration.function._all_event_types is not None
):
context["all_event_types"] = integration.function._all_event_types
if isinstance(integration, HubotIntegration):
context["hubot_docs_url"] = integration.hubot_docs_url