[MediaWiki-commits] [Gerrit] Print a message to run i18n_from_json when python i18n are m... - change (pywikibot/compat)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Print a message to run i18n_from_json when python i18n are 
missing
..


Print a message to run i18n_from_json when python i18n are missing

python i18n translation files are no longer supported but needed for compat.
But it is easy to create the needed files with a maintenance script. This
patch gives a warning to create these files if they are missing.

Change-Id: Ifd7b65f4d247c59fcea12677c4ead4d1f6567a45
---
M pywikibot/i18n.py
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index e62d04d..75590c4 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -335,7 +335,15 @@
 import table.
 
 package = twtitle.split(-)[0]
-transdict = getattr(__import__(i18n, {}, {}, [package]), package).msg
+try:
+transdict = getattr(__import__(i18n, {}, {}, [package]), package).msg
+except AttributeError:
+raise TranslationError(No translation file '%s' has been defined\n
+   for TranslateWiki key %r.\n
+   Please run the  maintenance script 
+   'i18n_from_json.py'\ninside  maintenance 
+   folder to generate the files.
+   % (package, twtitle))
 
 code_needed = False
 # If a site is given instead of a code, use its language

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd7b65f4d247c59fcea12677c4ead4d1f6567a45
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: John Vandenberg jay...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] filter S:RI from wm2015register T45250 - change (operations/puppet)

2015-07-05 Thread BBlack (Code Review)
BBlack has submitted this change and it was merged.

Change subject: filter S:RI from wm2015register T45250
..


filter S:RI from wm2015register T45250

Change-Id: Ib20e75a6d34f15d119f574c5ea08a7a1232c4e70
---
M templates/varnish/text-frontend.inc.vcl.erb
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  BBlack: Verified; Looks good to me, approved



diff --git a/templates/varnish/text-frontend.inc.vcl.erb 
b/templates/varnish/text-frontend.inc.vcl.erb
index 807e074..9271e14 100644
--- a/templates/varnish/text-frontend.inc.vcl.erb
+++ b/templates/varnish/text-frontend.inc.vcl.erb
@@ -60,6 +60,9 @@
 }
 
 sub filter_noise {
+   if (req.url ~ Special:RecordImpression.*campaign=wm2015register) {
+   error 403 Noise;
+   }
if (req.request == POST  req.url ~ 
index\.php\?option=com_jcetask=pluginplugin=imgmanagerfile=imgmanagermethod=formcid=)
 {
error 403 Noise;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib20e75a6d34f15d119f574c5ea08a7a1232c4e70
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack bbl...@wikimedia.org
Gerrit-Reviewer: BBlack bbl...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] filter S:RI from wm2015register T45250 - change (operations/puppet)

2015-07-05 Thread BBlack (Code Review)
BBlack has uploaded a new change for review.

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

Change subject: filter S:RI from wm2015register T45250
..

filter S:RI from wm2015register T45250

Change-Id: Ib20e75a6d34f15d119f574c5ea08a7a1232c4e70
---
M templates/varnish/text-frontend.inc.vcl.erb
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/79/222879/1

diff --git a/templates/varnish/text-frontend.inc.vcl.erb 
b/templates/varnish/text-frontend.inc.vcl.erb
index 807e074..9271e14 100644
--- a/templates/varnish/text-frontend.inc.vcl.erb
+++ b/templates/varnish/text-frontend.inc.vcl.erb
@@ -60,6 +60,9 @@
 }
 
 sub filter_noise {
+   if (req.url ~ Special:RecordImpression.*campaign=wm2015register) {
+   error 403 Noise;
+   }
if (req.request == POST  req.url ~ 
index\.php\?option=com_jcetask=pluginplugin=imgmanagerfile=imgmanagermethod=formcid=)
 {
error 403 Noise;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib20e75a6d34f15d119f574c5ea08a7a1232c4e70
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack bbl...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Remove www.donate.mediawiki.org from DNS - change (operations/dns)

2015-07-05 Thread Chmarkine (Code Review)
Chmarkine has uploaded a new change for review.

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

Change subject: Remove www.donate.mediawiki.org from DNS
..

Remove www.donate.mediawiki.org from DNS

http://www.donate.mediawiki.org is an Unconfigured domain.
After this domain is removed, mediawiki.org can be submitted
to HSTS preload list.

Bug: T102827
Change-Id: I0940f278af2ec2cdd6be0317b3bb444fdc760362
---
M templates/mediawiki.org
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/77/222877/1

diff --git a/templates/mediawiki.org b/templates/mediawiki.org
index 33bdce1..09fb984 100644
--- a/templates/mediawiki.org
+++ b/templates/mediawiki.org
@@ -44,7 +44,6 @@
 donate  600 IN DYNA geoip!text-addrs
 download600 IN DYNA geoip!text-addrs
 integration 600 IN DYNA geoip!text-addrs
-www.donate  600 IN DYNA geoip!text-addrs
 svn 600 IN DYNA geoip!text-addrs
 
 ; Mobile

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0940f278af2ec2cdd6be0317b3bb444fdc760362
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Chmarkine chmark...@hotmail.com

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


[MediaWiki-commits] [Gerrit] Remove www.donate.wikimediafoundation.org from DNS - change (operations/dns)

2015-07-05 Thread Chmarkine (Code Review)
Chmarkine has uploaded a new change for review.

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

Change subject: Remove www.donate.wikimediafoundation.org from DNS
..

Remove www.donate.wikimediafoundation.org from DNS

http://www.donate.wikimediafoundation.org redirects to
https://wikimediafoundation.org/wiki/Home, which is not
so useful anyway. After this domain is removed,
wikimediafoundation.org can be submitted to HSTS preload
list.

Bug: T102827
Change-Id: I8e27563a458203c5e6cef24e8253afbfd35746bf
---
M templates/wikimediafoundation.org
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/76/222876/1

diff --git a/templates/wikimediafoundation.org 
b/templates/wikimediafoundation.org
index 902842b..a1d1266 100644
--- a/templates/wikimediafoundation.org
+++ b/templates/wikimediafoundation.org
@@ -40,6 +40,5 @@
 www 600 IN DYNA geoip!text-addrs
 
 ; Other websites
-www.donate  600 IN DYNA geoip!text-addrs
 donate  600 IN DYNA geoip!text-addrs
 m   600 IN DYNA geoip!mobile-addrs

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e27563a458203c5e6cef24e8253afbfd35746bf
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Chmarkine chmark...@hotmail.com

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


[MediaWiki-commits] [Gerrit] Locating errors in the editing area - change (mediawiki...LanguageTool)

2015-07-05 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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

Change subject: Locating errors in the editing area
..

Locating errors in the editing area

Change-Id: Ice2ec2dfb489fad3e1d54eaf0dcabb431b51e4fc
---
A modules/ext.LanguageTool.css
M modules/ext.LanguageToolAction.js
2 files changed, 112 insertions(+), 49 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LanguageTool 
refs/changes/75/222875/1

diff --git a/modules/ext.LanguageTool.css b/modules/ext.LanguageTool.css
new file mode 100644
index 000..590dc78
--- /dev/null
+++ b/modules/ext.LanguageTool.css
@@ -0,0 +1,13 @@
+.hiddenSpellError {
+background-color: rgba(255,0,0, 0.2);
+cursor: pointer;
+}
+
+.hiddenGrammarError {
+background-color: #fee481;
+cursor: pointer;
+}
+
+.hiddenSuggestion {
+background-color: #fee481;
+}
diff --git a/modules/ext.LanguageToolAction.js 
b/modules/ext.LanguageToolAction.js
index c781af8..b749b20 100644
--- a/modules/ext.LanguageToolAction.js
+++ b/modules/ext.LanguageToolAction.js
@@ -17,6 +17,16 @@
 mw.languageToolAction = function VeUiLanguageToolAction( surface ) {
// Parent constructor
ve.ui.Action.call( this, surface );
+   this.surfaceModel = this.surface.getModel();
+   //console.log( this.surfaceModel );
+   this.surrogateAttribute = onkeypress;
+   this.surrogateAttributeDelimiter = ---#---;
+   this.ignoredRulesIds = [];
+   this.ignoredSpellingErrors = [];
+   this.$findResults = $( 'div' ).addClass( 'hiddenSpellError' );
+   this.initialFragment = null;
+   this.fragments = [];
+   this.surface.$selections.append( this.$findResults );
 };
 
 /* Inheritance */
@@ -72,7 +82,7 @@
  * @return {NULL} Action was executed
  */
 mw.languageToolAction.prototype.send = function () {
-   var textNodes, model, text, nodeI, node, nodeRange, nodeText, lang;
+   var textNodes, model, text, nodeI, node, nodeRange, nodeText, lang, 
self;
 
textNodes = this.extract();
model = ve.init.target.getSurface().getModel();
@@ -82,90 +92,123 @@
node = textNodes[nodeI];
nodeRange = node.getRange();
nodeText = model.getLinearFragment( nodeRange ).getText();
+
+   console.log( nodeText );
text = text + '\n' + nodeText;
}
 
+   console.log( text );
+
// TODO: Get the language from VE's data model
lang = mw.config.get( 'wgPageContentLanguage' );
+   self = this;
 
$.ajax( {
type: 'POST',
-   // dataType: 'xml',
+   dataType: 'xml',
url: 'http://tools.wmflabs.org/languageproofing/',
-   data: { language: lang,  text: text }
-   } ).done(
-   this.openDialog
-   //this.processXML
-   );
+   data: {language: lang,  text: text}
+   } ) .done( function( responseXML ) {
+   //console.log( responseXML );
+   self.openDialog.apply( self, [ responseXML, text ] );
+   } );
 
return;
-};
+}
 
-mw.languageToolAction.prototype.openDialog = function ( responseXML ) {
-   var suggestions, messageDialog, windowManager, errors, i, response;
+mw.languageToolAction.prototype.openDialog = function ( responseXML, text ) {
+   var results, range, fragment, surfaceModel, languageCode, 
previousSpanStart,
+   suggestionIndex, suggestion, spanStart, spanEnd, ruleId, 
cssName;
 
-   //var processXML = this.processXML.bind( this );
-   suggestions = this.processXML( responseXML );
-   console.log('suggestions');
-   console.log(suggestions);
+   //console.log( this.constructor.name );
+   //this.processXML = mw.languageToolAction.prototype.processXML.bind( 
this );
+   //console.log( responseXML );
+   results = this.processXML( responseXML );
+   surfaceModel = this.surface.getModel();
 
-   messageDialog = new OO.ui.MessageDialog();
+   this.suggestions = results;
+   //console.log( results );
+   // TODO: Get the language from VE's data model
+   languageCode = mw.config.get( 'wgPageContentLanguage' );
+   previousSpanStart = -1;
 
-   // Create and append a window manager
-   windowManager = new OO.ui.WindowManager();
-   $( 'body' ).append( windowManager.$element );
-   windowManager.addWindows( [ messageDialog ] );
+   // iterate backwards as we change the text and thus modify positions:
+   for ( suggestionIndex = this.suggestions.length - 1; suggestionIndex = 
0; suggestionIndex-- ) {
+   suggestion = this.suggestions[suggestionIndex];
 
-   errors = responseXML.getElementsByTagName( 'error' );
-   console.log( errors );
+   if (!suggestion.used) {
+   spanStart = suggestion.offset;
+   

[MediaWiki-commits] [Gerrit] Print a message to run i18n_from_json when python i18n are m... - change (pywikibot/compat)

2015-07-05 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

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

Change subject: Print a message to run i18n_from_json when python i18n are 
missing
..

Print a message to run i18n_from_json when python i18n are missing

python i18n translation files are no longer supported but needed for compat.
But it is easy to create the needed files with a maintenance script. This
patch gives a warning to create these files if they are missing.

Change-Id: Ifd7b65f4d247c59fcea12677c4ead4d1f6567a45
---
M pywikibot/i18n.py
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/78/222878/1

diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index e62d04d..75590c4 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -335,7 +335,15 @@
 import table.
 
 package = twtitle.split(-)[0]
-transdict = getattr(__import__(i18n, {}, {}, [package]), package).msg
+try:
+transdict = getattr(__import__(i18n, {}, {}, [package]), package).msg
+except AttributeError:
+raise TranslationError(No translation file '%s' has been defined\n
+   for TranslateWiki key %r.\n
+   Please run the  maintenance script 
+   'i18n_from_json.py'\ninside  maintenance 
+   folder to generate the files.
+   % (package, twtitle))
 
 code_needed = False
 # If a site is given instead of a code, use its language

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd7b65f4d247c59fcea12677c4ead4d1f6567a45
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

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


[MediaWiki-commits] [Gerrit] Add a test for cite_error_ref_no_input - change (mediawiki...Cite)

2015-07-05 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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

Change subject: Add a test for cite_error_ref_no_input
..

Add a test for cite_error_ref_no_input

Change-Id: Ibb3bb1ab3450a34889dcd66b34542f2dd25fdc2b
---
M citeParserTests.txt
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite 
refs/changes/84/222884/1

diff --git a/citeParserTests.txt b/citeParserTests.txt
index 98ad713..944b28d 100644
--- a/citeParserTests.txt
+++ b/citeParserTests.txt
@@ -449,3 +449,13 @@
 /ol/div
 
 !! end
+
+!! test
+ref with no name and no content.
+!! input
+Bla.ref/ref
+!! result
+pBla.strong class=error mw-ext-cite-errorCite error: Invalid 
codelt;refgt;/code tag;
+refs with no name must have content/strong
+/p
+!! end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb3bb1ab3450a34889dcd66b34542f2dd25fdc2b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il

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


[MediaWiki-commits] [Gerrit] Use the same selector for infobox as for bannerImage - change (mediawiki...MobileFrontend)

2015-07-05 Thread Florianschmidtwelzow (Code Review)
Florianschmidtwelzow has uploaded a new change for review.

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

Change subject: Use the same selector for infobox as for bannerImage
..

Use the same selector for infobox as for bannerImage

Bug: T104793
Change-Id: Ie4b2fea4a8ee9c653aba63dc9155407411cf1153
---
M resources/skins.minerva.alpha.scripts/infobox.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/86/222886/1

diff --git a/resources/skins.minerva.alpha.scripts/infobox.js 
b/resources/skins.minerva.alpha.scripts/infobox.js
index 9051f5c..7076a54 100644
--- a/resources/skins.minerva.alpha.scripts/infobox.js
+++ b/resources/skins.minerva.alpha.scripts/infobox.js
@@ -13,7 +13,7 @@
infobox = new Infobox( {
itemId: wikidataID
} );
-   infobox.insertAfter( '.pre-content' );
+   infobox.insertAfter( '.pre-content:first' );
 
overlayManager.add( /\/infobox\/editor/, function () {
return new InfoboxEditorOverlay( {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4b2fea4a8ee9c653aba63dc9155407411cf1153
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow florian.schmidt.wel...@t-online.de

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


[MediaWiki-commits] [Gerrit] Add blacklisted gom code to SKIPLANGS too - change (translatewiki)

2015-07-05 Thread Nemo bis (Code Review)
Nemo bis has uploaded a new change for review.

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

Change subject: Add blacklisted gom code to SKIPLANGS too
..

Add blacklisted gom code to SKIPLANGS too

So that translators worry less.
https://translatewiki.net/wiki/Thread:Support/Please_delete_gom_translations

Change-Id: I71acd46f3ba69efd62106826539412edf0bba11c
---
M bin/do-stats
M bin/export-by-prefix
M bin/repoexport
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/93/222893/1

diff --git a/bin/do-stats b/bin/do-stats
index 26deba7..0b3d7eb 100755
--- a/bin/do-stats
+++ b/bin/do-stats
@@ -22,7 +22,7 @@
 echo $WIKIPAGE
 exit
 STATSFILE=$HOME/temp/stats.txt
-SKIPLANGS=test, aeb, be-x-old, crh, de-ch, dk, en, fiu-vro, gan, got, hif, 
kbd, kk, kk-cn, iu, kk-kz, kk-tr, ko-kp, ku, ku-arab, no, ruq, simple, sr, tg, 
tp, tt, ug, zh, zh-classical, zh-cn, zh-sg, zh-hk, zh-min-nan, zh-mo, zh-my, 
zh-tw, zh-yue, bbc, ady
+SKIPLANGS=test, aeb, be-x-old, crh, de-ch, dk, en, fiu-vro, gan, gom, got, 
hif, kbd, kk, kk-cn, iu, kk-kz, kk-tr, ko-kp, ku, ku-arab, no, ruq, simple, sr, 
tg, tp, tt, ug, zh, zh-classical, zh-cn, zh-sg, zh-hk, zh-min-nan, zh-mo, 
zh-my, zh-tw, zh-yue, bbc, ady
 
 # create basic stats file for $GROUPS
 /usr/bin/php 
/srv/mediawiki/targets/production/extensions/Translate/scripts/groupStatistics.php
 --fuzzy --skipzero --groups=${GROUPS} --skiplanguages=${SKIPLANGS}  
${STATSFILE}
diff --git a/bin/export-by-prefix b/bin/export-by-prefix
index 32d9576..a659582 100755
--- a/bin/export-by-prefix
+++ b/bin/export-by-prefix
@@ -16,7 +16,7 @@
 HOURS=--hours=200 # Somewhat over week
 PROJECT=$2
 SKIPGROUPS=
-SKIPLANGS=--skip=test,aeb,be-x-old,crh,dk,en,fiu-vro,gan,got,hif,kbd,kk,kk-cn,iu,kk-k,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-sg,zh-hk,zh-min-nan,zh-mo,zh-my,zh-tw,zh-yue,bbc,ady
+SKIPLANGS=--skip=test,aeb,be-x-old,crh,dk,en,fiu-vro,gan,gom,got,hif,kbd,kk,kk-cn,iu,kk-k,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-sg,zh-hk,zh-min-nan,zh-mo,zh-my,zh-tw,zh-yue,bbc,ady
 TARGET=$3
 
 cd $DIR
diff --git a/bin/repoexport b/bin/repoexport
index e2fc40f..26cbec1 100755
--- a/bin/repoexport
+++ b/bin/repoexport
@@ -15,7 +15,7 @@
 echo $(date --rfc-3339=seconds --utc) [$(whoami) at $DIR] $0 $@  ${DIRLOG}
 
 EXPORTER=$WIKI/extensions/Translate/scripts/export.php
-SKIPLANGS=test,aeb,be-x-old,crh,dk,en,fiu-vro,gan,got,hif,kbd,kk,kk-cn,iu,kk-kz,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-sg,zh-hk,zh-min-nan,zh-mo,zh-my,zh-tw,zh-yue,bbc,ady
+SKIPLANGS=test,aeb,be-x-old,crh,dk,en,fiu-vro,gan,gom,got,hif,kbd,kk,kk-cn,iu,kk-kz,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-sg,zh-hk,zh-min-nan,zh-mo,zh-my,zh-tw,zh-yue,bbc,ady
 FORCELANGS=chy,cr,ki,nrm,rn,rup,rw,tum,tw # Must not contain any of those 
above
 THRESHOLD=--threshold 35
 HOURS=--hours 200 # Somewhat over a week

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71acd46f3ba69efd62106826539412edf0bba11c
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nemo bis federicol...@tiscali.it

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


[MediaWiki-commits] [Gerrit] Removing obsolete `-moz-inline-block` property - change (mediawiki/core)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Removing obsolete `-moz-inline-block` property
..


Removing obsolete `-moz-inline-block` property

Bug: T103605
Change-Id: Id689cfd629d94a82999020121d4275c5daac4e58
---
M resources/src/mediawiki.action/mediawiki.action.edit.css
M resources/src/mediawiki.legacy/commonPrint.css
M resources/src/mediawiki.legacy/oldshared.css
M resources/src/mediawiki.legacy/shared.css
M resources/src/mediawiki.skinning/content.css
5 files changed, 1 insertion(+), 8 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  Edokter: Looks good to me, but someone else must approve
  VolkerE: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.css 
b/resources/src/mediawiki.action/mediawiki.action.edit.css
index 45ba543..9b0c430 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.css
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.css
@@ -7,9 +7,6 @@
height: 22px;
cursor: pointer;
vertical-align: middle;
-   /* Cross-browser inline-block */
-   /* Firefox 2 */
-   display: -moz-inline-block;
/* Modern browsers */
display: inline-block;
/* IE7 */
diff --git a/resources/src/mediawiki.legacy/commonPrint.css 
b/resources/src/mediawiki.legacy/commonPrint.css
index 9a8d391..e35b1cf 100644
--- a/resources/src/mediawiki.legacy/commonPrint.css
+++ b/resources/src/mediawiki.legacy/commonPrint.css
@@ -123,7 +123,6 @@
border: 1px solid #aa;
background-color: #f9f9f9;
padding: 5px;
-   display: -moz-inline-block;
display: inline-block;
display: table;
/* IE7 and earlier */
diff --git a/resources/src/mediawiki.legacy/oldshared.css 
b/resources/src/mediawiki.legacy/oldshared.css
index c2bd5a7..196ea21 100644
--- a/resources/src/mediawiki.legacy/oldshared.css
+++ b/resources/src/mediawiki.legacy/oldshared.css
@@ -168,7 +168,6 @@
padding: 5px;
font-size: 95%;
text-align: center;
-   display: -moz-inline-block;
display: inline-block;
display: table;
 
diff --git a/resources/src/mediawiki.legacy/shared.css 
b/resources/src/mediawiki.legacy/shared.css
index 6b8cb19..a0861df 100644
--- a/resources/src/mediawiki.legacy/shared.css
+++ b/resources/src/mediawiki.legacy/shared.css
@@ -566,7 +566,6 @@
border: 1px solid;
padding: .5em 1em;
margin-bottom: 1em;
-   display: -moz-inline-block;
display: inline-block;
zoom: 1;
*display: inline;
diff --git a/resources/src/mediawiki.skinning/content.css 
b/resources/src/mediawiki.skinning/content.css
index 7dd5ee7..454fe58 100644
--- a/resources/src/mediawiki.skinning/content.css
+++ b/resources/src/mediawiki.skinning/content.css
@@ -23,14 +23,13 @@
  * We use display:table. Even though it should only contain other table-* 
display
  * elements, there are no known problems with using this.
  *
- * Because IE  8, FF 2 and other older browsers don't support display:table, 
we fallback to
+ * Because IE  8 and other older browsers don't support display:table, we 
fallback to
  * using inline-block mode, which features at least intrinsic width, but won't 
clear preceding
  * inline elements. In practice inline elements surrounding the TOC are 
uncommon enough that
  * this is an acceptable sacrifice.
  */
 #toc,
 .toc {
-   display: -moz-inline-block;
display: inline-block;
display: table;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id689cfd629d94a82999020121d4275c5daac4e58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński matma@gmail.com
Gerrit-Reviewer: Edokter er...@darcoury.nl
Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net
Gerrit-Reviewer: Krinkle krinklem...@gmail.com
Gerrit-Reviewer: VolkerE ve...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Improve special page UI a little - change (mediawiki...SmiteSpam)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Improve special page UI a little
..


Improve special page UI a little

Added Delete selected buttons both above and below the table - only
become visible once the table is displayed. Also added select all and
select none.

Change-Id: I4b418c0f7d62ddeba3f3b931d80bd3300a128440
---
M SmiteSpam.php
M SpecialSmiteSpam.php
M i18n/en.json
M i18n/qqq.json
M static/js/ext.smitespam.retriever.js
5 files changed, 35 insertions(+), 3 deletions(-)

Approvals:
  jan: Looks good to me, but someone else must approve
  Polybuildr: Looks good to me, approved
  Yaron Koren: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/SmiteSpam.php b/SmiteSpam.php
index b47b430..289ff15 100644
--- a/SmiteSpam.php
+++ b/SmiteSpam.php
@@ -45,6 +45,9 @@
'smitespam-delete-page-success-msg',
'smitespam-delete-page-failure-msg',
'smitespam-deleted-reason',
+   'powersearch-toggleall',
+   'powersearch-togglenone',
+   'smitespam-select',
),
 );
 
diff --git a/SpecialSmiteSpam.php b/SpecialSmiteSpam.php
index 9793fcc..1433f95 100644
--- a/SpecialSmiteSpam.php
+++ b/SpecialSmiteSpam.php
@@ -54,6 +54,11 @@
)
)
);
+
+   $out-addHTML( 'div id=smitespam-select-options/div' );
+
+   $out-addHTML( 'input type=submit value='
+   . $this-msg( 'smitespam-delete-selected' ) . ' 
style=display:none;' );
$out-addHTML( Html::openElement( 'table', array(
'class' = 'wikitable',
'id' = 'smitespam-page-list',
@@ -61,7 +66,7 @@
 
$out-addHTML( Html::closeElement( 'table' ) );
$out-addHTML( 'input type=submit value='
-   . $this-msg( 'smitespam-delete-selected' ) . '' );
+   . $this-msg( 'smitespam-delete-selected' ) . ' 
style=display:none;' );
$out-addHTML( Html::closeElement( 'form' ) );
 
$out-addModules( 'ext.SmiteSpam.retriever' );
diff --git a/i18n/en.json b/i18n/en.json
index 30013bf..41cac73 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -20,5 +20,6 @@
smitespam-probability-low: Low,
smitespam-probability-medium: Medium,
smitespam-probability-high: High,
-   smitespam-probability-very-high: Very high
+   smitespam-probability-very-high: Very high,
+   smitespam-select: Select: 
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index abf249a..b17e47f 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -22,5 +22,6 @@
smitespam-probability-low: Low probability\n{{Identical|Low}},
smitespam-probability-medium: Medium 
probability\n{{Identical|Medium}},
smitespam-probability-high: High probability\n{{Identical|High}},
-   smitespam-probability-very-high: Very high probability
+   smitespam-probability-very-high: Very high probability,
+   smitespam-select: Followed by two links: 
{{msg-mw|Powersearch-toggleall}} and {{msg-mw|Powersearch-togglenone}} which 
respectively selects all pages and de-selects all pages\n{{Identical|Select}}
 }
diff --git a/static/js/ext.smitespam.retriever.js 
b/static/js/ext.smitespam.retriever.js
index 4b1d808..63116a8 100644
--- a/static/js/ext.smitespam.retriever.js
+++ b/static/js/ext.smitespam.retriever.js
@@ -127,6 +127,28 @@
$( '#displayed-page-number' ).text( 
resultPageToDisplay.getValue() + 1 );
},
displayResults: function () {
+   $( '#smitespam-delete-pages input[type=submit]' 
).show();
+   var $selectAll = $( 'a' )
+   .attr( 'href', '#' )
+   .text( mw.msg( 'powersearch-toggleall' ) )
+   .on( 'click', function () {
+   $( '#smitespam-page-list 
input[type=checkbox]' ).each( function () {
+   $( this ).prop( 'checked', true 
).triggerHandler( 'change' );
+   } );
+   } );
+   var $selectNone = $( 'a' )
+   .attr( 'href', '#' )
+   .text( mw.msg( 'powersearch-togglenone' ) )
+   .on( 'click', function () {
+   $( '#smitespam-page-list 
input[type=checkbox]' ).each( function () {
+   $( this ).prop( 'checked', 
false ).triggerHandler( 'change' );
+   } );
+   } );
+   $( '#smitespam-select-options' ).empty();
+ 

[MediaWiki-commits] [Gerrit] Remove ApiWikibase::mustBePosted - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Remove ApiWikibase::mustBePosted
..

Remove ApiWikibase::mustBePosted

This is already correctly assesed by
ApiBase::mustBePosted which checks if a token
is needed or not.

If we require a token, it must be posted

Change-Id: I4ccc278ce9c4d8e294fc456032078de4a92ae094
---
M repo/includes/api/ApiWikibase.php
1 file changed, 0 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/03/222903/1

diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index eee9cab..c05b6cc 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -161,15 +161,6 @@
}
 
/**
-* @see ApiBase::mustBePosted()
-*
-* @return bool
-*/
-   public function mustBePosted() {
-   return $this-isWriteMode();
-   }
-
-   /**
 * Returns the permissions that are required to perform the operation 
specified by
 * the parameters.
 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ccc278ce9c4d8e294fc456032078de4a92ae094
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore addshorew...@gmail.com

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


[MediaWiki-commits] [Gerrit] Locating errors in the editing area - change (mediawiki...LanguageTool)

2015-07-05 Thread Ankita-ks (Code Review)
Ankita-ks has submitted this change and it was merged.

Change subject: Locating errors in the editing area
..


Locating errors in the editing area

A squashing of several patches by Ankita.

Change-Id: Ice2ec2dfb489fad3e1d54eaf0dcabb431b51e4fc
---
A modules/ext.LanguageTool.css
M modules/ext.LanguageToolAction.js
2 files changed, 112 insertions(+), 49 deletions(-)

Approvals:
  Ankita-ks: Verified; Looks good to me, approved



diff --git a/modules/ext.LanguageTool.css b/modules/ext.LanguageTool.css
new file mode 100644
index 000..590dc78
--- /dev/null
+++ b/modules/ext.LanguageTool.css
@@ -0,0 +1,13 @@
+.hiddenSpellError {
+background-color: rgba(255,0,0, 0.2);
+cursor: pointer;
+}
+
+.hiddenGrammarError {
+background-color: #fee481;
+cursor: pointer;
+}
+
+.hiddenSuggestion {
+background-color: #fee481;
+}
diff --git a/modules/ext.LanguageToolAction.js 
b/modules/ext.LanguageToolAction.js
index c781af8..b749b20 100644
--- a/modules/ext.LanguageToolAction.js
+++ b/modules/ext.LanguageToolAction.js
@@ -17,6 +17,16 @@
 mw.languageToolAction = function VeUiLanguageToolAction( surface ) {
// Parent constructor
ve.ui.Action.call( this, surface );
+   this.surfaceModel = this.surface.getModel();
+   //console.log( this.surfaceModel );
+   this.surrogateAttribute = onkeypress;
+   this.surrogateAttributeDelimiter = ---#---;
+   this.ignoredRulesIds = [];
+   this.ignoredSpellingErrors = [];
+   this.$findResults = $( 'div' ).addClass( 'hiddenSpellError' );
+   this.initialFragment = null;
+   this.fragments = [];
+   this.surface.$selections.append( this.$findResults );
 };
 
 /* Inheritance */
@@ -72,7 +82,7 @@
  * @return {NULL} Action was executed
  */
 mw.languageToolAction.prototype.send = function () {
-   var textNodes, model, text, nodeI, node, nodeRange, nodeText, lang;
+   var textNodes, model, text, nodeI, node, nodeRange, nodeText, lang, 
self;
 
textNodes = this.extract();
model = ve.init.target.getSurface().getModel();
@@ -82,90 +92,123 @@
node = textNodes[nodeI];
nodeRange = node.getRange();
nodeText = model.getLinearFragment( nodeRange ).getText();
+
+   console.log( nodeText );
text = text + '\n' + nodeText;
}
 
+   console.log( text );
+
// TODO: Get the language from VE's data model
lang = mw.config.get( 'wgPageContentLanguage' );
+   self = this;
 
$.ajax( {
type: 'POST',
-   // dataType: 'xml',
+   dataType: 'xml',
url: 'http://tools.wmflabs.org/languageproofing/',
-   data: { language: lang,  text: text }
-   } ).done(
-   this.openDialog
-   //this.processXML
-   );
+   data: {language: lang,  text: text}
+   } ) .done( function( responseXML ) {
+   //console.log( responseXML );
+   self.openDialog.apply( self, [ responseXML, text ] );
+   } );
 
return;
-};
+}
 
