Child of T409078: ⬆️🚦Deduplicate mapping of mediawiki backend versions
- Currently this endpoint exists to get the MediaWiki database version of a wiki: https://github.com/wbstack/api/blob/563ecd28e1d4110909c69b3376d8d116ddb96aa7/routes/backend.php#L20
- Currently, the mapping from database version to MediaWiki hosts gets duplicated across our codebases
- The Goal of this ticket is to create a platform API endpoint that provides URLs to the correct hosts (i.e. mediawiki-139-app-backend.default.svc.cluster.local)
- Attention: since it's not clear if it's easy to reuse the response body in the nginx config (see T409532: ⬆️🚦Replace mw mapping in nginx configuration with api call), it's probably best to output the requested value both in the request body and HTTP headers.
ACs:
- A new backend endpoint in the Platform API is implemented which returns an appropriate MW version given a domain
Task breakdown notes:
- API Spec:
- Path: /backend/getWikiHostForDomain
- Request Parameters: ?domain=coffebase.wikibase.cloud
- Response Body: { backend-host: mediawiki-139-app-backend.default.svc.cluster.local, web-host: mediawiki-139-app-web.default.svc.cluster.local, api-host: mediawiki-139-app-api.default.svc.cluster.local, alpha-host: mediawiki-139-app-alpha.default.svc.cluster.local }
- Response Headers:
- x-backend-host: mediawiki-139-app-backend.default.svc.cluster.local
- x-web-host: mediawiki-139-app-web.default.svc.cluster.local
- x-api-host: mediawiki-139-app-api.default.svc.cluster.local
- x-alpha-host: mediawiki-139-app-alpha.default.svc.cluster.local
PRs: