Files
upstream-zulip/zerver/lib/url_redirects.py
upstream-mirror 64898b2c79
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
snapshot of https://github.com/zulip/zulip.git @ 48c69911c7dd4e03b20552eb3bd77ad8151c1357 (2026-09-15)
2026-09-15 15:05:30 +05:00

88 lines
2.9 KiB
Python

from dataclasses import dataclass
@dataclass
class URLRedirect:
old_url: str
new_url: str
# If redirecting to the help center, we no longer test the old URL
# in the backend test suite, so it should be added to this list
# even if it was originally in the API or policies documentation.
REDIRECTED_TO_HELP_DOCUMENTATION: list[URLRedirect] = [
URLRedirect("/api/outgoing-webhooks", "/help/outgoing-webhooks"),
URLRedirect("/api/deploying-bots", "/help/deploying-bots"),
URLRedirect("/api/running-bots", "/help/running-bots"),
URLRedirect(
"/api/writing-tests-for-interactive-bots", "/help/writing-tests-for-interactive-bots"
),
URLRedirect("/api/interactive-bots-api", "/help/interactive-bots-api"),
URLRedirect("/api/writing-bots", "/help/writing-bots"),
URLRedirect("/api/non-webhook-integrations", "/help/non-webhook-integrations"),
URLRedirect("/api/integrations-overview", "/help/integrations-overview"),
]
API_DOCUMENTATION_REDIRECTS: list[URLRedirect] = [
# Add URL redirects for REST API documentation here:
URLRedirect("/api/delete-stream", "/api/archive-stream"),
URLRedirect(
"/api/incoming-webhooks-overview",
"https://zulip.readthedocs.io/en/latest/webhooks/incoming-webhooks-overview.html",
),
URLRedirect(
"/api/incoming-webhooks-walkthrough",
"https://zulip.readthedocs.io/en/latest/webhooks/incoming-webhooks-walkthrough.html",
),
]
POLICY_DOCUMENTATION_REDIRECTS: list[URLRedirect] = [
# Add URL redirects for policy documentation here:
URLRedirect("/privacy/", "/policies/privacy"),
URLRedirect("/terms/", "/policies/terms"),
]
LANDING_PAGE_REDIRECTS = [
# Add URL redirects for corporate landing pages here.
URLRedirect("/new-user/", "/hello/"),
URLRedirect("/developer-community/", "/development-community"),
URLRedirect("/for/companies/", "/for/business"),
URLRedirect("/for/working-groups-and-communities/", "/for/communities"),
URLRedirect("/try-zulip/", "https://chat.zulip.org/?show_try_zulip_modal"),
]
DOCUMENTATION_REDIRECTS = (
API_DOCUMENTATION_REDIRECTS + POLICY_DOCUMENTATION_REDIRECTS + REDIRECTED_TO_HELP_DOCUMENTATION
)
# List of category slugs at the time of changing the URL scheme to have
# `/category` be appended before the category slug. This list does not
# need to change with changing categories.
INTEGRATION_CATEGORY_SLUGS = [
"bots",
"communication",
"continuous-integration",
"customer-support",
"deployment",
"entertainment",
"financial",
"hr",
"marketing",
"meta-integration",
"misc",
"monitoring",
"productivity",
"project-management",
"version-control",
]
def get_integration_category_redirects() -> list[URLRedirect]:
return [
URLRedirect(
f"/integrations/{slug}",
f"/integrations/category/{slug}",
)
for slug in INTEGRATION_CATEGORY_SLUGS
]