-mw.languageToolAction.prototype.openDialog = function ( responseXML ) {
-   var suggestions, messageDialog, windowManager, errors, i, response;
+mw.languageToolAction.prototype.openDialog = function ( responseXML, text ) {
+   var results, range, fragment, surfaceModel, languageCode, 
previousSpanStart,
+   suggestionIndex, suggestion, spanStart, spanEnd, ruleId, 
cssName;
 
-   //var processXML = this.processXML.bind( this );
-   suggestions = this.processXML( responseXML );
-   console.log('suggestions');
-   console.log(suggestions);
+   //console.log( this.constructor.name );
+   //this.processXML = mw.languageToolAction.prototype.processXML.bind( 
this );
+   //console.log( responseXML );
+   results = this.processXML( responseXML );
+   surfaceModel = this.surface.getModel();
 
-   messageDialog = new OO.ui.MessageDialog();
+   this.suggestions = results;
+   //console.log( results );
+   // TODO: Get the language from VE's data model
+   languageCode = mw.config.get( 'wgPageContentLanguage' );
+   previousSpanStart = -1;
 
-   // Create and append a window manager
-   windowManager = new OO.ui.WindowManager();
-   $( 'body' ).append( windowManager.$element );
-   windowManager.addWindows( [ messageDialog ] );
+   // iterate backwards as we change the text and thus modify positions:
+   for ( suggestionIndex = this.suggestions.length - 1; suggestionIndex = 
0; suggestionIndex-- ) {
+   suggestion = this.suggestions[suggestionIndex];
 
-   errors = responseXML.getElementsByTagName( 'error' );
-   console.log( errors );
+   if (!suggestion.used) {
+   spanStart = suggestion.offset;
+   spanEnd = 

[MediaWiki-commits] [Gerrit] [bugfix] Double double escape brace chars to enable double f... - change (pywikibot/core)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: [bugfix] Double double escape brace chars to enable double 
formatting
..


[bugfix] Double double escape brace chars to enable double formatting

Bug: T104798
Change-Id: I19311da391b8778bba8ccd3d00e2d9be57abaee2
---
M pywikibot/bot.py
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  XZise: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index bc47a80..57e8ec0 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -935,8 +935,9 @@
 if self._new is False:
 question += 'be unlinked?'
 else:
-question += 'target to 
\03{{lightpurple}}{0}\03{{default}}?'.format(
-self._new.canonical_title())
+question += ('target to '
+ 
'\03lightpurple{0}\03default?').format(
+ self._new.canonical_title())
 
 choice = pywikibot.input_choice(
 question.format(self._old.canonical_title()),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I19311da391b8778bba8ccd3d00e2d9be57abaee2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: John Vandenberg jay...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: XZise commodorefabia...@gmx.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Replace Claims with StatementList in Api\SetClaim - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Replace Claims with StatementList in Api\SetClaim
..


Replace Claims with StatementList in Api\SetClaim

Change-Id: I676cbf68d97ed7a47810fa04452fb5a53e99e760
---
M repo/includes/api/SetClaim.php
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/api/SetClaim.php b/repo/includes/api/SetClaim.php
index da51806..1d04bf6 100644
--- a/repo/includes/api/SetClaim.php
+++ b/repo/includes/api/SetClaim.php
@@ -14,9 +14,9 @@
 use Wikibase\ChangeOp\StatementChangeOpFactory;
 use Wikibase\ClaimSummaryBuilder;
 use Wikibase\DataModel\Claim\Claim;
-use Wikibase\DataModel\Claim\Claims;
 use Wikibase\DataModel\Entity\Entity;
 use Wikibase\DataModel\Statement\StatementGuidParsingException;
+use Wikibase\DataModel\Statement\StatementListProvider;
 use Wikibase\Lib\Serializers\SerializerFactory;
 use Wikibase\Repo\Diff\ClaimDiffer;
 use Wikibase\Repo\WikibaseRepo;
@@ -99,15 +99,17 @@
 * @todo this summary builder is ugly and summary stuff needs to be 
refactored
 */
private function getSummary( array $params, Claim $claim, Entity 
$entity ) {
+   if ( !( $entity instanceof StatementListProvider ) ) {
+   throw new InvalidArgumentException( '$entity must be a 
StatementListProvider' );
+   }
+
$claimSummaryBuilder = new ClaimSummaryBuilder(
$this-getModuleName(),
new ClaimDiffer( new OrderedListDiffer( new 
ComparableComparer() ) )
);
 
-   $claims = new Claims( $entity-getClaims() );
-
$summary = $claimSummaryBuilder-buildClaimSummary(
-   $claims-getClaimWithGuid( $claim-getGuid() ),
+   $entity-getStatements()-getFirstStatementWithGuid( 
$claim-getGuid() ),
$claim
);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I676cbf68d97ed7a47810fa04452fb5a53e99e760
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene benestar.wikime...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Bene benestar.wikime...@gmail.com
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Use getStatements instead of getClaim in ChangeOpsMerge - change (mediawiki...Wikibase)

2015-07-05 Thread Bene (Code Review)
Bene has uploaded a new change for review.

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

Change subject: Use getStatements instead of getClaim in ChangeOpsMerge
..

Use getStatements instead of getClaim in ChangeOpsMerge

Also did some refactoring.

Change-Id: Ie5b258d1a873707b9102ec11945e181224329da5
---
M repo/includes/ChangeOp/ChangeOpsMerge.php
1 file changed, 20 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/92/222892/1

diff --git a/repo/includes/ChangeOp/ChangeOpsMerge.php 
b/repo/includes/ChangeOp/ChangeOpsMerge.php
index 6aaf4cf..b69fef1 100644
--- a/repo/includes/ChangeOp/ChangeOpsMerge.php
+++ b/repo/includes/ChangeOp/ChangeOpsMerge.php
@@ -7,7 +7,6 @@
 use SiteLookup;
 use ValueValidators\Error;
 use ValueValidators\Result;
-use Wikibase\DataModel\Claim\Claim;
 use Wikibase\DataModel\Entity\Entity;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\Item;
@@ -158,7 +157,7 @@
$this-generateDescriptionsChangeOps();
$this-generateAliasesChangeOps();
$this-generateSitelinksChangeOps();
-   $this-generateClaimsChangeOps();
+   $this-generateStatementsChangeOps();
}
 
private function generateLabelsChangeOps() {
@@ -257,43 +256,40 @@
return $site;
}
 
-   private function generateClaimsChangeOps() {
-   foreach ( $this-fromItem-getClaims() as $fromClaim ) {
-   $this-fromChangeOps-add( 
$this-getStatementChangeOpFactory()-newRemoveStatementOp( 
$fromClaim-getGuid() ) );
+   private function generateStatementsChangeOps() {
+   foreach ( $this-fromItem-getStatements() as $fromStatement ) {
+   $this-fromChangeOps-add( 
$this-getStatementChangeOpFactory()-newRemoveStatementOp( 
$fromStatement-getGuid() ) );
 
-   $toClaim = clone $fromClaim;
-   $toClaim-setGuid( null );
-   $toMergeToClaim = false;
+   $toStatement = clone $fromStatement;
+   $toStatement-setGuid( null );
+   $toMergeToStatement = $this-findEquivalentStatement( 
$toStatement );
 
-   if ( $toClaim instanceof Statement ) {
-   $toMergeToClaim = $this-findEquivalentClaim( 
$toClaim );
-   }
-
-   if ( $toMergeToClaim ) {
-   $this-generateReferencesChangeOps( $toClaim, 
$toMergeToClaim );
+   if ( $toMergeToStatement ) {
+   $this-generateReferencesChangeOps( 
$toStatement, $toMergeToStatement );
} else {
-   $this-toChangeOps-add( 
$this-getStatementChangeOpFactory()-newSetStatementOp( $toClaim ) );
+   $this-toChangeOps-add( 
$this-getStatementChangeOpFactory()-newSetStatementOp( $toStatement ) );
}
}
}
 
/**
-* Finds a claim in the target entity with the same main snak and 
qualifiers as $fromStatement
+* Finds a statement in the target entity with the same main snak and 
qualifiers as $fromStatement
 *
 * @param Statement $fromStatement
 *
-* @return Claim|false Claim to merge reference into or false
+* @return Statement|false Statement to merge reference into or false
 */
-   private function findEquivalentClaim( $fromStatement ) {
-   $fromHash = $this-getClaimHash( $fromStatement );
+   private function findEquivalentStatement( $fromStatement ) {
+   $fromHash = $this-getStatementHash( $fromStatement );
 
-   /** @var $claim Claim */
-   foreach ( $this-toItem-getClaims() as $claim ) {
-   $toHash = $this-getClaimHash( $claim );
+   /** @var Statement $statement */
+   foreach ( $this-toItem-getStatements() as $statement ) {
+   $toHash = $this-getStatementHash( $statement );
if ( $toHash === $fromHash ) {
-   return $claim;
+   return $statement;
}
}
+
return false;
}
 
@@ -302,7 +298,7 @@
 *
 * @return string combined hash of the Mainsnak and Qualifiers
 */
-   private function getClaimHash( Statement $statement ) {
+   private function getStatementHash( Statement $statement ) {
return $statement-getMainSnak()-getHash() . 
$statement-getQualifiers()-getHash();
}
 

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

Gerrit-MessageType: 

[MediaWiki-commits] [Gerrit] Autosize description field to expand with content - change (analytics...web)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Autosize description field to expand with content
..


Autosize description field to expand with content

Bug: T77945
Change-Id: Id060ddecee59a9b33e8d386f535f5cec487b6bf6
---
M quarry/web/static/js/query/view.js
M quarry/web/templates/query/view.html
2 files changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Yuvipanda: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/quarry/web/static/js/query/view.js 
b/quarry/web/static/js/query/view.js
index c57f407..d0df447 100644
--- a/quarry/web/static/js/query/view.js
+++ b/quarry/web/static/js/query/view.js
@@ -15,6 +15,8 @@
 matchBrackets: true
 });
 
+$('#query-description').autosize();
+
 if (vars.can_edit) {
 $('#title').blur(function() {
 $.post( /api/query/meta, {
diff --git a/quarry/web/templates/query/view.html 
b/quarry/web/templates/query/view.html
index db4841c..afbec52 100644
--- a/quarry/web/templates/query/view.html
+++ b/quarry/web/templates/query/view.html
@@ -11,6 +11,7 @@
 script 
src=//tools-static.wmflabs.org/cdnjs/ajax/libs/codemirror/5.4.0/addon/edit/matchbrackets.min.js
 /script
 script src=/static/vendor/datatables-1.10.2/js/jquery.dataTables.min.js 
/script
 script src=/static/vendor/datatables-1.10.2/js/dataTables.bootstrap.js 
/script
+script 
src=//tools-static.wmflabs.org/cdnjs/ajax/libs/autosize.js/1.18.18/jquery.autosize.min.js
 /script
 link href=/static/vendor/datatables-1.10.2/css/dataTables.bootstrap.css 
rel=stylesheet
 script src=/static/js/query/view.js /script
 {% endblock %}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id060ddecee59a9b33e8d386f535f5cec487b6bf6
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Use getStatements instead of getClaims in EntityContent subc... - change (mediawiki...Wikibase)

2015-07-05 Thread Bene (Code Review)
Bene has uploaded a new change for review.

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

Change subject: Use getStatements instead of getClaims in EntityContent 
subclasses
..

Use getStatements instead of getClaims in EntityContent subclasses

Change-Id: I0709f49dd46714286b2bc2fc558facc498615701
---
M repo/includes/content/EntityContent.php
M repo/includes/content/ItemContent.php
M repo/includes/content/PropertyContent.php
3 files changed, 22 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/95/222895/1

diff --git a/repo/includes/content/EntityContent.php 
b/repo/includes/content/EntityContent.php
index 3577335..9c85b81 100644
--- a/repo/includes/content/EntityContent.php
+++ b/repo/includes/content/EntityContent.php
@@ -742,7 +742,6 @@
 *
 * Keys used:
 * - wb-status: the entity's status, according to getEntityStatus()
-* - wb-claims: the number of claims in the entity
 *
 * @return array A map from property names to property values.
 */
@@ -751,9 +750,7 @@
return array();
}
 
-   $properties = array(
-   'wb-claims' = count( $this-getEntity()-getClaims() ),
-   );
+   $properties = array();
 
$status = $this-getEntityStatus();
 
diff --git a/repo/includes/content/ItemContent.php 
b/repo/includes/content/ItemContent.php
index ee013da..4423669 100644
--- a/repo/includes/content/ItemContent.php
+++ b/repo/includes/content/ItemContent.php
@@ -209,7 +209,8 @@
/**
 * @see EntityContent::getEntityPageProperties
 *
-* Records the number of sitelinks in the 'wb-sitelinks' key.
+* Records the number of statements in the 'wb-claims' key
+* and sitelinks in the 'wb-sitelinks' key.
 *
 * @return array A map from property names to property values.
 */
@@ -219,6 +220,7 @@
}
 
$properties = parent::getEntityPageProperties();
+   $properties['wb-claims'] = 
$this-getItem()-getStatements()-count();
$properties['wb-sitelinks'] = 
$this-getItem()-getSiteLinkList()-count();
 
return $properties;
diff --git a/repo/includes/content/PropertyContent.php 
b/repo/includes/content/PropertyContent.php
index b8b40d0..c8f7c51 100644
--- a/repo/includes/content/PropertyContent.php
+++ b/repo/includes/content/PropertyContent.php
@@ -92,6 +92,24 @@
}
 
/**
+* @see EntityContent::getEntityPageProperties
+*
+* Records the number of statements in the 'wb-claims' key.
+*
+* @return array A map from property names to property values.
+*/
+   public function getEntityPageProperties() {
+   if ( $this-isRedirect() ) {
+   return array();
+   }
+
+   $properties = parent::getEntityPageProperties();
+   $properties['wb-claims'] = 
$this-getProperty()-getStatements()-count();
+
+   return $properties;
+   }
+
+   /**
 * Checks if this PropertyContent is valid for saving.
 *
 * Returns false if the entity does not have a DataType set.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0709f49dd46714286b2bc2fc558facc498615701
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene benestar.wikime...@gmail.com

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


[MediaWiki-commits] [Gerrit] Autosize description field to expand with content - change (analytics...web)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: Autosize description field to expand with content
..

Autosize description field to expand with content

Bug: T77945
Change-Id: Id060ddecee59a9b33e8d386f535f5cec487b6bf6
---
M quarry/web/static/js/query/view.js
M quarry/web/templates/query/view.html
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/quarry/web 
refs/changes/94/222894/1

diff --git a/quarry/web/static/js/query/view.js 
b/quarry/web/static/js/query/view.js
index c57f407..d0df447 100644
--- a/quarry/web/static/js/query/view.js
+++ b/quarry/web/static/js/query/view.js
@@ -15,6 +15,8 @@
 matchBrackets: true
 });
 
+$('#query-description').autosize();
+
 if (vars.can_edit) {
 $('#title').blur(function() {
 $.post( /api/query/meta, {
diff --git a/quarry/web/templates/query/view.html 
b/quarry/web/templates/query/view.html
index db4841c..afbec52 100644
--- a/quarry/web/templates/query/view.html
+++ b/quarry/web/templates/query/view.html
@@ -11,6 +11,7 @@
 script 
src=//tools-static.wmflabs.org/cdnjs/ajax/libs/codemirror/5.4.0/addon/edit/matchbrackets.min.js
 /script
 script src=/static/vendor/datatables-1.10.2/js/jquery.dataTables.min.js 
/script
 script src=/static/vendor/datatables-1.10.2/js/dataTables.bootstrap.js 
/script
+script 
src=//tools-static.wmflabs.org/cdnjs/ajax/libs/autosize.js/1.18.18/jquery.autosize.min.js
 /script
 link href=/static/vendor/datatables-1.10.2/css/dataTables.bootstrap.css 
rel=stylesheet
 script src=/static/js/query/view.js /script
 {% endblock %}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id060ddecee59a9b33e8d386f535f5cec487b6bf6
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fully restore Zotero data type integrity - change (mediawiki...citoid)

2015-07-05 Thread Mvolz (Code Review)
Mvolz has uploaded a new change for review.

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

Change subject: Fully restore Zotero data type integrity
..

Fully restore Zotero data type integrity

DOI is not a valid field for all Zotero types,
and PMID and PCMID are not valid fields for any
Zotero types. publicationTitle is not a valid
Zotero field for type webpage.

This removes DOI field from invalid types and PMID
and PMCID from all types in lib/Scraper.js, and
adds them into the citation during the export to
mediawiki and mwDeprecated functions instead (see
test/features/scraping/export.js). It also removes
field publicationTitle from type webpage.

Because these IDs can be useful for determining
the type of the resource, DOI has been made accessible
from the CitoidRequest object.

Also fix up addPubMedFromID method to add all IDs
from any ID (previously would only add IDs from DOI,
if present).

Bug: T93514
Bug: T95295
Change-Id: I8caff05cf051b2c730c1ef14e0c4f6d7e15801cd
---
M lib/CitoidRequest.js
M lib/CitoidService.js
M lib/Exporter.js
M lib/Scraper.js
M test/features/scraping/export.js
M test/features/scraping/index.js
6 files changed, 80 insertions(+), 72 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid 
refs/changes/98/222898/1

diff --git a/lib/CitoidRequest.js b/lib/CitoidRequest.js
index baea288..57c7f7e 100644
--- a/lib/CitoidRequest.js
+++ b/lib/CitoidRequest.js
@@ -22,6 +22,7 @@
this.idValue = null;
 
this.url = null;
+   this.doi = null;
 
this.exporter = app.citoid.exporter;
 
diff --git a/lib/CitoidService.js b/lib/CitoidService.js
index 632d564..ac474ba 100644
--- a/lib/CitoidService.js
+++ b/lib/CitoidService.js
@@ -62,8 +62,14 @@
 
var reHTTP = new RegExp('^((https?)://.+\\..+)'); // Assumes all 
strings with http/s protocol are URLs
var reWWW = new RegExp('^((www)\\..+\\..+)'); // Assumes all strings 
with www substring are URLs
+   var reDOI = new RegExp('\\b10\\.?[0-9]{3,4}(?:[.][0-9]+)*/.*');
var matchHTTP = search.match(reHTTP);
var matchWWW = search.match(reWWW);
+   var matchDOI = search.match(reDOI);
+
+   // TODO: Resolve to make sure DOI scraped from inside URLs are valid 
(except when dx.doi.org links)
+   if (matchDOI  matchDOI[0]) { cr.doi = matchDOI[0]; }
+
if (matchHTTP || matchWWW){
cr.idType = 'url';
cr.idValue = matchHTTP ? encodeURI(matchHTTP[0]) : 'http://' + 
encodeURI(matchWWW[0]);
@@ -72,8 +78,6 @@
return cr;
}
 
-   var reDOI = new RegExp('\\b10\\.?[0-9]{3,4}(?:[.][0-9]+)*/.*');
-   var matchDOI = search.match(reDOI);
if (matchDOI) {
cr.idType = 'doi';
cr.idValue = encodeURI(matchDOI[0]); //TODO; move this encoding 
further upstream so original DOI is retained
@@ -200,7 +204,7 @@
 
var doi;
 
-   if (!cr.doi  cr.idType === 'doi'){
+   if (cr.idType === 'doi'){
doi = cr.idValue;
} else {
return BBPromise.reject('No doi in citoid request object');
diff --git a/lib/Exporter.js b/lib/Exporter.js
index 845db53..bda5fef 100644
--- a/lib/Exporter.js
+++ b/lib/Exporter.js
@@ -71,7 +71,7 @@
  * Takes Zotero output and standardises it
  * @param  {Object}   citationcr.response.citation[0]
  * @param  {Object}   cr  CitoidResponse object
- * @return {Object}   BBPromise for array of citations
+ * @return {Object}   BBPromise for CitoidResponse object
  */
 Exporter.prototype.convertToZotero = BBPromise.method(function(citation, cr){
cr.response.body = cr.response.citation;
@@ -83,7 +83,7 @@
  * TODO: Use to take any Zotero output format
  * @param  {Object}   citationcr.response.citation[0]
  * @param  {Object}   cr  CitoidResponse object
- * @return {Object}   BBPromise for array of citations
+ * @return {Object}   BBPromise for CitoidResponse object
  */
 Exporter.prototype.convertToBibtex = BBPromise.method(function(citation, cr){
var zoteroService = this.zoteroService;
@@ -117,7 +117,7 @@
  * Takes Zotero output and converts to 'mediawiki' format
  * @param  {Object}   citationPointercr.response.citation[0]
  * @param  {Object}   cr CitoidResponse object
- * @return {Object}  BBPromise for array of citations
+ * @return {Object}  BBPromise for CitoidResponse object
  */
 Exporter.prototype.convertToMediawiki = 
BBPromise.method(function(citationPointer, cr){
// Don't directly modify cr.response.citation, this should remain in 
zotero format only.
@@ -127,8 +127,10 @@
citation = fixISBN(citation);
citation = fixISSN(citation);
 
-   cr.response.body = [citation];
-   return cr;
+   return addIDSToCitation(cr, citation).then(function(cit){
+   

[MediaWiki-commits] [Gerrit] Replace getClaims with getStatements in tests - change (mediawiki...Wikibase)

2015-07-05 Thread Bene (Code Review)
Bene has uploaded a new change for review.

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

Change subject: Replace getClaims with getStatements in tests
..

Replace getClaims with getStatements in tests

Change-Id: I49724b4e84296649b3d76f36a76b7ca69b2cdd0d
---
M repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php
2 files changed, 7 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/04/222904/1

diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
index b9658a4..9c22b90 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
@@ -104,10 +104,9 @@
// update an existing claim with a new main snak value
$item = $this-makeNewItemWithClaim( 'Q234', $snak );
$newSnak =  $this-makeSnak( 'P5', 'changedSnak' );
-   $claims = $item-getClaims();
-   $claim = reset( $claims );
+   $statements = $item-getStatements()-toArray();
 
-   $guid = $claim-getGuid();
+   $guid = $statements[0]-getGuid();
$changeOp = $this-newChangeOpMainSnak( $guid, $newSnak );
$expected = $newSnak-getDataValue();
$args['update claim by guid'] = array( $item, $changeOp, 
$expected );
@@ -121,11 +120,11 @@
public function testApply( Item $item, ChangeOpMainSnak $changeOp, 
DataValue $expected = null ) {
$this-assertTrue( $changeOp-apply( $item ), Applying the 
ChangeOp did not return true );
$this-assertNotEmpty( $changeOp-getStatementGuid() );
-   $claims = new Claims( $item-getClaims() );
+   $statements = $item-getStatements();
if ( $expected === null ) {
-   $this-assertEquals( $expected, 
$claims-getClaimWithGuid( $changeOp-getStatementGuid() ) );
+   $this-assertEquals( $expected, 
$statements-getFirstStatementWithGuid( $changeOp-getStatementGuid() ) );
} else {
-   $this-assertEquals( $expected, 
$claims-getClaimWithGuid( $changeOp-getStatementGuid() 
)-getMainSnak()-getDataValue() );
+   $this-assertEquals( $expected, 
$statements-getFirstStatementWithGuid( $changeOp-getStatementGuid() 
)-getMainSnak()-getDataValue() );
}
}
 
diff --git 
a/repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php
index 5e693c2..d886eaf 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php
@@ -67,8 +67,8 @@
public function testApplyAddNewClaim( Item $item, 
ChangeOpRemoveStatement $changeOp, DataValue $expected = null ) {
$this-assertTrue( $changeOp-apply( $item ), Applying the 
ChangeOp did not return true );
$this-assertNotEmpty( $changeOp-getGuid() );
-   $claims = new Claims( $item-getClaims() );
-   $this-assertEquals( $expected, $claims-getClaimWithGuid( 
$changeOp-getGuid() ) );
+   $statements = $item-getStatements();
+   $this-assertEquals( $expected, 
$statements-getFirstStatementWithGuid( $changeOp-getGuid() ) );
}
 
private function newItemWithClaim( $itemIdString, $snak ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49724b4e84296649b3d76f36a76b7ca69b2cdd0d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene benestar.wikime...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove a bunch more unused services from ApiWikibase - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Remove a bunch more unused services from ApiWikibase
..

Remove a bunch more unused services from ApiWikibase

Change-Id: I8f1c6c44e551f774c29522870f0f91c26b355e5d
---
M repo/includes/api/ApiWikibase.php
1 file changed, 0 insertions(+), 58 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/09/222909/1

diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index 35ea991..3080364 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -4,26 +4,12 @@
 
 use ApiBase;
 use ApiMain;
-use Exception;
-use LogicException;
-use Status;
-use UsageException;
-use User;
 use Wikibase\DataModel\Entity\Entity;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\EntityIdParser;
-use Wikibase\EntityRevision;
-use Wikibase\Lib\Localizer\ExceptionLocalizer;
-use Wikibase\Lib\Store\BadRevisionException;
 use Wikibase\Lib\Store\EntityRevisionLookup;
-use Wikibase\Lib\Store\EntityTitleLookup;
-use Wikibase\Lib\Store\StorageException;
-use Wikibase\Lib\Store\UnresolvedRedirectException;
-use Wikibase\Repo\Hooks\EditFilterHookRunner;
-use Wikibase\Repo\Store\EntityPermissionChecker;
 use Wikibase\Repo\WikibaseRepo;
-use Wikibase\SummaryFormatter;
 
 /**
  * Base class for API modules
@@ -43,21 +29,6 @@
private $resultBuilder;
 
/**
-* @var ApiErrorReporter
-*/
-   private $errorReporter;
-
-   /**
-* @var ExceptionLocalizer
-*/
-   private $exceptionLocalizer;
-
-   /**
-* @var EntityTitleLookup
-*/
-   private $titleLookup;
-
-   /**
 * @var EntityIdParser
 */
private $idParser;
@@ -66,21 +37,6 @@
 * @var EntityRevisionLookup
 */
private $entityRevisionLookup;
-
-   /**
-* @var SummaryFormatter
-*/
-   private $summaryFormatter;
-
-   /**
-* @var EntityPermissionChecker
-*/
-   private $permissionChecker;
-
-   /**
-* @var EditFilterHookRunner
-*/
-   private $editFilterHookRunner;
 
/**
 * @var EntitySaveHelper
@@ -104,30 +60,16 @@
 
$wikibaseRepo = WikibaseRepo::getDefaultInstance();
 
-   $this-titleLookup = $wikibaseRepo-getEntityTitleLookup();
$this-idParser = $wikibaseRepo-getEntityIdParser();
 
// NOTE: use uncached lookup for write mode!
$uncached = $this-isWriteMode() ? 'uncached' : '';
$this-entityRevisionLookup = 
$wikibaseRepo-getEntityRevisionLookup( $uncached );
 
-   $this-summaryFormatter = $wikibaseRepo-getSummaryFormatter();
-
-   $this-permissionChecker = 
$wikibaseRepo-getEntityPermissionChecker();
-
-   $this-exceptionLocalizer = 
$wikibaseRepo-getExceptionLocalizer();
-
$apiHelperFactory = $wikibaseRepo-getApiHelperFactory( 
$this-getContext() );
-   $this-errorReporter = $apiHelperFactory-getErrorReporter( 
$this );
$this-resultBuilder = $apiHelperFactory-getResultBuilder( 
$this );
$this-entitySaveHelper = 
$apiHelperFactory-getEntitySaveHelper( $this );
$this-entityLoadHelper = 
$apiHelperFactory-getEntityLoadHelper( $this );
-
-   $this-editFilterHookRunner = new EditFilterHookRunner(
-   $this-titleLookup,
-   $wikibaseRepo-getEntityContentFactory(),
-   $this-getContext()
-   );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f1c6c44e551f774c29522870f0f91c26b355e5d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore addshorew...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Move ApiWikibase::checkPermissions to ModifyEntity - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Move ApiWikibase::checkPermissions to ModifyEntity
..

Move ApiWikibase::checkPermissions to ModifyEntity

Apparently this is the only class that currently
uses this method, so lets put it there rather than in
this base class we would love to kill.

Change-Id: I04c9318fa9af9df10b9eb1d48c8cfc803e29023e
---
M repo/includes/api/ApiWikibase.php
M repo/includes/api/ModifyEntity.php
2 files changed, 29 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/08/222908/1

diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index c05b6cc..35ea991 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -186,27 +186,6 @@
}
 
/**
-* Check the rights for the user accessing the module.
-*
-* @param $entity EntityDocument the entity to check
-* @param $user User doing the action
-*
-* @return Status the check's result
-* @todo: use this also to check for read access in ApiGetEntities, etc
-*/
-   protected function checkPermissions( EntityDocument $entity, User $user 
) {
-   $permissions = $this-getRequiredPermissions( $entity );
-   $status = Status::newGood();
-
-   foreach ( array_unique( $permissions ) as $perm ) {
-   $permStatus = 
$this-permissionChecker-getPermissionStatusForEntity( $user, $perm, $entity );
-   $status-merge( $permStatus );
-   }
-
-   return $status;
-   }
-
-   /**
 * @see EntitySaveHelper::loadEntityRevision
 */
protected function loadEntityRevision(
diff --git a/repo/includes/api/ModifyEntity.php 
b/repo/includes/api/ModifyEntity.php
index 965ea0b..c34efcc 100644
--- a/repo/includes/api/ModifyEntity.php
+++ b/repo/includes/api/ModifyEntity.php
@@ -8,10 +8,12 @@
 use LogicException;
 use Status;
 use UsageException;
+use User;
 use Wikibase\ChangeOp\ChangeOp;
 use Wikibase\ChangeOp\ChangeOpException;
 use Wikibase\ChangeOp\ChangeOpValidationException;
 use Wikibase\DataModel\Entity\Entity;
+use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\EntityIdParsingException;
 use Wikibase\DataModel\Entity\ItemId;
@@ -22,6 +24,7 @@
 use Wikibase\Lib\Store\SiteLinkLookup;
 use Wikibase\Lib\Store\StorageException;
 use Wikibase\Repo\SiteLinkTargetProvider;
+use Wikibase\Repo\Store\EntityPermissionChecker;
 use Wikibase\Repo\WikibaseRepo;
 use Wikibase\StringNormalizer;
 use Wikibase\Summary;
@@ -81,6 +84,11 @@
private $errorReporter;
 
/**
+* @var EntityPermissionChecker
+*/
+   private $permissionChecker;
+
+   /**
 * Flags to pass to EditEntity::attemptSave; use with the EDIT_XXX 
constants.
 *
 * @see EditEntity::attemptSave
@@ -113,6 +121,7 @@
$settings-getSetting( 'specialSiteLinkGroups' )
);
 
+   $this-permissionChecker = 
$wikibaseRepo-getEntityPermissionChecker();
$this-entityStore = $wikibaseRepo-getEntityStore();
$this-titleLookup = $wikibaseRepo-getEntityTitleLookup();
$this-siteLinkGroups = $settings-getSetting( 'siteLinkGroups' 
);
@@ -406,6 +415,26 @@
}
 
/**
+* Check the rights for the user accessing the module.
+*
+* @param $entity EntityDocument the entity to check
+* @param $user User doing the action
+*
+* @return Status the check's result
+*/
+   private function checkPermissions( EntityDocument $entity, User $user ) 
{
+   $permissions = $this-getRequiredPermissions( $entity );
+   $status = Status::newGood();
+
+   foreach ( array_unique( $permissions ) as $perm ) {
+   $permStatus = 
$this-permissionChecker-getPermissionStatusForEntity( $user, $perm, $entity );
+   $status-merge( $permStatus );
+   }
+
+   return $status;
+   }
+
+   /**
 * @param bool $entityIsNew
 */
protected function addFlags( $entityIsNew ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04c9318fa9af9df10b9eb1d48c8cfc803e29023e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore addshorew...@gmail.com
Gerrit-Reviewer: jenkins-bot 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] Replace getClaims with getStatements in tests - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Replace getClaims with getStatements in tests
..


Replace getClaims with getStatements in tests

Change-Id: I49724b4e84296649b3d76f36a76b7ca69b2cdd0d
---
M repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php
2 files changed, 7 insertions(+), 8 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
index b9658a4..9c22b90 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php
@@ -104,10 +104,9 @@
// update an existing claim with a new main snak value
$item = $this-makeNewItemWithClaim( 'Q234', $snak );
$newSnak =  $this-makeSnak( 'P5', 'changedSnak' );
-   $claims = $item-getClaims();
-   $claim = reset( $claims );
+   $statements = $item-getStatements()-toArray();
 
-   $guid = $claim-getGuid();
+   $guid = $statements[0]-getGuid();
$changeOp = $this-newChangeOpMainSnak( $guid, $newSnak );
$expected = $newSnak-getDataValue();
$args['update claim by guid'] = array( $item, $changeOp, 
$expected );
@@ -121,11 +120,11 @@
public function testApply( Item $item, ChangeOpMainSnak $changeOp, 
DataValue $expected = null ) {
$this-assertTrue( $changeOp-apply( $item ), Applying the 
ChangeOp did not return true );
$this-assertNotEmpty( $changeOp-getStatementGuid() );
-   $claims = new Claims( $item-getClaims() );
+   $statements = $item-getStatements();
if ( $expected === null ) {
-   $this-assertEquals( $expected, 
$claims-getClaimWithGuid( $changeOp-getStatementGuid() ) );
+   $this-assertEquals( $expected, 
$statements-getFirstStatementWithGuid( $changeOp-getStatementGuid() ) );
} else {
-   $this-assertEquals( $expected, 
$claims-getClaimWithGuid( $changeOp-getStatementGuid() 
)-getMainSnak()-getDataValue() );
+   $this-assertEquals( $expected, 
$statements-getFirstStatementWithGuid( $changeOp-getStatementGuid() 
)-getMainSnak()-getDataValue() );
}
}
 
diff --git 
a/repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php
index 5e693c2..d886eaf 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpRemoveStatementTest.php
@@ -67,8 +67,8 @@
public function testApplyAddNewClaim( Item $item, 
ChangeOpRemoveStatement $changeOp, DataValue $expected = null ) {
$this-assertTrue( $changeOp-apply( $item ), Applying the 
ChangeOp did not return true );
$this-assertNotEmpty( $changeOp-getGuid() );
-   $claims = new Claims( $item-getClaims() );
-   $this-assertEquals( $expected, $claims-getClaimWithGuid( 
$changeOp-getGuid() ) );
+   $statements = $item-getStatements();
+   $this-assertEquals( $expected, 
$statements-getFirstStatementWithGuid( $changeOp-getGuid() ) );
}
 
private function newItemWithClaim( $itemIdString, $snak ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I49724b4e84296649b3d76f36a76b7ca69b2cdd0d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene benestar.wikime...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Use getStatements instead of getClaim in ChangeOpsMerge - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use getStatements instead of getClaim in ChangeOpsMerge
..


Use getStatements instead of getClaim in ChangeOpsMerge

Also did some refactoring.

Change-Id: Ie5b258d1a873707b9102ec11945e181224329da5
---
M repo/includes/ChangeOp/ChangeOpsMerge.php
1 file changed, 20 insertions(+), 24 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/ChangeOp/ChangeOpsMerge.php 
b/repo/includes/ChangeOp/ChangeOpsMerge.php
index 6aaf4cf..b69fef1 100644
--- a/repo/includes/ChangeOp/ChangeOpsMerge.php
+++ b/repo/includes/ChangeOp/ChangeOpsMerge.php
@@ -7,7 +7,6 @@
 use SiteLookup;
 use ValueValidators\Error;
 use ValueValidators\Result;
-use Wikibase\DataModel\Claim\Claim;
 use Wikibase\DataModel\Entity\Entity;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\Item;
@@ -158,7 +157,7 @@
$this-generateDescriptionsChangeOps();
$this-generateAliasesChangeOps();
$this-generateSitelinksChangeOps();
-   $this-generateClaimsChangeOps();
+   $this-generateStatementsChangeOps();
}
 
private function generateLabelsChangeOps() {
@@ -257,43 +256,40 @@
return $site;
}
 
-   private function generateClaimsChangeOps() {
-   foreach ( $this-fromItem-getClaims() as $fromClaim ) {
-   $this-fromChangeOps-add( 
$this-getStatementChangeOpFactory()-newRemoveStatementOp( 
$fromClaim-getGuid() ) );
+   private function generateStatementsChangeOps() {
+   foreach ( $this-fromItem-getStatements() as $fromStatement ) {
+   $this-fromChangeOps-add( 
$this-getStatementChangeOpFactory()-newRemoveStatementOp( 
$fromStatement-getGuid() ) );
 
-   $toClaim = clone $fromClaim;
-   $toClaim-setGuid( null );
-   $toMergeToClaim = false;
+   $toStatement = clone $fromStatement;
+   $toStatement-setGuid( null );
+   $toMergeToStatement = $this-findEquivalentStatement( 
$toStatement );
 
-   if ( $toClaim instanceof Statement ) {
-   $toMergeToClaim = $this-findEquivalentClaim( 
$toClaim );
-   }
-
-   if ( $toMergeToClaim ) {
-   $this-generateReferencesChangeOps( $toClaim, 
$toMergeToClaim );
+   if ( $toMergeToStatement ) {
+   $this-generateReferencesChangeOps( 
$toStatement, $toMergeToStatement );
} else {
-   $this-toChangeOps-add( 
$this-getStatementChangeOpFactory()-newSetStatementOp( $toClaim ) );
+   $this-toChangeOps-add( 
$this-getStatementChangeOpFactory()-newSetStatementOp( $toStatement ) );
}
}
}
 
/**
-* Finds a claim in the target entity with the same main snak and 
qualifiers as $fromStatement
+* Finds a statement in the target entity with the same main snak and 
qualifiers as $fromStatement
 *
 * @param Statement $fromStatement
 *
-* @return Claim|false Claim to merge reference into or false
+* @return Statement|false Statement to merge reference into or false
 */
-   private function findEquivalentClaim( $fromStatement ) {
-   $fromHash = $this-getClaimHash( $fromStatement );
+   private function findEquivalentStatement( $fromStatement ) {
+   $fromHash = $this-getStatementHash( $fromStatement );
 
-   /** @var $claim Claim */
-   foreach ( $this-toItem-getClaims() as $claim ) {
-   $toHash = $this-getClaimHash( $claim );
+   /** @var Statement $statement */
+   foreach ( $this-toItem-getStatements() as $statement ) {
+   $toHash = $this-getStatementHash( $statement );
if ( $toHash === $fromHash ) {
-   return $claim;
+   return $statement;
}
}
+
return false;
}
 
@@ -302,7 +298,7 @@
 *
 * @return string combined hash of the Mainsnak and Qualifiers
 */
-   private function getClaimHash( Statement $statement ) {
+   private function getStatementHash( Statement $statement ) {
return $statement-getMainSnak()-getHash() . 
$statement-getQualifiers()-getHash();
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] Remove www.donate.wikipedia.org from DNS - change (operations/dns)

2015-07-05 Thread Chmarkine (Code Review)
Chmarkine has uploaded a new change for review.

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

Change subject: Remove www.donate.wikipedia.org from DNS
..

Remove www.donate.wikipedia.org from DNS

http://www.donate.wikipedia.org/ redirects to
http://donate.wikipedia.org/w/index.php, which redirects to
https://donate.wikipedia.org/w/index.php, which redirects to
https://wikimediafoundation.org/wiki/Home, which is
not related to donation.

Bug: T102827
Change-Id: Iacc184b672eaac819ab8732adb5d7616966940a6
---
M templates/wikipedia.org
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/83/222883/1

diff --git a/templates/wikipedia.org b/templates/wikipedia.org
index 4e5f636..60d4767 100644
--- a/templates/wikipedia.org
+++ b/templates/wikipedia.org
@@ -80,7 +80,6 @@
 shop600 IN DYNA geoip!text-addrs
 stats   1H  IN CNAMEstats.wikimedia.org.
 store   600 IN DYNA geoip!text-addrs
-www.donate  600 IN DYNA geoip!text-addrs
 www.m   600 IN DYNA geoip!mobile-addrs
 zero600 IN DYNA geoip!mobile-addrs
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacc184b672eaac819ab8732adb5d7616966940a6
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Chmarkine chmark...@hotmail.com

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


[MediaWiki-commits] [Gerrit] Do not unconditionally redirect to home page after login - change (analytics...web)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: Do not unconditionally redirect to home page after login
..

Do not unconditionally redirect to home page after login

Bug: T100162
Change-Id: I4f43a64d0bbb7f342b71823545b80f0c9415e162
---
M quarry/web/templates/base.html
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/quarry/web 
refs/changes/91/222891/1

diff --git a/quarry/web/templates/base.html b/quarry/web/templates/base.html
index 00af032..efd112c 100644
--- a/quarry/web/templates/base.html
+++ b/quarry/web/templates/base.html
@@ -59,7 +59,7 @@
 /ul
 /li
 {% else %}
-lia href=/loginLogin/a/li
+lia href=/login?next={{request.path}}Login/a/li
 {% endif  %}
 /ul
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f43a64d0bbb7f342b71823545b80f0c9415e162
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add a redirect to get latest output of a query - change (analytics...web)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add a redirect to get latest output of a query
..


Add a redirect to get latest output of a query

Bug: T75883
Change-Id: Idaeadd7fedf0c257a16fb45461521cb518b8bdc9
---
M quarry/web/app.py
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Yuvipanda: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/quarry/web/app.py b/quarry/web/app.py
index 0c71e74..38e21b7 100644
--- a/quarry/web/app.py
+++ b/quarry/web/app.py
@@ -228,6 +228,16 @@
 )
 
 
+@app.route('/query/int:query_id/result/latest/string:resultset_id/string:format')
+def query_output_redirect(query_id, resultset_id, format):
+query = g.conn.session.query(Query).filter(Query.id == query_id).one()
+qrun_id = query.latest_rev.latest_run_id
+return redirect(
+url_for('output_result', qrun_id=qrun_id,
+resultset_id=resultset_id, format=format)
+)
+
+
 @app.route('/api/query/meta', methods=['POST'])
 def api_set_meta():
 if get_user() is None:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idaeadd7fedf0c257a16fb45461521cb518b8bdc9
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add a redirect to get latest output of a query - change (analytics...web)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: Add a redirect to get latest output of a query
..

Add a redirect to get latest output of a query

Bug: T75883
Change-Id: Idaeadd7fedf0c257a16fb45461521cb518b8bdc9
---
M quarry/web/app.py
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/quarry/web 
refs/changes/96/222896/1

diff --git a/quarry/web/app.py b/quarry/web/app.py
index 0c71e74..38e21b7 100644
--- a/quarry/web/app.py
+++ b/quarry/web/app.py
@@ -228,6 +228,16 @@
 )
 
 
+@app.route('/query/int:query_id/result/latest/string:resultset_id/string:format')
+def query_output_redirect(query_id, resultset_id, format):
+query = g.conn.session.query(Query).filter(Query.id == query_id).one()
+qrun_id = query.latest_rev.latest_run_id
+return redirect(
+url_for('output_result', qrun_id=qrun_id,
+resultset_id=resultset_id, format=format)
+)
+
+
 @app.route('/api/query/meta', methods=['POST'])
 def api_set_meta():
 if get_user() is None:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idaeadd7fedf0c257a16fb45461521cb518b8bdc9
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove ApiWikibase::isReadMode - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Remove ApiWikibase::isReadMode
..

Remove ApiWikibase::isReadMode

This is just set to true here and is also
true in ApiBase, thus no really point in overriding
it here to do the same thing...

Change-Id: I7ec07c2963901c4a29612361affe1d389257b306
---
M repo/includes/api/ApiWikibase.php
1 file changed, 0 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/02/222902/1

diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index 8c4ae26..eee9cab 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -170,15 +170,6 @@
}
 
/**
-* @see ApiBase::isReadMode
-*
-* @return bool Always true in this abstract base implementation.
-*/
-   public function isReadMode() {
-   return true;
-   }
-
-   /**
 * Returns the permissions that are required to perform the operation 
specified by
 * the parameters.
 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ec07c2963901c4a29612361affe1d389257b306
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore addshorew...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove ApiWikibase getTokenSalt - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Remove ApiWikibase getTokenSalt
..

Remove ApiWikibase getTokenSalt

This used to be a method in ApiBase.
But it is no longer there.
It is also not used by anyting

Change-Id: Id95097cce8f574b57ce91e53db05f7b6704fe7dc
---
M repo/includes/api/ApiWikibase.php
1 file changed, 0 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/01/222901/1

diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index fd44f5b..8c4ae26 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -161,15 +161,6 @@
}
 
/**
-* @see ApiBase::getTokenSalt()
-*
-* @return string|false
-*/
-   public function getTokenSalt() {
-   return $this-needsToken() ? '' : false;
-   }
-
-   /**
 * @see ApiBase::mustBePosted()
 *
 * @return bool

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id95097cce8f574b57ce91e53db05f7b6704fe7dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore addshorew...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add option to block user in special page - change (mediawiki...SmiteSpam)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add option to block user in special page
..


Add option to block user in special page

Added a button next to the username that can be used to block the user
with 'nocreate', 'noemail' and 'autoblock' options set for an indefinite
period of time.

Change-Id: I1890623998195c8fced8945268e9e7a8763bfe82
---
M api/SmiteSpamApiQuery.php
M static/js/ext.smitespam.retriever.js
2 files changed, 52 insertions(+), 2 deletions(-)

Approvals:
  jan: Looks good to me, but someone else must approve
  Polybuildr: Looks good to me, approved
  Yaron Koren: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/api/SmiteSpamApiQuery.php b/api/SmiteSpamApiQuery.php
index ba654dc..081154f 100644
--- a/api/SmiteSpamApiQuery.php
+++ b/api/SmiteSpamApiQuery.php
@@ -34,13 +34,17 @@
$creator = $oldestRevision-getUserText( 
Revision::RAW );
if ( $creator ) {
if ( !isset( $users[$creator] ) ) {
+   $blocked = false;
+   if ( Block::newFromTarget( 
$creator, $creator ) ) {
+   $blocked = true;
+   }
$users[$creator] = array(
'link' = Linker::link(

SpecialPage::getTitleFor( 'Contributions', $creator ),

Sanitizer::escapeHtmlAllowEntities( $creator ),
array( 'target' 
= '_blank' )
),
-   'blocked' = 
(int)User::newFromId( $oldestRevision-getUser( Revision::RAW ) )-isBlocked(),
+   'blocked' = 
(int)$blocked,
);
}
} else {
diff --git a/static/js/ext.smitespam.retriever.js 
b/static/js/ext.smitespam.retriever.js
index 4b1d808..9eb8848 100644
--- a/static/js/ext.smitespam.retriever.js
+++ b/static/js/ext.smitespam.retriever.js
@@ -158,12 +158,58 @@
groupedPages.sort( function ( a, b ) {
return b.totalSpamValue - a.totalSpamValue;
} );
+   function onBlockButton() {
+   var $this = $( this );
+   var username = $this.parent().data( 'username' 
);
+   $this.prop( 'disabled', true );
+   $.post( mw.config.get( 'wgScriptPath' ) + 
'/api.php?action=blockformat=json',
+   {
+   user: username,
+   token: editToken,
+   nocreate: '',
+   noemail: '',
+   autoblock: '',
+   reason: 'Spamming'
+   },
+   'json'
+   ).done( function ( data ) {
+   if ( 'block' in data ) {
+   $( '#smitespam-page-list th 
button' ).each( function () {
+   var $this = $( this );
+   if ( 
$this.parent().data( 'username' )  === username ) {
+   
$this.parent().append( ' (Blocked)' );
+   $this.remove();
+   return false;
+   }
+   } );
+   } else if ( 'error' in data ) {
+   $( '#smitespam-page-list th 
button' ).each( function () {
+   var $this = $( this );
+   if ( 
$this.parent().data( 'username' )  === username ) {
+   
$this.parent().append( ' (Failed to block)' );
+   $this.remove();
+   

[MediaWiki-commits] [Gerrit] Remove spaces from the end of the line - change (mediawiki...Cite)

2015-07-05 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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

Change subject: Remove spaces from the end of the line
..

Remove spaces from the end of the line

Spaces in the end of the line are usually unnecessary,
and they doesn't seem to do anything useful here.

Change-Id: Ib4d1b72aafd80f36ddf198f3924e5ebbeba79aa5
---
M citeParserTests.txt
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite 
refs/changes/82/222882/1

diff --git a/citeParserTests.txt b/citeParserTests.txt
index 047b11a..98ad713 100644
--- a/citeParserTests.txt
+++ b/citeParserTests.txt
@@ -304,7 +304,7 @@
 !! end
 
 !! test
-Simple ref, with references/ in group, with groupname in chinese 
+Simple ref, with references/ in group, with groupname in chinese
 !! input
 AAAref group=参ref a/refBBBref group=注note b/refCCCref 
group=参ref c/ref
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4d1b72aafd80f36ddf198f3924e5ebbeba79aa5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il

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


[MediaWiki-commits] [Gerrit] [bugfix] Fallback to default if mw message 'disambiguationsp... - change (pywikibot/core)

2015-07-05 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

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

Change subject: [bugfix] Fallback to default if mw message 
'disambiguationspage' doesn't exists
..

[bugfix] Fallback to default if mw message 'disambiguationspage' doesn't exists

Bug: T100928
Change-Id: Icbb97b092fcd23d09766a8e91eeccbfeeaa926d7
---
M pywikibot/page.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/81/222881/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 392f385..d265ceb 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -807,12 +807,13 @@
 disambigs = set(link.title(withNamespace=False)
 for link in disambigpages.linkedPages()
 if link.namespace() == 10)
-else:
+elif self.site.has_mediawiki_message('disambiguationspage'):
 message = self.site.mediawiki_message(
 'disambiguationspage').split(':', 1)[1]
 # add the default template(s) for default mw message
 # only
 disambigs = set([first_upper(message)]) | default
+else disambigs = default
 self.site._disambigtemplates = disambigs
 else:
 # Normalize template capitalization

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbb97b092fcd23d09766a8e91eeccbfeeaa926d7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

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


[MediaWiki-commits] [Gerrit] Remove shortcut die* methods from ApiWikibase - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Remove shortcut die* methods from ApiWikibase
..

Remove shortcut die* methods from ApiWikibase

This adds the services each api modules needs
(in regards to error reporting)
to the api module itself.

Another step toward getting rid of ApiWikibase

This change also split up long over 100 char die
lines onto multiple lines!

Change-Id: I717812b33e919cebd6b212507a83cb9c87f289b1
---
M repo/includes/api/ApiWikibase.php
M repo/includes/api/CreateClaim.php
M repo/includes/api/EditEntity.php
M repo/includes/api/GetClaims.php
M repo/includes/api/GetEntities.php
M repo/includes/api/LinkTitles.php
M repo/includes/api/ModifyEntity.php
M repo/includes/api/RemoveClaims.php
M repo/includes/api/RemoveQualifiers.php
M repo/includes/api/RemoveReferences.php
M repo/includes/api/SetAliases.php
M repo/includes/api/SetClaim.php
M repo/includes/api/SetClaimValue.php
M repo/includes/api/SetQualifier.php
M repo/includes/api/SetReference.php
M repo/includes/api/SetSiteLink.php
16 files changed, 301 insertions(+), 168 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/88/222888/2

diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index da27bf3..70a2738 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -247,18 +247,18 @@
$revision = 
$this-entityRevisionLookup-getEntityRevision( $entityId, $revId );
 
if ( !$revision ) {
-   $this-dieError(
+   $this-errorReporter-dieError(
'Entity ' . 
$entityId-getSerialization() . ' not found',
'cant-load-entity-content' );
}
 
return $revision;
} catch ( UnresolvedRedirectException $ex ) {
-   $this-dieException( $ex, 'unresolved-redirect' );
+   $this-errorReporter-dieException( $ex, 
'unresolved-redirect' );
} catch ( BadRevisionException $ex ) {
-   $this-dieException( $ex, 'nosuchrevid' );
+   $this-errorReporter-dieException( $ex, 'nosuchrevid' 
);
} catch ( StorageException $ex ) {
-   $this-dieException( $ex, 'cant-load-entity-content' );
+   $this-errorReporter-dieException( $ex, 
'cant-load-entity-content' );
}
 
throw new LogicException( 'ApiErrorReporter::dieError did not 
throw a UsageException' );
@@ -272,8 +272,8 @@
}
 
/**
-* @deprecated since 0.5, use dieError(), dieException() or the
-* methods in $this-apiErrorReporter instead.
+* @deprecated since 0.5, use dieError(), dieException() and 
dieMessage()
+* methods inside an ApiErrorReporter object instead
 *
 * @param string $description
 * @param string $errorCode
@@ -283,46 +283,6 @@
public function dieUsage( $description, $errorCode, $httpRespCode = 0, 
$extradata = null ) {
//NOTE: This is just here for the @deprecated flag above.
parent::dieUsage( $description, $errorCode, $httpRespCode, 
$extradata );
-   }
-
-   /**
-* @see ApiErrorReporter::dieError()
-*
-* @since 0.5
-*
-* @param string $description
-* @param string $code
-* @param int $httpStatusCode
-* @param array $extradata
-*/
-   protected function dieError( $description, $code, $httpStatusCode = 0, 
$extradata = array() ) {
-   $this-errorReporter-dieError( $description, $code, 
$httpStatusCode, $extradata );
-   }
-
-   /**
-* @see ApiErrorReporter::dieException()
-*
-* @since 0.5
-*
-* @param Exception $exception
-* @param string $code
-* @param int $httpStatusCode
-* @param array $extradata
-*/
-   protected function dieException( Exception $exception, $code, 
$httpStatusCode = 0, $extradata = array() ) {
-   $this-errorReporter-dieException( $exception, $code, 
$httpStatusCode, $extradata );
-   }
-
-   /**
-* @see ApiErrorReporter::dieMessage()
-*
-* @since 0.5
-*
-* @param string $errorCode A code identifying the error.
-* @param string [$param,...] Parameters for the Message.
-*/
-   protected function dieMessage( $errorCode /*...*/ ) {
-   call_user_func_array( array( $this-errorReporter, 'dieMessage' 
), func_get_args() );
}
 
 }
diff --git a/repo/includes/api/CreateClaim.php 
b/repo/includes/api/CreateClaim.php
index 87d64f6..04c1c35 100644
--- 

[MediaWiki-commits] [Gerrit] cassandra: raise heap size to 16Gb - change (operations/puppet)

2015-07-05 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has uploaded a new change for review.

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

Change subject: cassandra: raise heap size to 16Gb
..

cassandra: raise heap size to 16Gb

Supposedly this should help mitigate a bit the current crazyness.

Change-Id: I6142f9b0a1137e05861b96d2f6e11a7accc930df
---
M hieradata/role/common/cassandra.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/99/222899/1

diff --git a/hieradata/role/common/cassandra.yaml 
b/hieradata/role/common/cassandra.yaml
index 72bdb1d..e2f5731 100644
--- a/hieradata/role/common/cassandra.yaml
+++ b/hieradata/role/common/cassandra.yaml
@@ -11,7 +11,7 @@
 - restbase1004.eqiad.wmnet
 - restbase1005.eqiad.wmnet
 - restbase1006.eqiad.wmnet
-cassandra::max_heap_size: 12g
+cassandra::max_heap_size: 16g
 # 1/4 heap size, no more than 100m/thread
 cassandra::heap_newsize: 2048m
 cassandra::compaction_throughput_mb_per_sec: 160

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6142f9b0a1137e05861b96d2f6e11a7accc930df
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto glavage...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] [bugfix] Fallback to default if mw message 'disambiguationsp... - change (pywikibot/core)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: [bugfix] Fallback to default if mw message 
'disambiguationspage' doesn't exists
..


[bugfix] Fallback to default if mw message 'disambiguationspage' doesn't exists

Bug: T100928
Change-Id: Icbb97b092fcd23d09766a8e91eeccbfeeaa926d7
---
M pywikibot/page.py
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/page.py b/pywikibot/page.py
index 392f385..25d2779 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -807,12 +807,14 @@
 disambigs = set(link.title(withNamespace=False)
 for link in disambigpages.linkedPages()
 if link.namespace() == 10)
-else:
+elif self.site.has_mediawiki_message('disambiguationspage'):
 message = self.site.mediawiki_message(
 'disambiguationspage').split(':', 1)[1]
 # add the default template(s) for default mw message
 # only
 disambigs = set([first_upper(message)]) | default
+else:
+disambigs = default
 self.site._disambigtemplates = disambigs
 else:
 # Normalize template capitalization

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icbb97b092fcd23d09766a8e91eeccbfeeaa926d7
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: John Vandenberg jay...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] [FEAT] color_format to ignore valid colors - change (pywikibot/core)

2015-07-05 Thread XZise (Code Review)
XZise has uploaded a new change for review.

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

Change subject: [FEAT] color_format to ignore valid colors
..

[FEAT] color_format to ignore valid colors

This allows to add colors to strings which will be filled using format. Instead
of calling 'str'.format(…), color_format('str', …) is called. That adds all
valid colors as keyword arguments so that they are replaced by themselves.

Change-Id: Ib354fb80180b0e421a18474cc67d7ee10cda3745
---
M pywikibot/bot.py
M tests/bot_tests.py
2 files changed, 43 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/07/222907/1

diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 57e8ec0..f09dd18 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -49,6 +49,7 @@
 ChoiceException, QuitKeyboardInterrupt,
 )
 from pywikibot.tools import deprecated, deprecated_args, PY2, PYTHON_VERSION
+from pywikibot.userinterfaces.terminal_interface_base import colors
 
 if not PY2:
 unicode = str
@@ -84,6 +85,19 @@
 def __init__(self, stop=False):
 Constructor.
 self.stop = stop
+
+
+def color_format(text, *args, **kwargs):
+Do C{str.format} without having to worry about colors.
+valid_colors = set(colors)
+if valid_colors.intersection(kwargs):  # kwargs use colors
+raise ValueError('Keyword argument(s) should not use valid color(s): ' 
+
+ ', '.join(valid_colors.intersection(kwargs)))
+else:
+# Add all colors to kwargs to replace nothing
+for color in valid_colors:
+kwargs[color] = '{{{0}}}'.format(color)
+return text.format(*args, **kwargs)
 
 
 # Logging module configuration
@@ -930,17 +944,16 @@
  '\03{default}' + text[rng[1]: rng[1] + 
self.context])
 question = 'Should the link '
 else:
-question = 'Should the link \03{{lightred}}{0}\03{{default}} '
+question = 'Should the link \03{lightred}{0}\03{default} '
 
 if self._new is False:
 question += 'be unlinked?'
 else:
-question += ('target to '
- 
'\03lightpurple{0}\03default?').format(
- self._new.canonical_title())
+question += color_format('target to 
\03{lightpurple}{0}\03{default}?',
+ self._new.canonical_title())
 
 choice = pywikibot.input_choice(
-question.format(self._old.canonical_title()),
+color_format(question, self._old.canonical_title()),
 choices, default=self._default, automatic_quit=self._quit)
 
 return self.handle_answer(choice)
diff --git a/tests/bot_tests.py b/tests/bot_tests.py
index 4764e79..5227de4 100644
--- a/tests/bot_tests.py
+++ b/tests/bot_tests.py
@@ -19,6 +19,31 @@
 )
 
 
+class ColorFormatTestCase(TestCase):
+
+Test color_format function in bot module.
+
+net = False
+
+def test_no_colors(self):
+Test without colors in template string.
+self.assertEqual(pywikibot.bot.color_format('42'), '42')
+self.assertEqual(pywikibot.bot.color_format('{0}', 42), '42')
+self.assertEqual(pywikibot.bot.color_format('{ans}', ans=42), '42')
+
+def test_colors(self):
+Test with colors in template string.
+self.assertEqual(pywikibot.bot.color_format('{0}{black}', 42),
+ '42{black}')
+self.assertEqual(pywikibot.bot.color_format('{ans}{black}', ans=42),
+ '42{black}')
+
+def test_color_kwargs(self):
+Test with a color as keyword argument.
+self.assertRaises(ValueError,
+  pywikibot.bot.color_format, '{aqua}{black}', aqua=42)
+
+
 class FakeSaveBotTestCase(TestCase):
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib354fb80180b0e421a18474cc67d7ee10cda3745
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise commodorefabia...@gmx.de

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


[MediaWiki-commits] [Gerrit] Do not unconditionally redirect to home page after login - change (analytics...web)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Do not unconditionally redirect to home page after login
..


Do not unconditionally redirect to home page after login

Bug: T100162
Change-Id: I4f43a64d0bbb7f342b71823545b80f0c9415e162
---
M quarry/web/templates/base.html
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Yuvipanda: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/quarry/web/templates/base.html b/quarry/web/templates/base.html
index 00af032..efd112c 100644
--- a/quarry/web/templates/base.html
+++ b/quarry/web/templates/base.html
@@ -59,7 +59,7 @@
 /ul
 /li
 {% else %}
-lia href=/loginLogin/a/li
+lia href=/login?next={{request.path}}Login/a/li
 {% endif  %}
 /ul
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f43a64d0bbb7f342b71823545b80f0c9415e162
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add pages with Cite errors to a tracking category - change (mediawiki...Cite)

2015-07-05 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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

Change subject: Add pages with Cite errors to a tracking category
..

Add pages with Cite errors to a tracking category

Bug: T104792
Change-Id: I6f8b12788a20480bd8880332238d545ee70a8ef9
---
M Cite_body.php
M extension.json
M i18n/en.json
3 files changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite 
refs/changes/97/222897/1

diff --git a/Cite_body.php b/Cite_body.php
index e800d94..abfd0ee 100644
--- a/Cite_body.php
+++ b/Cite_body.php
@@ -252,6 +252,8 @@
# be equivalent ref ... /, for compatability with 
#tag.
if ( $key == false ) {
$this-mRefCallStack[] = false;
+
+
return $this-error( 'cite_error_ref_no_input' 
);
} else {
$str = null;
@@ -1144,6 +1146,8 @@
-inContentLanguage()
-plain();
 
+   $this-mParser-addTrackingCategory( 
'cite-tracking-category-cite-error' );
+
$ret = 'strong class=error mw-ext-cite-error' . $msg . 
'/strong';
 
if ( $parse == 'parse' ) {
diff --git a/extension.json b/extension.json
index 6b19973..858a561 100644
--- a/extension.json
+++ b/extension.json
@@ -73,5 +73,8 @@
ParserTestFiles: [
citeParserTests.txt
],
+   TrackingCategories: [
+   cite-tracking-category-cite-error
+   ],
manifest_version: 1
 }
diff --git a/i18n/en.json b/i18n/en.json
index 5c5ad60..d6a4da1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -32,6 +32,8 @@
cite_error_references_missing_key: codelt;refgt;/code tag with 
name \$1\ defined in codelt;referencesgt;/code is not used in prior 
text.,
cite_error_references_no_key: codelt;refgt;/code tag defined 
in codelt;referencesgt;/code has no name attribute.,
cite_error_empty_references_define: codelt;refgt;/code tag 
defined in codelt;referencesgt;/code with name \$1\ has no content.,
+   cite-tracking-category-cite-error: Pages with reference errors,
+   cite-tracking-category-cite-error-desc: Pages in this category have 
errors in the usage of references tags.,
cite_reference_link_key_with_num: $1_$2,
cite_reference_link_prefix: cite_ref-,
cite_reference_link_suffix: ,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f8b12788a20480bd8880332238d545ee70a8ef9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cite
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il

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


[MediaWiki-commits] [Gerrit] cassandra: raise heap size to 16Gb - change (operations/puppet)

2015-07-05 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: cassandra: raise heap size to 16Gb
..


cassandra: raise heap size to 16Gb

Supposedly this should help mitigate a bit the current crazyness.

Change-Id: I6142f9b0a1137e05861b96d2f6e11a7accc930df
---
M hieradata/role/common/cassandra.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Mobrovac: Looks good to me, but someone else must approve
  Giuseppe Lavagetto: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/hieradata/role/common/cassandra.yaml 
b/hieradata/role/common/cassandra.yaml
index 72bdb1d..e2f5731 100644
--- a/hieradata/role/common/cassandra.yaml
+++ b/hieradata/role/common/cassandra.yaml
@@ -11,7 +11,7 @@
 - restbase1004.eqiad.wmnet
 - restbase1005.eqiad.wmnet
 - restbase1006.eqiad.wmnet
-cassandra::max_heap_size: 12g
+cassandra::max_heap_size: 16g
 # 1/4 heap size, no more than 100m/thread
 cassandra::heap_newsize: 2048m
 cassandra::compaction_throughput_mb_per_sec: 160

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6142f9b0a1137e05861b96d2f6e11a7accc930df
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto glavage...@wikimedia.org
Gerrit-Reviewer: Giuseppe Lavagetto glavage...@wikimedia.org
Gerrit-Reviewer: Mobrovac mobro...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove www.donate.wiktionary.org from DNS - change (operations/dns)

2015-07-05 Thread Chmarkine (Code Review)
Chmarkine has uploaded a new change for review.

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

Change subject: Remove www.donate.wiktionary.org from DNS
..

Remove www.donate.wiktionary.org from DNS

http://www.donate.wiktionary.org/ returns 404.

Bug: T102827
Change-Id: I1c8903ba09c28ee5371bfdc2164538f5ee7cd5d5
---
M templates/wiktionary.org
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/80/222880/1

diff --git a/templates/wiktionary.org b/templates/wiktionary.org
index 5098727..bad136e 100644
--- a/templates/wiktionary.org
+++ b/templates/wiktionary.org
@@ -40,7 +40,6 @@
 {{ geolanglist('text-addrs') }}
 
 ; Other websites
-www.donate  600 IN DYNA geoip!text-addrs
 donate  600 IN DYNA geoip!text-addrs
 
 ; Mobile

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c8903ba09c28ee5371bfdc2164538f5ee7cd5d5
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Chmarkine chmark...@hotmail.com

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


[MediaWiki-commits] [Gerrit] Show the file which raised the pywikibot.Error - change (pywikibot/core)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Show the file which raised the pywikibot.Error
..


Show the file which raised the pywikibot.Error

- For investigating the error, it helps to know the affected file page.
- New error message. The error occurs when an invalid or broken template
  was fetched.

Change-Id: I0b03a76d233fe664d067e668df781f1998f472ce
---
M scripts/checkimages.py
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 267eb23..1b50c33 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -1325,9 +1325,8 @@
 licenses_TEST = regex_are_licenses.findall(self.imageCheckText)
 if not self.licenses_found and licenses_TEST:
 raise pywikibot.Error(
-APIs seems down. No templates found with them but 
-actually there are templates used in the image's 
-page!)
+Invalid or broken templates found in the image's 
+page %s! % self.image)
 self.allLicenses = []
 
 if not self.list_licenses:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b03a76d233fe664d067e668df781f1998f472ce
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: John Vandenberg jay...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Mpaa mpaa.w...@gmail.com
Gerrit-Reviewer: Ricordisamoa ricordisa...@openmailbox.org
Gerrit-Reviewer: XZise commodorefabia...@gmx.de
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add mw.Title.newFromLink function - change (mediawiki/core)

2015-07-05 Thread M4tx (Code Review)
M4tx has uploaded a new change for review.

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

Change subject: Add mw.Title.newFromLink function
..

Add mw.Title.newFromLink function

Bug: T58303
Change-Id: I718e6e6ddfcb566d87c0859320ba68d26471a470
---
M resources/src/mediawiki/mediawiki.Title.js
1 file changed, 31 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/222887/1

diff --git a/resources/src/mediawiki/mediawiki.Title.js 
b/resources/src/mediawiki/mediawiki.Title.js
index 661ab74..5a2e700 100644
--- a/resources/src/mediawiki/mediawiki.Title.js
+++ b/resources/src/mediawiki/mediawiki.Title.js
@@ -678,6 +678,37 @@
};
 
/**
+* Get the title from a link element.
+*
+* var title = mw.Title.newFromLink( $( 'a.new:first' ) );
+*
+* @static
+* @param {HTMLElement|jQuery} link The link to use
+* @return {mw.Title|null} The link title or null if unsuccessful
+*/
+   Title.newFromLink = function ( link ) {
+   var serverUrl, url, regex, href, decodedHref, matches;
+
+   serverUrl = mw.config.get( 'wgServer' );
+   // The regex matches everything either until the end of the 
string or first ? or  found
+   url = serverUrl + mw.config.get( 'wgArticlePath' ).replace( 
'$1', '(.+?(?=[\?\])|.+)' );
+   regex = new RegExp( url );
+
+   href = link.jquery ? link[0].href : link.href;
+   decodedHref = decodeURIComponent( href );
+   matches = decodedHref.match( regex );
+
+   if ( matches  matches[1] ) {
+   return mw.Title.newFromText( matches[1] );
+   } else if ( href.indexOf( serverUrl + mw.config.get( 'wgScript' 
) ) !== -1 ) {
+   // Handle redlinks and other special links which does 
not use $wgArticlePath pattern
+   return mw.Title.newFromText( mw.util.getParamValue( 
'title', href ) );
+   }
+
+   return null;
+   };
+
+   /**
 * Whether this title exists on the wiki.
 *
 * @static

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I718e6e6ddfcb566d87c0859320ba68d26471a470
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: M4tx m...@m4tx.pl

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


[MediaWiki-commits] [Gerrit] [bugfix] Double double escape brace chars to enable double f... - change (pywikibot/core)

2015-07-05 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

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

Change subject: [bugfix] Double double escape brace chars to enable double 
formatting
..

[bugfix] Double double escape brace chars to enable double formatting

Bug: T104798
Change-Id: I19311da391b8778bba8ccd3d00e2d9be57abaee2
---
M pywikibot/bot.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/89/222889/1

diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index bc47a80..57e8ec0 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -935,8 +935,9 @@
 if self._new is False:
 question += 'be unlinked?'
 else:
-question += 'target to 
\03{{lightpurple}}{0}\03{{default}}?'.format(
-self._new.canonical_title())
+question += ('target to '
+ 
'\03lightpurple{0}\03default?').format(
+ self._new.canonical_title())
 
 choice = pywikibot.input_choice(
 question.format(self._old.canonical_title()),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I19311da391b8778bba8ccd3d00e2d9be57abaee2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

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


[MediaWiki-commits] [Gerrit] Stop using ApiWikibase in GetEntities - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Stop using ApiWikibase in GetEntities
..

Stop using ApiWikibase in GetEntities

Change-Id: I846d71dd5357d88104df010f70f51096aea802ae
---
M repo/includes/api/GetEntities.php
1 file changed, 34 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/05/222905/1

diff --git a/repo/includes/api/GetEntities.php 
b/repo/includes/api/GetEntities.php
index 3751b23..9a02832 100644
--- a/repo/includes/api/GetEntities.php
+++ b/repo/includes/api/GetEntities.php
@@ -5,12 +5,14 @@
 use ApiBase;
 use ApiMain;
 use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\DataModel\Entity\EntityIdParsingException;
 use Wikibase\EntityRevision;
 use Wikibase\LanguageFallbackChainFactory;
 use Wikibase\Lib\Serializers\EntitySerializer;
 use Wikibase\Lib\Serializers\SerializationOptions;
 use Wikibase\Lib\Store\EntityPrefetcher;
+use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Lib\Store\UnresolvedRedirectException;
 use Wikibase\Repo\SiteLinkTargetProvider;
 use Wikibase\Repo\WikibaseRepo;
@@ -27,7 +29,7 @@
  * @author Michał Łazowik
  * @author Adam Shorland
  */
-class GetEntities extends ApiWikibase {
+class GetEntities extends ApiBase {
 
/**
 * @var StringNormalizer
@@ -60,6 +62,21 @@
private $errorReporter;
 
/**
+* @var ResultBuilder
+*/
+   private $resultBuilder;
+
+   /**
+* @var EntityRevisionLookup
+*/
+   private $entityRevisionLookup;
+
+   /**
+* @var EntityIdParser
+*/
+   private $idParser;
+
+   /**
 * @param ApiMain $mainModule
 * @param string $moduleName
 * @param string $modulePrefix
@@ -72,8 +89,11 @@
$apiHelperFactory = $wikibaseRepo-getApiHelperFactory( 
$this-getContext() );
 
$this-errorReporter = $apiHelperFactory-getErrorReporter( 
$this );
+   $this-resultBuilder = $apiHelperFactory-getResultBuilder( 
$this );
$this-stringNormalizer = $wikibaseRepo-getStringNormalizer();
$this-languageFallbackChainFactory = 
$wikibaseRepo-getLanguageFallbackChainFactory();
+   $this-entityRevisionLookup = 
$wikibaseRepo-getEntityRevisionLookup();
+   $this-idParser = $wikibaseRepo-getEntityIdParser();
 
$this-siteLinkTargetProvider = new SiteLinkTargetProvider(
$wikibaseRepo-getSiteStore(),
@@ -109,7 +129,7 @@
//todo remove once result builder is used... (what exactly does 
this do?)
$this-getResult()-addIndexedTagName( array( 'entities' ), 
'entity' );
 
-   $this-getResultBuilder()-markSuccess( 1 );
+   $this-resultBuilder-markSuccess( 1 );
}
 
/**
@@ -135,7 +155,7 @@
if ( isset( $params['ids'] ) ) {
foreach ( $params['ids'] as $id ) {
try {
-   $ids[] = $this-getIdParser()-parse( 
$id );
+   $ids[] = $this-idParser-parse( $id );
} catch ( EntityIdParsingException $e ) {
$this-errorReporter-dieError( 
Invalid id: $id, 'no-such-entity' );
}
@@ -165,7 +185,7 @@
$siteLinkStore = 
WikibaseRepo::getDefaultInstance()-getStore()-newSiteLinkStore();
$siteStore = WikibaseRepo::getDefaultInstance()-getSiteStore();
return new ItemByTitleHelper(
-   $this-getResultBuilder(),
+   $this-resultBuilder,
$siteLinkStore,
$siteStore,
$this-stringNormalizer
@@ -177,7 +197,7 @@
 */
private function addMissingItemsToResult( $missingItems ) {
foreach ( $missingItems as $missingItem ) {
-   $this-getResultBuilder()-addMissingEntity( null, 
$missingItem );
+   $this-resultBuilder-addMissingEntity( null, 
$missingItem );
}
}
 
@@ -227,7 +247,7 @@
$entityRevision = null;
 
try {
-   $entityRevision = 
$this-getEntityRevisionLookup()-getEntityRevision( $entityId );
+   $entityRevision = 
$this-entityRevisionLookup-getEntityRevision( $entityId );
} catch ( UnresolvedRedirectException $ex ) {
if ( $resolveRedirects ) {
$entityId = $ex-getRedirectTargetId();
@@ -247,13 +267,19 @@
 */
private function handleEntity( $sourceEntityId, EntityRevision 
$entityRevision = 

[MediaWiki-commits] [Gerrit] Stop using ApiWikibase in GetClaims - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Stop using ApiWikibase in GetClaims
..

Stop using ApiWikibase in GetClaims

Change-Id: I001f2491af2db02522d7f1ac799cfd62b8b6b892
---
M repo/includes/api/GetClaims.php
1 file changed, 38 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/06/222906/1

diff --git a/repo/includes/api/GetClaims.php b/repo/includes/api/GetClaims.php
index d91a49e..058bc32 100644
--- a/repo/includes/api/GetClaims.php
+++ b/repo/includes/api/GetClaims.php
@@ -6,6 +6,7 @@
 use ApiMain;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\DataModel\Entity\EntityIdParsingException;
 use Wikibase\DataModel\Statement\Statement;
 use Wikibase\DataModel\Statement\StatementGuidParser;
@@ -26,7 +27,7 @@
  * @author Jeroen De Dauw  jeroended...@gmail.com 
  * @author Adam Shorland
  */
-class GetClaims extends ApiWikibase {
+class GetClaims extends ApiBase {
 
/**
 * @var ClaimGuidValidator
@@ -44,6 +45,21 @@
private $errorReporter;
 
/**
+* @var EntityIdParser
+*/
+   private $idParser;
+
+   /**
+* @var EntityLoadHelper
+*/
+   private $entityLoadHelper;
+
+   /**
+* @var ResultBuilder
+*/
+   private $resultBuilder;
+
+   /**
 * @param ApiMain $mainModule
 * @param string $moduleName
 * @param string $modulePrefix
@@ -57,8 +73,11 @@
$wikibaseRepo = WikibaseRepo::getDefaultInstance();
$apiHelperFactory = $wikibaseRepo-getApiHelperFactory( 
$this-getContext() );
$this-errorReporter = $apiHelperFactory-getErrorReporter( 
$this );
+   $this-resultBuilder = $apiHelperFactory-getResultBuilder( 
$this );
+   $this-entityLoadHelper = 
$apiHelperFactory-getEntityLoadHelper( $this );
$this-guidValidator = $wikibaseRepo-getClaimGuidValidator();
$this-guidParser = $wikibaseRepo-getStatementGuidParser();
+   $this-idParser = $wikibaseRepo-getEntityIdParser();
}
 
/**
@@ -73,16 +92,20 @@
list( $idString, $guid ) = $this-getIdentifiers( $params );
 
try {
-   $entityId = $this-getIdParser()-parse( $idString );
+   $entityId = $this-idParser-parse( $idString );
} catch ( EntityIdParsingException $e ) {
$this-errorReporter-dieException( $e, 'param-invalid' 
);
}
 
-   $entityRevision = $entityId ? $this-loadEntityRevision( 
$entityId, EntityRevisionLookup::LATEST_FROM_SLAVE ) : null;
+   /** @var EntityId $entityId */
+   $entityRevision = $this-entityLoadHelper-loadEntityRevision(
+   $entityId,
+   EntityRevisionLookup::LATEST_FROM_SLAVE
+   );
$entity = $entityRevision-getEntity();
 
if ( $params['ungroupedlist'] ) {
-   $this-getResultBuilder()-getOptions()
+   $this-resultBuilder-getOptions()
-setOption(

SerializationOptions::OPT_GROUP_BY_PROPERTIES,
array()
@@ -90,12 +113,15 @@
}
 
$claims = $this-getClaims( $entity, $guid );
-   $this-getResultBuilder()-addClaims( $claims, null );
+   $this-resultBuilder-addClaims( $claims, null );
}
 
private function validateParameters( array $params ) {
if ( !isset( $params['entity'] )  !isset( $params['claim'] ) 
) {
-   $this-errorReporter-dieError( 'Either the entity 
parameter or the claim parameter need to be set', 'param-missing' );
+   $this-errorReporter-dieError(
+   'Either the entity parameter or the claim 
parameter need to be set',
+   'param-missing'
+   );
}
}
 
@@ -155,11 +181,12 @@
 
if ( isset( $params['property'] ) ) {
try {
-   $parsedProperty = $this-getIdParser()-parse( 
$params['property'] );
+   $parsedProperty = $this-idParser-parse( 
$params['property'] );
} catch ( EntityIdParsingException $e ) {
$this-errorReporter-dieException( $e, 
'param-invalid' );
}
 
+   /** @var EntityId $parsedProperty */
return $propertyId-equals( $parsedProperty );
}
 

[MediaWiki-commits] [Gerrit] replace.py: remove line endings when reading from file - change (pywikibot/core)

2015-07-05 Thread Merlijn van Deen (Code Review)
Merlijn van Deen has uploaded a new change for review.

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

Change subject: replace.py: remove line endings when reading from file
..

replace.py: remove line endings when reading from file

Change-Id: I9de69215f98ca583e636b41734ee8effaca5dbee
---
M scripts/replace.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/11/222911/1

diff --git a/scripts/replace.py b/scripts/replace.py
index f5eeeb6..4909725 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -817,7 +817,7 @@
 if replacement_file:
 try:
 with codecs.open(replacement_file, 'r', 'utf-8') as f:
-file_replacements = f.readlines()
+file_replacements = [x.strip() for x in f.readlines()]
 except (IOError, OSError) as e:
 pywikibot.error(u'Error loading {0}: {1}'.format(
 replacement_file, e))

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9de69215f98ca583e636b41734ee8effaca5dbee
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl

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


[MediaWiki-commits] [Gerrit] ores: Move ores initial install setup into a base class - change (operations/puppet)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: ores: Move ores initial install setup into a base class
..

ores: Move ores initial install setup into a base class

Change-Id: If3d159f187a98240a01148d437e8ca3f6c2fd25e
---
A modules/ores/manifests/base.pp
M modules/ores/manifests/web.pp
2 files changed, 60 insertions(+), 53 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/14/222914/1

diff --git a/modules/ores/manifests/base.pp b/modules/ores/manifests/base.pp
new file mode 100644
index 000..c147079
--- /dev/null
+++ b/modules/ores/manifests/base.pp
@@ -0,0 +1,58 @@
+class ores::base(
+$branch = 'deploy',
+) {
+# Let's use a virtualenv for maximum flexibility - we can convert
+# this to deb packages in the future if needed. We also install build tools
+# because they are needed by pip to install scikit.
+# FIXME: Use debian packages for all the packages needing compilation
+require_package('python-virtualenv', 'python3-dev', 'build-essential',
+'gfortran', 'libopenblas-dev', 'liblapack-dev')
+
+# Install scipy via debian package so we don't need to build it via pip
+# takes forever and is quite buggy
+require_package('python3-scipy')
+
+# ORES is a python3 application \o/
+require_package('uwsgi-plugin-python3')
+
+# It requires the enchant debian package
+require_package('enchant')
+
+# Spellcheck packages for supported languages
+require_package('myspell-pt', 'myspell-fa', 'myspell-en-au',
+'myspell-en-gb', 'myspell-en-us',
+'myspell-en-za', 'myspell-fr')
+
+$config_path = '/srv/ores/config'
+$venv_path = '/srv/ores/venv'
+$data_path = '/srv/ores/data'
+
+file { '/srv':
+ensure = directory,
+owner  = 'root',
+group  = 'root',
+mode   = '0775',
+}
+
+file { [
+'/srv/ores',
+$data_path,
+${data_path}/nltk,
+]:
+ensure  = directory,
+owner   = 'www-data',
+group   = 'www-data',
+mode= '0775',
+require = File['/srv'],
+}
+
+git::clone { 'ores-wm-config':
+origin= 'https://github.com/wiki-ai/ores-wikimedia-config.git',
+ensure= present,
+directory = $config_path,
+branch= $branch,
+owner = 'www-data',
+group = 'www-data',
+require   = File['/srv/ores'],
+}
+}
diff --git a/modules/ores/manifests/web.pp b/modules/ores/manifests/web.pp
index 33825f1..6ce6afa 100644
--- a/modules/ores/manifests/web.pp
+++ b/modules/ores/manifests/web.pp
@@ -3,59 +3,8 @@
 class ores::web(
 $branch = 'deploy',
 ) {
-# Let's use a virtualenv for maximum flexibility - we can convert
-# this to deb packages in the future if needed. We also install build tools
-# because they are needed by pip to install scikit.
-# FIXME: Use debian packages for all the packages needing compilation
-require_package('python-virtualenv', 'python3-dev', 'build-essential',
-'gfortran', 'libopenblas-dev', 'liblapack-dev')
-
-# Install scipy via debian package so we don't need to build it via pip
-# takes forever and is quite buggy
-require_package('python3-scipy')
-
-# ORES is a python3 application \o/
-require_package('uwsgi-plugin-python3')
-
-# It requires the enchant debian package
-require_package('enchant')
-
-# Spellcheck packages for supported languages
-require_package('myspell-pt', 'myspell-fa', 'myspell-en-au',
-'myspell-en-gb', 'myspell-en-us',
-'myspell-en-za', 'myspell-fr')
-
-$config_path = '/srv/ores/config'
-$venv_path = '/srv/ores/venv'
-$data_path = '/srv/ores/data'
-
-file { '/srv':
-ensure = directory,
-owner  = 'root',
-group  = 'root',
-mode   = '0775',
-}
-
-file { [
-'/srv/ores',
-$data_path,
-${data_path}/nltk,
-]:
-ensure  = directory,
-owner   = 'www-data',
-group   = 'www-data',
-mode= '0775',
-require = File['/srv'],
-}
-
-git::clone { 'ores-wm-config':
-origin= 'https://github.com/wiki-ai/ores-wikimedia-config.git',
-ensure= present,
-directory = $config_path,
-branch= $branch,
-owner = 'www-data',
-group = 'www-data',
-require   = File['/srv/ores'],
+class { 'ores::base':
+branch = $branch,
 }
 
 uwsgi::app { 'ores-web':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3d159f187a98240a01148d437e8ca3f6c2fd25e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet

[MediaWiki-commits] [Gerrit] celery: Create simple module for celery workers - change (operations/puppet)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: celery: Create simple module for celery workers
..

celery: Create simple module for celery workers

Only supports debian atm

Change-Id: I96133b0f61ff30e3d8e5a10bc773d4e82152db8a
---
A modules/celery/manifests/worker.pp
A modules/celery/templates/initscripts/celery.systemd.erb
2 files changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/13/222913/1

diff --git a/modules/celery/manifests/worker.pp 
b/modules/celery/manifests/worker.pp
new file mode 100644
index 000..0cf523f
--- /dev/null
+++ b/modules/celery/manifests/worker.pp
@@ -0,0 +1,11 @@
+class celery::worker(
+$app,
+$working_dir,
+$user,
+$group,
+$celery_bin_path = '/usr/bin/celery'
+) {
+base::service_unit { 'celery':
+systemd = true,
+}
+}
diff --git a/modules/celery/templates/initscripts/celery.systemd.erb 
b/modules/celery/templates/initscripts/celery.systemd.erb
new file mode 100644
index 000..2116f69
--- /dev/null
+++ b/modules/celery/templates/initscripts/celery.systemd.erb
@@ -0,0 +1,12 @@
+[Unit]
+Description=Celery workers
+After=network.target
+
+[Service]
+User=%= @user %
+Group=%= @group %
+ExecStart=%= @celery_bin_path % worker \
+--app %= @app % --workingdir %= @working_dir %
+
+[Install]
+WantedBy=multi-user.target

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96133b0f61ff30e3d8e5a10bc773d4e82152db8a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] ores: Fix scoping issue with src/venv/config paths - change (operations/puppet)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: ores: Fix scoping issue with src/venv/config paths
..

ores: Fix scoping issue with src/venv/config paths

Change-Id: I8617e36b2d0a3dcda0c1d4c5fd232ceec04f06e0
---
M modules/ores/manifests/base.pp
M modules/ores/manifests/web.pp
2 files changed, 6 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/15/222915/1

diff --git a/modules/ores/manifests/base.pp b/modules/ores/manifests/base.pp
index c147079..128e1a7 100644
--- a/modules/ores/manifests/base.pp
+++ b/modules/ores/manifests/base.pp
@@ -1,5 +1,8 @@
 class ores::base(
 $branch = 'deploy',
+$config_path = '/srv/ores/config',
+$venv_path = '/srv/ores/venv',
+$data_path = '/srv/ores/data',
 ) {
 # Let's use a virtualenv for maximum flexibility - we can convert
 # this to deb packages in the future if needed. We also install build tools
@@ -22,10 +25,6 @@
 require_package('myspell-pt', 'myspell-fa', 'myspell-en-au',
 'myspell-en-gb', 'myspell-en-us',
 'myspell-en-za', 'myspell-fr')
-
-$config_path = '/srv/ores/config'
-$venv_path = '/srv/ores/venv'
-$data_path = '/srv/ores/data'
 
 file { '/srv':
 ensure = directory,
diff --git a/modules/ores/manifests/web.pp b/modules/ores/manifests/web.pp
index 6ce6afa..1c1ee24 100644
--- a/modules/ores/manifests/web.pp
+++ b/modules/ores/manifests/web.pp
@@ -11,11 +11,11 @@
 settings = {
 uwsgi = {
 plugins = 'python3',
-'wsgi-file' = ${config_path}/ores.wmflabs.org.wsgi,
+'wsgi-file' = 
${ores::base::config_path}/ores.wmflabs.org.wsgi,
 master  = true,
-chdir   = $config_path,
+chdir   = $ores::base::config_path,
 http-socket = '0.0.0.0:8080',
-venv= $venv_path,
+venv= $ores::base::venv_path,
 processes   = inline_template('%= @processorcount.to_i * 4 
%'),
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8617e36b2d0a3dcda0c1d4c5fd232ceec04f06e0
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] ores: Fix scoping issue with src/venv/config paths - change (operations/puppet)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: ores: Fix scoping issue with src/venv/config paths
..


ores: Fix scoping issue with src/venv/config paths

Change-Id: I8617e36b2d0a3dcda0c1d4c5fd232ceec04f06e0
---
M modules/ores/manifests/base.pp
M modules/ores/manifests/web.pp
2 files changed, 6 insertions(+), 7 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/modules/ores/manifests/base.pp b/modules/ores/manifests/base.pp
index c147079..128e1a7 100644
--- a/modules/ores/manifests/base.pp
+++ b/modules/ores/manifests/base.pp
@@ -1,5 +1,8 @@
 class ores::base(
 $branch = 'deploy',
+$config_path = '/srv/ores/config',
+$venv_path = '/srv/ores/venv',
+$data_path = '/srv/ores/data',
 ) {
 # Let's use a virtualenv for maximum flexibility - we can convert
 # this to deb packages in the future if needed. We also install build tools
@@ -22,10 +25,6 @@
 require_package('myspell-pt', 'myspell-fa', 'myspell-en-au',
 'myspell-en-gb', 'myspell-en-us',
 'myspell-en-za', 'myspell-fr')
-
-$config_path = '/srv/ores/config'
-$venv_path = '/srv/ores/venv'
-$data_path = '/srv/ores/data'
 
 file { '/srv':
 ensure = directory,
diff --git a/modules/ores/manifests/web.pp b/modules/ores/manifests/web.pp
index 6ce6afa..1c1ee24 100644
--- a/modules/ores/manifests/web.pp
+++ b/modules/ores/manifests/web.pp
@@ -11,11 +11,11 @@
 settings = {
 uwsgi = {
 plugins = 'python3',
-'wsgi-file' = ${config_path}/ores.wmflabs.org.wsgi,
+'wsgi-file' = 
${ores::base::config_path}/ores.wmflabs.org.wsgi,
 master  = true,
-chdir   = $config_path,
+chdir   = $ores::base::config_path,
 http-socket = '0.0.0.0:8080',
-venv= $venv_path,
+venv= $ores::base::venv_path,
 processes   = inline_template('%= @processorcount.to_i * 4 
%'),
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8617e36b2d0a3dcda0c1d4c5fd232ceec04f06e0
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] Don't use deprecated methods in ChangeOpsMerge - change (mediawiki...Wikibase)

2015-07-05 Thread Bene (Code Review)
Bene has uploaded a new change for review.

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

Change subject: Don't use deprecated methods in ChangeOpsMerge
..

Don't use deprecated methods in ChangeOpsMerge

Change-Id: I98ef6ac70ae647398ee67a8d7a5c78374a9495f7
---
M repo/includes/ChangeOp/ChangeOpsMerge.php
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/16/222916/1

diff --git a/repo/includes/ChangeOp/ChangeOpsMerge.php 
b/repo/includes/ChangeOp/ChangeOpsMerge.php
index 6aaf4cf..aa906ba 100644
--- a/repo/includes/ChangeOp/ChangeOpsMerge.php
+++ b/repo/includes/ChangeOp/ChangeOpsMerge.php
@@ -162,7 +162,7 @@
}
 
private function generateLabelsChangeOps() {
-   foreach ( $this-fromItem-getLabels() as $langCode = $label ) 
{
+   foreach ( 
$this-fromItem-getFingerprint()-getLabels()-toTextArray() as $langCode = 
$label ) {
$toLabel = $this-toItem-getLabel( $langCode );
if ( $toLabel === false || $toLabel === $label ) {
$this-fromChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newRemoveLabelOp( $langCode ) );
@@ -175,7 +175,7 @@
}
 
private function generateDescriptionsChangeOps() {
-   foreach ( $this-fromItem-getDescriptions() as $langCode = 
$desc ) {
+   foreach ( 
$this-fromItem-getFingerprint()-getDescriptions()-toTextArray() as 
$langCode = $desc ) {
$toDescription = $this-toItem-getDescription( 
$langCode );
if ( $toDescription === false || $toDescription === 
$desc ) {
$this-fromChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newRemoveDescriptionOp( $langCode ) );
@@ -189,9 +189,9 @@
}
 
private function generateAliasesChangeOps() {
-   foreach ( $this-fromItem-getAllAliases() as $langCode = 
$aliases ) {
-   $this-fromChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newRemoveAliasesOp( $langCode, $aliases 
) );
-   $this-toChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newAddAliasesOp( $langCode, $aliases, 
'add' ) );
+   foreach ( $this-fromItem-getFingerprint()-getAliasGroups() 
as $langCode = $aliases ) {
+   $this-fromChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newRemoveAliasesOp( $langCode, 
$aliases-toTextArray() ) );
+   $this-toChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newAddAliasesOp( $langCode, 
$aliases-toTextArray(), 'add' ) );
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I98ef6ac70ae647398ee67a8d7a5c78374a9495f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene benestar.wikime...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fix special page alias for Persian - change (mediawiki...ContentTranslation)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix special page alias for Persian
..


Fix special page alias for Persian

Change-Id: I191522ee052821a9a465480058957652ec10a3d8
---
M ContentTranslation.alias.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  KartikMistry: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ContentTranslation.alias.php b/ContentTranslation.alias.php
index 5b50301..0c7c3fb 100644
--- a/ContentTranslation.alias.php
+++ b/ContentTranslation.alias.php
@@ -49,7 +49,7 @@
 /** Persian (فارسی) */
 $specialPageAliases['fa'] = array(
'ContentTranslation' = array( 'ترجمهٔ_محتوا', 'ترجمه_محتوا' ),
-   'ContentTranslation' = array( 'آمار_ترجمهٔ_محتوا', 'آمار_ترجمه_محتوا' 
),
+   'ContentTranslationStats' = array( 'آمار_ترجمهٔ_محتوا', 
'آمار_ترجمه_محتوا' ),
 );
 
 /** Hebrew (עברית) */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I191522ee052821a9a465480058957652ec10a3d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il
Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Stop using ApiWikibase - change (mediawiki...WikibaseQualityExternalValidation)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Stop using ApiWikibase
..

Stop using ApiWikibase

Change-Id: I2b83d2f6e3cb29c4256c51d4f008ad53c045c2dd
---
M api/RunCrossCheck.php
1 file changed, 42 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation
 refs/changes/26/222926/1

diff --git a/api/RunCrossCheck.php b/api/RunCrossCheck.php
index 521fd57..6a26362 100755
--- a/api/RunCrossCheck.php
+++ b/api/RunCrossCheck.php
@@ -2,10 +2,14 @@
 
 namespace WikibaseQuality\ExternalValidation\Api;
 
+use ApiBase;
 use ApiMain;
 use DataValues\Serializers;
-use Wikibase\Api\ApiWikibase;
+use Wikibase\Api\ApiErrorReporter;
+use Wikibase\Api\ApiHelperFactory;
+use Wikibase\Api\ResultBuilder;
 use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Repo\WikibaseRepo;
 use WikibaseQuality\ExternalValidation\CrossCheck\CrossCheckInteractor;
@@ -22,7 +26,7 @@
  * @author BP2014N1
  * @license GNU GPL v2+
  */
-class RunCrossCheck extends ApiWikibase {
+class RunCrossCheck extends ApiBase {
 
/**
 * @var ClaimGuidValidator
@@ -38,6 +42,21 @@
 * @var SerializerFactory
 */
private $serializerFactory;
+
+   /**
+* @var ApiErrorReporter
+*/
+   private $errorReporter;
+
+   /**
+* @var ResultBuilder
+*/
+   private $resultBuilder;
+
+   /**
+* @var EntityIdParser
+*/
+   private $idParser;
 
/**
 * Creates new instance from global state.
@@ -57,7 +76,9 @@
$prefix,
$repo-getClaimGuidValidator(),
$externalValidationServices-getCrossCheckInteractor(),
-   $externalValidationServices-getSerializerFactory()
+   $externalValidationServices-getSerializerFactory(),
+   $repo-getApiHelperFactory(),
+   $repo-getEntityIdParser()
);
}
 
@@ -67,12 +88,16 @@
 * @param string $prefix
 */
public function __construct( ApiMain $main, $name, $prefix = '', 
ClaimGuidValidator $claimGuidValidator,
-
CrossCheckInteractor $crossCheckInteractor, SerializerFactory 
$serializerFactory ) {
+
CrossCheckInteractor $crossCheckInteractor, SerializerFactory 
$serializerFactory,
+
ApiHelperFactory $apiHelperFactory, EntityIdParser $idParser ) {
parent::__construct( $main, $name, $prefix );
 
$this-claimGuidValidator = $claimGuidValidator;
$this-crossCheckInteractor = $crossCheckInteractor;
$this-serializerFactory = $serializerFactory;
+   $this-errorReporter = $apiHelperFactory-getErrorReporter( 
$this );
+   $this-resultBuilder = $apiHelperFactory-getResultBuilder( 
$this );
+   $this-idParser = $idParser;
}
 
/**
@@ -82,7 +107,7 @@
$params = $this-extractRequestParams();
 
if ( $params['entities']  $params['claims'] ) {
-   $this-dieError(
+   $this-errorReporter-dieError(
'Either provide the ids of entities or ids of 
claims, that should be cross-checked.',
'param-invalid'
);
@@ -99,7 +124,7 @@
$this-assertAreValidClaimGuids( $claimGuids );
$resultLists = 
$this-crossCheckInteractor-crossCheckStatements( $claimGuids );
} else {
-   $this-dieError(
+   $this-errorReporter-dieError(
'Either provide the ids of entities or ids of 
claims, that should be cross-checked.',
'param-missing'
);
@@ -116,7 +141,7 @@
 */
private function parseEntityIds( array $entityIds ) {
return array_map(
-   array( $this-getIdParser(), 'parse' ),
+   array( $this-idParser, 'parse' ),
$entityIds
);
}
@@ -127,7 +152,7 @@
private function assertAreValidClaimGuids( array $claimGuids ) {
foreach ( $claimGuids as $claimGuid ) {
if ( $this-claimGuidValidator-validateFormat( 
$claimGuid ) === false ) {
-   $this-dieError( 'Invalid claim guid.', 
'invalid-guid' );
+   $this-errorReporter-dieError( 'Invalid claim 

[MediaWiki-commits] [Gerrit] refresh symlinks to catch new dblists - change (operations/mediawiki-config)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: refresh symlinks to catch new dblists
..


refresh symlinks to catch new dblists

Change-Id: I7ecae6fbeff958865c9ef2fa9441ed0a2c06a774
---
A docroot/noc/conf/mediaviewer.dblist
A docroot/noc/conf/nonglobal.dblist
A docroot/noc/conf/visualeditor.dblist
3 files changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/docroot/noc/conf/mediaviewer.dblist 
b/docroot/noc/conf/mediaviewer.dblist
new file mode 12
index 000..dc867c9
--- /dev/null
+++ b/docroot/noc/conf/mediaviewer.dblist
@@ -0,0 +1 @@
+../../../mediaviewer.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/nonglobal.dblist 
b/docroot/noc/conf/nonglobal.dblist
new file mode 12
index 000..0a19a7f
--- /dev/null
+++ b/docroot/noc/conf/nonglobal.dblist
@@ -0,0 +1 @@
+../../../nonglobal.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/visualeditor.dblist 
b/docroot/noc/conf/visualeditor.dblist
new file mode 12
index 000..8bc4252
--- /dev/null
+++ b/docroot/noc/conf/visualeditor.dblist
@@ -0,0 +1 @@
+../../../visualeditor.dblist
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7ecae6fbeff958865c9ef2fa9441ed0a2c06a774
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: John F. Lewis johnflewi...@gmail.com
Gerrit-Reviewer: Alex Monk kren...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove more services from ApiWikibase - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove more services from ApiWikibase
..


Remove more services from ApiWikibase

EntityStore, ErrorReporter, EntityTitleLookup

These services and the getters for these services
have been moved down the chain of classes,
removing even more from the large ApiWikibase

Change-Id: I54b900287201db53ec9028306f9a6211dc050d1e
---
M repo/includes/api/ApiWikibase.php
M repo/includes/api/ModifyClaim.php
M repo/includes/api/ModifyEntity.php
3 files changed, 35 insertions(+), 32 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index fa78f53..da27bf3 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -17,7 +17,6 @@
 use Wikibase\Lib\Localizer\ExceptionLocalizer;
 use Wikibase\Lib\Store\BadRevisionException;
 use Wikibase\Lib\Store\EntityRevisionLookup;
-use Wikibase\Lib\Store\EntityStore;
 use Wikibase\Lib\Store\EntityTitleLookup;
 use Wikibase\Lib\Store\StorageException;
 use Wikibase\Lib\Store\UnresolvedRedirectException;
@@ -69,11 +68,6 @@
private $entityRevisionLookup;
 
/**
-* @var EntityStore
-*/
-   private $entityStore;
-
-   /**
 * @var SummaryFormatter
 */
private $summaryFormatter;
@@ -111,7 +105,6 @@
// NOTE: use uncached lookup for write mode!
$uncached = $this-isWriteMode() ? 'uncached' : '';
$this-entityRevisionLookup = 
$wikibaseRepo-getEntityRevisionLookup( $uncached );
-   $this-entityStore = $wikibaseRepo-getEntityStore();
 
$this-summaryFormatter = $wikibaseRepo-getSummaryFormatter();
 
@@ -132,20 +125,6 @@
}
 
/**
-* @return ApiErrorReporter
-*/
-   protected function getErrorReporter() {
-   return $this-errorReporter;
-   }
-
-   /**
-* @return EntityStore
-*/
-   protected function getEntityStore() {
-   return $this-entityStore;
-   }
-
-   /**
 * @return EntityRevisionLookup
 */
protected function getEntityRevisionLookup() {
@@ -157,13 +136,6 @@
 */
protected function getIdParser() {
return $this-idParser;
-   }
-
-   /**
-* @return EntityTitleLookup
-*/
-   protected function getTitleLookup() {
-   return $this-titleLookup;
}
 
/**
diff --git a/repo/includes/api/ModifyClaim.php 
b/repo/includes/api/ModifyClaim.php
index b2a203e..59b4364 100644
--- a/repo/includes/api/ModifyClaim.php
+++ b/repo/includes/api/ModifyClaim.php
@@ -45,11 +45,14 @@
public function __construct( ApiMain $mainModule, $moduleName, 
$modulePrefix = '' ) {
parent::__construct( $mainModule, $moduleName, $modulePrefix );
 
+   $wikibaseRepo = WikibaseRepo::getDefaultInstance();
+   $apiHelperFactory = $wikibaseRepo-getApiHelperFactory( 
$this-getContext() );
+
$this-modificationHelper = new StatementModificationHelper(
-   
WikibaseRepo::getDefaultInstance()-getSnakConstructionService(),
-   WikibaseRepo::getDefaultInstance()-getEntityIdParser(),
-   
WikibaseRepo::getDefaultInstance()-getClaimGuidValidator(),
-   $this-getErrorReporter()
+   $wikibaseRepo-getSnakConstructionService(),
+   $wikibaseRepo-getEntityIdParser(),
+   $wikibaseRepo-getClaimGuidValidator(),
+   $apiHelperFactory-getErrorReporter( $this )
);
 
$this-guidParser = 
WikibaseRepo::getDefaultInstance()-getStatementGuidParser();
diff --git a/repo/includes/api/ModifyEntity.php 
b/repo/includes/api/ModifyEntity.php
index 8acd776..745050c 100644
--- a/repo/includes/api/ModifyEntity.php
+++ b/repo/includes/api/ModifyEntity.php
@@ -17,6 +17,8 @@
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\EntityRevision;
 use Wikibase\Lib\Store\EntityRevisionLookup;
+use Wikibase\Lib\Store\EntityStore;
+use Wikibase\Lib\Store\EntityTitleLookup;
 use Wikibase\Lib\Store\SiteLinkLookup;
 use Wikibase\Lib\Store\StorageException;
 use Wikibase\Repo\SiteLinkTargetProvider;
@@ -50,6 +52,16 @@
 * @var SiteLinkLookup
 */
protected $siteLinkLookup;
+
+   /**
+* @var EntityTitleLookup
+*/
+   private $titleLookup;
+
+   /**
+* @var EntityStore
+*/
+   private $entityStore;
 
/**
 * @since 0.5
@@ -94,12 +106,28 @@
$settings-getSetting( 'specialSiteLinkGroups' )
);
 
+   $this-entityStore = $wikibaseRepo-getEntityStore();
+   

[MediaWiki-commits] [Gerrit] added shebang to .sh files for lintian - change (mediawiki/core)

2015-07-05 Thread MidPhoto (Code Review)
MidPhoto has uploaded a new change for review.

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

Change subject: added shebang to .sh files for lintian
..

added shebang to .sh files for lintian

Makes lintian not throw errors at files:
- maintenance/dev/includes/php.sh
- maintenance/dev/includes/require-php.sh

Bug: T103762
Change-Id: I707e8b3a119dd9de9fee7504f703e001ff57074a
---
M maintenance/dev/includes/php.sh
M maintenance/dev/includes/require-php.sh
2 files changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/222910/1

diff --git a/maintenance/dev/includes/php.sh b/maintenance/dev/includes/php.sh
index 3c5bef0..bbda3c8 100755
--- a/maintenance/dev/includes/php.sh
+++ b/maintenance/dev/includes/php.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 # Include-able script to determine the location of our php if any
 # We search for a environment var called PHP, native php,
 # a local copy, home directory location used by installphp.sh
diff --git a/maintenance/dev/includes/require-php.sh 
b/maintenance/dev/includes/require-php.sh
index 470e6eb..57e9732 100755
--- a/maintenance/dev/includes/require-php.sh
+++ b/maintenance/dev/includes/require-php.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 # Include-able script to require that we have a known php binary we can execute
 
 . $DEV/includes/php.sh

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I707e8b3a119dd9de9fee7504f703e001ff57074a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MidPhoto dave.olstho...@gmail.com

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


[MediaWiki-commits] [Gerrit] [VisualEditor] Remove deleted keys - change (translatewiki)

2015-07-05 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: [VisualEditor] Remove deleted keys
..


[VisualEditor] Remove deleted keys

https://gerrit.wikimedia.org/r/#/c/222694/1/modules/ve-mw/i18n/en.json,unified

Change-Id: I11722dd61db31ec9872eaf214cb4ecdce84e0aaf
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index e5ab098..0a6f849 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -2336,7 +2336,6 @@
 descmsg = visualeditor-desc
 file = VisualEditor/modules/ve-mw/i18n/%CODE%.json
 optional = visualeditor-preference-core-discussion-link, 
visualeditor-preference-core-info-link
-optional = visualeditor-preference-mwalienextension-discussion-link, 
visualeditor-preference-mwalienextension-info-link
 optional = visualeditor-dialog-media-dimensionseparator, 
visualeditor-dialog-media-info-dateformat
 optional = visualeditor-dialog-media-info-ellipsis, 
visualeditor-dialog-media-info-separator
 ignored = accesskey-ca-ve-edit, accesskey-ca-editsource

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I11722dd61db31ec9872eaf214cb4ecdce84e0aaf
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] [VisualEditor] Remove deleted keys - change (translatewiki)

2015-07-05 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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

Change subject: [VisualEditor] Remove deleted keys
..

[VisualEditor] Remove deleted keys

https://gerrit.wikimedia.org/r/#/c/222694/1/modules/ve-mw/i18n/en.json,unified

Change-Id: I11722dd61db31ec9872eaf214cb4ecdce84e0aaf
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/20/222920/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index e5ab098..0a6f849 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -2336,7 +2336,6 @@
 descmsg = visualeditor-desc
 file = VisualEditor/modules/ve-mw/i18n/%CODE%.json
 optional = visualeditor-preference-core-discussion-link, 
visualeditor-preference-core-info-link
-optional = visualeditor-preference-mwalienextension-discussion-link, 
visualeditor-preference-mwalienextension-info-link
 optional = visualeditor-dialog-media-dimensionseparator, 
visualeditor-dialog-media-info-dateformat
 optional = visualeditor-dialog-media-info-ellipsis, 
visualeditor-dialog-media-info-separator
 ignored = accesskey-ca-ve-edit, accesskey-ca-editsource

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11722dd61db31ec9872eaf214cb4ecdce84e0aaf
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] [Math] Remove deleted keys - change (translatewiki)

2015-07-05 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: [Math] Remove deleted keys
..


[Math] Remove deleted keys

https://gerrit.wikimedia.org/r/#/c/222700/1/i18n/en.json,unified

Change-Id: I2df9b25bada8186190f7afeaf71e1fb806c6305e
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 0a6f849..5fcccb1 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -1330,7 +1330,6 @@
 
 Math
 aliasfile = Math/Math.alias.php
-ignored = math-preference-mwmathinspector-discussion-link, 
math-preference-mwmathinspector-info-link
 
 Math Search
 aliasfile = MathSearch/MathSearch.alias.php

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2df9b25bada8186190f7afeaf71e1fb806c6305e
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] Database schema improvements (T102992) - change (mediawiki...WikibaseQualityConstraints)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Database schema improvements (T102992)
..


Database schema improvements (T102992)

Change-Id: I32dacbde7aef28bf012ca90218d9fb3a7cd703a0
---
M includes/ConstraintRepository.php
M maintenance/UpdateTable.php
M sql/create_wbqc_constraints.sql
3 files changed, 8 insertions(+), 9 deletions(-)

Approvals:
  Tamslo: Looks good to me, approved
  Jonaskeutel: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/ConstraintRepository.php 
b/includes/ConstraintRepository.php
index 000de2c..df66a75 100644
--- a/includes/ConstraintRepository.php
+++ b/includes/ConstraintRepository.php
@@ -51,9 +51,6 @@
);
 
$db = wfGetDB( DB_MASTER );
-   $db-commit( __METHOD__, flush );
-   wfWaitForSlaves();
-
return $db-insert( CONSTRAINT_TABLE, $accumulator );
}
 
diff --git a/maintenance/UpdateTable.php b/maintenance/UpdateTable.php
index 8078776..d234411 100644
--- a/maintenance/UpdateTable.php
+++ b/maintenance/UpdateTable.php
@@ -46,11 +46,16 @@
private function insertValues( $constraintRepo, $csvFile ) {
 
$i = 0;
+   $db = wfGetDB( DB_MASTER );
$accumulator = array();
while ( true ) {
$data = fgetcsv( $csvFile );
if ( $data === false || ++$i % $this-mBatchSize === 0 
) {
$constraintRepo-insertBatch( $accumulator );
+
+   $db-commit( __METHOD__, 'flush' );
+   wfWaitForSlaves();
+
if ( !$this-isQuiet() ) {
$this-output( \r\033[K );
$this-output( $i rows inserted );
diff --git a/sql/create_wbqc_constraints.sql b/sql/create_wbqc_constraints.sql
index 7b371c1..18c4bb4 100755
--- a/sql/create_wbqc_constraints.sql
+++ b/sql/create_wbqc_constraints.sql
@@ -1,12 +1,9 @@
 CREATE TABLE IF NOT EXISTS /*_*/wbqc_constraints (
-  constraint_guidVARCHAR(255)  PRIMARY KEY,
+  constraint_guidVARBINARY(63) PRIMARY KEY,
   pidINT(11)   NOT NULL,
-  constraint_type_qid  VARCHAR(255)NOT NULL,
+  constraint_type_qid  VARBINARY(25)   NOT NULL,
   constraint_parametersTEXT  DEFAULT 
NULL
 ) /*$wgDBTableOptions*/;
 
 CREATE INDEX /*i*/wbqc_constraints_pid_index
-ON /*_*/wbqc_constraints (pid);
-
-CREATE INDEX /*i*/wbqc_constraints_constraint_type_qid_index
-ON /*_*/wbqc_constraints (constraint_type_qid);
\ No newline at end of file
+ON /*_*/wbqc_constraints (pid);
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I32dacbde7aef28bf012ca90218d9fb3a7cd703a0
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: v1
Gerrit-Owner: Soeren.oldag soeren_ol...@freenet.de
Gerrit-Reviewer: Jonaskeutel jonas.keu...@student.hpi.de
Gerrit-Reviewer: Tamslo tamaraslosa...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Don't use deprecated methods in ChangeOpsMerge - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Don't use deprecated methods in ChangeOpsMerge
..


Don't use deprecated methods in ChangeOpsMerge

Change-Id: I98ef6ac70ae647398ee67a8d7a5c78374a9495f7
---
M repo/includes/ChangeOp/ChangeOpsMerge.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/ChangeOp/ChangeOpsMerge.php 
b/repo/includes/ChangeOp/ChangeOpsMerge.php
index 6aaf4cf..3b44832 100644
--- a/repo/includes/ChangeOp/ChangeOpsMerge.php
+++ b/repo/includes/ChangeOp/ChangeOpsMerge.php
@@ -162,7 +162,7 @@
}
 
private function generateLabelsChangeOps() {
-   foreach ( $this-fromItem-getLabels() as $langCode = $label ) 
{
+   foreach ( 
$this-fromItem-getFingerprint()-getLabels()-toTextArray() as $langCode = 
$label ) {
$toLabel = $this-toItem-getLabel( $langCode );
if ( $toLabel === false || $toLabel === $label ) {
$this-fromChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newRemoveLabelOp( $langCode ) );
@@ -175,7 +175,7 @@
}
 
private function generateDescriptionsChangeOps() {
-   foreach ( $this-fromItem-getDescriptions() as $langCode = 
$desc ) {
+   foreach ( 
$this-fromItem-getFingerprint()-getDescriptions()-toTextArray() as 
$langCode = $desc ) {
$toDescription = $this-toItem-getDescription( 
$langCode );
if ( $toDescription === false || $toDescription === 
$desc ) {
$this-fromChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newRemoveDescriptionOp( $langCode ) );
@@ -189,7 +189,7 @@
}
 
private function generateAliasesChangeOps() {
-   foreach ( $this-fromItem-getAllAliases() as $langCode = 
$aliases ) {
+   foreach ( 
$this-fromItem-getFingerprint()-getAliasGroups()-toTextArray() as $langCode 
= $aliases ) {
$this-fromChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newRemoveAliasesOp( $langCode, $aliases 
) );
$this-toChangeOps-add( 
$this-getFingerprintChangeOpFactory()-newAddAliasesOp( $langCode, $aliases, 
'add' ) );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I98ef6ac70ae647398ee67a8d7a5c78374a9495f7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene benestar.wikime...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] [ConfirmEdit ReCaptcha NoCaptcha] Register module - change (translatewiki)

2015-07-05 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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

Change subject: [ConfirmEdit ReCaptcha NoCaptcha] Register module
..

[ConfirmEdit ReCaptcha NoCaptcha] Register module

https://gerrit.wikimedia.org/r/#/c/179793/

Change-Id: Iaaa1453c24adae0828adbfea50dba55603c94f2d
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/31/222931/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 5fcccb1..200f347 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -656,6 +656,9 @@
 descmsg = recaptcha-desc
 optional = recaptcha-desc
 
+ConfirmEdit ReCaptcha NoCaptcha
+file = ConfirmEdit/ReCaptchaNoCaptcha/i18n/%CODE%.json
+
 Contact Page
 aliasfile = ContactPage/ContactPage.alias.php
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaaa1453c24adae0828adbfea50dba55603c94f2d
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] [ConfirmEdit ReCaptcha NoCaptcha] Register module - change (translatewiki)

2015-07-05 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: [ConfirmEdit ReCaptcha NoCaptcha] Register module
..


[ConfirmEdit ReCaptcha NoCaptcha] Register module

https://gerrit.wikimedia.org/r/#/c/179793/

Change-Id: Iaaa1453c24adae0828adbfea50dba55603c94f2d
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 5fcccb1..200f347 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -656,6 +656,9 @@
 descmsg = recaptcha-desc
 optional = recaptcha-desc
 
+ConfirmEdit ReCaptcha NoCaptcha
+file = ConfirmEdit/ReCaptchaNoCaptcha/i18n/%CODE%.json
+
 Contact Page
 aliasfile = ContactPage/ContactPage.alias.php
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaaa1453c24adae0828adbfea50dba55603c94f2d
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] i18nize [[Special:RandomInCategory]] submit button - change (mediawiki/core)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: i18nize [[Special:RandomInCategory]] submit button
..


i18nize [[Special:RandomInCategory]] submit button

This commit fixes a regression caused by an earlier refactor of the
Special:RandomInCategory page, which introduced message reuse. This
commit splits the message again.

Bug: T101717
Change-Id: Iabfe172b2e1d8464262b244337789bca388460f8
---
M includes/specials/SpecialRandomInCategory.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialRandomInCategory.php 
b/includes/specials/SpecialRandomInCategory.php
index b5c9e19..e21eaeb 100644
--- a/includes/specials/SpecialRandomInCategory.php
+++ b/includes/specials/SpecialRandomInCategory.php
@@ -89,6 +89,10 @@
return false;
}
 
+   protected function alterForm( HTMLForm $form ) {
+   $form-setSubmitTextMsg( 'randomincategory-submit' );
+   }
+
protected function setParameter( $par ) {
// if subpage present, fake form submission
$this-onSubmit( array( 'category' = $par ) );
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 2a22479..3a47bce 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1575,6 +1575,7 @@
randomincategory-nopages: There are no pages in the 
[[:Category:$1|$1]] category.,
randomincategory-category: Category:,
randomincategory-legend: Random page in category,
+   randomincategory-submit: Go,
randomredirect: Random redirect,
randomredirect-nopages: There are no redirects in the namespace 
\$1\.,
statistics: Statistics,
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 777c7f1..915e1750 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -1745,6 +1745,7 @@
randomincategory-nopages: Message shown from 
[[Special:RandomInCategory]] if the category is empty.\n\nParameters:\n* $1 - 
the category name (without the namespace prefix),
randomincategory-category: Shown on [[Special:RandomInCategory]] as 
a label for a text box allowing the user to input a category 
name.\n{{Identical|Category}},
randomincategory-legend: Used as fieldset label for the form on 
[[Special:RandomInCategory]].,
+   randomincategory-submit: Used as label for the Submit button on 
[[Special:RandomInCategory]].\n{{Identical|Go}},
randomredirect: {{doc-special|RandomRedirect}},
randomredirect-nopages: Parameters:\n* $1 - list of namespaces\n* $2 
- (Unused) number of namespaces\nSee also:\n* {{msg-mw|Randompage-nopages}},
statistics: {{doc-special|Statistics}}\n{{Identical|Statistics}},

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iabfe172b2e1d8464262b244337789bca388460f8
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Microchip08 doug...@chippy.ch
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Microchip08 doug...@chippy.ch
Gerrit-Reviewer: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Factor EntitySaveHelper out of ApiWikibase - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Factor EntitySaveHelper out of ApiWikibase
..


Factor EntitySaveHelper out of ApiWikibase

This moves the logic of an API saving pages out
of the base class and into a helper class.
This was essentially a Copy  Paste move
of the methods.

This means it can be tested seperatly and injected
where needed.
I have also introduced some basic tests for the class
and method. These are only basic currently.

A convenience method has also been added to the
api helper factory.

Change-Id: Ie426c1828a69623c9cced688eb7bf7992a8b437f
---
M repo/includes/WikibaseRepo.php
M repo/includes/api/ApiHelperFactory.php
M repo/includes/api/ApiWikibase.php
M repo/includes/api/CreateRedirect.php
A repo/includes/api/EntitySaveHelper.php
M repo/includes/api/FormatSnakValue.php
M repo/includes/api/MergeItems.php
M repo/includes/api/ParseValue.php
M repo/tests/phpunit/includes/WikibaseRepoTest.php
M repo/tests/phpunit/includes/api/ApiHelperFactoryTest.php
A repo/tests/phpunit/includes/api/EntitySaverHelperTest.php
M repo/tests/phpunit/includes/api/MergeItemsTest.php
12 files changed, 547 insertions(+), 181 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index 1d091a1..5767a1e 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -330,12 +330,21 @@
$this-getEntityPermissionChecker(),
$this-getSummaryFormatter(),
$user,
-   new EditFilterHookRunner(
-   $this-getEntityTitleLookup(),
-   $this-getEntityContentFactory(),
-   $context
-   ),
+   $this-newEditFilterHookRunner( $context ),
$this-getStore()-getEntityRedirectLookup()
+   );
+   }
+
+   /**
+* @param IContextSource $context
+*
+* @return EditFilterHookRunner
+*/
+   private function newEditFilterHookRunner( IContextSource $context ) {
+   return new EditFilterHookRunner(
+   $this-getEntityTitleLookup(),
+   $this-getEntityContentFactory(),
+   $context
);
}
 
@@ -1060,14 +1069,21 @@
}
 
/**
+* @param IContextSource $context
+*
 * @return ApiHelperFactory
 */
-   public function getApiHelperFactory() {
+   public function getApiHelperFactory( $context ) {
return new ApiHelperFactory(
$this-getEntityTitleLookup(),
$this-getExceptionLocalizer(),
$this-getPropertyDataTypeLookup(),
-   $this-getEntityFactory()
+   $this-getEntityFactory(),
+   $this-getSummaryFormatter(),
+   $this-getEntityRevisionLookup(),
+   $this-getEntityStore(),
+   $this-getEntityPermissionChecker(),
+   $this-newEditFilterHookRunner( $context )
);
}
 
diff --git a/repo/includes/api/ApiHelperFactory.php 
b/repo/includes/api/ApiHelperFactory.php
index d9bf807..3a6a83b 100644
--- a/repo/includes/api/ApiHelperFactory.php
+++ b/repo/includes/api/ApiHelperFactory.php
@@ -8,7 +8,12 @@
 use Wikibase\Lib\Localizer\ExceptionLocalizer;
 use Wikibase\Lib\Serializers\SerializationOptions;
 use Wikibase\Lib\Serializers\SerializerFactory;
+use Wikibase\Lib\Store\EntityRevisionLookup;
+use Wikibase\Lib\Store\EntityStore;
 use Wikibase\Lib\Store\EntityTitleLookup;
+use Wikibase\Repo\Hooks\EditFilterHookRunner;
+use Wikibase\Repo\Store\EntityPermissionChecker;
+use Wikibase\SummaryFormatter;
 
 /**
  * A factory class for API helper objects.
@@ -44,17 +49,51 @@
 */
private $entityFactory;
 
+   /**
+* @var SummaryFormatter
+*/
+   private $summaryFormatter;
+
+   /**
+* @var EntityRevisionLookup
+*/
+   private $entityRevisionLookup;
+
+   /**
+* @var EntityStore
+*/
+   private $entityStore;
+
+   /**
+* @var EntityPermissionChecker
+*/
+   private $entityPermissionChecker;
+
+   /**
+* @var EditFilterHookRunner
+*/
+   private $editFilterHookRunner;
+
public function __construct(
EntityTitleLookup $titleLookup,
ExceptionLocalizer $exceptionLocalizer,
PropertyDataTypeLookup $dataTypeLookup,
-   EntityFactory $entityFactory
+   EntityFactory $entityFactory,
+   SummaryFormatter $summaryFormatter,
+   

[MediaWiki-commits] [Gerrit] Remove bastion1 and bastion2 from labs bastion hosts list - change (operations/puppet)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: Remove bastion1 and bastion2 from labs bastion hosts list
..


Remove bastion1 and bastion2 from labs bastion hosts list

https://wikitech.wikimedia.org/wiki/Special:Diff/163822

Change-Id: I2e4603ddf9a735ef17d685a66b3a46fc21fa09b4
---
M manifests/network.pp
1 file changed, 0 insertions(+), 2 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/manifests/network.pp b/manifests/network.pp
index 657558f..23bcc20 100644
--- a/manifests/network.pp
+++ b/manifests/network.pp
@@ -54,8 +54,6 @@
 },
 'labs' = {
 'bastion_hosts' = [
-'10.68.16.5',   # bastion1.eqiad.wmflabs
-'10.68.16.66',  # bastion2.eqiad.wmflabs
 '10.68.17.232', # bastion-01.eqiad.wmflabs
 '10.68.18.65',  # bastion-02.eqiad.wmflabs
 '10.68.18.66',  # bastion-restricted-01.eqiad.wmflabs

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2e4603ddf9a735ef17d685a66b3a46fc21fa09b4
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk kren...@gmail.com
Gerrit-Reviewer: Alex Monk kren...@gmail.com
Gerrit-Reviewer: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove B/C hack when modifyEntity would return true - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove B/C hack when modifyEntity would return true
..


Remove B/C hack when modifyEntity would return true

After looking at all implementations of the modifyEntity
method none will ever return true now.

Change-Id: Ifaf74f61887af1fbad59ef5f2700d21f416fa6a6
---
M repo/includes/api/ModifyEntity.php
1 file changed, 0 insertions(+), 4 deletions(-)

Approvals:
  Bene: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/api/ModifyEntity.php 
b/repo/includes/api/ModifyEntity.php
index 4ff37a3..8acd776 100644
--- a/repo/includes/api/ModifyEntity.php
+++ b/repo/includes/api/ModifyEntity.php
@@ -353,10 +353,6 @@
$this-dieError( 'Attempted modification of the item 
failed', 'failed-modify' );
}
 
-   if ( $summary === true ) { // B/C, for implementations of 
modifyEntity that return true on success.
-   $summary = new Summary( $this-getModuleName() );
-   }
-
$this-addFlags( $entity-getId() === null );
 
//NOTE: EDIT_NEW will not be set automatically. If the entity 
doesn't exist, and EDIT_NEW was

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifaf74f61887af1fbad59ef5f2700d21f416fa6a6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Bene benestar.wikime...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] [WIP] ores: worker role - change (operations/puppet)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: [WIP] ores: worker role
..

[WIP] ores: worker role

Change-Id: Ia8dd63709cb8aaf097881bc7f825683cf1b51ae4
---
M manifests/role/labsores.pp
M modules/celery/manifests/worker.pp
A modules/ores/manifests/worker.pp
3 files changed, 21 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/19/222919/1

diff --git a/manifests/role/labsores.pp b/manifests/role/labsores.pp
index 881c542..0fb8fa7 100644
--- a/manifests/role/labsores.pp
+++ b/manifests/role/labsores.pp
@@ -32,6 +32,10 @@
 branch = 'staging',
 }
 
+class { '::ores::worker':
+branch = 'staging',
+}
+
 class { '::ores::lb':
 realservers = [ 'localhost:8080' ],
 cache   = false,
diff --git a/modules/celery/manifests/worker.pp 
b/modules/celery/manifests/worker.pp
index 0cf523f..360c7bf 100644
--- a/modules/celery/manifests/worker.pp
+++ b/modules/celery/manifests/worker.pp
@@ -3,7 +3,7 @@
 $working_dir,
 $user,
 $group,
-$celery_bin_path = '/usr/bin/celery'
+$celery_bin_path = '/usr/bin/celery',
 ) {
 base::service_unit { 'celery':
 systemd = true,
diff --git a/modules/ores/manifests/worker.pp b/modules/ores/manifests/worker.pp
new file mode 100644
index 000..ca9927b
--- /dev/null
+++ b/modules/ores/manifests/worker.pp
@@ -0,0 +1,16 @@
+class ores::worker(
+$branch = 'deploy',
+) {
+
+class { 'ores::base':
+branch = $branch,
+}
+
+celery::worker { 'ores-worker':
+app = 'ores.worker',
+working_dir = $ores::base::config_path,
+user= 'www-data',
+group   = 'www-data',
+celery_bin_path = ${ores::base::venve_path}/bin/celery,
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8dd63709cb8aaf097881bc7f825683cf1b51ae4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] Get rid of ApiWikibase!!!! - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Get rid of ApiWikibase
..

Get rid of ApiWikibase

It is gone!

Bug: T71001
Change-Id: I25ba7eae310deb6223ae91aa30d310158fb55457
---
M repo/includes/api/ApiHelperFactory.php
D repo/includes/api/ApiWikibase.php
M repo/includes/api/EditEntity.php
M repo/includes/api/LinkTitles.php
M repo/includes/api/ModifyClaim.php
M repo/includes/api/ModifyEntity.php
M repo/includes/api/ModifyTerm.php
M repo/includes/api/ResultBuilder.php
M repo/includes/api/SetAliases.php
9 files changed, 177 insertions(+), 190 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/28/222928/5

diff --git a/repo/includes/api/ApiHelperFactory.php 
b/repo/includes/api/ApiHelperFactory.php
index 275e3c2..18a6b8e 100644
--- a/repo/includes/api/ApiHelperFactory.php
+++ b/repo/includes/api/ApiHelperFactory.php
@@ -21,9 +21,6 @@
  * @note: This is a high level factory which should not be injected or passed 
around.
  * It should only be used when bootstrapping from a static context.
  *
- * @todo: Factor functionality out of ApiWikibase into separate helper 
classes, and
- * make them available via ApiHelperFactory.
- *
  * @license GPL 2+
  * @author Daniel Kinzler
  */
diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
deleted file mode 100644
index 3080364..000
--- a/repo/includes/api/ApiWikibase.php
+++ /dev/null
@@ -1,161 +0,0 @@
-?php
-
-namespace Wikibase\Api;
-
-use ApiBase;
-use ApiMain;
-use Wikibase\DataModel\Entity\Entity;
-use Wikibase\DataModel\Entity\EntityDocument;
-use Wikibase\DataModel\Entity\EntityId;
-use Wikibase\DataModel\Entity\EntityIdParser;
-use Wikibase\Lib\Store\EntityRevisionLookup;
-use Wikibase\Repo\WikibaseRepo;
-
-/**
- * Base class for API modules
- *
- * @since 0.1
- * @licence GNU GPL v2+
- * @author John Erling Blad  jeb...@gmail.com 
- * @author Tobias Gritschacher  tobias.gritschac...@wikimedia.de 
- * @author Adam Shorland
- * @author Daniel Kinzler
- */
-abstract class ApiWikibase extends ApiBase {
-
-   /**
-* @var ResultBuilder
-*/
-   private $resultBuilder;
-
-   /**
-* @var EntityIdParser
-*/
-   private $idParser;
-
-   /**
-* @var EntityRevisionLookup
-*/
-   private $entityRevisionLookup;
-
-   /**
-* @var EntitySaveHelper
-*/
-   private $entitySaveHelper;
-
-   /**
-* @var EntityLoadHelper
-*/
-   private $entityLoadHelper;
-
-   /**
-* @param ApiMain $mainModule
-* @param string $moduleName
-* @param string $modulePrefix
-*
-* @see ApiBase::__construct
-*/
-   public function __construct( ApiMain $mainModule, $moduleName, 
$modulePrefix = '' ) {
-   parent::__construct( $mainModule, $moduleName, $modulePrefix );
-
-   $wikibaseRepo = WikibaseRepo::getDefaultInstance();
-
-   $this-idParser = $wikibaseRepo-getEntityIdParser();
-
-   // NOTE: use uncached lookup for write mode!
-   $uncached = $this-isWriteMode() ? 'uncached' : '';
-   $this-entityRevisionLookup = 
$wikibaseRepo-getEntityRevisionLookup( $uncached );
-
-   $apiHelperFactory = $wikibaseRepo-getApiHelperFactory( 
$this-getContext() );
-   $this-resultBuilder = $apiHelperFactory-getResultBuilder( 
$this );
-   $this-entitySaveHelper = 
$apiHelperFactory-getEntitySaveHelper( $this );
-   $this-entityLoadHelper = 
$apiHelperFactory-getEntityLoadHelper( $this );
-   }
-
-   /**
-* @return EntityRevisionLookup
-*/
-   protected function getEntityRevisionLookup() {
-   return $this-entityRevisionLookup;
-   }
-
-   /**
-* @return EntityIdParser
-*/
-   protected function getIdParser() {
-   return $this-idParser;
-   }
-
-   /**
-* @return ResultBuilder
-*/
-   protected function getResultBuilder() {
-   return $this-resultBuilder;
-   }
-
-   /**
-* @see ApiBase::needsToken()
-*
-* @return string|false
-*/
-   public function needsToken() {
-   return $this-isWriteMode() ? 'csrf' : false;
-   }
-
-   /**
-* Returns the permissions that are required to perform the operation 
specified by
-* the parameters.
-*
-* Per default, this will include the 'read' permission if 
$this-isReadMode() returns true,
-* and the 'edit' permission if $this-isWriteMode() returns true,
-*
-* @param EntityDocument $entity The entity to check permissions for
-*
-* @return string[] A list of permissions
-*/
-   protected function 

[MediaWiki-commits] [Gerrit] Fix margin for the bullet-icon in svg - change (mediawiki...Vector)

2015-07-05 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Fix margin for the bullet-icon in svg
..

Fix margin for the bullet-icon in svg

* Caused it to look a little funny then the png.

Change-Id: I086034cfdf6245d12006778ac280330e2ce07fe9
---
M components/common.less
M i18n/kk-cyrl.json
M i18n/scn.json
3 files changed, 9 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/29/222929/1

diff --git a/components/common.less b/components/common.less
index 16e2622..69686bc 100644
--- a/components/common.less
+++ b/components/common.less
@@ -131,6 +131,7 @@
 ul {
list-style-type: disc;
.list-style-image-svg('images/bullet-icon.svg', 
'images/bullet-icon.png');
+   margin: .3em 0 0 1.5em !important;
 }
 
 pre,
diff --git a/i18n/kk-cyrl.json b/i18n/kk-cyrl.json
index 3593350..978e262 100644
--- a/i18n/kk-cyrl.json
+++ b/i18n/kk-cyrl.json
@@ -11,7 +11,7 @@
vector-action-delete: Жою,
vector-action-move: Атауын өзгерту,
vector-action-protect: Қорғау,
-   vector-action-undelete: Жоймау,
+   vector-action-undelete: Жоюды болдырмау,
vector-action-unprotect: Қорғанысын өзгерту,
vector-view-create: Бастау,
vector-view-edit: Өңдеу,
diff --git a/i18n/scn.json b/i18n/scn.json
index 1a06895..5374e3f 100644
--- a/i18n/scn.json
+++ b/i18n/scn.json
@@ -6,17 +6,17 @@
Pippinu
]
},
-   vector-skin-desc: Virsioni muderna di MonoBook cu' n'aspettu novu e 
tanti migghiuramenti nta l'usabbilità,
-   vector-action-addsection: Agghiunci argumentu,
-   vector-action-delete: Cancella,
+   vector-skin-desc: Virsioni muderna di MonoBook cu n’aspettu novu e 
tanti migghiuramenti nta l’usabbilità,
+   vector-action-addsection: Agghiunci n’argumentu,
+   vector-action-delete: Scancella,
vector-action-move: Sposta,
vector-action-protect: Pruteggi,
-   vector-action-undelete: Annulla la cancillazzioni,
+   vector-action-undelete: Annulla la scancillazzioni,
vector-action-unprotect: Cancia la prutizzioni,
-   vector-view-create: Crea,
+   vector-view-create: Crìa,
vector-view-edit: Cancia,
-   vector-view-history: Talìa la crunuluggìa,
+   vector-view-history: Talìa la cronuluggìa,
vector-view-view: Leggi,
vector-view-viewsource: Talìa lu surgenti,
-   vector-more-actions: Àutri cosi
+   vector-more-actions: Autri cosi
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I086034cfdf6245d12006778ac280330e2ce07fe9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
Gerrit-Branch: master
Gerrit-Owner: Paladox thomasmulhall...@yahoo.com

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


[MediaWiki-commits] [Gerrit] Remove debian lintian warnings - change (mediawiki...BlueSky)

2015-07-05 Thread MidPhoto (Code Review)
MidPhoto has uploaded a new change for review.

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

Change subject: Remove debian lintian warnings
..

Remove debian lintian warnings

Removes lintian warnings given by debian because of wrong file permissions 
given to files:
- resources/css/home.css
- resources/css/main.less
- resources/css/theme/colors/blue.less

Bug: T103790
Change-Id: I141695beb6ae61e92f9a74f789c9d0a1d4c79a0c
---
M resources/css/home.css
M resources/css/main.less
M resources/css/theme/colors/blue.less
3 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSky 
refs/changes/30/222930/1

diff --git a/resources/css/home.css b/resources/css/home.css
old mode 100755
new mode 100644
diff --git a/resources/css/main.less b/resources/css/main.less
old mode 100755
new mode 100644
diff --git a/resources/css/theme/colors/blue.less 
b/resources/css/theme/colors/blue.less
old mode 100755
new mode 100644

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I141695beb6ae61e92f9a74f789c9d0a1d4c79a0c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: MidPhoto dave.olstho...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove shortcut die* methods from ApiWikibase - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove shortcut die* methods from ApiWikibase
..


Remove shortcut die* methods from ApiWikibase

This adds the services each api modules needs
(in regards to error reporting)
to the api module itself.

Another step toward getting rid of ApiWikibase

This change also split up long over 100 char die
lines onto multiple lines!

Change-Id: I717812b33e919cebd6b212507a83cb9c87f289b1
---
M repo/includes/api/ApiWikibase.php
M repo/includes/api/CreateClaim.php
M repo/includes/api/EditEntity.php
M repo/includes/api/GetClaims.php
M repo/includes/api/GetEntities.php
M repo/includes/api/LinkTitles.php
M repo/includes/api/ModifyEntity.php
M repo/includes/api/RemoveClaims.php
M repo/includes/api/RemoveQualifiers.php
M repo/includes/api/RemoveReferences.php
M repo/includes/api/SetAliases.php
M repo/includes/api/SetClaim.php
M repo/includes/api/SetClaimValue.php
M repo/includes/api/SetQualifier.php
M repo/includes/api/SetReference.php
M repo/includes/api/SetSiteLink.php
16 files changed, 301 insertions(+), 168 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/api/ApiWikibase.php 
b/repo/includes/api/ApiWikibase.php
index da27bf3..70a2738 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -247,18 +247,18 @@
$revision = 
$this-entityRevisionLookup-getEntityRevision( $entityId, $revId );
 
if ( !$revision ) {
-   $this-dieError(
+   $this-errorReporter-dieError(
'Entity ' . 
$entityId-getSerialization() . ' not found',
'cant-load-entity-content' );
}
 
return $revision;
} catch ( UnresolvedRedirectException $ex ) {
-   $this-dieException( $ex, 'unresolved-redirect' );
+   $this-errorReporter-dieException( $ex, 
'unresolved-redirect' );
} catch ( BadRevisionException $ex ) {
-   $this-dieException( $ex, 'nosuchrevid' );
+   $this-errorReporter-dieException( $ex, 'nosuchrevid' 
);
} catch ( StorageException $ex ) {
-   $this-dieException( $ex, 'cant-load-entity-content' );
+   $this-errorReporter-dieException( $ex, 
'cant-load-entity-content' );
}
 
throw new LogicException( 'ApiErrorReporter::dieError did not 
throw a UsageException' );
@@ -272,8 +272,8 @@
}
 
/**
-* @deprecated since 0.5, use dieError(), dieException() or the
-* methods in $this-apiErrorReporter instead.
+* @deprecated since 0.5, use dieError(), dieException() and 
dieMessage()
+* methods inside an ApiErrorReporter object instead
 *
 * @param string $description
 * @param string $errorCode
@@ -283,46 +283,6 @@
public function dieUsage( $description, $errorCode, $httpRespCode = 0, 
$extradata = null ) {
//NOTE: This is just here for the @deprecated flag above.
parent::dieUsage( $description, $errorCode, $httpRespCode, 
$extradata );
-   }
-
-   /**
-* @see ApiErrorReporter::dieError()
-*
-* @since 0.5
-*
-* @param string $description
-* @param string $code
-* @param int $httpStatusCode
-* @param array $extradata
-*/
-   protected function dieError( $description, $code, $httpStatusCode = 0, 
$extradata = array() ) {
-   $this-errorReporter-dieError( $description, $code, 
$httpStatusCode, $extradata );
-   }
-
-   /**
-* @see ApiErrorReporter::dieException()
-*
-* @since 0.5
-*
-* @param Exception $exception
-* @param string $code
-* @param int $httpStatusCode
-* @param array $extradata
-*/
-   protected function dieException( Exception $exception, $code, 
$httpStatusCode = 0, $extradata = array() ) {
-   $this-errorReporter-dieException( $exception, $code, 
$httpStatusCode, $extradata );
-   }
-
-   /**
-* @see ApiErrorReporter::dieMessage()
-*
-* @since 0.5
-*
-* @param string $errorCode A code identifying the error.
-* @param string [$param,...] Parameters for the Message.
-*/
-   protected function dieMessage( $errorCode /*...*/ ) {
-   call_user_func_array( array( $this-errorReporter, 'dieMessage' 
), func_get_args() );
}
 
 }
diff --git a/repo/includes/api/CreateClaim.php 
b/repo/includes/api/CreateClaim.php
index 87d64f6..04c1c35 100644
--- a/repo/includes/api/CreateClaim.php
+++ 

[MediaWiki-commits] [Gerrit] remove lintian errors by correcting permission script - change (mediawiki...Flow)

2015-07-05 Thread MidPhoto (Code Review)
MidPhoto has uploaded a new change for review.

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

Change subject: remove lintian errors by correcting permission script
..

remove lintian errors by correcting permission script

Removes lintian error by setting the permission to 644 for the following file:
- scripts/generatecss.php

Bug: T104724
Change-Id: If964d92c2793e6f91bdddc115dcc4fffd3a27917
---
M scripts/generatecss.php
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/12/222912/1

diff --git a/scripts/generatecss.php b/scripts/generatecss.php
old mode 100755
new mode 100644

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If964d92c2793e6f91bdddc115dcc4fffd3a27917
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: MidPhoto dave.olstho...@gmail.com

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


[MediaWiki-commits] [Gerrit] ores: Move ores initial install setup into a base class - change (operations/puppet)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: ores: Move ores initial install setup into a base class
..


ores: Move ores initial install setup into a base class

Change-Id: If3d159f187a98240a01148d437e8ca3f6c2fd25e
---
A modules/ores/manifests/base.pp
M modules/ores/manifests/web.pp
2 files changed, 60 insertions(+), 53 deletions(-)

Approvals:
  Yuvipanda: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ores/manifests/base.pp b/modules/ores/manifests/base.pp
new file mode 100644
index 000..c147079
--- /dev/null
+++ b/modules/ores/manifests/base.pp
@@ -0,0 +1,58 @@
+class ores::base(
+$branch = 'deploy',
+) {
+# Let's use a virtualenv for maximum flexibility - we can convert
+# this to deb packages in the future if needed. We also install build tools
+# because they are needed by pip to install scikit.
+# FIXME: Use debian packages for all the packages needing compilation
+require_package('python-virtualenv', 'python3-dev', 'build-essential',
+'gfortran', 'libopenblas-dev', 'liblapack-dev')
+
+# Install scipy via debian package so we don't need to build it via pip
+# takes forever and is quite buggy
+require_package('python3-scipy')
+
+# ORES is a python3 application \o/
+require_package('uwsgi-plugin-python3')
+
+# It requires the enchant debian package
+require_package('enchant')
+
+# Spellcheck packages for supported languages
+require_package('myspell-pt', 'myspell-fa', 'myspell-en-au',
+'myspell-en-gb', 'myspell-en-us',
+'myspell-en-za', 'myspell-fr')
+
+$config_path = '/srv/ores/config'
+$venv_path = '/srv/ores/venv'
+$data_path = '/srv/ores/data'
+
+file { '/srv':
+ensure = directory,
+owner  = 'root',
+group  = 'root',
+mode   = '0775',
+}
+
+file { [
+'/srv/ores',
+$data_path,
+${data_path}/nltk,
+]:
+ensure  = directory,
+owner   = 'www-data',
+group   = 'www-data',
+mode= '0775',
+require = File['/srv'],
+}
+
+git::clone { 'ores-wm-config':
+origin= 'https://github.com/wiki-ai/ores-wikimedia-config.git',
+ensure= present,
+directory = $config_path,
+branch= $branch,
+owner = 'www-data',
+group = 'www-data',
+require   = File['/srv/ores'],
+}
+}
diff --git a/modules/ores/manifests/web.pp b/modules/ores/manifests/web.pp
index 33825f1..6ce6afa 100644
--- a/modules/ores/manifests/web.pp
+++ b/modules/ores/manifests/web.pp
@@ -3,59 +3,8 @@
 class ores::web(
 $branch = 'deploy',
 ) {
-# Let's use a virtualenv for maximum flexibility - we can convert
-# this to deb packages in the future if needed. We also install build tools
-# because they are needed by pip to install scikit.
-# FIXME: Use debian packages for all the packages needing compilation
-require_package('python-virtualenv', 'python3-dev', 'build-essential',
-'gfortran', 'libopenblas-dev', 'liblapack-dev')
-
-# Install scipy via debian package so we don't need to build it via pip
-# takes forever and is quite buggy
-require_package('python3-scipy')
-
-# ORES is a python3 application \o/
-require_package('uwsgi-plugin-python3')
-
-# It requires the enchant debian package
-require_package('enchant')
-
-# Spellcheck packages for supported languages
-require_package('myspell-pt', 'myspell-fa', 'myspell-en-au',
-'myspell-en-gb', 'myspell-en-us',
-'myspell-en-za', 'myspell-fr')
-
-$config_path = '/srv/ores/config'
-$venv_path = '/srv/ores/venv'
-$data_path = '/srv/ores/data'
-
-file { '/srv':
-ensure = directory,
-owner  = 'root',
-group  = 'root',
-mode   = '0775',
-}
-
-file { [
-'/srv/ores',
-$data_path,
-${data_path}/nltk,
-]:
-ensure  = directory,
-owner   = 'www-data',
-group   = 'www-data',
-mode= '0775',
-require = File['/srv'],
-}
-
-git::clone { 'ores-wm-config':
-origin= 'https://github.com/wiki-ai/ores-wikimedia-config.git',
-ensure= present,
-directory = $config_path,
-branch= $branch,
-owner = 'www-data',
-group = 'www-data',
-require   = File['/srv/ores'],
+class { 'ores::base':
+branch = $branch,
 }
 
 uwsgi::app { 'ores-web':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If3d159f187a98240a01148d437e8ca3f6c2fd25e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 

[MediaWiki-commits] [Gerrit] Inject DM/SerializerFactory into ResultBuilder - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Inject DM/SerializerFactory into ResultBuilder
..

Inject DM/SerializerFactory into ResultBuilder

Change-Id: Icf6e7f22c3d1a14863090277e53fb17ed940c1a8
---
M repo/includes/LinkedData/EntityDataSerializationService.php
M repo/includes/api/ApiHelperFactory.php
M repo/includes/api/ResultBuilder.php
M repo/includes/specials/SpecialEntityData.php
M repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
M repo/tests/phpunit/includes/api/ApiHelperFactoryTest.php
M repo/tests/phpunit/includes/api/ResultBuilderTest.php
M repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
9 files changed, 81 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/00/222600/3

diff --git a/repo/includes/LinkedData/EntityDataSerializationService.php 
b/repo/includes/LinkedData/EntityDataSerializationService.php
index 2d76fc9..6d273a4 100644
--- a/repo/includes/LinkedData/EntityDataSerializationService.php
+++ b/repo/includes/LinkedData/EntityDataSerializationService.php
@@ -12,6 +12,7 @@
 use SiteList;
 use Wikibase\Api\ResultBuilder;
 use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\DataModel\SerializerFactory;
 use Wikibase\EntityRevision;
 use Wikibase\Lib\Serializers\SerializationOptions;
 use Wikibase\Lib\Serializers\LibSerializerFactory;
@@ -82,6 +83,11 @@
/**
 * @var LibSerializerFactory
 */
+   private $libSerializerFactory;
+
+   /**
+* @var SerializerFactory
+*/
private $serializerFactory;
 
/**
@@ -109,9 +115,10 @@
 * @param string $rdfDataURI
 * @param EntityLookup $entityLookup
 * @param EntityTitleLookup $entityTitleLookup
-* @param LibSerializerFactory $serializerFactory
+* @param LibSerializerFactory $libSerializerFactory
 * @param PropertyDataTypeLookup $propertyLookup
 * @param SiteList $sites
+* @param SerializerFactory $serializerFactory
 *
 * @since 0.4
 */
@@ -120,15 +127,17 @@
$rdfDataURI,
EntityLookup $entityLookup,
EntityTitleLookup $entityTitleLookup,
-   LibSerializerFactory $serializerFactory,
+   LibSerializerFactory $libSerializerFactory,
PropertyDataTypeLookup $propertyLookup,
SiteList $sites,
-   EntityDataFormatProvider $entityDataFormatProvider
+   EntityDataFormatProvider $entityDataFormatProvider,
+   SerializerFactory $serializerFactory
) {
$this-rdfBaseURI = $rdfBaseURI;
$this-rdfDataURI = $rdfDataURI;
$this-entityLookup = $entityLookup;
$this-entityTitleLookup = $entityTitleLookup;
+   $this-libSerializerFactory = $libSerializerFactory;
$this-serializerFactory = $serializerFactory;
$this-propertyLookup = $propertyLookup;
$this-sites = $sites;
@@ -412,6 +421,7 @@
$resultBuilder = new ResultBuilder(
$res,
$this-entityTitleLookup,
+   $this-libSerializerFactory,
$this-serializerFactory
);
$resultBuilder-addEntityRevision( null, $entityRevision, 
$options );
diff --git a/repo/includes/api/ApiHelperFactory.php 
b/repo/includes/api/ApiHelperFactory.php
index c2738d6..9a9ecd1 100644
--- a/repo/includes/api/ApiHelperFactory.php
+++ b/repo/includes/api/ApiHelperFactory.php
@@ -3,7 +3,9 @@
 namespace Wikibase\Api;
 
 use ApiBase;
+use DataValues\Serializers\DataValueSerializer;
 use Wikibase\DataModel\Entity\PropertyDataTypeLookup;
+use Wikibase\DataModel\SerializerFactory;
 use Wikibase\EntityFactory;
 use Wikibase\Lib\Localizer\ExceptionLocalizer;
 use Wikibase\Lib\Serializers\SerializationOptions;
@@ -69,7 +71,9 @@
return new ResultBuilder(
$api-getResult(),
$this-titleLookup,
-   $this-getSerializerFactory( $defaultOptions ) );
+   $this-getLibSerializerFactory( $defaultOptions ),
+   $this-getSerializerFactory()
+   );
}
 
/**
@@ -94,7 +98,7 @@
 *
 * @return LibSerializerFactory
 */
-   public function getSerializerFactory( SerializationOptions 
$defaultOptions = null ) {
+   public function getLibSerializerFactory( SerializationOptions 
$defaultOptions = null ) {
return new LibSerializerFactory(
$defaultOptions,
$this-dataTypeLookup,
@@ -102,4 +106,13 @@

[MediaWiki-commits] [Gerrit] Use DM Serializetion in RB for aliases - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Use DM Serializetion in RB for aliases
..

Use DM Serializetion in RB for aliases

Change-Id: I74d6486589e9a73583f1a5c33285085925b6aa17
---
M repo/includes/api/EditEntity.php
M repo/includes/api/ResultBuilder.php
M repo/includes/api/SetAliases.php
M repo/tests/phpunit/includes/api/ResultBuilderTest.php
4 files changed, 72 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/07/222607/3

diff --git a/repo/includes/api/EditEntity.php b/repo/includes/api/EditEntity.php
index ca9557a..8ad42da 100644
--- a/repo/includes/api/EditEntity.php
+++ b/repo/includes/api/EditEntity.php
@@ -542,7 +542,7 @@
 
$builder-addLabels( $fingerprint-getLabels(), 
'entity' );
$builder-addDescriptions( 
$fingerprint-getDescriptions(), 'entity' );
-   $builder-addAliases( 
$fingerprint-getAliasGroups()-toTextArray(), 'entity' );
+   $builder-addAliasGroupList( 
$fingerprint-getAliasGroups(), 'entity' );
}
 
if ( $entity instanceof Item ) {
diff --git a/repo/includes/api/ResultBuilder.php 
b/repo/includes/api/ResultBuilder.php
index 6048652..f2e610a 100644
--- a/repo/includes/api/ResultBuilder.php
+++ b/repo/includes/api/ResultBuilder.php
@@ -12,6 +12,8 @@
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Reference;
 use Wikibase\DataModel\SerializerFactory;
+use Wikibase\DataModel\Term\AliasGroup;
+use Wikibase\DataModel\Term\AliasGroupList;
 use Wikibase\DataModel\Term\Term;
 use Wikibase\DataModel\Term\TermList;
 use Wikibase\EntityRevision;
@@ -450,16 +452,31 @@
}
 
/**
-* Get serialized aliases and add them to result
+* Get serialized AliasGroup and add it to result
 *
 * @since 0.5
 *
-* @param array $aliases the aliases to set in the result
+* @param AliasGroup $aliasGroup the AliasGroup to set in the result
 * @param array|string $path where the data is located
 */
-   public function addAliases( array $aliases, $path ) {
-   $aliasSerializer = 
$this-libSerializerFactory-newAliasSerializer( $this-getOptions() );
-   $values = $aliasSerializer-getSerialized( $aliases );
+   public function addAliasGroup( AliasGroup $aliasGroup, $path ) {
+   $this-addAliasGroupList(
+   new AliasGroupList( array( $aliasGroup ) ),
+   $path
+   );
+   }
+
+   /**
+* Get serialized AliasGroupList and add it to result
+*
+* @since 0.5
+*
+* @param AliasGroupList $aliasGroupList the AliasGroupList to set in 
the result
+* @param array|string $path where the data is located
+*/
+   public function addAliasGroupList( AliasGroupList $aliasGroupList, 
$path ) {
+   $serializer = 
$this-serializerFactory-newAliasGroupListSerializer();
+   $values = $serializer-serialize( $aliasGroupList );
$this-setList( $path, 'aliases', $values, 'alias' );
}
 
diff --git a/repo/includes/api/SetAliases.php b/repo/includes/api/SetAliases.php
index cf4c811..3b6c481 100644
--- a/repo/includes/api/SetAliases.php
+++ b/repo/includes/api/SetAliases.php
@@ -107,9 +107,11 @@
$summary-addAutoSummaryArgs( $entity-getAliases( 
$language ) );
}
 
-   $aliases = $entity-getAliases( $language );
-   if ( count( $aliases ) ) {
-   $this-getResultBuilder()-addAliases( array( $language 
= $aliases ), 'entity' );
+   if ( $entity-getFingerprint()-hasAliasGroup( $language ) ) {
+   $aliasGroup = $entity-getFingerprint()-getAliasGroup( 
$language );
+   if ( !$aliasGroup-isEmpty() ) {
+   $this-getResultBuilder()-addAliasGroup( 
$aliasGroup, 'entity' );
+   }
}
 
return $summary;
diff --git a/repo/tests/phpunit/includes/api/ResultBuilderTest.php 
b/repo/tests/phpunit/includes/api/ResultBuilderTest.php
index 79f37ac..7b08e51 100644
--- a/repo/tests/phpunit/includes/api/ResultBuilderTest.php
+++ b/repo/tests/phpunit/includes/api/ResultBuilderTest.php
@@ -17,6 +17,8 @@
 use Wikibase\DataModel\Snak\PropertyValueSnak;
 use Wikibase\DataModel\Snak\SnakList;
 use Wikibase\DataModel\Statement\Statement;
+use Wikibase\DataModel\Term\AliasGroup;
+use Wikibase\DataModel\Term\AliasGroupList;
 use Wikibase\DataModel\Term\Term;
 use Wikibase\DataModel\Term\TermList;
 use Wikibase\EntityRevision;
@@ -575,9 +577,48 @@
$this-assertEquals( $expected, $data );
}
 
-   public function testAddAliases() {

[MediaWiki-commits] [Gerrit] Rename Lib/SerializerFactory to LibSerializerFactory - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Rename Lib/SerializerFactory to LibSerializerFactory
..

Rename Lib/SerializerFactory to LibSerializerFactory

This will make removing it and using the new
serlizer much easier and more obvious!

Change-Id: I16f56bd13e5b82d1e7965a208bb29608de713a82
---
M client/includes/DataAccess/Scribunto/EntityAccessor.php
M lib/includes/serializers/DispatchingEntitySerializer.php
R lib/includes/serializers/LibSerializerFactory.php
M lib/tests/phpunit/serializers/DataModelSerializationRoundtripTest.php
M lib/tests/phpunit/serializers/DispatchingEntitySerializerTest.php
R lib/tests/phpunit/serializers/LibSerializerFactoryTest.php
M repo/includes/LinkedData/EntityDataSerializationService.php
M repo/includes/ParserOutputJsConfigBuilder.php
M repo/includes/api/ApiHelperFactory.php
M repo/includes/api/EditEntity.php
M repo/includes/api/ResultBuilder.php
M repo/includes/api/SetClaim.php
M repo/includes/api/SetReference.php
M repo/includes/specials/SpecialEntityData.php
M repo/maintenance/dumpJson.php
M repo/tests/phpunit/includes/Dumpers/JsonDumpGeneratorTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
M repo/tests/phpunit/includes/ParserOutputJsConfigBuilderTest.php
M repo/tests/phpunit/includes/api/ApiHelperFactoryTest.php
M repo/tests/phpunit/includes/api/GetClaimsTest.php
M repo/tests/phpunit/includes/api/GetEntitiesTest.php
M repo/tests/phpunit/includes/api/ResultBuilderTest.php
M repo/tests/phpunit/includes/api/SetClaimTest.php
M repo/tests/phpunit/includes/api/SetReferenceTest.php
M repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
26 files changed, 69 insertions(+), 69 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/96/222596/2

diff --git a/client/includes/DataAccess/Scribunto/EntityAccessor.php 
b/client/includes/DataAccess/Scribunto/EntityAccessor.php
index f206d18..5872b4f 100644
--- a/client/includes/DataAccess/Scribunto/EntityAccessor.php
+++ b/client/includes/DataAccess/Scribunto/EntityAccessor.php
@@ -11,7 +11,7 @@
 use Wikibase\Lib\ContentLanguages;
 use Wikibase\Lib\Serializers\SerializationOptions;
 use Wikibase\Lib\Serializers\Serializer;
-use Wikibase\Lib\Serializers\SerializerFactory;
+use Wikibase\Lib\Serializers\LibSerializerFactory;
 use Wikibase\Lib\Store\EntityLookup;
 
 /**
@@ -150,7 +150,7 @@
 */
private function getEntitySerializer( EntityDocument $entityObject ) {
$options = $this-getSerializationOptions();
-   $serializerFactory = new SerializerFactory( $options, 
$this-dataTypeLookup );
+   $serializerFactory = new LibSerializerFactory( $options, 
$this-dataTypeLookup );
 
return $serializerFactory-newSerializerForObject( 
$entityObject, $options );
}
diff --git a/lib/includes/serializers/DispatchingEntitySerializer.php 
b/lib/includes/serializers/DispatchingEntitySerializer.php
index d27b21f..8aac946 100644
--- a/lib/includes/serializers/DispatchingEntitySerializer.php
+++ b/lib/includes/serializers/DispatchingEntitySerializer.php
@@ -18,7 +18,7 @@
 class DispatchingEntitySerializer extends SerializerObject implements 
Unserializer {
 
/**
-* @var SerializerFactory
+* @var LibSerializerFactory
 */
protected $serializerFactory;
 
@@ -33,10 +33,10 @@
protected $unserializers;
 
/**
-* @param SerializerFactory $serializerFactory
+* @param LibSerializerFactory $serializerFactory
 * @param SerializationOptions $options
 */
-   public function __construct( SerializerFactory $serializerFactory, 
SerializationOptions $options = null ) {
+   public function __construct( LibSerializerFactory $serializerFactory, 
SerializationOptions $options = null ) {
parent::__construct( $options );
 
$this-serializerFactory = $serializerFactory;
diff --git a/lib/includes/serializers/SerializerFactory.php 
b/lib/includes/serializers/LibSerializerFactory.php
similarity index 99%
rename from lib/includes/serializers/SerializerFactory.php
rename to lib/includes/serializers/LibSerializerFactory.php
index d7ce5a8..77c75ec 100644
--- a/lib/includes/serializers/SerializerFactory.php
+++ b/lib/includes/serializers/LibSerializerFactory.php
@@ -25,7 +25,7 @@
  *
  * @todo: allow this to be obtained from WikibaseRepo resp. WikibaseClient
  */
-class SerializerFactory {
+class LibSerializerFactory {
 
/**
 * @var EntityFactory|null
diff --git 
a/lib/tests/phpunit/serializers/DataModelSerializationRoundtripTest.php 
b/lib/tests/phpunit/serializers/DataModelSerializationRoundtripTest.php
index de53615..53cb995 100644
--- 

[MediaWiki-commits] [Gerrit] Use DM Serializetion in RB for sitelinks - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Use DM Serializetion in RB for sitelinks
..

Use DM Serializetion in RB for sitelinks

Change-Id: I5b8db42240b8c5d3f0438db3e9d46c83c296376f
---
M repo/includes/LinkedData/EntityDataSerializationService.php
M repo/includes/WikibaseRepo.php
M repo/includes/api/ApiHelperFactory.php
M repo/includes/api/EditEntity.php
M repo/includes/api/LinkTitles.php
M repo/includes/api/ResultBuilder.php
M repo/includes/api/SetSiteLink.php
M repo/includes/specials/SpecialEntityData.php
M repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
M repo/tests/phpunit/includes/api/ApiHelperFactoryTest.php
M repo/tests/phpunit/includes/api/ResultBuilderTest.php
M repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php
13 files changed, 200 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/12/222612/5

diff --git a/repo/includes/LinkedData/EntityDataSerializationService.php 
b/repo/includes/LinkedData/EntityDataSerializationService.php
index 6d273a4..a5be38f 100644
--- a/repo/includes/LinkedData/EntityDataSerializationService.php
+++ b/repo/includes/LinkedData/EntityDataSerializationService.php
@@ -10,6 +10,7 @@
 use MWException;
 use RequestContext;
 use SiteList;
+use SiteStore;
 use Wikibase\Api\ResultBuilder;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\SerializerFactory;
@@ -111,6 +112,11 @@
private $rdfWriterFactory;
 
/**
+* @var SiteStore
+*/
+   private $siteStore;
+
+   /**
 * @param string $rdfBaseURI
 * @param string $rdfDataURI
 * @param EntityLookup $entityLookup
@@ -119,6 +125,7 @@
 * @param PropertyDataTypeLookup $propertyLookup
 * @param SiteList $sites
 * @param SerializerFactory $serializerFactory
+* @param SiteStore $siteStore
 *
 * @since 0.4
 */
@@ -131,7 +138,8 @@
PropertyDataTypeLookup $propertyLookup,
SiteList $sites,
EntityDataFormatProvider $entityDataFormatProvider,
-   SerializerFactory $serializerFactory
+   SerializerFactory $serializerFactory,
+   SiteStore $siteStore
) {
$this-rdfBaseURI = $rdfBaseURI;
$this-rdfDataURI = $rdfDataURI;
@@ -142,6 +150,7 @@
$this-propertyLookup = $propertyLookup;
$this-sites = $sites;
$this-entityDataFormatProvider = $entityDataFormatProvider;
+   $this-siteStore = $siteStore;
 
$this-rdfWriterFactory = new RdfWriterFactory();
}
@@ -422,7 +431,8 @@
$res,
$this-entityTitleLookup,
$this-libSerializerFactory,
-   $this-serializerFactory
+   $this-serializerFactory,
+   $this-siteStore
);
$resultBuilder-addEntityRevision( null, $entityRevision, 
$options );
 
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index dd84af8..e4ab561 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -1067,7 +1067,8 @@
$this-getEntityTitleLookup(),
$this-getExceptionLocalizer(),
$this-getPropertyDataTypeLookup(),
-   $this-getEntityFactory()
+   $this-getEntityFactory(),
+   $this-getSiteStore()
);
}
 
diff --git a/repo/includes/api/ApiHelperFactory.php 
b/repo/includes/api/ApiHelperFactory.php
index 9a9ecd1..62e1526 100644
--- a/repo/includes/api/ApiHelperFactory.php
+++ b/repo/includes/api/ApiHelperFactory.php
@@ -4,6 +4,7 @@
 
 use ApiBase;
 use DataValues\Serializers\DataValueSerializer;
+use SiteStore;
 use Wikibase\DataModel\Entity\PropertyDataTypeLookup;
 use Wikibase\DataModel\SerializerFactory;
 use Wikibase\EntityFactory;
@@ -46,17 +47,24 @@
 */
private $entityFactory;
 
+   /**
+* @var SiteStore
+*/
+   private $siteStore;
+
public function __construct(
EntityTitleLookup $titleLookup,
ExceptionLocalizer $exceptionLocalizer,
PropertyDataTypeLookup $dataTypeLookup,
-   EntityFactory $entityFactory
+   EntityFactory $entityFactory,
+   SiteStore $siteStore
) {
 
$this-titleLookup = $titleLookup;
$this-exceptionLocalizer = $exceptionLocalizer;
$this-dataTypeLookup = $dataTypeLookup;
$this-entityFactory = $entityFactory;
+

[MediaWiki-commits] [Gerrit] Use DM Serializetion in RB for references - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Use DM Serializetion in RB for references
..

Use DM Serializetion in RB for references

This also now means that the output contains
the individual snak hashes

Change-Id: If89d508e3e27b5e1be7b69922aaa163c2d32e125
---
M repo/includes/LinkedData/EntityDataSerializationService.php
M repo/includes/api/ApiHelperFactory.php
M repo/includes/api/ResultBuilder.php
M repo/tests/phpunit/includes/api/ResultBuilderTest.php
4 files changed, 26 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/22/222622/1

diff --git a/repo/includes/LinkedData/EntityDataSerializationService.php 
b/repo/includes/LinkedData/EntityDataSerializationService.php
index a5be38f..7d4a6cb 100644
--- a/repo/includes/LinkedData/EntityDataSerializationService.php
+++ b/repo/includes/LinkedData/EntityDataSerializationService.php
@@ -432,7 +432,8 @@
$this-entityTitleLookup,
$this-libSerializerFactory,
$this-serializerFactory,
-   $this-siteStore
+   $this-siteStore,
+   $this-propertyLookup
);
$resultBuilder-addEntityRevision( null, $entityRevision, 
$options );
 
diff --git a/repo/includes/api/ApiHelperFactory.php 
b/repo/includes/api/ApiHelperFactory.php
index 62e1526..4dd8c97 100644
--- a/repo/includes/api/ApiHelperFactory.php
+++ b/repo/includes/api/ApiHelperFactory.php
@@ -81,7 +81,8 @@
$this-titleLookup,
$this-getLibSerializerFactory( $defaultOptions ),
$this-getSerializerFactory(),
-   $this-siteStore
+   $this-siteStore,
+   $this-dataTypeLookup
);
}
 
diff --git a/repo/includes/api/ResultBuilder.php 
b/repo/includes/api/ResultBuilder.php
index d5e724c..bad2450 100644
--- a/repo/includes/api/ResultBuilder.php
+++ b/repo/includes/api/ResultBuilder.php
@@ -11,6 +11,8 @@
 use Wikibase\DataModel\Claim\Claim;
 use Wikibase\DataModel\Claim\Claims;
 use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\DataModel\Entity\PropertyDataTypeLookup;
+use Wikibase\DataModel\Entity\PropertyId;
 use Wikibase\DataModel\Reference;
 use Wikibase\DataModel\SerializerFactory;
 use Wikibase\DataModel\SiteLinkList;
@@ -71,6 +73,7 @@
 * @param LibSerializerFactory $libSerializerFactory
 * @param SerializerFactory $serializerFactory
 * @param SiteStore $siteStore
+* @param PropertyDataTypeLookup $dataTypeLookup
 *
 * @throws InvalidArgumentException
 */
@@ -79,7 +82,8 @@
EntityTitleLookup $entityTitleLookup,
LibSerializerFactory $libSerializerFactory,
SerializerFactory $serializerFactory,
-   SiteStore $siteStore
+   SiteStore $siteStore,
+   PropertyDataTypeLookup $dataTypeLookup
) {
if ( !$result instanceof ApiResult ) {
throw new InvalidArgumentException( 'Result builder 
must be constructed with an ApiWikibase' );
@@ -91,6 +95,7 @@
$this-serializerFactory = $serializerFactory;
$this-missingEntityCounter = -1;
$this-siteStore = $siteStore;
+   $this-dataTypeLookup = $dataTypeLookup;
}
 
/**
@@ -577,13 +582,24 @@
 * @since 0.5
 */
public function addReference( Reference $reference ) {
-   $serializer = 
$this-libSerializerFactory-newReferenceSerializer( $this-getOptions() );
+   $serializer = 
$this-serializerFactory-newReferenceSerializer();
 
//TODO: this is currently only used to add a Reference as the 
top level structure,
//  with a null path and a fixed name. Would be nice to 
also allow references
//  to be added to a list, using a path and a id key or 
index.
 
-   $value = $serializer-getSerialized( $reference );
+   $value = $serializer-serialize( $reference );
+
+   // Inject the 'datatype' into the serialization
+   foreach ( $value['snaks'] as $propertyIdGroup = $snakGroup ) {
+   $dataType = 
$this-dataTypeLookup-getDataTypeIdForProperty(
+   new PropertyId( $propertyIdGroup )
+   );
+   foreach ( $snakGroup as $snak ) {
+   $snak['datatype'] = $dataType;
+   }
+   }
+
$this-setValue( null, 'reference', $value );
}
 
diff --git a/repo/tests/phpunit/includes/api/ResultBuilderTest.php 

[MediaWiki-commits] [Gerrit] Use DM Serializetion in RB for labels Descs - change (mediawiki...Wikibase)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Use DM Serializetion in RB for labels  Descs
..

Use DM Serializetion in RB for labels  Descs

Change-Id: Iabe3a0df79f88c56d465629f84f6c94e2c62b1c3
---
M repo/includes/api/EditEntity.php
M repo/includes/api/ResultBuilder.php
M repo/includes/api/SetDescription.php
M repo/includes/api/SetLabel.php
M repo/tests/phpunit/includes/api/ResultBuilderTest.php
5 files changed, 145 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/02/222602/4

diff --git a/repo/includes/api/EditEntity.php b/repo/includes/api/EditEntity.php
index 8f730ff..ca9557a 100644
--- a/repo/includes/api/EditEntity.php
+++ b/repo/includes/api/EditEntity.php
@@ -540,8 +540,8 @@
if ( $entity instanceof FingerprintProvider ) {
$fingerprint = $entity-getFingerprint();
 
-   $builder-addLabels( 
$fingerprint-getLabels()-toTextArray(), 'entity' );
-   $builder-addDescriptions( 
$fingerprint-getDescriptions()-toTextArray(), 'entity' );
+   $builder-addLabels( $fingerprint-getLabels(), 
'entity' );
+   $builder-addDescriptions( 
$fingerprint-getDescriptions(), 'entity' );
$builder-addAliases( 
$fingerprint-getAliasGroups()-toTextArray(), 'entity' );
}
 
diff --git a/repo/includes/api/ResultBuilder.php 
b/repo/includes/api/ResultBuilder.php
index 7ccfb67..6048652 100644
--- a/repo/includes/api/ResultBuilder.php
+++ b/repo/includes/api/ResultBuilder.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Api;
 
 use ApiResult;
+use DataValues\Serializers\DataValueSerializer;
 use InvalidArgumentException;
 use Revision;
 use Status;
@@ -11,6 +12,8 @@
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Reference;
 use Wikibase\DataModel\SerializerFactory;
+use Wikibase\DataModel\Term\Term;
+use Wikibase\DataModel\Term\TermList;
 use Wikibase\EntityRevision;
 use Wikibase\Lib\Serializers\EntitySerializer;
 use Wikibase\Lib\Serializers\SerializationOptions;
@@ -369,14 +372,23 @@
 *
 * @since 0.5
 *
-* @param array $labels the labels to set in the result
+* @param TermList $labels the labels to insert in the result
 * @param array|string $path where the data is located
 */
-   public function addLabels( array $labels, $path ) {
-   $labelSerializer = 
$this-libSerializerFactory-newLabelSerializer( $this-getOptions() );
+   public function addLabels( TermList $labels, $path ) {
+   $this-addTermList( $labels, 'labels', 'label', $path );
+   }
 
-   $values = $labelSerializer-getSerialized( $labels );
-   $this-setList( $path, 'labels', $values, 'label' );
+   /**
+* Adds fake serialization to show a label has been removed
+*
+* @since 0.5
+*
+* @param string $language
+* @param array|string $path where the data is located
+*/
+   public function addRemovedLabel( $language, $path ) {
+   $this-addRemovedTerm( $language, 'labels', 'label', $path );
}
 
/**
@@ -384,14 +396,57 @@
 *
 * @since 0.5
 *
-* @param array $descriptions the descriptions to insert in the result
+* @param TermList $descriptions the descriptions to insert in the 
result
 * @param array|string $path where the data is located
 */
-   public function addDescriptions( array $descriptions, $path ) {
-   $descriptionSerializer = 
$this-libSerializerFactory-newDescriptionSerializer( $this-getOptions() );
+   public function addDescriptions( TermList $descriptions, $path ) {
+   $this-addTermList( $descriptions, 'descriptions', 
'description', $path );
+   }
 
-   $values = $descriptionSerializer-getSerialized( $descriptions 
);
-   $this-setList( $path, 'descriptions', $values, 'description' );
+   /**
+* Adds fake serialization to show a label has been removed
+*
+* @since 0.5
+*
+* @param string $language
+* @param array|string $path where the data is located
+*/
+   public function addRemovedDescription( $language, $path ) {
+   $this-addRemovedTerm( $language, 'descriptions', 
'description', $path );
+   }
+
+   /**
+* Get serialized TermList and add it to the result
+*
+* @since 0.5
+*
+* @param TermList $termList
+* @param string $name
+* @param string $tag
+* @param array|string $path where the data is located
+*/
+   private function addTermList( TermList $termList, $name, $tag, $path ) {
+   $serializer = 

[MediaWiki-commits] [Gerrit] Display reason(s) for a page being marked as spam on special... - change (mediawiki...SmiteSpam)

2015-07-05 Thread Polybuildr (Code Review)
Polybuildr has uploaded a new change for review.

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

Change subject: Display reason(s) for a page being marked as spam on special 
page
..

Display reason(s) for a page being marked as spam on special page

Change-Id: Ie490df94f7ea67d4e66ae7c2ceed8f246bef918f
---
M SmiteSpam.php
M api/SmiteSpamApiQuery.php
M i18n/en.json
M i18n/qqq.json
M includes/SmiteSpamAnalyzer.php
M includes/SmiteSpamWikiPage.php
M includes/checkers/SmiteSpamExternalLinksChecker.php
M includes/checkers/SmiteSpamRepeatedExternalLinksChecker.php
M includes/checkers/SmiteSpamWikitextChecker.php
M static/js/ext.smitespam.retriever.js
10 files changed, 39 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SmiteSpam 
refs/changes/18/222918/1

diff --git a/SmiteSpam.php b/SmiteSpam.php
index 289ff15..bb1a4da 100644
--- a/SmiteSpam.php
+++ b/SmiteSpam.php
@@ -48,6 +48,7 @@
'powersearch-toggleall',
'powersearch-togglenone',
'smitespam-select',
+   'smitespam-issues',
),
 );
 
diff --git a/api/SmiteSpamApiQuery.php b/api/SmiteSpamApiQuery.php
index f421195..41243d7 100644
--- a/api/SmiteSpamApiQuery.php
+++ b/api/SmiteSpamApiQuery.php
@@ -78,7 +78,8 @@
'creator' = $creator,
'spam-probability-value' = 
$page-spamProbability,
'spam-probability-text' = $spamProbability,
-   'preview' = $previewText
+   'preview' = $previewText,
+   'issues' = implode( , , $page-spamReasons ),
);
}
 
diff --git a/i18n/en.json b/i18n/en.json
index 41cac73..403a158 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -21,5 +21,9 @@
smitespam-probability-medium: Medium,
smitespam-probability-high: High,
smitespam-probability-very-high: Very high,
-   smitespam-select: Select: 
+   smitespam-select: Select: ,
+   smitespam-externallinkschecker-msg: Too many external links,
+   smitespam-repeatedexternallinkschecker-msg: Repeated external links,
+   smitespam-wikitextchecker-msg: Too little wikitext,
+   smitespam-issues: Issues
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b17e47f..baf515c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -23,5 +23,9 @@
smitespam-probability-medium: Medium 
probability\n{{Identical|Medium}},
smitespam-probability-high: High probability\n{{Identical|High}},
smitespam-probability-very-high: Very high probability,
-   smitespam-select: Followed by two links: 
{{msg-mw|Powersearch-toggleall}} and {{msg-mw|Powersearch-togglenone}} which 
respectively selects all pages and de-selects all pages\n{{Identical|Select}}
+   smitespam-select: Followed by two links: 
{{msg-mw|Powersearch-toggleall}} and {{msg-mw|Powersearch-togglenone}} which 
respectively selects all pages and de-selects all pages\n{{Identical|Select}},
+   smitespam-externallinkschecker-msg: Reason for being marked as spam 
by ExternalLinksChecker,
+   smitespam-repeatedexternallinkschecker-msg: Reason for being marked 
as spam by RepeatedExternalLinksChecker,
+   smitespam-wikitextchecker-msg: Reason for being marked as spam by 
WikitextChecker,
+   smitespam-issues: Title of a table column listing issues with a page
 }
diff --git a/includes/SmiteSpamAnalyzer.php b/includes/SmiteSpamAnalyzer.php
index 908c9ed..691924d 100644
--- a/includes/SmiteSpamAnalyzer.php
+++ b/includes/SmiteSpamAnalyzer.php
@@ -83,6 +83,9 @@
$checker = 'SmiteSpam' . $checker . 'Checker';
$check = new $checker;
$checkvalue = $check-getValue( $page );
+   if ( $checkvalue  1 ) {
+   $page-spamReasons[] = 
$check-getReasonMessage();
+   }
if ( $checkvalue !== false ) {
$value += $checkvalue * $weight;
$checkersUsed++;
diff --git a/includes/SmiteSpamWikiPage.php b/includes/SmiteSpamWikiPage.php
index 1d2014a..0f3cf32 100644
--- a/includes/SmiteSpamWikiPage.php
+++ b/includes/SmiteSpamWikiPage.php
@@ -16,6 +16,12 @@
public $spamProbability;
 
/**
+* An array of strings representing the reasons that the page was 
marked as spam
+* @var array
+*/
+   public $spamReasons;
+
+   /**
 * @param int $pageID
 */
public function __construct( $pageID ) {
@@ -25,6 +31,7 @@
}
parent::__construct( $title );
$this-metadata = array();
+   $this-spamReasons = array();
   

[MediaWiki-commits] [Gerrit] Stop using ApiWikibase - change (mediawiki...WikibaseQuality)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Stop using ApiWikibase
..

Stop using ApiWikibase

Change-Id: Ie4db0ef0032bc096c181ed2604cd97eef3c9338b
---
M api/GetViolationMessages.php
M api/GetViolationTypes.php
M api/ModifyViolation.php
3 files changed, 98 insertions(+), 44 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQuality 
refs/changes/21/222921/1

diff --git a/api/GetViolationMessages.php b/api/GetViolationMessages.php
index daef849..4799b89 100755
--- a/api/GetViolationMessages.php
+++ b/api/GetViolationMessages.php
@@ -2,11 +2,14 @@
 
 namespace WikibaseQuality\Api;
 
+use ApiBase;
 use MWException;
 use ApiMain;
 use DataValues\Serializers;
 use UnexpectedValueException;
-use Wikibase\Api\ApiWikibase;
+use Wikibase\Api\ApiErrorReporter;
+use Wikibase\Api\ApiHelperFactory;
+use Wikibase\Api\ResultBuilder;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\Repo\Store\EntityPermissionChecker;
@@ -27,7 +30,7 @@
  * @author BP2014N1
  * @license GNU GPL v2+
  */
-class GetViolationMessages extends ApiWikibase {
+class GetViolationMessages extends ApiBase {
 
/**
 * @var EntityPermissionChecker
@@ -50,6 +53,16 @@
private $violationFormatter;
 
/**
+* @var ResultBuilder
+*/
+   private $resultBuilder;
+
+   /**
+* @var ApiErrorReporter
+*/
+   private $errorReporter;
+
+   /**
 * @param ApiMain $main
 * @param $name
 * @param string $prefix
@@ -66,7 +79,8 @@
$wikibaseRepo-getEntityIdParser(),
$wikibaseRepo-getEntityPermissionChecker(),
$qualityServices-getViolationLookup(),
-   $qualityServices-getDispatchingViolationFormatter()
+   $qualityServices-getDispatchingViolationFormatter(),
+   $wikibaseRepo-getApiHelperFactory()
);
}
 
@@ -78,6 +92,7 @@
 * @param EntityPermissionChecker $permissionChecker
 * @param ViolationLookup $violationLookup
 * @param DispatchingViolationFormatter $dispatchingViolationFormatter
+* @param ApiHelperFactory $apiHelperFactory
 */
public function __construct(
ApiMain $main,
@@ -86,7 +101,8 @@
EntityIdParser $entityIdParser,
EntityPermissionChecker $permissionChecker,
ViolationLookup $violationLookup,
-   DispatchingViolationFormatter $dispatchingViolationFormatter
+   DispatchingViolationFormatter $dispatchingViolationFormatter,
+   ApiHelperFactory $apiHelperFactory
) {
parent::__construct( $main, $name, $prefix );
 
@@ -94,6 +110,8 @@
$this-permissionChecker = $permissionChecker;
$this-violationLookup = $violationLookup;
$this-violationFormatter = $dispatchingViolationFormatter;
+   $this-resultBuilder = $apiHelperFactory-getResultBuilder( 
$this );
+   $this-errorReporter = $apiHelperFactory-getErrorReporter( 
$this );
}
 
/**
@@ -134,7 +152,7 @@
return $this-violationLookup-get( $query );
}
catch( MWException $e ) {
-   $this-dieException( $e, 'database-error' );
+   $this-errorReporter-dieException( $e, 
'database-error' );
}
}
 
@@ -184,7 +202,7 @@
$this-getResult()-setIndexedTagName( $output, 
'violatedClaims' );
$this-getResult()-addValue( null, 'results', $output );
 
-   $this-getResultBuilder()-markSuccess( 1 );
+   $this-resultBuilder-markSuccess( 1 );
}
 
/**
@@ -194,13 +212,13 @@
 * @codeCoverageIgnore
 */
public function getAllowedParams() {
-   return array_merge( parent::getAllowedParams(), array(
+   return array(
'entityid' = array(
-   ApiWikibase::PARAM_TYPE = 'string',
-   ApiWikibase::PARAM_ISMULTI = false,
-   ApiWikibase::PARAM_REQUIRED = true
+   ApiBase::PARAM_TYPE = 'string',
+   ApiBase::PARAM_ISMULTI = false,
+   ApiBase::PARAM_REQUIRED = true
)
-   ) );
+   );
}
 
/**
diff --git a/api/GetViolationTypes.php b/api/GetViolationTypes.php
index 3c7d4ee..777dfec 100644
--- a/api/GetViolationTypes.php
+++ b/api/GetViolationTypes.php
@@ -2,9 +2,12 @@
 
 namespace WikibaseQuality\Api;
 
+use ApiBase;
 use ApiMain;
 use 

[MediaWiki-commits] [Gerrit] Remove debian lintian warnings - change (mediawiki...Blueprint)

2015-07-05 Thread MidPhoto (Code Review)
MidPhoto has uploaded a new change for review.

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

Change subject: Remove debian lintian warnings
..

Remove debian lintian warnings

Removes lintian warnings given by debian because of wrong file permissions 
given to files:
- lib/bootstrap/bootstrap.min.css
- lib/bootstrap/bootstrap.min.js
- src/BlueprintSkinTemplate.php
- src/SkinBlueprint.php
- templates/Skin.template

Bug: T103787
Change-Id: I35c08eabe2584bbf3bc979f1a2109cbad7562862
---
M lib/bootstrap/bootstrap.min.css
M lib/bootstrap/bootstrap.min.js
M src/BlueprintSkinTemplate.php
M src/SkinBlueprint.php
M templates/Skin.template
5 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Blueprint 
refs/changes/22/222922/1

diff --git a/lib/bootstrap/bootstrap.min.css b/lib/bootstrap/bootstrap.min.css
old mode 100755
new mode 100644
diff --git a/lib/bootstrap/bootstrap.min.js b/lib/bootstrap/bootstrap.min.js
old mode 100755
new mode 100644
diff --git a/src/BlueprintSkinTemplate.php b/src/BlueprintSkinTemplate.php
old mode 100755
new mode 100644
diff --git a/src/SkinBlueprint.php b/src/SkinBlueprint.php
old mode 100755
new mode 100644
diff --git a/templates/Skin.template b/templates/Skin.template
old mode 100755
new mode 100644

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35c08eabe2584bbf3bc979f1a2109cbad7562862
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Blueprint
Gerrit-Branch: master
Gerrit-Owner: MidPhoto dave.olstho...@gmail.com

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


[MediaWiki-commits] [Gerrit] [Math] Remove deleted keys - change (translatewiki)

2015-07-05 Thread Raimond Spekking (Code Review)
Raimond Spekking has uploaded a new change for review.

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

Change subject: [Math] Remove deleted keys
..

[Math] Remove deleted keys

https://gerrit.wikimedia.org/r/#/c/222700/1/i18n/en.json,unified

Change-Id: I2df9b25bada8186190f7afeaf71e1fb806c6305e
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/23/222923/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 0a6f849..5fcccb1 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -1330,7 +1330,6 @@
 
 Math
 aliasfile = Math/Math.alias.php
-ignored = math-preference-mwmathinspector-discussion-link, 
math-preference-mwmathinspector-info-link
 
 Math Search
 aliasfile = MathSearch/MathSearch.alias.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2df9b25bada8186190f7afeaf71e1fb806c6305e
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com

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


[MediaWiki-commits] [Gerrit] [FIX] Replace section/label according to the names - change (pywikibot/core)

2015-07-05 Thread XZise (Code Review)
XZise has uploaded a new change for review.

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

Change subject: [FIX] Replace section/label according to the names
..

[FIX] Replace section/label according to the names

The options 'Change link target and label' and 'Change link target and section'
currently would replace the property not listed in them (including the target).
So 'Change link target and section' would use the target's page as target and
the target's page's title as the label. But instead if should replace the
section and reuse the old label.

Bug: T104805
Change-Id: Ic6f3d1dd0d2e56a639ebf74e89834cf02d7b224a
---
M pywikibot/bot.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/27/222927/1

diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 57e8ec0..4d5db37 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -865,9 +865,9 @@
 ('replace', StaticChoice('Change link target', 't',
  self._new.canonical_title())),
 ('replace_section', LinkChoice('Change link target and 
section',
-   's', self, True)),
+   's', self, False)),
 ('replace_label', LinkChoice('Change link target and label',
- 'l', self, False)),
+ 'l', self, True)),
 ('replace_all', StaticChoice('Change complete link', 'c',
  self._new)),
 ]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6f3d1dd0d2e56a639ebf74e89834cf02d7b224a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise commodorefabia...@gmx.de

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


[MediaWiki-commits] [Gerrit] Add blacklisted gom code to SKIPLANGS too - change (translatewiki)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add blacklisted gom code to SKIPLANGS too
..


Add blacklisted gom code to SKIPLANGS too

So that translators worry less.
https://translatewiki.net/wiki/Thread:Support/Please_delete_gom_translations

Change-Id: I71acd46f3ba69efd62106826539412edf0bba11c
---
M bin/do-stats
M bin/export-by-prefix
M bin/repoexport
3 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Raimond Spekking: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/bin/do-stats b/bin/do-stats
index 26deba7..0b3d7eb 100755
--- a/bin/do-stats
+++ b/bin/do-stats
@@ -22,7 +22,7 @@
 echo $WIKIPAGE
 exit
 STATSFILE=$HOME/temp/stats.txt
-SKIPLANGS=test, aeb, be-x-old, crh, de-ch, dk, en, fiu-vro, gan, got, hif, 
kbd, kk, kk-cn, iu, kk-kz, kk-tr, ko-kp, ku, ku-arab, no, ruq, simple, sr, tg, 
tp, tt, ug, zh, zh-classical, zh-cn, zh-sg, zh-hk, zh-min-nan, zh-mo, zh-my, 
zh-tw, zh-yue, bbc, ady
+SKIPLANGS=test, aeb, be-x-old, crh, de-ch, dk, en, fiu-vro, gan, gom, got, 
hif, kbd, kk, kk-cn, iu, kk-kz, kk-tr, ko-kp, ku, ku-arab, no, ruq, simple, sr, 
tg, tp, tt, ug, zh, zh-classical, zh-cn, zh-sg, zh-hk, zh-min-nan, zh-mo, 
zh-my, zh-tw, zh-yue, bbc, ady
 
 # create basic stats file for $GROUPS
 /usr/bin/php 
/srv/mediawiki/targets/production/extensions/Translate/scripts/groupStatistics.php
 --fuzzy --skipzero --groups=${GROUPS} --skiplanguages=${SKIPLANGS}  
${STATSFILE}
diff --git a/bin/export-by-prefix b/bin/export-by-prefix
index 32d9576..a659582 100755
--- a/bin/export-by-prefix
+++ b/bin/export-by-prefix
@@ -16,7 +16,7 @@
 HOURS=--hours=200 # Somewhat over week
 PROJECT=$2
 SKIPGROUPS=
-SKIPLANGS=--skip=test,aeb,be-x-old,crh,dk,en,fiu-vro,gan,got,hif,kbd,kk,kk-cn,iu,kk-k,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-sg,zh-hk,zh-min-nan,zh-mo,zh-my,zh-tw,zh-yue,bbc,ady
+SKIPLANGS=--skip=test,aeb,be-x-old,crh,dk,en,fiu-vro,gan,gom,got,hif,kbd,kk,kk-cn,iu,kk-k,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-sg,zh-hk,zh-min-nan,zh-mo,zh-my,zh-tw,zh-yue,bbc,ady
 TARGET=$3
 
 cd $DIR
diff --git a/bin/repoexport b/bin/repoexport
index e2fc40f..26cbec1 100755
--- a/bin/repoexport
+++ b/bin/repoexport
@@ -15,7 +15,7 @@
 echo $(date --rfc-3339=seconds --utc) [$(whoami) at $DIR] $0 $@  ${DIRLOG}
 
 EXPORTER=$WIKI/extensions/Translate/scripts/export.php
-SKIPLANGS=test,aeb,be-x-old,crh,dk,en,fiu-vro,gan,got,hif,kbd,kk,kk-cn,iu,kk-kz,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-sg,zh-hk,zh-min-nan,zh-mo,zh-my,zh-tw,zh-yue,bbc,ady
+SKIPLANGS=test,aeb,be-x-old,crh,dk,en,fiu-vro,gan,gom,got,hif,kbd,kk,kk-cn,iu,kk-kz,kk-tr,ko-kp,ku,ku-arab,no,ruq,simple,sr,tg,tp,tt,ug,zh,zh-classical,zh-cn,zh-sg,zh-hk,zh-min-nan,zh-mo,zh-my,zh-tw,zh-yue,bbc,ady
 FORCELANGS=chy,cr,ki,nrm,rn,rup,rw,tum,tw # Must not contain any of those 
above
 THRESHOLD=--threshold 35
 HOURS=--hours 200 # Somewhat over a week

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I71acd46f3ba69efd62106826539412edf0bba11c
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nemo bis federicol...@tiscali.it
Gerrit-Reviewer: Nemo bis federicol...@tiscali.it
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Clean up noc symlinks - change (operations/mediawiki-config)

2015-07-05 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: Clean up noc symlinks
..

Clean up noc symlinks

Follow-up to I7ecae6fb, If7a18144 and Id0b99321: Turns out a couple of these
had actually been deleted, so remove their lines from createTxtFileSymlinks and
remove their symlinks.

Change-Id: I05cbf59651bfb12562cd5ddfc4d12f6517aefc19
---
D docroot/noc/conf/mediaviewer.dblist
D docroot/noc/conf/visualeditor.dblist
M docroot/noc/createTxtFileSymlinks.sh
3 files changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/32/222932/1

diff --git a/docroot/noc/conf/mediaviewer.dblist 
b/docroot/noc/conf/mediaviewer.dblist
deleted file mode 12
index dc867c9..000
--- a/docroot/noc/conf/mediaviewer.dblist
+++ /dev/null
@@ -1 +0,0 @@
-../../../mediaviewer.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/visualeditor.dblist 
b/docroot/noc/conf/visualeditor.dblist
deleted file mode 12
index 8bc4252..000
--- a/docroot/noc/conf/visualeditor.dblist
+++ /dev/null
@@ -1 +0,0 @@
-../../../visualeditor.dblist
\ No newline at end of file
diff --git a/docroot/noc/createTxtFileSymlinks.sh 
b/docroot/noc/createTxtFileSymlinks.sh
index dad28a0..dcc5ba6 100755
--- a/docroot/noc/createTxtFileSymlinks.sh
+++ b/docroot/noc/createTxtFileSymlinks.sh
@@ -62,7 +62,6 @@
group0.dblist
langlist
large.dblist
-   mediaviewer.dblist
medium.dblist
nonglobal.dblist
private.dblist
@@ -75,7 +74,6 @@
s7.dblist
small.dblist
special.dblist
-   visualeditor.dblist
visualeditor-default.dblist
wikibooks.dblist
wikidata.dblist

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05cbf59651bfb12562cd5ddfc4d12f6517aefc19
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Alex Monk kren...@gmail.com

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


[MediaWiki-commits] [Gerrit] Clean up noc symlinks - change (operations/mediawiki-config)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Clean up noc symlinks
..


Clean up noc symlinks

Follow-up to I7ecae6fb, If7a18144 and Id0b99321: Turns out a couple of these
had actually been deleted, so remove their lines from createTxtFileSymlinks and
remove their symlinks.

Change-Id: I05cbf59651bfb12562cd5ddfc4d12f6517aefc19
---
D docroot/noc/conf/mediaviewer.dblist
D docroot/noc/conf/visualeditor.dblist
M docroot/noc/createTxtFileSymlinks.sh
3 files changed, 0 insertions(+), 4 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/docroot/noc/conf/mediaviewer.dblist 
b/docroot/noc/conf/mediaviewer.dblist
deleted file mode 12
index dc867c9..000
--- a/docroot/noc/conf/mediaviewer.dblist
+++ /dev/null
@@ -1 +0,0 @@
-../../../mediaviewer.dblist
\ No newline at end of file
diff --git a/docroot/noc/conf/visualeditor.dblist 
b/docroot/noc/conf/visualeditor.dblist
deleted file mode 12
index 8bc4252..000
--- a/docroot/noc/conf/visualeditor.dblist
+++ /dev/null
@@ -1 +0,0 @@
-../../../visualeditor.dblist
\ No newline at end of file
diff --git a/docroot/noc/createTxtFileSymlinks.sh 
b/docroot/noc/createTxtFileSymlinks.sh
index dad28a0..dcc5ba6 100755
--- a/docroot/noc/createTxtFileSymlinks.sh
+++ b/docroot/noc/createTxtFileSymlinks.sh
@@ -62,7 +62,6 @@
group0.dblist
langlist
large.dblist
-   mediaviewer.dblist
medium.dblist
nonglobal.dblist
private.dblist
@@ -75,7 +74,6 @@
s7.dblist
small.dblist
special.dblist
-   visualeditor.dblist
visualeditor-default.dblist
wikibooks.dblist
wikidata.dblist

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I05cbf59651bfb12562cd5ddfc4d12f6517aefc19
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Alex Monk kren...@gmail.com
Gerrit-Reviewer: Alex Monk kren...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] celery: Create simple module for celery workers - change (operations/puppet)

2015-07-05 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: celery: Create simple module for celery workers
..


celery: Create simple module for celery workers

Only supports debian atm

Change-Id: I96133b0f61ff30e3d8e5a10bc773d4e82152db8a
---
A modules/celery/manifests/worker.pp
A modules/celery/templates/initscripts/celery.systemd.erb
2 files changed, 23 insertions(+), 0 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/modules/celery/manifests/worker.pp 
b/modules/celery/manifests/worker.pp
new file mode 100644
index 000..0cf523f
--- /dev/null
+++ b/modules/celery/manifests/worker.pp
@@ -0,0 +1,11 @@
+class celery::worker(
+$app,
+$working_dir,
+$user,
+$group,
+$celery_bin_path = '/usr/bin/celery'
+) {
+base::service_unit { 'celery':
+systemd = true,
+}
+}
diff --git a/modules/celery/templates/initscripts/celery.systemd.erb 
b/modules/celery/templates/initscripts/celery.systemd.erb
new file mode 100644
index 000..2116f69
--- /dev/null
+++ b/modules/celery/templates/initscripts/celery.systemd.erb
@@ -0,0 +1,12 @@
+[Unit]
+Description=Celery workers
+After=network.target
+
+[Service]
+User=%= @user %
+Group=%= @group %
+ExecStart=%= @celery_bin_path % worker \
+--app %= @app % --workingdir %= @working_dir %
+
+[Install]
+WantedBy=multi-user.target

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I96133b0f61ff30e3d8e5a10bc773d4e82152db8a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove getFlags method from ModifyClaim - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove getFlags method from ModifyClaim
..


Remove getFlags method from ModifyClaim

The bot flag is already handled by the attemptSaveEntity
method.
Thus we just need to set a default flag of EDIT_UPDATE
as was done by this method.

Change-Id: Ic18884db30985c98849a134053363419e1f95cbd
---
M repo/includes/api/ModifyClaim.php
1 file changed, 1 insertion(+), 15 deletions(-)

Approvals:
  Bene: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/api/ModifyClaim.php 
b/repo/includes/api/ModifyClaim.php
index 7a5f762..b2a203e 100644
--- a/repo/includes/api/ModifyClaim.php
+++ b/repo/includes/api/ModifyClaim.php
@@ -67,7 +67,7 @@
return $this-attemptSaveEntity(
$entity,
$summary,
-   $this-getFlags()
+   EDIT_UPDATE
);
}
 
@@ -76,20 +76,6 @@
 */
public function isWriteMode() {
return true;
-   }
-
-   /**
-* @since 0.4
-*
-* @return integer
-*/
-   protected function getFlags() {
-   $flags = EDIT_UPDATE;
-
-   $params = $this-extractRequestParams();
-   $flags |= ( $this-getUser()-isAllowed( 'bot' )  
$params['bot'] ) ? EDIT_FORCE_BOT : 0;
-
-   return $flags;
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic18884db30985c98849a134053363419e1f95cbd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Bene benestar.wikime...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove ResultBuilder interaction out of ModifyClaim::saveCha... - change (mediawiki...Wikibase)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove ResultBuilder interaction out of ModifyClaim::saveChanges
..


Remove ResultBuilder interaction out of ModifyClaim::saveChanges

Fixes a TODO..
Slightly helps use move away from these base
classes

Change-Id: Ieb42afe8577b8e8b94acebbd0c8c1ae7e46150df
---
M repo/includes/api/CreateClaim.php
M repo/includes/api/ModifyClaim.php
M repo/includes/api/RemoveClaims.php
M repo/includes/api/RemoveQualifiers.php
M repo/includes/api/RemoveReferences.php
M repo/includes/api/SetClaim.php
M repo/includes/api/SetClaimValue.php
M repo/includes/api/SetQualifier.php
M repo/includes/api/SetReference.php
9 files changed, 20 insertions(+), 12 deletions(-)

Approvals:
  Bene: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/api/CreateClaim.php 
b/repo/includes/api/CreateClaim.php
index bccc1a5..87d64f6 100644
--- a/repo/includes/api/CreateClaim.php
+++ b/repo/includes/api/CreateClaim.php
@@ -71,7 +71,8 @@
 
$statement = 
$entity-getStatements()-getFirstStatementWithGuid( 
$changeOp-getStatementGuid() );
 
-   $this-saveChanges( $entity, $summary );
+   $status = $this-saveChanges( $entity, $summary );
+   $this-getResultBuilder()-addRevisionIdFromStatusToResult( 
$status, 'pageinfo' );
$this-getResultBuilder()-markSuccess();
$this-getResultBuilder()-addClaim( $statement );
}
diff --git a/repo/includes/api/ModifyClaim.php 
b/repo/includes/api/ModifyClaim.php
index 5e41650..7a5f762 100644
--- a/repo/includes/api/ModifyClaim.php
+++ b/repo/includes/api/ModifyClaim.php
@@ -4,6 +4,7 @@
 
 use ApiBase;
 use ApiMain;
+use Status;
 use Wikibase\DataModel\Statement\StatementGuidParser;
 use Wikibase\DataModel\Entity\Entity;
 use Wikibase\Repo\WikibaseRepo;
@@ -59,16 +60,15 @@
 *
 * @param Entity $entity
 * @param Summary $summary
+*
+* @returns Status
 */
public function saveChanges( Entity $entity, Summary $summary ) {
-   $status = $this-attemptSaveEntity(
+   return $this-attemptSaveEntity(
$entity,
$summary,
$this-getFlags()
);
-
-   //@todo this doesnt belong here!...
-   $this-getResultBuilder()-addRevisionIdFromStatusToResult( 
$status, 'pageinfo' );
}
 
/**
diff --git a/repo/includes/api/RemoveClaims.php 
b/repo/includes/api/RemoveClaims.php
index 9ec9fdc..23ce5e1 100644
--- a/repo/includes/api/RemoveClaims.php
+++ b/repo/includes/api/RemoveClaims.php
@@ -69,7 +69,8 @@
$this-dieException( $e, 'failed-save' );
}
 
-   $this-saveChanges( $entity, $summary );
+   $status = $this-saveChanges( $entity, $summary );
+   $this-getResultBuilder()-addRevisionIdFromStatusToResult( 
$status, 'pageinfo' );
$this-getResultBuilder()-markSuccess();
$this-getResultBuilder()-setList( null, 'claims', 
$params['claim'], 'claim' );
}
diff --git a/repo/includes/api/RemoveQualifiers.php 
b/repo/includes/api/RemoveQualifiers.php
index 3ef8dda..1046be5 100644
--- a/repo/includes/api/RemoveQualifiers.php
+++ b/repo/includes/api/RemoveQualifiers.php
@@ -68,7 +68,8 @@
$this-dieException( $e, 'failed-save' );
}
 
-   $this-saveChanges( $entity, $summary );
+   $status = $this-saveChanges( $entity, $summary );
+   $this-getResultBuilder()-addRevisionIdFromStatusToResult( 
$status, 'pageinfo' );
$this-getResultBuilder()-markSuccess();
}
 
diff --git a/repo/includes/api/RemoveReferences.php 
b/repo/includes/api/RemoveReferences.php
index 7c5faf5..0609503 100644
--- a/repo/includes/api/RemoveReferences.php
+++ b/repo/includes/api/RemoveReferences.php
@@ -72,7 +72,8 @@
$this-dieException( $e, 'failed-save' );
}
 
-   $this-saveChanges( $entity, $summary );
+   $status = $this-saveChanges( $entity, $summary );
+   $this-getResultBuilder()-addRevisionIdFromStatusToResult( 
$status, 'pageinfo' );
$this-getResultBuilder()-markSuccess();
}
 
diff --git a/repo/includes/api/SetClaim.php b/repo/includes/api/SetClaim.php
index b0dc22f..f4050f8 100644
--- a/repo/includes/api/SetClaim.php
+++ b/repo/includes/api/SetClaim.php
@@ -84,7 +84,8 @@
 
$this-modificationHelper-applyChangeOp( $changeop, $entity, 
$summary );
 
-   $this-saveChanges( $entity, $summary );
+   $status = $this-saveChanges( $entity, $summary );
+   $this-getResultBuilder()-addRevisionIdFromStatusToResult( 
$status, 'pageinfo' );

[MediaWiki-commits] [Gerrit] Fix php check - change (mediawiki/core)

2015-07-05 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Fix php check
..

Fix php check

* This fixes the php check when starting mediawiki.

* It would cause it to fail thinking you had incompatible php version.

* This problem only happended if you had mutiple php version installed or
* if you were on a shared hosting server with mutiple php installed to
* choose from the check would think you had php 5.2 when you doint.

Change-Id: I7ae0369e4bab279d5e1bc754fe1a0bc8543bb2ed
---
M api.php
M index.php
M load.php
M maintenance/Maintenance.php
M mw-config/index.php
5 files changed, 20 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/222917/1

diff --git a/api.php b/api.php
index af7c452..2baffbf 100644
--- a/api.php
+++ b/api.php
@@ -37,8 +37,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'api.php' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' )  0 ) {
+   require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
+   wfEntryPointCheck( 'api.php' );
+}
 
 require __DIR__ . '/includes/WebStart.php';
 
diff --git a/index.php b/index.php
index 67bd0c9..b667e57 100644
--- a/index.php
+++ b/index.php
@@ -32,8 +32,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'index.php' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' )  0 ) {
+   require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
+   wfEntryPointCheck( 'index.php' );
+}
 
 require __DIR__ . '/includes/WebStart.php';
 
diff --git a/load.php b/load.php
index 22f62fe..ffd1fd7 100644
--- a/load.php
+++ b/load.php
@@ -26,8 +26,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'load.php' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' )  0 ) {
+   require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
+   wfEntryPointCheck( 'load.php' );
+}
 
 require __DIR__ . '/includes/WebStart.php';
 
diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php
index 04aa3a5..344bbca 100644
--- a/maintenance/Maintenance.php
+++ b/maintenance/Maintenance.php
@@ -22,8 +22,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'cli' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' )  0 ) {
+   require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
+   wfEntryPointCheck( 'cli' );
+}
 
 /**
  * @defgroup MaintenanceArchive Maintenance archives
diff --git a/mw-config/index.php b/mw-config/index.php
index be811dc..3fc5c2c 100644
--- a/mw-config/index.php
+++ b/mw-config/index.php
@@ -22,8 +22,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'mw-config/index.php' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' )  0 ) {
+   require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
+   wfEntryPointCheck( 'mw-config/index.php' );
+}
 
 define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
 define( 'MEDIAWIKI_INSTALL', true );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ae0369e4bab279d5e1bc754fe1a0bc8543bb2ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Paladox thomasmulhall...@yahoo.com

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


[MediaWiki-commits] [Gerrit] Stop using ApiWikibase - change (mediawiki...WikibaseQualityExternalValidation)

2015-07-05 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Stop using ApiWikibase
..

Stop using ApiWikibase

Change-Id: I2b83d2f6e3cb29c4256c51d4f008ad53c045c2dd
---
M api/RunCrossCheck.php
1 file changed, 42 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation
 refs/changes/24/222924/1

diff --git a/api/RunCrossCheck.php b/api/RunCrossCheck.php
index 521fd57..ee7d244 100755
--- a/api/RunCrossCheck.php
+++ b/api/RunCrossCheck.php
@@ -2,10 +2,14 @@
 
 namespace WikibaseQuality\ExternalValidation\Api;
 
+use ApiBase;
 use ApiMain;
 use DataValues\Serializers;
-use Wikibase\Api\ApiWikibase;
+use Wikibase\Api\ApiErrorReporter;
+use Wikibase\Api\ApiHelperFactory;
+use Wikibase\Api\ResultBuilder;
 use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Repo\WikibaseRepo;
 use WikibaseQuality\ExternalValidation\CrossCheck\CrossCheckInteractor;
@@ -22,7 +26,7 @@
  * @author BP2014N1
  * @license GNU GPL v2+
  */
-class RunCrossCheck extends ApiWikibase {
+class RunCrossCheck extends ApiMain {
 
/**
 * @var ClaimGuidValidator
@@ -38,6 +42,21 @@
 * @var SerializerFactory
 */
private $serializerFactory;
+
+   /**
+* @var ApiErrorReporter
+*/
+   private $errorReporter;
+
+   /**
+* @var ResultBuilder
+*/
+   private $resultBuilder;
+
+   /**
+* @var EntityIdParser
+*/
+   private $idParser;
 
/**
 * Creates new instance from global state.
@@ -57,7 +76,9 @@
$prefix,
$repo-getClaimGuidValidator(),
$externalValidationServices-getCrossCheckInteractor(),
-   $externalValidationServices-getSerializerFactory()
+   $externalValidationServices-getSerializerFactory(),
+   $repo-getApiHelperFactory(),
+   $repo-getEntityIdParser()
);
}
 
@@ -67,12 +88,16 @@
 * @param string $prefix
 */
public function __construct( ApiMain $main, $name, $prefix = '', 
ClaimGuidValidator $claimGuidValidator,
-
CrossCheckInteractor $crossCheckInteractor, SerializerFactory 
$serializerFactory ) {
+
CrossCheckInteractor $crossCheckInteractor, SerializerFactory 
$serializerFactory,
+
ApiHelperFactory $apiHelperFactory, EntityIdParser $idParser ) {
parent::__construct( $main, $name, $prefix );
 
$this-claimGuidValidator = $claimGuidValidator;
$this-crossCheckInteractor = $crossCheckInteractor;
$this-serializerFactory = $serializerFactory;
+   $this-errorReporter = $apiHelperFactory-getErrorReporter( 
$this );
+   $this-resultBuilder = $apiHelperFactory-getResultBuilder( 
$this );
+   $this-idParser = $idParser;
}
 
/**
@@ -82,7 +107,7 @@
$params = $this-extractRequestParams();
 
if ( $params['entities']  $params['claims'] ) {
-   $this-dieError(
+   $this-errorReporter-dieError(
'Either provide the ids of entities or ids of 
claims, that should be cross-checked.',
'param-invalid'
);
@@ -99,7 +124,7 @@
$this-assertAreValidClaimGuids( $claimGuids );
$resultLists = 
$this-crossCheckInteractor-crossCheckStatements( $claimGuids );
} else {
-   $this-dieError(
+   $this-errorReporter-dieError(
'Either provide the ids of entities or ids of 
claims, that should be cross-checked.',
'param-missing'
);
@@ -116,7 +141,7 @@
 */
private function parseEntityIds( array $entityIds ) {
return array_map(
-   array( $this-getIdParser(), 'parse' ),
+   array( $this-idParser, 'parse' ),
$entityIds
);
}
@@ -127,7 +152,7 @@
private function assertAreValidClaimGuids( array $claimGuids ) {
foreach ( $claimGuids as $claimGuid ) {
if ( $this-claimGuidValidator-validateFormat( 
$claimGuid ) === false ) {
-   $this-dieError( 'Invalid claim guid.', 
'invalid-guid' );
+   $this-errorReporter-dieError( 'Invalid claim 

[MediaWiki-commits] [Gerrit] Use localization for server default timezone on Special:Pref... - change (mediawiki/core)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use localization for server default timezone on 
Special:Preferences
..


Use localization for server default timezone on Special:Preferences

The timezone list on Special:Preferences contains all time zones with a
localized region and also an option to use the system default value.
The message for this option gets the current server timezone as
parameter, but that parameter is not localized.
Refactor the timezone list processing into a new function and call it at
the beginning to do a lookup for the localized name and use it, if it
exists in the array.

Also changed from procedural style to object oriented style for the
DateTime processing.

Bug: T33516
Change-Id: I00e81324d0d16fbe6c9811480210ab6513461823
---
M includes/Preferences.php
1 file changed, 75 insertions(+), 43 deletions(-)

Approvals:
  Nikerabbit: Looks good to me, approved
  Siebrand: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/Preferences.php b/includes/Preferences.php
index ecb2294..9497ee7 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -1294,12 +1294,19 @@
$opt = array();
 
$localTZoffset = $context-getConfig()-get( 'LocalTZoffset' );
+   $timeZoneList = self::getTimeZoneList( $context-getLanguage() 
);
+
$timestamp = MWTimestamp::getLocalInstance();
// Check that the LocalTZoffset is the same as the local time 
zone offset
if ( $localTZoffset == $timestamp-format( 'Z' ) / 60 ) {
+   $timezoneName = $timestamp-getTimezone()-getName();
+   // Localize timezone
+   if ( isset( $timeZoneList[$timezoneName] ) ) {
+   $timezoneName = 
$timeZoneList[$timezoneName]['name'];
+   }
$server_tz_msg = $context-msg(
'timezoneuseserverdefault',
-   $timestamp-getTimezone()-getName()
+   $timezoneName
)-text();
} else {
$tzstring = sprintf(
@@ -1313,49 +1320,12 @@
$opt[$context-msg( 'timezoneuseoffset' )-text()] = 'other';
$opt[$context-msg( 'guesstimezone' )-text()] = 'guess';
 
-   if ( function_exists( 'timezone_identifiers_list' ) ) {
-   # Read timezone list
-   $tzs = timezone_identifiers_list();
-   sort( $tzs );
-
-   $tzRegions = array();
-   $tzRegions['Africa'] = $context-msg( 
'timezoneregion-africa' )-text();
-   $tzRegions['America'] = $context-msg( 
'timezoneregion-america' )-text();
-   $tzRegions['Antarctica'] = $context-msg( 
'timezoneregion-antarctica' )-text();
-   $tzRegions['Arctic'] = $context-msg( 
'timezoneregion-arctic' )-text();
-   $tzRegions['Asia'] = $context-msg( 
'timezoneregion-asia' )-text();
-   $tzRegions['Atlantic'] = $context-msg( 
'timezoneregion-atlantic' )-text();
-   $tzRegions['Australia'] = $context-msg( 
'timezoneregion-australia' )-text();
-   $tzRegions['Europe'] = $context-msg( 
'timezoneregion-europe' )-text();
-   $tzRegions['Indian'] = $context-msg( 
'timezoneregion-indian' )-text();
-   $tzRegions['Pacific'] = $context-msg( 
'timezoneregion-pacific' )-text();
-   asort( $tzRegions );
-
-   $prefill = array_fill_keys( array_values( $tzRegions ), 
array() );
-   $opt = array_merge( $opt, $prefill );
-
-   $now = date_create( 'now' );
-
-   foreach ( $tzs as $tz ) {
-   $z = explode( '/', $tz, 2 );
-
-   # timezone_identifiers_list() returns a number 
of
-   # backwards-compatibility entries. This filters 
them out of the
-   # list presented to the user.
-   if ( count( $z ) != 2 || !array_key_exists( 
$z[0], $tzRegions ) ) {
-   continue;
-   }
-
-   # Localize region
-   $z[0] = $tzRegions[$z[0]];
-
-   $minDiff = floor( timezone_offset_get( 
timezone_open( $tz ), $now ) / 60 );
-
-   $display = str_replace( '_', ' ', $z[0] . '/' . 
$z[1] );
-   $value = ZoneInfo|$minDiff|$tz;
-
-   $opt[$z[0]][$display] = $value;
+   

[MediaWiki-commits] [Gerrit] add unibas.ch to wgCopyUploadsDomains - change (operations/mediawiki-config)

2015-07-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: add unibas.ch to wgCopyUploadsDomains
..


add unibas.ch to wgCopyUploadsDomains

bug: T104178
Change-Id: Ief4b60648e9d54dae909e65640f309bcabc06e20
---
M wmf-config/InitialiseSettings.php
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index da50cfe..a2ef0c9 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -11464,6 +11464,8 @@
'*.bl.uk',  // British Library - T98734
'www.limis.lt', // Lithuanian Art Museum - 
T101513
'*.dvidshub.net',   // Defense Video and 
Imagery Distribution System - T103062
+   '*.ub.unibas.ch',   // Universität Basel - 
T104178
+   '*.unibas.ch',  // Universität Basel - 
T104178
),
 ),
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ief4b60648e9d54dae909e65640f309bcabc06e20
Gerrit-PatchSet: 4
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Matanya mata...@foss.co.il
Gerrit-Reviewer: 20after4 mmod...@wikimedia.org
Gerrit-Reviewer: Alex Monk kren...@gmail.com
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Reedy re...@wikimedia.org
Gerrit-Reviewer: Steinsplitter steinsplit...@wikipedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Do not hide facets when there are results for a language. - change (mediawiki...Translate)

2015-07-05 Thread Phoenix303 (Code Review)
Phoenix303 has uploaded a new change for review.

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

Change subject: Do not hide facets when there are results for a language.
..

Do not hide facets when there are results for a language.

Change-Id: Ie12c34fd18dae57ff73672e772299ece76c84318
Followup:Id: I9e9af0ee30b684884c7b2ef0cec41b76d63ee414
---
M specials/SpecialSearchTranslations.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/33/222933/1

diff --git a/specials/SpecialSearchTranslations.php 
b/specials/SpecialSearchTranslations.php
index 37b2344..17c880e 100644
--- a/specials/SpecialSearchTranslations.php
+++ b/specials/SpecialSearchTranslations.php
@@ -92,7 +92,7 @@
$total = $server-getTotalHits( $resultset );
$facetHtml = '';
 
-   if ( $total  0 ) {
+   if ( count( $facets['language'] )  0 ) {
$facetHtml = Html::element( 'div',
array( 'class' = 'row facet languages',
'data-facets' = FormatJson::encode( 
$this-getLanguages( $facets['language'] ) ),
@@ -100,7 +100,9 @@
),
$this-msg( 'tux-sst-facet-language' )
);
+   }
 
+   if ( count( $facets['group'] )  0 ) {
$facetHtml .= Html::element( 'div',
array( 'class' = 'row facet groups',
'data-facets' = FormatJson::encode( 
$this-getGroups( $facets['group'] ) ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie12c34fd18dae57ff73672e772299ece76c84318
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Phoenix303 divyalife...@gmail.com

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


[MediaWiki-commits] [Gerrit] [TimelineTable] Register extension - change (translatewiki)

2015-07-05 Thread Raimond Spekking (Code Review)
Raimond Spekking has submitted this change and it was merged.

Change subject: [TimelineTable] Register extension
..


[TimelineTable] Register extension

Add some more commented out extensions

Change-Id: I7de67d0c5ccd43a69625bfdaeaa2bf27b93163c1
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Raimond Spekking: Verified; Looks good to me, approved



diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 200f347..0ddb4f3 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -1520,6 +1520,9 @@
 OdbcDatabase
 aliasfile = OdbcDatabase/OdbcDatabase.alias.php
 
+# Missing message doc, message prefixes needed - 2015-05-07 - RS
+# Offline Import Lexicon
+
 # Ogg Handler # Deleted on Git. TimedMediaHandler as replacement. 
I6ad2538fda15d29d780a22796e7c980e94901729
 
 Online Status
@@ -2179,6 +2182,8 @@
 Timeline
 file = timeline/i18n/%CODE%.json
 
+Timeline Table
+
 Timezone Selector
 aliasfile = TimezoneSelector/TimezoneSelector.alias.php
 optional = timezoneselector-message-long, timezoneselector-message-verbose
@@ -2193,6 +2198,9 @@
 Toc Tree
 
 Tooltip
+
+# Missing message doc - 2015-07-05
+# Top Ten Pages
 
 Tor Block
 
@@ -2575,6 +2583,9 @@
 file = WikimediaMessages/i18n/temporary/%CODE%.json
 prefix = temporary- | wikimediamessages-desc
 
+# Missing message doc
+# Wiki Share
+
 Wikivote Maps Yandex
 
 Windows Azure SDK

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7de67d0c5ccd43a69625bfdaeaa2bf27b93163c1
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


  1   2   >