Cscott has uploaded a new change for review.

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

Change subject: Clean ups for apiConf refactor.
......................................................................

Clean ups for apiConf refactor.

This is a follow up to I05e2e1bf63ba1249b53be9666d3d8a2fcc435a39.

Change-Id: I0c2c0daec7b3df681faa0e039ae965cae6fa60ba
---
M lib/linter.js
M tests/parserTests.js
2 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/06/212306/1

diff --git a/lib/linter.js b/lib/linter.js
index ac3d27d..9659e12 100644
--- a/lib/linter.js
+++ b/lib/linter.js
@@ -7,6 +7,7 @@
 'use strict';
 
 var request = require('request');
+var url = require('url');
 
 var Linter = function(env) {
        this._env = env;
@@ -60,7 +61,7 @@
                msg.wiki = wiki;
                msg.page = this._env.page.name;
                msg.revision = this._env.page.meta.revision.revid;
-               msg.wikiurl = 
this._env.conf.parsoid.mwApiMap.get(wiki).uri.split('/w/')[0];
+               msg.wikiurl = 
url.resolve(this._env.conf.parsoid.mwApiMap.get(wiki).uri, '/');
 
                if ( logData.locationData ) {
                        msg.location = logData.locationData.toString();
diff --git a/tests/parserTests.js b/tests/parserTests.js
index 4125bdd..4af7259 100755
--- a/tests/parserTests.js
+++ b/tests/parserTests.js
@@ -1669,8 +1669,9 @@
                parsoidConfig.initMwApiMap();
 
                // Send all requests to the mock API server.
-               parsoidConfig.mwApiMap.forEach(function(val, key) {
-                       parsoidConfig.setMwApi(key, mockAPIServerURL);
+               parsoidConfig.reverseMwApiMap.clear();
+               parsoidConfig.mwApiMap.forEach(function(apiConf, prefix) {
+                       parsoidConfig.setMwApi(prefix, { uri: mockAPIServerURL 
});
                });
 
                // This isn't part of the sitematrix but the

-- 
To view, visit https://gerrit.wikimedia.org/r/212306
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c2c0daec7b3df681faa0e039ae965cae6fa60ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <canan...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to