Page MenuHomePhabricator

Adapt CX configuration to use v1 and v2 at a same time
Open, MediumPublic

Description

Before T107914 can be implemented, CX configuration need to adapt to use both v1 and v2 from cxserver in order to keep CX1 and CX2 working. Once CX2 is in production, we can switch back to normal configuration.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 18 2017, 1:34 PM

@mobrovac We have v1 and v2 apis in cxserver. v2 was recently added to support CX2(CX with VE - not exposed in production). Any reccommendation on interfacing this at wikimedia.org/api or xx.wikimedia.org/api ? What it takes to have https://wikimedia.org/api/rest_v2/ ?

I don't agree with the premise of this ticket. If these are two separate APIs, I don't see why they both have to be exposed before any of them can be used.

@mobrovac We have v1 and v2 apis in cxserver. v2 was recently added to support CX2(CX with VE - not exposed in production). Any reccommendation on interfacing this at wikimedia.org/api or xx.wikimedia.org/api ?

Where can the specification of v2 be seen? Does it incorporate v1 as well? Are there plans about switching from one to the other? These are some of the initial questions that need to be answered before we can make any progress on this.

What it takes to have https://wikimedia.org/api/rest_v2/ ?

It takes a whole new set of APIs for all of our components. Having a new version of the API for a single component that isn't even published yet does not warrant /api/rest_v2/. As I said, once we get more clarity on the questions above, we can start devising a plan.

Where can the specification of v2 be seen? Does it incorporate v1 as well? Are there plans about switching from one to the other? These are some of the initial questions that need to be answered before we can make any progress on this.

cxserver v2 is at https://cxserver.wikimedia.org/v2?doc.
cxserver v1 is at https://cxserver.wikimedia.org/v1?doc.

It changes the output structure, and input parameters for some apis from v1.

We will need v1 and v2 co-exist since v1 apis are for Content translation in production. v2 apis are for Content Translation V2 which is in development.

The development and deployment plan assumes CX1 and CX2 co-exist and gradually remove CX1. cxserver v2 api will provide every api that v1 api provides and modify some api behavior(Relevant code https://github.com/wikimedia/mediawiki-services-cxserver/blob/master/lib/routes/v2.js) .

Ok, so this is not actually blocking the roll-out of the v1 API if CX2 is still in development.

Pginer-WMF triaged this task as Medium priority.Feb 14 2018, 7:02 AM
Pginer-WMF moved this task from Backlog to Priority backlog on the Language-2018-Jan-Mar board.

Ok, so this is not actually blocking the roll-out of the v1 API if CX2 is still in development.

Now, we've reach point where we need v1 and v2 both in Production. We place to roll-out CX2 (which use v2) at the end of the quarter.

Update:

  • CX can work with v1 and v2 as switch can happen in mw-config without any issue.
  • Planning to add similar swith in restbase as it has v1 separately now.

I plan to update config in Beta this week (even though CX in Beta is broken).

Pginer-WMF added a subscriber: Pginer-WMF.EditedApr 8 2019, 9:55 AM

@KartikMistry can you provide more detail on the following?

a) What needs to be done here? The description is a bit confusing, because currently version 1 and version 2 of Content translation can be used. Maybe you can clarify what is not possible to do now that will be possible once this ticket is completed.

b) What is pending to complete this? Which work is still pending/needed to complete this ticket.

c) Considering that now version 2 is the default (although version 1 is still used for old translations), is that making things different in any way?

@KartikMistry can you provide more detail on the following?

a) What needs to be done here? The description is a bit confusing, because currently version 1 and version 2 of Content translation can be used. Maybe you can clarify what is not possible to do now that will be possible once this ticket is completed.

This is about cxserver v1/v2 end point.

b) What is pending to complete this? Which work is still pending/needed to complete this ticket.

I'll schedule further meeting with Marco/Alex and we can conclude final pending things.

c) Considering that now version 2 is the default (although version 1 is still used for old translations), is that making things different in any way?

If we can deprecate CX1, we don't need this.

AFAIK, nothing blocks on this task as of now and go ahead. I probably need to check V1 usage once again.

We still have v1 endpoint APIs with CX1, with drafts in-progress.

@santhosh Is there any easy way to detect if CX version is CX1 or CX2 since we removed ContentTranslationVersion variable from extension.json of extension.

We still have v1 endpoint APIs with CX1, with drafts in-progress.

@santhosh Is there any easy way to detect if CX version is CX1 or CX2 since we removed ContentTranslationVersion variable from extension.json of extension.

In which context do you need to know the version? There is mw.cx.getCXVersion() in mw.cx.util.js, which utilizes wgContentTranslationVersion config option.

In which context do you need to know the version? There is mw.cx.getCXVersion() in mw.cx.util.js, which utilizes wgContentTranslationVersion config option.

This should work for testing as of now, thanks!

Aklapper removed KartikMistry as the assignee of this task.Jun 19 2020, 4:19 PM

This task has been assigned to the same task owner for more than two years. Resetting task assignee due to inactivity, to decrease task cookie-licking and to get a slightly more realistic overview of plans. Please feel free to assign this task to yourself again if you still realistically work or plan to work on this task - it would be welcome!

For tips how to manage individual work in Phabricator (noisy notifications, lists of task, etc.), see https://phabricator.wikimedia.org/T228575#6237124 for available options.
(For the records, two emails were sent to assignee addresses before resetting assignees. See T228575 for more info and for potential feedback. Thanks!)