Page MenuHomePhabricator

Decommission cxserver endpoints from RESTBase
Open, MediumPublic

Description

Background Information

The endpoints in RESTBase for cxserver are safe to remove since cxserver v2 has been deployed. Once traffic is blocked at T375616: Block RESTBase cxserver v1 endpoints in favor of the new endpoints we can remove the code and simplify the RESTBase code.

What

Remove the code from restbase once traffic is blocked and deploy it.

Acceptance Criteria

  • cxserver v1 endpoints are not part of RESTBase infrastructure and codebase anymore

Event Timeline

I did an initial effort to get this list from the restbase specs, but I'm not sure I got everything right. Once this is reviewed this is ready to get started.

PWaigi-WMF triaged this task as Medium priority.
PWaigi-WMF moved this task from Backlog to Component Updates on the CX-cxserver board.
PWaigi-WMF moved this task from Component Updates to Other teams on the CX-cxserver board.
  1. Machine-Translate Content Endpoint
    • HTTP Verb: POST
    • Production Endpoint:
      • <domain>/api/rest_v1/transform/html/from/{from}
    • cxserver Endpoint:
      • <domain>/v1/transform/html/from/{from}

cxserver endpoint is /v2/translate/{from}/{to}. Reference:
https://cxserver.wikimedia.org/v2?doc#/Machine%20translation/post_v2_translate__from___to_

  1. Machine-Translate Content by Provider Endpoint
    • HTTP Verb: POST
    • Production Endpoint:
      • <domain>/api/rest_v1/transform/html/from/{from}/{provider}
    • cxserver Endpoint:
      • <domain>/v1/transform/html/from/{from}/{provider}

cxserver endpoint is /v2/translate/{from}/{to}/{provider}. Reference:
https://cxserver.wikimedia.org/v2?doc#/Machine%20translation/post_v2_translate__from___to___provider_

  1. Fetch Dictionary Meaning of a Word Endpoint
    • HTTP Verb: GET
    • Production Endpoint:
      • <domain>/api/rest_v1/transform/word/from/{from}/{word}
    • cxserver Endpoint:
      • <domain>/v1/transform/word/from/{from}/{word}

This endpoint does not exist. Dictionary support was removed form cxserver.

  1. Fetch Dictionary Meaning by Provider Endpoint
    • HTTP Verb: GET
    • Production Endpoint:
      • <domain>/api/rest_v1/transform/word/from/{from}/{word}/{provider}
    • cxserver Endpoint:
      • <domain>/v1/transform/word/from/{from}/{word}/{provider}

This endpoint does not exist. Dictionary support was removed form cxserver.


MediaWiki Section Content API

  1. Fetch Segmented Page Content Endpoint
    • HTTP Verb: GET
    • Production Endpoint:
      • <domain>/api/rest_v1/segments/{title}
    • cxserver Endpoint:
      • <domain>/v1/segments/{title}

cxserver endpoint: /v2/page/{sourcelanguage}/{targetlanguage}/{title}

  1. Fetch Segmented Page Content by Revision Endpoint
    • HTTP Verb: GET
    • Production Endpoint:
      • <domain>/api/rest_v1/segments/{title}/{revision}
    • cxserver Endpoint:
      • <domain>/v1/segments/{title}/{revision}

cxserver endpoint: /v2/page/{sourcelanguage}/{targetlanguage}/{title}


Global Transform API

There is no transform API in cxserver, it is translate in cxserver terminology. transform is often used in parsoid terminology

  1. Global Machine-Translate Content Endpoint
    • HTTP Verb: POST
    • Production Endpoint:
      • <domain>/api/rest_v1/transform/html/from/{from_lang}/to/{to_lang}
    • cxserver Endpoint:
      • <domain>/v1/transform/html/from/{from_lang}/to/{to_lang}

cxserver endpoint is /v2/translate/{from}/{to}. Reference:
https://cxserver.wikimedia.org/v2?doc#/Machine%20translation/post_v2_translate__from___to_

  1. Global Machine-Translate Content by Provider Endpoint
    • HTTP Verb: POST
    • Production Endpoint:
      • <domain>/api/rest_v1/transform/html/from/{from_lang}/to/{to_lang}/{provider}
    • cxserver Endpoint:
      • <domain>/v1/transform/html/from/{from_lang}/to/{to_lang}/{provider}

cxserver endpoint is /v2/translate/{from}/{to}/{provider}. Reference:
https://cxserver.wikimedia.org/v2?doc#/Machine%20translation/post_v2_translate__from___to___provider_

  1. Global Fetch Dictionary Meaning of a Word Endpoint
    • HTTP Verb: GET
    • Production Endpoint:
      • <domain>/api/rest_v1/transform/word/from/{from_lang}/to/{to_lang}/{word}
    • cxserver Endpoint:
      • <domain>/v1/transform/word/from/{from_lang}/to/{to_lang}/{word}

This endpoint does not exist. Dictionary support was removed form cxserver.

  1. Global Fetch Dictionary Meaning by Provider Endpoint
    • HTTP Verb: GET
    • Production Endpoint:
      • <domain>/api/rest_v1/transform/word/from/{from_lang}/to/{to_lang}/{word}/{provider}
    • cxserver Endpoint:
      • <domain>/v1/transform/word/from/{from_lang}/to/{to_lang}/{word}/{provider}

This endpoint does not exist. Dictionary support was removed form cxserver.

After further investigation, this is considered invalid and we will instead remove the functionality from RESTBase.

@akosiaris we should continue here like we did with MCS, blocking traffic to the endpoints so the team can remove the functionality from the stack. How should we proceed? Is there a standard way to request these traffic changes?

After further investigation, this is considered invalid and we will instead remove the functionality from RESTBase.

@akosiaris we should continue here like we did with MCS, blocking traffic to the endpoints so the team can remove the functionality from the stack. How should we proceed? Is there a standard way to request these traffic changes?

No standard way, but we can tag this task as Traffic and I 'll take it from there since I did the last bunch too. Since the task is a bit difficult to parse and figure out what I need to block, would you be so kind as to update it with the exact url/url patterns that should be blocked? Thanks!

After further investigation, this is considered invalid and we will instead remove the functionality from RESTBase.

@akosiaris we should continue here like we did with MCS, blocking traffic to the endpoints so the team can remove the functionality from the stack. How should we proceed? Is there a standard way to request these traffic changes?

No standard way, but we can tag this task as Traffic and I 'll take it from there since I did the last bunch too. Since the task is a bit difficult to parse and figure out what I need to block, would you be so kind as to update it with the exact url/url patterns that should be blocked? Thanks!

@akosiaris I created this task (T375616) for the Traffic work and will re-scope this one for the removal of the code once the block is done.

MSantos updated the task description. (Show Details)
MSantos added a project: Essential-Work.
MSantos added a subscriber: santhosh.
MSantos added subscribers: Jgiannelos, daniel.
akosiaris renamed this task from Switchover plan from RESTBase to REST Gateway for cxserver to Decommission cxserver endpoints from RESTBase.Nov 20 2024, 9:35 AM