jenkins-bot has submitted this change and it was merged.
Change subject: Remove uri fallback from env.switchToConfig
......................................................................
Remove uri fallback from env.switchToConfig
* Seems specific to parserTests.js, where it's now patched, and a
potential source of confusion.
* Update the sitematrix.json to ensure be-taraskwiki isn't present.
Change-Id: Ifcfb0db1bf958afa80794d8603322e2d7cc1debe
---
M lib/mediawiki.parser.environment.js
M lib/sitematrix.json
M tests/parserTests.js
3 files changed, 9 insertions(+), 23 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/mediawiki.parser.environment.js
b/lib/mediawiki.parser.environment.js
index 5fb32f2..fa3e75e 100644
--- a/lib/mediawiki.parser.environment.js
+++ b/lib/mediawiki.parser.environment.js
@@ -280,22 +280,10 @@
var uri;
var getConfigPromise = Promise.method(function() {
- if (!prefix) {
- throw new Error('Wiki prefix not provided');
+ if (!prefix || !parsoid.interwikiMap.has(prefix)) {
+ throw new Error('No API URI available for: ' + prefix);
} else {
uri = parsoid.interwikiMap.get(prefix);
- if (!uri) {
- // SSS: Ugh! Looks like parser tests use a
prefix
- // that is not part of the interwikiMap -- so we
- // cannot crash with an error. Hence defaulting
- // to enwiki api which is quite odd. Does the
- // interwikiMap need updating or is this
use-case
- // valid outside of parserTests??
- env.log('error', 'Did not find api uri for ' +
- prefix + '; defaulting to
enwiki');
- uri = parsoid.interwikiMap.get('enwiki');
- }
-
if (env.confCache[prefix]) {
env.conf.wiki = env.confCache[prefix];
return nothingToDo;
diff --git a/lib/sitematrix.json b/lib/sitematrix.json
index e72b5a3..3bdc80b 100644
--- a/lib/sitematrix.json
+++ b/lib/sitematrix.json
@@ -4557,7 +4557,7 @@
"url": "http://or.wiktionary.org",
"dbname": "orwiktionary",
"code": "wiktionary",
- "sitename": "Wikipedia"
+ "sitename": "ଉଇକିଅଭିଧାନ"
},
{
"url": "http://or.wikisource.org",
@@ -6928,7 +6928,7 @@
],
"localname": "Zulu"
},
- "count": 889,
+ "count": 888,
"specials": [
{
"url": "http://advisory.wikimedia.org",
@@ -7324,12 +7324,6 @@
"dbname": "usabilitywiki",
"code": "usability",
"closed": ""
- },
- {
- "url": "http://ve.wikimedia.org",
- "dbname": "vewikimedia",
- "code": "vewikimedia",
- "fishbowl": ""
},
{
"url": "https://vote.wikimedia.org",
diff --git a/tests/parserTests.js b/tests/parserTests.js
index 8cdd8f3..0944c6b 100755
--- a/tests/parserTests.js
+++ b/tests/parserTests.js
@@ -1662,9 +1662,13 @@
var parsoidConfig = new ParsoidConfig( null, options );
parsoidConfig.interwikiMap.forEach(function( val, key ) {
- parsoidConfig.interwikiMap.set(key, mockAPIServerURL);
+ parsoidConfig.setInterwiki(key, mockAPIServerURL);
});
+ // This isn't part of the sitematrix but the
+ // "Check noCommafy in formatNum" test depends on it.
+ parsoidConfig.setInterwiki('be-taraskwiki', mockAPIServerURL);
+
// Set tracing and debugging before the env. object is
// constructed since tracing backends are registered there.
// (except for the --quiet option where the backends are
--
To view, visit https://gerrit.wikimedia.org/r/206521
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifcfb0db1bf958afa80794d8603322e2d7cc1debe
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits