Page MenuHomePhabricator

Write and merge puppet patch to update parsoid-rt-client.config.js to talk to Parsoid/PHP
Closed, ResolvedPublic

Description

Once we have Parsoid/PHP deployed to scandium, and we are ready to run roundtrip tests against it, we should update the parsoid-rt-client-config.js script to point to Parsoid/PHP instead of Parsoid/JS.

Event Timeline

Maybe we need some config file to pick options that override defaults in the puppet file? Otherwise, every time we need to switch between JS & PHP runs, we will need a new puppet patch.

ssastry triaged this task as Medium priority.Aug 5 2019, 8:21 PM

Let me know how parsoid-rt-client-config.js has to be changed and i can look at making a patch for puppet so that it can be switched back and forth by just flipping a hiera switch.

The file modules/testreduce/templates/parsoid-rt-client.config.js.erb sets:

opts: {
  // Talk to the existing Parsoid service.
  // No need to spin up our own private Parsoid service.
  parsoidURL: 'http://localhost:<%= @parsoid_port %>',
},

So, Parsoid/JS base url would be http://localhost:<%=@parsoid_port%>. But, Parsoid/PHP base url would be http://localhost/rest.php. What is the best way to do this?

The file modules/testreduce/templates/parsoid-rt-client.config.js.erb sets:

opts: {
  // Talk to the existing Parsoid service.
  // No need to spin up our own private Parsoid service.
  parsoidURL: 'http://localhost:<%= @parsoid_port %>',
},

So, Parsoid/JS base url would be http://localhost:<%=@parsoid_port%>. But, Parsoid/PHP base url would be http://localhost/rest.php. What is the best way to do this?

If required, we can update the rt testing script to accept new or different options.

So, we could possibly set opts: { js: { .., enabled: false }, php: { ..., enabled: true }, } and have hiera flip the enabled flag for opts.js or opts.php. Or any other idea you have. I don't know how hiera works and how we flip these flags. But, I can look up on wikitech later.

Change 528615 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] parsoid-testing: add Hiera switch between parsoid/JS and parsoid/PHP

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

Change 528615 merged by Dzahn:
[operations/puppet@production] parsoid-testing: add Hiera switch between parsoid/JS and parsoid/PHP

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

Change 528976 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] parsoid::testing: allow switching parsoid/JS to parsoid/PHP

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

Change 528976 merged by Dzahn:
[operations/puppet@production] parsoid::testing: allow switching parsoid/JS to parsoid/PHP

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

Change 529118 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] parsoid::testing: switch from Parsoid/PHP to Parsoid/JS

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

Change 529118 merged by Dzahn:
[operations/puppet@production] parsoid::testing: switch from Parsoid/PHP to Parsoid/JS

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

Change 529122 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] parsoid-testing: add both PHP and JS parsoid URLs to rt client config

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

Change 529122 merged by Dzahn:
[operations/puppet@production] parsoid-testing: add both PHP and JS parsoid URLs to rt client config

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

This is resolved on the puppet end. We will update the test runner in the Parsoid repo to look at filesystem state (some magic file) and pick either the JS or PHP config.