Page MenuHomePhabricator

Support using the production REST API URL layout in RestbaseVirtualRESTService
Closed, ResolvedPublic

Description

Use case:

I am trying to figure out how to use the new URL scheme with RestbaseVirtualRESTService on my development wiki for testing, but that class hardcodes /v1/ in the url. so it seems impossible.

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 17 2016, 4:00 PM
GWicke triaged this task as Normal priority.Jun 17 2016, 4:01 PM

👍 This would be useful for Content translation development too. It is difficult now without local restbase instance.

Change 300000 had a related patch set uploaded (by Nikerabbit):
RestbaseVirtualRESTService: Support production URL layout

https://gerrit.wikimedia.org/r/300000

@mobrovac @Nikerabbit is waiting for review on this. This will make CX in Beta working again.

@Nikerabbit and I have been discussing this on Gerrit, but let's move the discussion here for posterity and transparency.

My stance is that the VRS shouldn't allow one to contact a wiki that is not in the same environment as the VRS itself.

I don't understand the push against making development and testing work easier.

It is not my intention to stop you from working or making your life harder (I choose to believe here that it's just about poor wording here, not intent). Mine is a security concern: the implications of contacting other wikis outside its execution environment go beyond making one's life easier. Why is it that you even need to contact production from Beta or your local machine? Both Beta and MW-Vagrant give you a full MW environment on top of which you can run CXServer and test it.

Our sprint work was partially blocked for weeks until I made this patch for myself and I am now running it on my development environment.
Similarly for beta labs, we currently do not have a good way to test CX extension changes there.

Mind expounding on this? What is Beta lacking?

Both are important issues. Some time ago I was told that parsoid on labs is not really maintained. I believe that has changed now, but I still doubt there is interest to run two sets of restbase/parsoid there (one that uses labs data, one that loads data from production).

Both RB and Parsoid are being regularly deployed to Beta. If you were being told otherwise, you should have checked what is going on with them seeing that CXServer heavily depends on them.

There has never been, nor will there ever be, an intention of running a production set of these services in Beta.

Or us spending time copying lots of pages with required templates and images. It seems much better to just to be able to point CX to the same restbase for html2wikitext where data was previously loaded from.

I am quite sure that creating an import/export script that copies some pages and/or files from prod to Beta would take you less than a day. Besides, you do not need all of production, you just need a representative subset in Beta so that you can test with it. Honestly, I'm not convinced that the I can only test with prod or nothing argument stands. Resolving this problem would not only bring benefits to you, but to the general Beta audience that runs into similar problems.

The change would be a tad simpler if the WMF production URL layout would be /api/rest/v1/.

It still wouldn't make the security concerns void...

Mind expounding on this? What is Beta lacking?

CX in Beta can't load articles from Production, which makes CX testing in Beta practically impossible.

Mind expounding on this? What is Beta lacking?

CX in Beta can't load articles from Production, which makes CX testing in Beta practically impossible.

If you re-read my previous post more carefully, you will see that my point is exactly this - CXServer shouldn't be doing this. It should load articles from the Beta MW install. My question was what was precluding you from doing just that.

@mobrovac Currently in Beta CX loads article from Beta. This is default behavior. But, to really test CX on Beta, we need to have articles from Production. As most of issues are related to source articles (templates, gallery, references, weird syntaxes (sometime!) and so on), it would be great to test using articles from Production.

Besides that, Beta doesn't have much articles and also not for all languages.

Change 300000 merged by jenkins-bot:
RestbaseVirtualRESTService: Support production URL layout

https://gerrit.wikimedia.org/r/300000

mobrovac closed this task as Resolved.Aug 25 2016, 3:11 PM

After discussing it in the team, we concluded that it is acceptable to use the production Wiki, given the need for various articles with different contents and the fact that the Beta DB might be wiped at any point.

Note that, in order to use this functionality, you will need to set up a different RB VRS for CXServer in Beta.

Thanks for re-considering this. Config change will be tracked as part of T129284.