[MediaWiki-commits] [Gerrit] Convert wikihiero to use extension registration - change (mediawiki...wikihiero)

2015-12-23 Thread MtDu (Code Review)
MtDu has uploaded a new change for review.

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

Change subject: Convert wikihiero to use extension registration
..

Convert wikihiero to use extension registration

Bug: T87995
Change-Id: If4ac2b34ae5b9b8a0783bf20f73eaa301dbacf0c
---
A extension.json
D wikihiero.i18n.php
M wikihiero.php
A wikihierohooks.php
4 files changed, 112 insertions(+), 117 deletions(-)


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

diff --git a/extension.json b/extension.json
new file mode 100644
index 000..4d3846e
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,85 @@
+{
+   "name": "WikiHiero",
+   "version": "1.1",
+   "author": [
+   "Guillaume Blanchard",
+   "Max Semenik"
+   ],
+   "url": "https://www.mediawiki.org/wiki/Extension:WikiHiero";,
+   "descriptionmsg": "wikihiero-desc",
+   "license-name": "GPL-2.0+",
+   "type": "parserhook",
+   "Hooks": {
+   "ParserFirstCallInit": [
+   "wikihierohooks::wfRegisterWikiHiero"
+   ]
+   },
+   "MessagesDirs": {
+   "Wikihiero": [
+   "i18n"
+   ]
+   },
+   "ExtensionMessagesFiles": {
+   "Wikihiero": "wikihiero.i18n.php",
+   "HieroglyphsAlias": "wikihiero.alias.php"
+   },
+   "AutoloadClasses": {
+   "WikiHiero": "wikihiero.body.php",
+   "SpecialHieroglyphs": "SpecialHieroglyphs.php",
+   "HieroTokenizer": "HieroTokenizer.php"
+   },
+   "ParserTestFiles": [
+   "tests.txt"
+   ],
+   "SpecialPages": {
+   "Hieroglyphs": "SpecialHieroglyphs" 
+   },
+   "moduleTemplate": {
+   "localBasePath": "modules",
+   "remoteExtPath": "wikihiero/modules"
+   },
+   "ResourceModules": {
+   "ext.wikihiero": {
+   "position": "top",
+   "styles": "ext.wikihiero.css"
+   },
+   "ext.wikihiero.Special": {
+   "position": "top",
+   "scripts": "ext.wikihiero.Special.js",
+   "styles": "ext.wikihiero.Special.css",
+   "dependencies": [
+   "jquery.spinner"
+   ],
+   "messages": [
+   "wikihiero-input",
+   "wikihiero-result",
+   "wikihiero-load-error"
+   ]
+   },
+   "ext.wikihiero.visualEditor": {
+   "scripts": [
+   "ve-wikihiero/ve.dm.MWHieroNode.js",
+   "ve-wikihiero/ve.ce.MWHieroNode.js",
+   "ve-wikihiero/ve.ui.MWHieroInspector.js",
+   "ve-wikihiero/ve.ui.MWHieroInspectorTool.js"
+   ],
+   "styles": [
+   "ve-wikihiero/ve.ui.MWHieroIcons.css"
+   ],
+   "dependencies": [
+   "ext.visualEditor.mwcore"
+   ],
+   "messages": [
+   "wikihiero-visualeditor-mwhieroinspector-title"
+   ],
+   "targets": [
+   "desktop", 
+   "mobile"
+   ]
+   }
+   },
+   "VisualEditorPluginModules": [
+   "ext.wikihiero.visualEditor"
+   ],
+   "manifest_version": 1
+}
\ No newline at end of file
diff --git a/wikihiero.i18n.php b/wikihiero.i18n.php
deleted file mode 100644
index 1d9a97a..000
--- a/wikihiero.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = array();
-if ( !function_exists( 'wfJsonI18nShim37af3a06afb40457' ) ) {
-   function wfJsonI18nShim37af3a06afb40457( $cache, $code, &$cachedData ) {
-   $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-   foreach ( $codeSequence as $csCode ) {
-   $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
-   if ( is_readable( $fileName ) ) 

[MediaWiki-commits] [Gerrit] Enable hacking rule H202 - change (pywikibot/core)

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

Change subject: Enable hacking rule H202
..


Enable hacking rule H202

Hacking rule H202 prevents tests using self.assertRaises
with only 'Exception' being detected.  It requires tests
to switch to using assertRaisesRegexp or use a more
specific Exception subclass.

Change-Id: I667d7ed3aa447412d99b5a503d09394b7c09a02d
---
M tests/isbn_tests.py
M tests/weblinkchecker_tests.py
M tox.ini
3 files changed, 27 insertions(+), 7 deletions(-)

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



diff --git a/tests/isbn_tests.py b/tests/isbn_tests.py
index 506b65a..c437a03 100644
--- a/tests/isbn_tests.py
+++ b/tests/isbn_tests.py
@@ -11,6 +11,11 @@
 
 __version__ = '$Id$'
 
+try:
+from stdnum.exceptions import ValidationError as StdNumValidationError
+except ImportError:
+StdNumValidationError = None
+
 from pywikibot import Bot, Claim, ItemPage
 from pywikibot.cosmetic_changes import CosmeticChangesToolkit, CANCEL_MATCH
 
@@ -25,6 +30,11 @@
 WikibaseTestCase, ScriptMainTestCase,
 )
 from tests.bot_tests import TWNBotTestCase
+
+if StdNumValidationError:
+AnyIsbnValidationException = (StdNumValidationError, IsbnExc)
+else:
+AnyIsbnValidationException = IsbnExc
 
 
 class TestCosmeticChangesISBN(DefaultDrySiteTestCase):
@@ -45,10 +55,18 @@
 """Test that it'll fail when the ISBN is invalid."""
 cc = CosmeticChangesToolkit(self.site, namespace=0)
 
-self.assertRaises(Exception, cc.fix_ISBN, 'ISBN 0975229LOL')  # 
Invalid characters
-self.assertRaises(Exception, cc.fix_ISBN, 'ISBN 0975229801')  # 
Invalid checksum
-self.assertRaises(Exception, cc.fix_ISBN, 'ISBN 09752298')  # Invalid 
length
-self.assertRaises(Exception, cc.fix_ISBN, 'ISBN 09752X9801')  # X in 
the middle
+# Invalid characters
+self.assertRaises(AnyIsbnValidationException,
+  cc.fix_ISBN, 'ISBN 0975229LOL')
+# Invalid checksum
+self.assertRaises(AnyIsbnValidationException,
+  cc.fix_ISBN, 'ISBN 0975229801')
+# Invalid length
+self.assertRaises(AnyIsbnValidationException,
+  cc.fix_ISBN, 'ISBN 09752298')
+# X in the middle
+self.assertRaises(AnyIsbnValidationException,
+  cc.fix_ISBN, 'ISBN 09752X9801')
 
 def test_ignore_invalid_isbn(self):
 """Test fixing ISBN numbers with an invalid ISBN."""
diff --git a/tests/weblinkchecker_tests.py b/tests/weblinkchecker_tests.py
index e3682a7..2080d98 100644
--- a/tests/weblinkchecker_tests.py
+++ b/tests/weblinkchecker_tests.py
@@ -84,7 +84,10 @@
 
 def test_invalid(self):
 """Test getting memento for invalid URL."""
-self.assertRaises(Exception, self._get_archive_url, 'invalid')
+# memento_client raises 'Exception', not a subclass.
+self.assertRaisesRegexp(
+Exception, 'Only HTTP URIs are supported',
+self._get_archive_url, 'invalid')
 
 
 if __name__ == '__main__':
diff --git a/tox.ini b/tox.ini
index b737fee..a1bc548 100644
--- a/tox.ini
+++ b/tox.ini
@@ -95,9 +95,8 @@
 # E402: module level import not at top of file; see T87409
 # E731: do not assign a lambda expression, use a def; see I7b3db838
 # H201: Except: format
-# H202: assertRaises Exception too broad
 # P102,P103: string does contain unindexed parameters; see I36355923
-ignore = 
E402,E731,D105,D211,FI10,FI12,FI13,FI15,FI5,H101,H201,H202,H236,H301,H404,H405,I100,I101,P102,P103
+ignore = 
E402,E731,D105,D211,FI10,FI12,FI13,FI15,FI5,H101,H201,H236,H301,H404,H405,I100,I101,P102,P103
 exclude = 
.tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*
 max_line_length = 130
 accept-encodings = utf-8

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I667d7ed3aa447412d99b5a503d09394b7c09a02d
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] pagegenerators.py: allow filtering by quality level - change (pywikibot/core)

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

Change subject: pagegenerators.py: allow filtering by quality level
..


pagegenerators.py: allow filtering by quality level

Allow filtering by quality when page site has ProofreadPage extension
and requested pages are ProofreadPage pages.

Add related tests in page_generators_tests.py.

Add ProofreadPage.quality_level property for pages and related tests.

Bug: T122047
Change-Id: I93ff113f0fa3701b830a8589a955e0f35814b2a2
---
M pywikibot/pagegenerators.py
M pywikibot/proofreadpage.py
M tests/pagegenerators_tests.py
M tests/proofreadpage_tests.py
4 files changed, 123 insertions(+), 3 deletions(-)

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



diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index e205ff6..d3a15a9 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -48,7 +48,8 @@
 
 from pywikibot import date, config, i18n, xmlreader
 from pywikibot.comms import http
-from pywikibot.exceptions import ArgumentDeprecationWarning
+from pywikibot.exceptions import ArgumentDeprecationWarning, UnknownExtension
+from pywikibot.proofreadpage import ProofreadPage
 
 if sys.version_info[0] > 2:
 basestring = (str, )
@@ -278,6 +279,12 @@
   Case insensitive regular expressions will be used and
   dot matches any character, including a newline.
 
+-ql   Filter pages based on page quality.
+  This is only applicable if contentmodel equals
+  'proofread-page', otherwise has no effects.
+  Valid values are in range 0-4.
+  Multiple values can be comma-separated.
+
 -onlyif   A claim the page needs to contain, otherwise the item won't
   be returned.
   The format is property=value,qualifier=value. Multiple (or
@@ -339,6 +346,7 @@
 self._namespaces = []
 self.step = None
 self.limit = None
+self.qualityfilter_list = []
 self.articlefilter_list = []
 self.titlefilter_list = []
 self.claimfilter_list = []
@@ -411,8 +419,11 @@
 if self.limit:
 self.gens[i] = itertools.islice(self.gens[i], self.limit)
 if len(self.gens) == 0:
-if self.titlefilter_list or self.articlefilter_list or \
-   self.claimfilter_list or self.subpage_max_depth is not None:
+if (self.titlefilter_list or
+self.articlefilter_list or
+self.claimfilter_list or
+self.subpage_max_depth is not None or
+self.qualityfilter_list):
 pywikibot.warning(
 'filter(s) specified but no generators.')
 return None
@@ -442,6 +453,10 @@
 dupfiltergen = ItemClaimFilterPageGenerator(dupfiltergen,
 claim[0], claim[1],
 claim[2], claim[3])
+
+if self.qualityfilter_list:
+dupfiltergen = QualityFilterPageGenerator(
+dupfiltergen, self.qualityfilter_list)
 
 if self.titlefilter_list:
 dupfiltergen = RegexFilterPageGenerator(
@@ -777,6 +792,19 @@
 u'Which pattern do you want to grep?'))
 else:
 self.articlefilter_list.append(arg[6:])
+return True
+elif arg.startswith('-ql:'):
+if not self.site.has_extension('ProofreadPage'):
+raise UnknownExtension(
+'Ql filtering needs a site with ProofreadPage extension.')
+value = map(int, arg[4:].split(','))
+if min(value) < 0 or max(value) > 4:  # Invalid input ql.
+valid_ql = ['{0}: {1}'.format(*i) for
+i in self.site.proofread_levels.items()]
+valid_ql = ', '.join(valid_ql)
+pywikibot.warning('Acceptable values for -ql are:\n%s'
+  % valid_ql)
+self.qualityfilter_list = value
 return True
 elif arg.startswith('-onlyif') or arg.startswith('-onlyifnot'):
 ifnot = arg.startswith('-onlyifnot')
@@ -1501,6 +1529,27 @@
 return (page for page in generator
 if cls.__filter_match(reg, page.text, quantifier))
 
+
+def QualityFilterPageGenerator(generator, quality):
+"""
+Wrap a generator to filter pages according to quality levels.
+
+This is possible only for pages with content_model 'proofread-page'.
+In all the other cases, no filter is applied.
+
+@param generator: A generator object
+@param quality: proofread-page quality levels (valid range 0-4)
+@type quality: list of int
+
+"""
+for page in generator:
+ 

[MediaWiki-commits] [Gerrit] For source code pages, index page contents as `source_text` - change (mediawiki...CirrusSearch)

2015-12-23 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: For source code pages, index page contents as `source_text`
..

For source code pages, index page contents as `source_text`

Pages containing source code or machine-readable data (like
MediaWiki:Common.js) currently have no 'source_text' value.
The source code is emitted as the 'text' value. As a result,
'insource:' queries never match JS / CSS pages, which is both
counterintuitive and annoying.

So do as Nik suggested in T88247 and make the 'source_text' of
source code pages be the same as the page text.

This causes the same body of text to be emitted twice in the page
dump. But since these pages represent a very small fraction of
Wikimedia content, the storage costs are neglible.

After this change rolls out, something will need to trigger a
re-index of JS / CSS / JSON pages. It can either be a normal
edit to the page, or we can force it with a script.

Bug: T88247
Change-Id: Ibae6e02cd597de5d4f0efbfff8321aabf262d426
---
M includes/BuildDocument/PageTextBuilder.php
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/includes/BuildDocument/PageTextBuilder.php 
b/includes/BuildDocument/PageTextBuilder.php
index d35539d..b6a6f0c 100644
--- a/includes/BuildDocument/PageTextBuilder.php
+++ b/includes/BuildDocument/PageTextBuilder.php
@@ -86,6 +86,9 @@
private function buildSourceTextToIndex() {
switch ( $this->content->getModel() ) {
case CONTENT_MODEL_WIKITEXT:
+   case CONTENT_MODEL_JSON:
+   case CONTENT_MODEL_CSS:
+   case CONTENT_MODEL_JAVASCRIPT:
return $this->content->getTextForSearchIndex();
default:
return null;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibae6e02cd597de5d4f0efbfff8321aabf262d426
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] DO NOT MERGE: Output exception to help track down an issue - change (mediawiki...Flow)

2015-12-23 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: DO NOT MERGE: Output exception to help track down an issue
..

DO NOT MERGE: Output exception to help track down an issue

Bug: T122329
Change-Id: Id6b7aa79b1cfccac0f734e4c6e6e6961189a83e8
---
M maintenance/FlowUpdateWorkflowPageId.php
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/maintenance/FlowUpdateWorkflowPageId.php 
b/maintenance/FlowUpdateWorkflowPageId.php
index 7ff32a1..4372b44 100644
--- a/maintenance/FlowUpdateWorkflowPageId.php
+++ b/maintenance/FlowUpdateWorkflowPageId.php
@@ -110,6 +110,8 @@
// force article id to be refetched from db
$title->getArticleID( Title::GAID_FOR_UPDATE );
} catch ( \Exception $e ) {
+   echo $e;
+
// catch all exception to keep going with the 
rest we want to
// iterate over, we'll report on the failed 
entries at the end
$this->failed[] = $row;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6b7aa79b1cfccac0f734e4c6e6e6961189a83e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: REL1_26
Gerrit-Owner: Mattflaschen 

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


[MediaWiki-commits] [Gerrit] Have foreachwiki exit with non-zero status if any wiki fails - change (mediawiki/vagrant)

2015-12-23 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Have foreachwiki exit with non-zero status if any wiki fails
..

Have foreachwiki exit with non-zero status if any wiki fails

This allows puppet to detect the error here, rather than make it look
like a later step is at fault or there is an ordering problem.

Change-Id: Ia6563ce21002bfedac8ddd36475172b76a22e5a2
---
M puppet/modules/mediawiki/templates/multiwiki/foreachwiki.erb
1 file changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/01/260901/1

diff --git a/puppet/modules/mediawiki/templates/multiwiki/foreachwiki.erb 
b/puppet/modules/mediawiki/templates/multiwiki/foreachwiki.erb
index 3453288..b07084b 100755
--- a/puppet/modules/mediawiki/templates/multiwiki/foreachwiki.erb
+++ b/puppet/modules/mediawiki/templates/multiwiki/foreachwiki.erb
@@ -6,10 +6,20 @@
 CMD=$1
 shift
 
+failed_wiki_count=0
 for db in $(alldbs); do
   echo -
   echo $db
   echo -
-  mwscript "$CMD" --wiki=$db "$@" |
-  sed -u "s/^/$db:  /"
+  mwscript "$CMD" --wiki=$db "$@" | sed -u "s/^/$db:  /"
+  if [ ${PIPESTATUS[0]} -ne 0 ];
+  then
+  ((failed_wiki_count++))
+  fi
 done
+
+if [ $failed_wiki_count -ne 0 ];
+then
+echo "$failed_wiki_count wikis failed." >&2
+exit 1
+fi

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6563ce21002bfedac8ddd36475172b76a22e5a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 

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


[MediaWiki-commits] [Gerrit] Install dev-requirements.txt into Docker image - change (pywikibot/core)

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

Change subject: Install dev-requirements.txt into Docker image
..


Install dev-requirements.txt into Docker image

Bug: T120860
Change-Id: I4b1db6a881e3f9c8fd79a59cd21294db799b1a4f
---
M Dockerfile
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/Dockerfile b/Dockerfile
index ecb4459..8eb855f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,6 +16,7 @@
 RUN pip3 install -U pip
 
 RUN pip3 install -r /srv/pwb/requirements.txt
+RUN pip3 install -r /srv/pwb/dev-requirements.txt
 RUN pip3 install /srv/pwb/
 
 CMD /bin/bash

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b1db6a881e3f9c8fd79a59cd21294db799b1a4f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: Yuvipanda 
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 expand text by default in getCategoryLinks - change (pywikibot/core)

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

Change subject: Do not expand text by default in getCategoryLinks
..


Do not expand text by default in getCategoryLinks

666364ca introduced wikitext expansion while getting category links,
however this caused magic names like {{PAGENAME}} to be expanded
when it should be kept in the wikitext.

Make this new functionality disabled by default.

Bug: T109213
Change-Id: I321ba1715fe7b1a9c24d7f8109db236339e5f4b5
---
M pywikibot/textlib.py
M tests/textlib_tests.py
2 files changed, 9 insertions(+), 8 deletions(-)

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



diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 05e0b8b..0fe92e0 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -993,7 +993,7 @@
 # Functions dealing with category links
 # -
 
-def getCategoryLinks(text, site=None, include=[]):
+def getCategoryLinks(text, site=None, include=[], expand_text=False):
 """Return a list of category links found in text.
 
 @param include: list of tags which should not be removed by
@@ -1013,7 +1013,7 @@
 R = re.compile(r'\[\[\s*(?P%s)\s*:\s*(?P.+?)\]\]'
% catNamespace, re.I)
 for match in R.finditer(text):
-if '{{' in match.group('rest'):
+if expand_text and '{{' in match.group('rest'):
 rest = site.expand_text(match.group('rest'))
 else:
 rest = match.group('rest')
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 762f62d..6b674a8 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -265,24 +265,25 @@
 """Test normal templates inside category links."""
 self.site = self.get_site()
 self.assertEqual(textlib.getCategoryLinks(
-'[[Category:{{P1|Foo}}]]', self.site),
+'[[Category:{{P1|Foo}}]]', self.site, expand_text=True),
 [pywikibot.page.Category(self.site, 'Foo')])
 self.assertEqual(textlib.getCategoryLinks(
-'[[Category:{{P1|Foo}}|bar]]', self.site),
+'[[Category:{{P1|Foo}}|bar]]', self.site, expand_text=True),
 [pywikibot.page.Category(self.site, 'Foo', sortKey='bar')])
 self.assertEqual(textlib.getCategoryLinks(
-'[[Category:{{P1|{{P2|L33t|Foo|bar]]', self.site),
+'[[Category:{{P1|{{P2|L33t|Foo|bar]]',
+self.site, expand_text=True),
 [pywikibot.page.Category(self.site, 'Foo', sortKey='bar')])
 self.assertEqual(textlib.getCategoryLinks(
-'[[Category:Foo{{!}}bar]]', self.site),
+'[[Category:Foo{{!}}bar]]', self.site, expand_text=True),
 [pywikibot.page.Category(self.site, 'Foo', sortKey='bar')])
 self.assertEqual(textlib.getCategoryLinks(
 '[[Category:Foo{{!}}bar]][[Category:Wiki{{P2||pedia}}]]',
-self.site),
+self.site, expand_text=True),
 [pywikibot.page.Category(self.site, 'Foo', sortKey='bar'),
  pywikibot.page.Category(self.site, 'Wikipedia')])
 self.assertEqual(textlib.getCategoryLinks(
-'[[Category:Foo{{!}}and{{!}}bar]]', self.site),
+'[[Category:Foo{{!}}and{{!}}bar]]', self.site, expand_text=True),
 [pywikibot.page.Category(self.site, 'Foo', sortKey='and|bar')])
 self.assertRaises(pywikibot.InvalidTitle, textlib.getCategoryLinks,
   '[[Category:nasty{{{!}}]]', self.site)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I321ba1715fe7b1a9c24d7f8109db236339e5f4b5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Mpaa 
Gerrit-Reviewer: Xqt 
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 explanations for ignored flake8 codes - change (pywikibot/core)

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

Change subject: Add explanations for ignored flake8 codes
..


Add explanations for ignored flake8 codes

Change-Id: I6406b03d0e4c5af9a15fd05eb958070877755bed
---
M tox.ini
1 file changed, 21 insertions(+), 0 deletions(-)

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



diff --git a/tox.ini b/tox.ini
index ac5a94b..b737fee 100644
--- a/tox.ini
+++ b/tox.ini
@@ -78,6 +78,25 @@
 -rdocs/requirements-py3.txt
 
 [flake8]
+# The following are intentionally ignored, possibly pending consensus
+# D105: Missing docstring in magic method
+# D211: No blank lines allowed before class docstring
+# FI10,FI12,FI13,FI15: __future__ import "division", "with_statement", 
"print_function" and "generator_stop" missing
+# FI5: __future__ import "x" present
+# H101: TODO format
+# H236: Mandatory use of six for Python 2 & 3 metaclass support
+# H404: docstring multiline start
+# H405: docstring summary line
+# H301,I100,I101: import order rules; Pywikibot uses rules H306 and I201
+
+# The following are to be fixed
+# D102: Missing docstring in public method
+# D103: Missing docstring in public function
+# E402: module level import not at top of file; see T87409
+# E731: do not assign a lambda expression, use a def; see I7b3db838
+# H201: Except: format
+# H202: assertRaises Exception too broad
+# P102,P103: string does contain unindexed parameters; see I36355923
 ignore = 
E402,E731,D105,D211,FI10,FI12,FI13,FI15,FI5,H101,H201,H202,H236,H301,H404,H405,I100,I101,P102,P103
 exclude = 
.tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*
 max_line_length = 130
@@ -97,9 +116,11 @@
 
scripts/catall.py,scripts/imageharvest.py,scripts/makecat.py,scripts/maintenance/cache.py,scripts/maintenance/wikimedia_sites.py
 : +D103
 
 [pep8]
+# see explanations above
 ignore = E402,E731
 exclude = 
.tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*
 max_line_length = 130
 
 [pep257]
+# see explanations above
 ignore = D105,D211

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6406b03d0e4c5af9a15fd05eb958070877755bed
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: XZise 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fix invalid raise syntax in askForCaptcha - change (pywikibot/core)

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

Change subject: Fix invalid raise syntax in askForCaptcha
..


Fix invalid raise syntax in askForCaptcha

A base raise statement can only exist inside an `except:` clause.

Added in compat:
https://www.mediawiki.org/wiki/Special:Code/pywikipedia/7214

askForCaptcha is unused in core (T122194).

Change-Id: I308379e47a574dd62d1cddd73253fc3171f10dbf
---
M pywikibot/userinterfaces/terminal_interface_base.py
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/pywikibot/userinterfaces/terminal_interface_base.py 
b/pywikibot/userinterfaces/terminal_interface_base.py
index 4540e2c..66aad34 100755
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -443,8 +443,9 @@
 u'What is the solution of the CAPTCHA that is shown in '
 u'your web browser?')
 else:
-raise
-except:
+raise webbrowser.Error(
+'webbrowser.open failed to open a web browser')
+except Exception:
 pywikibot.output(u'Error in opening web browser: %s'
  % sys.exc_info()[0])
 pywikibot.output(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I308379e47a574dd62d1cddd73253fc3171f10dbf
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Typo fix - change (pywikibot/core)

2015-12-23 Thread Xqt (Code Review)
Xqt has submitted this change and it was merged.

Change subject: Typo fix
..


Typo fix

Change-Id: I2b273f1c5c56fd3aebd9959ad250c2f9c5f7a431
---
M scripts/welcome.py
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/scripts/welcome.py b/scripts/welcome.py
index b77d9e2..ea36244 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -151,7 +151,7 @@
 *  *
 * The regex to load the user might be slightly different from project to   *
 * project. (In this case, write to Filnik or the PWRF for help...) *
-* Use a class to group toghether the functions used.   *
+* Use a class to group together the functions used.   *
 *  *
  Badwords **
 
@@ -164,7 +164,7 @@
 or deleting.
 
 Some words, like "Administrator" or "Dio" (God in italian) or "Jimbo" aren't
-badword at all but can be used for some bad-nickname.
+badwords at all but can be used for some bad-nickname.
 """
 #
 # (C) Alfio, 2005

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2b273f1c5c56fd3aebd9959ad250c2f9c5f7a431
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: Xqt 
Gerrit-Reviewer: Hazard-SJ 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Make "Upload anyway" link a OOjs UI button - change (mediawiki...UploadWizard)

2015-12-23 Thread PranavK (Code Review)
PranavK has uploaded a new change for review.

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

Change subject: Make "Upload anyway" link a OOjs UI button
..

Make "Upload anyway" link a OOjs UI button

Bug: T114221
Change-Id: Iaee6b7c5abf5396d649bd87eb308dfd2e9b32fa5
---
M resources/mw.UploadWizardUpload.js
1 file changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/00/260900/1

diff --git a/resources/mw.UploadWizardUpload.js 
b/resources/mw.UploadWizardUpload.js
index da20c4d..077eab2 100644
--- a/resources/mw.UploadWizardUpload.js
+++ b/resources/mw.UploadWizardUpload.js
@@ -305,13 +305,15 @@
 
$extra = $ul;
if ( code === 'duplicate-archive' ) {
-   $override = $( '' )
-   .attr( 'href', '#' )
-   .text( mw.message( 'mwe-upwiz-override' 
).text() )
-   .click( function () {
-   this.removeErrors( 'duplicate-archive' 
);
-   }.bind( this ) );
-   $extra = $extra.add( $override );
+   this.uploadDuplicate = new OO.ui.ButtonWidget( {
+   label: mw.message( 'mwe-upwiz-override' 
).escaped(),
+   title: mw.message( 'mwe-upwiz-override' 
).escaped(),
+   flags: 'progressive',
+   framed: false
+   } ).on( 'click', function () {
+   this.removeErrors( 'duplicate-archive' );
+   } );
+   $extra = $extra.append( this.uploadDuplicate.$element );
}
 
this.setError( code, [ duplicates.length ], $extra );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaee6b7c5abf5396d649bd87eb308dfd2e9b32fa5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: PranavK 

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


[MediaWiki-commits] [Gerrit] Typo fix - change (pywikibot/core)

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

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

Change subject: Typo fix
..

Typo fix

Change-Id: I2b273f1c5c56fd3aebd9959ad250c2f9c5f7a431
---
M scripts/welcome.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/99/260899/1

diff --git a/scripts/welcome.py b/scripts/welcome.py
index b77d9e2..ea36244 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -151,7 +151,7 @@
 *  *
 * The regex to load the user might be slightly different from project to   *
 * project. (In this case, write to Filnik or the PWRF for help...) *
-* Use a class to group toghether the functions used.   *
+* Use a class to group together the functions used.   *
 *  *
  Badwords **
 
@@ -164,7 +164,7 @@
 or deleting.
 
 Some words, like "Administrator" or "Dio" (God in italian) or "Jimbo" aren't
-badword at all but can be used for some bad-nickname.
+badwords at all but can be used for some bad-nickname.
 """
 #
 # (C) Alfio, 2005

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b273f1c5c56fd3aebd9959ad250c2f9c5f7a431
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: Xqt 
Gerrit-Reviewer: Hazard-SJ 

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


[MediaWiki-commits] [Gerrit] apt: Followup to I801f0e007aac39421 - change (operations/puppet)

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

Change subject: apt: Followup to I801f0e007aac39421
..


apt: Followup to I801f0e007aac39421

Change-Id: I4e9600a9ef4806d9984878f8c1b75fd4982d1b83
---
M modules/apt/manifests/init.pp
1 file changed, 7 insertions(+), 5 deletions(-)

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



diff --git a/modules/apt/manifests/init.pp b/modules/apt/manifests/init.pp
index b2baf99..6509c6e 100644
--- a/modules/apt/manifests/init.pp
+++ b/modules/apt/manifests/init.pp
@@ -42,7 +42,7 @@
 priority => 1001,
 }
 
-if $use_proxy {
+if $use_proxy {
 $http_proxy = "http://webproxy.${::site}.wmnet:8080";
 
 # This will munge /etc/apt/apt.conf that get's created during 
installation
@@ -61,8 +61,6 @@
 }
 
 if $::operatingsystem == 'Debian' {
-$components = 'main backports thirdparty'
-
 apt::conf { 'security-debian-proxy':
 ensure   => present,
 priority => '80',
@@ -70,8 +68,6 @@
 value=> $http_proxy,
 }
 } elsif $::operatingsystem == 'Ubuntu' {
-$components = 'main universe thirdparty'
-
 apt::conf { 'security-ubuntu-proxy':
 ensure   => present,
 priority => '80',
@@ -97,6 +93,12 @@
 }
 }
 
+if $::operatingsystem == 'ubuntu' {
+$components = 'main universe thirdparty'
+} else {
+$components = 'main backports thirdparty'
+}
+
 apt::repository { 'wikimedia':
 uri => 'http://apt.wikimedia.org/wikimedia',
 dist=> "${::lsbdistcodename}-wikimedia",

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

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

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


[MediaWiki-commits] [Gerrit] apt: Followup to I801f0e007aac39421 - change (operations/puppet)

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

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

Change subject: apt: Followup to I801f0e007aac39421
..

apt: Followup to I801f0e007aac39421

Change-Id: I4e9600a9ef4806d9984878f8c1b75fd4982d1b83
---
M modules/apt/manifests/init.pp
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/98/260898/1

diff --git a/modules/apt/manifests/init.pp b/modules/apt/manifests/init.pp
index b2baf99..6509c6e 100644
--- a/modules/apt/manifests/init.pp
+++ b/modules/apt/manifests/init.pp
@@ -42,7 +42,7 @@
 priority => 1001,
 }
 
-if $use_proxy {
+if $use_proxy {
 $http_proxy = "http://webproxy.${::site}.wmnet:8080";
 
 # This will munge /etc/apt/apt.conf that get's created during 
installation
@@ -61,8 +61,6 @@
 }
 
 if $::operatingsystem == 'Debian' {
-$components = 'main backports thirdparty'
-
 apt::conf { 'security-debian-proxy':
 ensure   => present,
 priority => '80',
@@ -70,8 +68,6 @@
 value=> $http_proxy,
 }
 } elsif $::operatingsystem == 'Ubuntu' {
-$components = 'main universe thirdparty'
-
 apt::conf { 'security-ubuntu-proxy':
 ensure   => present,
 priority => '80',
@@ -97,6 +93,12 @@
 }
 }
 
+if $::operatingsystem == 'ubuntu' {
+$components = 'main universe thirdparty'
+} else {
+$components = 'main backports thirdparty'
+}
+
 apt::repository { 'wikimedia':
 uri => 'http://apt.wikimedia.org/wikimedia',
 dist=> "${::lsbdistcodename}-wikimedia",

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

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

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


[MediaWiki-commits] [Gerrit] SpecialContributions: Simplify check for 'Special:Contributi... - change (mediawiki/core)

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

Change subject: SpecialContributions: Simplify check for 
'Special:Contributions/newbies'
..


SpecialContributions: Simplify check for 'Special:Contributions/newbies'

Added in 54615b5ea1a05caf40461b46193b4779e912f528 (per T36659)
as a possibly temporary workaround, it has stuck around for six
release versions now. It's not going to suddenly disappear
and we shouldn't optimize this code for ease of removal :)

Bug: T36659
Change-Id: I946ae7cf164f5c71b2ea4023161df7452bd1745a
---
M includes/specials/SpecialContributions.php
1 file changed, 1 insertion(+), 5 deletions(-)

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



diff --git a/includes/specials/SpecialContributions.php 
b/includes/specials/SpecialContributions.php
index fc9f750..bf3ab90 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -49,11 +49,7 @@
$target = $request->getVal( 'target' );
}
 
-   // check for radiobox
-   if ( $request->getVal( 'contribs' ) == 'newbie' ) {
-   $target = 'newbies';
-   $this->opts['contribs'] = 'newbie';
-   } elseif ( $par === 'newbies' ) { // b/c for WMF
+   if ( $request->getVal( 'contribs' ) == 'newbie' || $par === 
'newbies' ) {
$target = 'newbies';
$this->opts['contribs'] = 'newbie';
} else {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I946ae7cf164f5c71b2ea4023161df7452bd1745a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apt: Do not use a proxy in labs - change (operations/puppet)

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

Change subject: apt: Do not use a proxy in labs
..


apt: Do not use a proxy in labs

All labs instances have direct internet connectivity and do
not need a HTTP proxy

Change-Id: I801f0e007aac39421d9396fc7f9adf7a9b9baea8
---
M hieradata/labs.yaml
M modules/apt/manifests/init.pp
2 files changed, 50 insertions(+), 43 deletions(-)

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



diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index 9c73926..6b1b792 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -57,3 +57,6 @@
 puppetmaster: "labs-puppetmaster-eqiad.wikimedia.org"
 saltmaster: "labs-puppetmaster-eqiad.wikimedia.org"
 mysql::server::use_apparmor: false  # The images we have for debian don't 
support it
+
+# All labs instances have internet connectivity, so do not bother with proxies
+apt::use_proxy: false
diff --git a/modules/apt/manifests/init.pp b/modules/apt/manifests/init.pp
index 4fd161c..b2baf99 100644
--- a/modules/apt/manifests/init.pp
+++ b/modules/apt/manifests/init.pp
@@ -1,4 +1,6 @@
-class apt {
+class apt(
+$use_proxy = true
+) {
 exec { 'apt-get update':
 path=> '/usr/bin',
 timeout => 240,
@@ -40,57 +42,59 @@
 priority => 1001,
 }
 
-$http_proxy = "http://webproxy.${::site}.wmnet:8080";
+if $use_proxy {
+$http_proxy = "http://webproxy.${::site}.wmnet:8080";
 
-# This will munge /etc/apt/apt.conf that get's created during installation
-# process (either labs vmbuilder or d-i). Given the ones below exist, it is
-# no longer needed after the installation is over
-file { '/etc/apt/apt.conf':
-ensure => absent,
-notify => Exec['apt-get update'],
-}
-
-apt::conf { 'wikimedia-proxy':
-ensure   => absent,
-priority => '80',
-key  => 'Acquire::http::Proxy',
-value=> $http_proxy,
-}
-
-if $::operatingsystem == 'Debian' {
-$components = 'main backports thirdparty'
-
-apt::conf { 'security-debian-proxy':
-ensure   => present,
-priority => '80',
-key  => 'Acquire::http::Proxy::security.debian.org',
-value=> $http_proxy,
+# This will munge /etc/apt/apt.conf that get's created during 
installation
+# process (either labs vmbuilder or d-i). Given the ones below exist, 
it is
+# no longer needed after the installation is over
+file { '/etc/apt/apt.conf':
+ensure => absent,
+notify => Exec['apt-get update'],
 }
-} elsif $::operatingsystem == 'Ubuntu' {
-$components = 'main universe thirdparty'
 
-apt::conf { 'security-ubuntu-proxy':
-ensure   => present,
+apt::conf { 'wikimedia-proxy':
+ensure   => absent,
 priority => '80',
-key  => 'Acquire::http::Proxy::security.ubuntu.com',
+key  => 'Acquire::http::Proxy',
 value=> $http_proxy,
 }
 
-apt::conf { 'ubuntu-cloud-archive-proxy':
-ensure   => present,
-priority => '80',
-key  => 
'Acquire::http::Proxy::ubuntu-cloud.archive.canonical.com',
-value=> $http_proxy,
-}
+if $::operatingsystem == 'Debian' {
+$components = 'main backports thirdparty'
 
-apt::conf { 'old-releases-proxy':
-ensure   => present,
-priority => '80',
-key  => 'Acquire::http::Proxy::old-releases.ubuntu.com',
-value=> $http_proxy,
+apt::conf { 'security-debian-proxy':
+ensure   => present,
+priority => '80',
+key  => 'Acquire::http::Proxy::security.debian.org',
+value=> $http_proxy,
+}
+} elsif $::operatingsystem == 'Ubuntu' {
+$components = 'main universe thirdparty'
+
+apt::conf { 'security-ubuntu-proxy':
+ensure   => present,
+priority => '80',
+key  => 'Acquire::http::Proxy::security.ubuntu.com',
+value=> $http_proxy,
+}
+
+apt::conf { 'ubuntu-cloud-archive-proxy':
+ensure   => present,
+priority => '80',
+key  => 
'Acquire::http::Proxy::ubuntu-cloud.archive.canonical.com',
+value=> $http_proxy,
+}
+
+apt::conf { 'old-releases-proxy':
+ensure   => present,
+priority => '80',
+key  => 'Acquire::http::Proxy::old-releases.ubuntu.com',
+value=> $http_proxy,
+}
+} else {
+fail("Unknown operating system '${::operatingsystem}'.")
 }
-} else {
-

[MediaWiki-commits] [Gerrit] apt: Do not use a proxy in labs - change (operations/puppet)

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

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

Change subject: apt: Do not use a proxy in labs
..

apt: Do not use a proxy in labs

All labs instances have direct internet connectivity and do
not need a HTTP proxy

Change-Id: I801f0e007aac39421d9396fc7f9adf7a9b9baea8
---
M hieradata/labs.yaml
M modules/apt/manifests/init.pp
2 files changed, 50 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/97/260897/1

diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index 9c73926..6b1b792 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -57,3 +57,6 @@
 puppetmaster: "labs-puppetmaster-eqiad.wikimedia.org"
 saltmaster: "labs-puppetmaster-eqiad.wikimedia.org"
 mysql::server::use_apparmor: false  # The images we have for debian don't 
support it
+
+# All labs instances have internet connectivity, so do not bother with proxies
+apt::use_proxy: false
diff --git a/modules/apt/manifests/init.pp b/modules/apt/manifests/init.pp
index 4fd161c..b2baf99 100644
--- a/modules/apt/manifests/init.pp
+++ b/modules/apt/manifests/init.pp
@@ -1,4 +1,6 @@
-class apt {
+class apt(
+$use_proxy = true
+) {
 exec { 'apt-get update':
 path=> '/usr/bin',
 timeout => 240,
@@ -40,57 +42,59 @@
 priority => 1001,
 }
 
-$http_proxy = "http://webproxy.${::site}.wmnet:8080";
+if $use_proxy {
+$http_proxy = "http://webproxy.${::site}.wmnet:8080";
 
-# This will munge /etc/apt/apt.conf that get's created during installation
-# process (either labs vmbuilder or d-i). Given the ones below exist, it is
-# no longer needed after the installation is over
-file { '/etc/apt/apt.conf':
-ensure => absent,
-notify => Exec['apt-get update'],
-}
-
-apt::conf { 'wikimedia-proxy':
-ensure   => absent,
-priority => '80',
-key  => 'Acquire::http::Proxy',
-value=> $http_proxy,
-}
-
-if $::operatingsystem == 'Debian' {
-$components = 'main backports thirdparty'
-
-apt::conf { 'security-debian-proxy':
-ensure   => present,
-priority => '80',
-key  => 'Acquire::http::Proxy::security.debian.org',
-value=> $http_proxy,
+# This will munge /etc/apt/apt.conf that get's created during 
installation
+# process (either labs vmbuilder or d-i). Given the ones below exist, 
it is
+# no longer needed after the installation is over
+file { '/etc/apt/apt.conf':
+ensure => absent,
+notify => Exec['apt-get update'],
 }
-} elsif $::operatingsystem == 'Ubuntu' {
-$components = 'main universe thirdparty'
 
-apt::conf { 'security-ubuntu-proxy':
-ensure   => present,
+apt::conf { 'wikimedia-proxy':
+ensure   => absent,
 priority => '80',
-key  => 'Acquire::http::Proxy::security.ubuntu.com',
+key  => 'Acquire::http::Proxy',
 value=> $http_proxy,
 }
 
-apt::conf { 'ubuntu-cloud-archive-proxy':
-ensure   => present,
-priority => '80',
-key  => 
'Acquire::http::Proxy::ubuntu-cloud.archive.canonical.com',
-value=> $http_proxy,
-}
+if $::operatingsystem == 'Debian' {
+$components = 'main backports thirdparty'
 
-apt::conf { 'old-releases-proxy':
-ensure   => present,
-priority => '80',
-key  => 'Acquire::http::Proxy::old-releases.ubuntu.com',
-value=> $http_proxy,
+apt::conf { 'security-debian-proxy':
+ensure   => present,
+priority => '80',
+key  => 'Acquire::http::Proxy::security.debian.org',
+value=> $http_proxy,
+}
+} elsif $::operatingsystem == 'Ubuntu' {
+$components = 'main universe thirdparty'
+
+apt::conf { 'security-ubuntu-proxy':
+ensure   => present,
+priority => '80',
+key  => 'Acquire::http::Proxy::security.ubuntu.com',
+value=> $http_proxy,
+}
+
+apt::conf { 'ubuntu-cloud-archive-proxy':
+ensure   => present,
+priority => '80',
+key  => 
'Acquire::http::Proxy::ubuntu-cloud.archive.canonical.com',
+value=> $http_proxy,
+}
+
+apt::conf { 'old-releases-proxy':
+ensure   => present,
+priority => '80',
+key  => 'Acquire::http::Proxy::old-releases.ubuntu.com',
+value=> $http_proxy,
+}
+} else {
+fail("Unknown operating system '${::op

[MediaWiki-commits] [Gerrit] Breaking change: Make SkinMinerva use the MenuBuilder class - change (mediawiki...MobileFrontend)

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

Change subject: Breaking change: Make SkinMinerva use the MenuBuilder class
..


Breaking change: Make SkinMinerva use the MenuBuilder class

Update SkinMinerva#getPersonalTools, #getDiscoveryTools
Breaking change, extensions adding items to menu will now
need to use MobileMenuData

Bug: T65459
Change-Id: I08a0282971bb2884e63fa7c6af5485f433b4c8aa
---
M includes/skins/SkinMinerva.php
1 file changed, 100 insertions(+), 155 deletions(-)

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



diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 6539231..ebfdb60 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -2,6 +2,7 @@
 /**
  * SkinMinerva.php
  */
+use MobileFrontend\MenuBuilder;
 
 /**
  * Minerva: Born from the godhead of Jupiter with weapons!
@@ -328,7 +329,7 @@
$returnToTitle = $this->getTitle()->getPrefixedText();
$donateTitle = SpecialPage::getTitleFor( 'Uploads' );
$watchTitle = SpecialPage::getTitleFor( 'Watchlist' );
-   $items = array();
+   $menu = new MenuBuilder();
 
// Watchlist link
$watchlistQuery = array();
@@ -343,87 +344,66 @@
$watchlistQuery['filter'] = $filter;
}
}
-   $items[] = array(
-   'name' => 'watchlist',
-   'components' => array(
-   array(
-   'text' => wfMessage( 
'mobile-frontend-main-menu-watchlist' )->escaped(),
-   'href' => $this->getPersonalUrl(
-   $watchTitle,
-   
'mobile-frontend-watchlist-purpose',
-   $watchlistQuery
-   ),
-   'class' => MobileUI::iconClass( 
'watchlist', 'before' ),
-   'data-event-name' => 'watchlist',
+
+   $menu->insert( 'watchlist', $isJSOnly = true )
+   ->addComponent(
+   wfMessage( 
'mobile-frontend-main-menu-watchlist' )->escaped(),
+   $this->getPersonalUrl(
+   $watchTitle,
+   'mobile-frontend-watchlist-purpose',
+   $watchlistQuery
),
-   ),
-   'class' => 'jsonly'
-   );
+   MobileUI::iconClass( 'watchlist', 'before' ),
+   array( 'data-event-name' => 'watchlist' )
+   );
 
// Links specifically for mobile mode
if ( $this->isMobileMode ) {
 
// Uploads link
if ( $this->mobileContext->userCanUpload() ) {
-   $items[] = array(
-   'name' => 'uploads',
-   'components' => array(
-   array(
-   'text' => wfMessage( 
'mobile-frontend-main-menu-upload' )->escaped(),
-   'href' => 
$this->getPersonalUrl(
-   $donateTitle,
-   
'mobile-frontend-donate-image-anon'
-   ),
-   'class' => 
MobileUI::iconClass( 'uploads', 'before', 'menu-item-upload' ),
-   'data-event-name' => 
'uploads',
+   $menu->insert( 'uploads', $isJSOnly = true )
+   ->addComponent(
+   wfMessage( 
'mobile-frontend-main-menu-upload' )->escaped(),
+   $this->getPersonalUrl(
+   $donateTitle,
+   
'mobile-frontend-donate-image-anon'
),
-   ),
-   'class' => 'jsonly',
-   );
+   MobileUI::iconClass( 'uploads', 
'before', 'menu-item-upload' ),
+

[MediaWiki-commits] [Gerrit] Add the MenuBuilder - change (mediawiki...MobileFrontend)

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

Change subject: Add the MenuBuilder
..


Add the MenuBuilder

The main menu is currently constructed using bare PHP array syntax
spread across SkinMinerva#getPersonalTools and #getDiscoveryTools, which
both emit events emit events - the MinervaPersonalTools [0] and
MinervaPersonalTools [1] events, respectively.

Rather than requiring that all functions that modify the adhere to an
undocumented structure, which admittedly doesn't change that often,
introduce a class that presents a stable, readable API that can
generate the required data structure when needed: the
MobileFrontend\MenuBuilder class.

[0] https://www.mediawiki.org/wiki/Manual:Hooks/MinervaPersonalTools
[1] https://www.mediawiki.org/wiki/Manual:Hooks/MinervaDiscoveryTools

Change-Id: I96e5945da429bbc2317fe6d2299d5b4c094d3571
---
M MobileFrontend.php
A includes/MenuBuilder.php
A tests/phpunit/MenuBuilderTest.php
3 files changed, 353 insertions(+), 0 deletions(-)

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



diff --git a/MobileFrontend.php b/MobileFrontend.php
index 536d0c0..232c0b9 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -94,6 +94,9 @@
 
'SkinMinerva' => 'skins/SkinMinerva',
'SkinMinervaBeta' => 'skins/SkinMinervaBeta',
+
+   'MobileFrontend\MenuBuilder' => 'MenuBuilder',
+   'MobileFrontend\MenuEntry' => 'MenuBuilder',
 );
 
 foreach ( $autoloadClasses as $className => $classFilename ) {
diff --git a/includes/MenuBuilder.php b/includes/MenuBuilder.php
new file mode 100644
index 000..c35c334
--- /dev/null
+++ b/includes/MenuBuilder.php
@@ -0,0 +1,163 @@
+ $entry->getName(),
+   'components' => $entry->getComponents(),
+   );
+
+   if ( $entry->isJSOnly() ) {
+   $result['class'] = 'jsonly';
+   }
+
+   return $result;
+   };
+
+   return array_map( $entryPresenter, $this->entries );
+   }
+
+   /**
+* Insert an entry into the menu.
+*
+* @param string $name A unique name identifying the menu entry
+* @param boolean [$isJSOnly] Whether the menu entry works without JS
+* @throws DomainException When the entry already exists
+* @return MenuEntry
+*/
+   public function insert( $name, $isJSOnly = false ) {
+   if ( $this->search( $name ) !== -1 ) {
+   throw new DomainException( "The \"${name}\" entry 
already exists." );
+   }
+
+   $this->entries[] = $entry = new MenuEntry( $name, $isJSOnly );
+
+   return $entry;
+   }
+
+   /**
+* Searches for a menu entry by name.
+*
+* @param string $name
+* @return integer If the menu entry exists, then the 0-based index of 
the entry; otherwise, -1
+*/
+   private function search( $name ) {
+   $count = count( $this->entries );
+
+   for ( $i = 0; $i < $count; ++$i ) {
+   if ( $this->entries[$i]->getName() === $name ) {
+   return $i;
+   }
+   }
+
+   return -1;
+   }
+
+   /**
+* Insert an entry after an existing one.
+*
+* @param string $targetName The name of the existing entry to insert
+*  the new entry after
+* @param string $name The name of the new entry
+* @param boolean [$isJSOnly] Whether the entry works without JS
+* @throws DomainException When the existing entry doesn't exist
+* @return MenuEntry
+*/
+   public function insertAfter( $targetName, $name, $isJSOnly = false ) {
+   if ( $this->search( $name ) !== -1 ) {
+   throw new DomainException( "The \"${name}\" entry 
already exists." );
+   }
+
+   $index = $this->search( $targetName );
+
+   if ( $index === -1 ) {
+   throw new DomainException( "The \"{$targetName}\" entry 
doesn't exist." );
+   }
+
+   $entry = new MenuEntry( $name, $isJSOnly );
+   array_splice( $this->entries, $index + 1, 0, array( $entry ) );
+
+   return $entry;
+   }
+}
+
+/**
+ * Model for a menu entry.
+ */
+class MenuEntry {
+   private $name;
+   private $isJSOnly;
+   private $components;
+
+   /**
+* @param string $name
+* @param boolean $isJSOnly Whether the entry works without JS
+*/
+   public function __construct( $name, $isJSOnly ) {
+   $this->name = $name;
+   $this->isJSOnly = $isJSOnly;
+   $this->components = array();
+   }
+
+  

[MediaWiki-commits] [Gerrit] Add Gemfile - change (mediawiki...RelatedArticles)

2015-12-23 Thread Bmansurov (Code Review)
Bmansurov has uploaded a new change for review.

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

Change subject: Add Gemfile
..

Add Gemfile

mediawiki_selenium 1.4 or greater is need for running browser tests.

Bug: T120715
Change-Id: If5bf9dcc7310896b8d8b218d636952c344a2a105
---
A Gemfile
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RelatedArticles 
refs/changes/96/260896/1

diff --git a/Gemfile b/Gemfile
new file mode 100644
index 000..35b657b
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,3 @@
+source 'https://rubygems.org'
+
+gem 'mediawiki_selenium', '~> 1.6.3'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5bf9dcc7310896b8d8b218d636952c344a2a105
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RelatedArticles
Gerrit-Branch: dev
Gerrit-Owner: Bmansurov 

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


[MediaWiki-commits] [Gerrit] Reenable InfiniteScroll and settings tests - change (mediawiki...MobileFrontend)

2015-12-23 Thread Sn1per (Code Review)
Sn1per has uploaded a new change for review.

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

Change subject: Reenable InfiniteScroll and settings tests
..

Reenable InfiniteScroll and settings tests

Bug: T106628
Change-Id: I729d0a4af9346654269c8855a4102d3fc02484c3
---
M tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js
M tests/qunit/mobile.settings/test_settings.js
2 files changed, 17 insertions(+), 8 deletions(-)


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

diff --git a/tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js 
b/tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js
index 4fee431..2ea393e 100644
--- a/tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js
+++ b/tests/qunit/mobile.infiniteScroll/test_InfiniteScroll.js
@@ -24,13 +24,22 @@
'Scrolling has been bound and is handler is called on 
scroll' );
} );
 
-   QUnit.skip( 'emits load event', 1, function ( assert ) {
-   var is = new InfiniteScroll();
-   is.setElement( $( 'body' ) );
+   QUnit.test( 'emits load event', 1, function ( assert ) {
+   var asyncDone = assert.async(),
+   is = new InfiniteScroll();
 
+   // Make sure we always have somewhere to scroll
+   $( 'body' ).height( 'px' );
+
+   is.setElement( $( 'body' ) );
is.on( 'load', function () {
assert.ok( true, 'Load event emitted' );
-   QUnit.start();
+
+   // Reset height
+   $( 'body' ).css( 'height', '' );
+
+   // Finish
+   asyncDone();
} );
 
// Scroll to the bottom of the body
diff --git a/tests/qunit/mobile.settings/test_settings.js 
b/tests/qunit/mobile.settings/test_settings.js
index 3d63c79..486d418 100644
--- a/tests/qunit/mobile.settings/test_settings.js
+++ b/tests/qunit/mobile.settings/test_settings.js
@@ -38,7 +38,7 @@
}
} );
 
-   QUnit.skip( 'check cookies', 2, function ( assert ) {
+   QUnit.test( 'check cookies', 2, function ( assert ) {
assert.strictEqual(
settings.cookiesEnabled(),
true,
@@ -54,7 +54,7 @@
);
} );
 
-   QUnit.skip( 'localstorage', 3, function ( assert ) {
+   QUnit.test( 'localstorage', 3, function ( assert ) {
assert.strictEqual(
settings.get( 'test_key' ),
null,
@@ -76,7 +76,7 @@
);
} );
 
-   QUnit.skip( 'cookie fallback', 3, function ( assert ) {
+   QUnit.test( 'cookie fallback', 3, function ( assert ) {
assert.strictEqual(
settings.get( 'test_key', true ),
null,
@@ -117,7 +117,7 @@
this.sandbox.restore();
}
} );
-   QUnit.skip( 'without cookies or localStorage', 3, function ( assert ) {
+   QUnit.test( 'without cookies or localStorage', 3, function ( assert ) {
assert.strictEqual(
settings.save( 'test_key', 'yep' ),
false,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I729d0a4af9346654269c8855a4102d3fc02484c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Sn1per 

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


[MediaWiki-commits] [Gerrit] mw.Upload.BookletLayout: Rewrite some code to use promise ch... - change (mediawiki/core)

2015-12-23 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mw.Upload.BookletLayout: Rewrite some code to use promise 
chaining
..

mw.Upload.BookletLayout: Rewrite some code to use promise chaining

Allegedly this makes it clearer.

Follow-up to I0b2f53b91454f22e2001462397087da9e055b701.

Change-Id: Ie3a6c20452d8102d44b4268f92c55bbabfc5cd68
---
M resources/src/mediawiki/mediawiki.ForeignStructuredUpload.BookletLayout.js
M resources/src/mediawiki/mediawiki.Upload.BookletLayout.js
2 files changed, 42 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/94/260894/1

diff --git 
a/resources/src/mediawiki/mediawiki.ForeignStructuredUpload.BookletLayout.js 
b/resources/src/mediawiki/mediawiki.ForeignStructuredUpload.BookletLayout.js
index a94038e..4df0fc6 100644
--- a/resources/src/mediawiki/mediawiki.ForeignStructuredUpload.BookletLayout.js
+++ b/resources/src/mediawiki/mediawiki.ForeignStructuredUpload.BookletLayout.js
@@ -39,21 +39,28 @@
 * @inheritdoc
 */
mw.ForeignStructuredUpload.BookletLayout.prototype.initialize = 
function () {
-   var deferred = $.Deferred();
-   
mw.ForeignStructuredUpload.BookletLayout.parent.prototype.initialize.call( this 
)
-   .done( function () {
+   var booklet = this;
+   return 
mw.ForeignStructuredUpload.BookletLayout.parent.prototype.initialize.call( this 
).then(
+   function () {
// Point the CategorySelector to the right wiki
-   this.upload.getApi().done( function ( api ) {
-   // If this is a ForeignApi, it will 
have a apiUrl, otherwise we don't need to do anything
-   if ( api.apiUrl ) {
-   // Can't reuse the same object, 
CategorySelector calls #abort on its mw.Api instance
-   this.categoriesWidget.api = new 
mw.ForeignApi( api.apiUrl );
+   return booklet.upload.getApi().then(
+   function ( api ) {
+   // If this is a ForeignApi, it 
will have a apiUrl, otherwise we don't need to do anything
+   if ( api.apiUrl ) {
+   // Can't reuse the same 
object, CategorySelector calls #abort on its mw.Api instance
+   
booklet.categoriesWidget.api = new mw.ForeignApi( api.apiUrl );
+   }
+   return 
$.Deferred().resolve().promise();
+   },
+   function () {
+   return 
$.Deferred().resolve().promise();
}
-   }.bind( this ) ).always( function () {
-   deferred.resolve();
-   } );
-   }.bind( this ) );
-   return deferred.promise();
+   );
+   },
+   function () {
+   return $.Deferred().resolve().promise();
+   }
+   );
};
 
/**
diff --git a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js 
b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js
index 536d7a5..00d2123 100644
--- a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js
+++ b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js
@@ -151,30 +151,33 @@
 * @return {jQuery.Promise} Promise resolved when everything is 
initialized
 */
mw.Upload.BookletLayout.prototype.initialize = function () {
-   var
-   booklet = this,
-   deferred = $.Deferred();
+   var booklet = this;
 
this.clear();
this.upload = this.createUpload();
this.setPage( 'upload' );
 
-   this.upload.getApi().done( function ( api ) {
-   // If the user can't upload anything, don't give them 
the option to.
-   api.getUserInfo().done( function ( userInfo ) {
-   if ( userInfo.rights.indexOf( 'upload' ) === -1 
) {
-   // TODO Use a better error message when 
not all logged-in users can upload
-   booklet.getPage( 'upload' 
).$element.msg( 'api-error-mustbeloggedin' );
- 

[MediaWiki-commits] [Gerrit] uw.controller.Details: Correct indentation, avoid Function#b... - change (mediawiki...UploadWizard)

2015-12-23 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: uw.controller.Details: Correct indentation, avoid Function#bind 
when not needed, tweak comments
..

uw.controller.Details: Correct indentation, avoid Function#bind when not 
needed, tweak comments

Change-Id: Ia38591302d89915e9970967657498dc98393a12f
---
M resources/controller/uw.controller.Details.js
1 file changed, 21 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/93/260893/1

diff --git a/resources/controller/uw.controller.Details.js 
b/resources/controller/uw.controller.Details.js
index 15de7b7..3a9aed6 100644
--- a/resources/controller/uw.controller.Details.js
+++ b/resources/controller/uw.controller.Details.js
@@ -108,6 +108,7 @@
 */
uw.controller.Details.prototype.valid = function () {
var
+   detailsController = this,
validityPromises = [],
warningValidityPromises = [],
titles = {};
@@ -157,29 +158,31 @@
} ) );
} );
 
-   // If not all uploads are valid, $.when will reject this
-   return $.when.apply( $, validityPromises ).then( function () {
-   // If not all uploads are warning-free, $.when will 
reject this too
-   return $.when.apply( $, warningValidityPromises ).then(
-   // All uploads valid, no warnings
-   function () {
-   return $.Deferred().resolve( true );
-   },
-   function () {
+   return $.when.apply( $, validityPromises ).then(
+   function () {
+   return $.when.apply( $, warningValidityPromises 
).then(
+   // All uploads valid, no warnings
+   function () {
+   return $.Deferred().resolve( 
true );
+   },
// Valid, but with warnings, ask for 
confirmation
-   this.showErrors(); // Update warning 
count before dialog
-   return this.confirmationDialog();
-   }.bind( this )
-   );
-   }.bind( this ),
-   function () {
-   return $.Deferred().resolve( false );
-   }
+   function () {
+   // Update warning count before 
dialog
+   detailsController.showErrors();
+   return 
detailsController.confirmationDialog();
+   }
+   );
+   },
+   function () {
+   return $.Deferred().resolve( false );
+   }
);
};
 
uw.controller.Details.prototype.confirmationDialog = function () {
-   return OO.ui.confirm( mw.message( 'mwe-upwiz-dialog-warning' 
).text(), { title: mw.message( 'mwe-upwiz-dialog-title' ).text() } );
+   return OO.ui.confirm( mw.message( 'mwe-upwiz-dialog-warning' 
).text(), {
+   title: mw.message( 'mwe-upwiz-dialog-title' ).text()
+   } );
};
 
uw.controller.Details.prototype.canTransition = function ( upload ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia38591302d89915e9970967657498dc98393a12f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] Use OO.ui.confirm() for the confirmation dialog in ext.tmh.t... - change (mediawiki...TimedMediaHandler)

2015-12-23 Thread Neonowy (Code Review)
Neonowy has uploaded a new change for review.

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

Change subject: Use OO.ui.confirm() for the confirmation dialog in 
ext.tmh.transcodetable
..

Use OO.ui.confirm() for the confirmation dialog in ext.tmh.transcodetable

Bug: T117078
Change-Id: I04005256a1c304dd43f841bbc8b4c888657e678a
---
M resources/ext.tmh.transcodetable.js
1 file changed, 31 insertions(+), 35 deletions(-)


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

diff --git a/resources/ext.tmh.transcodetable.js 
b/resources/ext.tmh.transcodetable.js
index 57aed14..1eb8d9c 100644
--- a/resources/ext.tmh.transcodetable.js
+++ b/resources/ext.tmh.transcodetable.js
@@ -13,9 +13,7 @@
$( 'body' ).append( windowManager.$element );
windowManager.addWindows( [ messageDialog ] );
 
-   // Configure the message dialog when it is opened with 
the window manager's openWindow() method.
-   windowManager.openWindow( messageDialog, {
-   title: mw.msg( 'timedmedia-reset' ),
+   OO.ui.confirm( mw.msg( 'timedmedia-reset' ), {
message: $( [
document.createTextNode( 
mw.msg( 'timedmedia-reset-explanation' ) ),
document.createElement( 'br' ),
@@ -24,7 +22,7 @@
] ),
actions: [
{
-   action: 'reset',
+   action: 'accept',
label: mw.msg( 
'timedmedia-reset-button-reset' ),
flags: [ 'primary', 
'destructive' ]
},
@@ -34,38 +32,36 @@
flags: 'safe'
}
]
-   } ).then( function ( opened ) {
-   opened.then( function ( closing, data ) {
-   var api;
-   if ( data && data.action === 'reset' ) {
-   api = new mw.Api();
-   api.postWithEditToken( {
-   action: 
'transcodereset',
-   transcodekey: tKey,
-   title: mw.config.get( 
'wgPageName' )
-   } ).done( function () {
-   // Refresh the page
-   location.reload();
-   } ).fail( function ( code, data 
) {
-   var errorText;
-   if ( data.error && 
data.error.info ) {
-   errorText = 
data.error.info;
-   } else {
-   errorText = 
mw.msg( 'timedmedia-reset-error' );
-   }
-   
windowManager.openWindow( messageDialog, {
-   message: 
errorText,
-   actions: [
-   {
-   
action: 'ok',
-   
label: mw.msg( 'timedmedia-reset-button-dismiss' ),
-   
flags: 'safe'
-   }
-   ]
-   } );
+   } ).done( function ( confirmed ) {
+   var api;
+   if ( confirmed ) {
+   api = new mw.Api();
+   api.postWithEditToken( {
+   action: 'transcodereset',
+   transcodekey: tKey,
+   title: mw.config.ge

[MediaWiki-commits] [Gerrit] Make sure docs encourage __METHOD__ use for begin/commit - change (mediawiki/core)

2015-12-23 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Make sure docs encourage __METHOD__ use for begin/commit
..

Make sure docs encourage __METHOD__ use for begin/commit

Change-Id: Id9c2d1b30f9dd758b418894b5751556daff20f0e
---
M includes/libs/objectcache/WANObjectCache.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/260891/1

diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 01f8ccc..4aa868e 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -450,7 +450,7 @@
 *
 * Example usage:
 * @code
-* $dbw->begin(); // start of request
+* $dbw->begin( __METHOD__ ); // start of request
 * ...  ...
 * // Update the row in the DB
 * $dbw->update( ... );
@@ -460,7 +460,7 @@
 * $cache->delete( $key );
 * } );
 * ...  ...
-* $dbw->commit(); // end of request
+* $dbw->commit( __METHOD__ ); // end of request
 * @endcode
 *
 * The $ttl parameter can be used when purging values that have not 
actually changed

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9c2d1b30f9dd758b418894b5751556daff20f0e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] [WIP] Upgrade mismatched begin() warnings to exceptions - change (mediawiki/core)

2015-12-23 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: [WIP] Upgrade mismatched begin() warnings to exceptions
..

[WIP] Upgrade mismatched begin() warnings to exceptions

I saw very few WMF logs for these in the last 7 days.

Change-Id: I79f2f2c8117ffa887a550a793a9e490c2a26f721
---
M includes/db/Database.php
1 file changed, 4 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/260890/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index 31e2653..d987dd6 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -3474,14 +3474,10 @@
} elseif ( !$this->mTrxAutomatic ) {
// We want to warn about inadvertently nested 
begin/commit pairs, but not about
// auto-committing implicit transactions that 
were started by query() via DBO_TRX
-   $msg = "$fname: Transaction already in progress 
(from {$this->mTrxFname}), " .
-   " performing implicit commit!";
-   wfWarn( $msg );
-   wfLogDBError( $msg,
-   $this->getLogContext( array(
-   'method' => __METHOD__,
-   'fname' => $fname,
-   ) )
+   throw new DBUnexpectedError(
+   $this,
+   "$fname: Transaction already in 
progress (from {$this->mTrxFname}), " .
+   " performing implicit commit!"
);
} else {
// if the transaction was automatic and has 
done write operations

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79f2f2c8117ffa887a550a793a9e490c2a26f721
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] Show talk pages to users with fewer than 5 edits - change (mediawiki...MobileFrontend)

2015-12-23 Thread Ebe123 (Code Review)
Ebe123 has uploaded a new change for review.

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

Change subject: Show talk pages to users with fewer than 5 edits
..

Show talk pages to users with fewer than 5 edits

Per discussion at T119337, the condition of having 5 edits before
being shown talk pages has been removed.

Bug: T122311
Change-Id: I0c0a8d63c1bf5e1223869c8a63d3bb4ab079e0a4
---
M includes/skins/SkinMinerva.php
M includes/skins/SkinMinervaBeta.php
2 files changed, 1 insertion(+), 17 deletions(-)


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

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 6539231..d80ceba 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -931,13 +931,6 @@
}
 
/**
-* Checks, if an edit count > 5.
-*/
-   protected function isExperiencedUser() {
-   return $this->getUser()->getEditCount() > 5;
-   }
-
-   /**
 * Returns true, if the page can have a talk page.
 * @return boolean
 */
@@ -945,8 +938,7 @@
$title = $this->getTitle();
return $this->isAllowedPageAction( 'talk' ) &&
!$title->isTalkPage() &&
-   $title->canTalk() &&
-   $this->isExperiencedUser();
+   $title->canTalk();
}
 
/*
diff --git a/includes/skins/SkinMinervaBeta.php 
b/includes/skins/SkinMinervaBeta.php
index 2e9c5b2..a227d4f 100644
--- a/includes/skins/SkinMinervaBeta.php
+++ b/includes/skins/SkinMinervaBeta.php
@@ -168,14 +168,6 @@
}
 
/**
-* If the user is in beta mode, we assume, he is an experienced
-* user (he/she found the "beta" switch ;))
-*/
-   protected function isExperiencedUser() {
-   return true;
-   }
-
-   /**
 * Add talk, contributions, and uploads links at the top of the user 
page.
 *
 * @inheritdoc

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c0a8d63c1bf5e1223869c8a63d3bb4ab079e0a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Ebe123 

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


[MediaWiki-commits] [Gerrit] Upgrade mismatched commit() warnings to exceptions - change (mediawiki/core)

2015-12-23 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Upgrade mismatched commit() warnings to exceptions
..

Upgrade mismatched commit() warnings to exceptions

I saw no WMF logs for these in the last 7 days.

Change-Id: I725535925ba3fc68cee485767f18937fb8f239bf
---
M includes/db/Database.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/260888/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index 31e2653..a93f792 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -3563,7 +3563,10 @@
if ( !$this->mTrxLevel ) {
return; // nothing to do
} elseif ( !$this->mTrxAutomatic ) {
-   wfWarn( "$fname: Flushing an explicit 
transaction, getting out of sync!" );
+   throw new DBUnexpectedError(
+   $this,
+   "$fname: Flushing an explicit 
transaction, getting out of sync!"
+   );
}
} else {
if ( !$this->mTrxLevel ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I725535925ba3fc68cee485767f18937fb8f239bf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] Update DonationInterface submodule - change (mediawiki/core)

2015-12-23 Thread Awight (Code Review)
Awight has submitted this change and it was merged.

Change subject: Update DonationInterface submodule
..


Update DonationInterface submodule

Change-Id: Ia6cbb26884fb1aeb5b7618ea79ffe25ad3c30439
---
M extensions/DonationInterface
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 0b75c53..dd83772 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
-Subproject commit 0b75c534746e18d80a8beb35854fdd5eef344bc2
+Subproject commit dd83772f23c631c12c62f13a481efd89ae1c96a1

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6cbb26884fb1aeb5b7618ea79ffe25ad3c30439
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_25
Gerrit-Owner: Awight 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Update DonationInterface submodule - change (mediawiki/core)

2015-12-23 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Update DonationInterface submodule
..

Update DonationInterface submodule

Change-Id: Ia6cbb26884fb1aeb5b7618ea79ffe25ad3c30439
---
M extensions/DonationInterface
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 0b75c53..dd83772 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
-Subproject commit 0b75c534746e18d80a8beb35854fdd5eef344bc2
+Subproject commit dd83772f23c631c12c62f13a481efd89ae1c96a1

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6cbb26884fb1aeb5b7618ea79ffe25ad3c30439
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_25
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] Merge master into deployment - change (mediawiki...DonationInterface)

2015-12-23 Thread Awight (Code Review)
Awight has submitted this change and it was merged.

Change subject: Merge master into deployment
..


Merge master into deployment

574e1fbbb78b11fcd3d34e3032350ee42b0f44dc Warn BPay donors not to recycle 
reference numbers
f4fb166c53c1b4d201a498e1d4682dcd87f61e49 Don't allow user_ip in GET params

Change-Id: I19e9f846fae2daf051a1a33258e2507e7c0f6bb1
---
D tests/Adapter/GatewayAdapterTest.php
D tests/DonationDataTest.php
2 files changed, 0 insertions(+), 701 deletions(-)

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



diff --git a/tests/Adapter/GatewayAdapterTest.php 
b/tests/Adapter/GatewayAdapterTest.php
deleted file mode 100644
index bcc2e97..000
--- a/tests/Adapter/GatewayAdapterTest.php
+++ /dev/null
@@ -1,288 +0,0 @@
-<<< HEAD   (0b75c5 Merge branch 'master' into deployment)
-===
-setMwGlobals( array(
-   'wgDonationInterfaceAllowedHtmlForms' => array(
-   'testytest' => array(
-   'gateway' => 'globalcollect', //RAR.
-   ),
-   'rapidFailError' => array(
-   'file' => 'error-cc.html',
-   'gateway' => array ( 'globalcollect', 
'adyen', 'amazon', 'astropay', 'paypal', 'worldpay' ),
-   'special_type' => 'error',
-   )
-   ),
-   ) );
-   }
-
-   /**
-*
-* @covers GatewayAdapter::__construct
-* @covers GatewayAdapter::defineVarMap
-* @covers GatewayAdapter::defineReturnValueMap
-* @covers GatewayAdapter::defineTransactions
-*/
-   public function testConstructor() {
-
-   $options = $this->getDonorTestData();
-   $class = $this->testAdapterClass;
-
-   $_SERVER['REQUEST_URI'] = 
GatewayFormChooser::buildPaymentsFormURL( 'testytest', array ( 'gateway' => 
$class::getIdentifier() ) );
-   $gateway = $this->getFreshGatewayObject( $options );
-
-   $this->assertInstanceOf( TESTS_ADAPTER_DEFAULT, $gateway );
-
-   $this->resetAllEnv();
-   $gateway = $this->getFreshGatewayObject( $options = array ( ) );
-   $this->assertInstanceOf( TESTS_ADAPTER_DEFAULT, $gateway, 
"Having trouble constructing a blank adapter." );
-   }
-
-   /**
-*
-* @covers GatewayAdapter::__construct
-* @covers DonationData::__construct
-*/
-   public function testConstructorHasDonationData() {
-
-   $_SERVER['REQUEST_URI'] = 
'/index.php/Special:GlobalCollectGateway?form_name=TwoStepAmount';
-   
-   $options = $this->getDonorTestData();
-   $gateway = $this->getFreshGatewayObject( $options );
-
-   $this->assertInstanceOf( 'TestingGlobalCollectAdapter', 
$gateway );
-
-   //please define this function only inside the 
TESTS_ADAPTER_DEFAULT, 
-   //which should be a test adapter object that descende from one 
of the 
-   //production adapters.
-   $exposed = TestingAccessWrapper::newFromObject( $gateway );
-   $this->assertInstanceOf( 'DonationData', $exposed->dataObj );
-   }
-
-   public function testLanguageChange() {
-   $options = $this->getDonorTestData( 'US' );
-   $options['payment_method'] = 'cc';
-   $options['payment_submethod'] = 'visa';
-   $gateway = $this->getFreshGatewayObject( $options );
-
-   $exposed = TestingAccessWrapper::newFromObject( $gateway );
-   $this->assertEquals( $exposed->getData_Staged( 'language' ), 
'en', "'US' donor's language was inproperly set. Should be 'en'" );
-   $gateway->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
-   //so we know it tried to screw with the session and such.
-
-   $options = $this->getDonorTestData( 'NO' );
-   $gateway = $this->getFreshGatewayObject( $options );
-   $exposed = TestingAccessWrapper::newFromObject( $gateway );
-   $this->assertEquals( $exposed->getData_Staged( 'language' ), 
'no', "'NO' donor's language was inproperly set. Should be 'no'" );
-   }
-
-   /**
-* Make sure data is cleared out when changing gateways.
-* In particular, ensure order IDs aren't leaking.
-*/
-   public function testResetOnGatewaySwitch() {
-   //Fill the session with some GlobalCollect stuff
-   $init = $this->getDonorTestData( 'FR' );
-   $init['contribution_tracking_id'] = mt_rand();
-   $globalcollect_gateway = new TestingGlobalCollectAdapter( array 
(
-   'external_data' => $init,
-  

[MediaWiki-commits] [Gerrit] Merge master into deployment - change (mediawiki...DonationInterface)

2015-12-23 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Merge master into deployment
..

Merge master into deployment

574e1fbbb78b11fcd3d34e3032350ee42b0f44dc Warn BPay donors not to recycle 
reference numbers
f4fb166c53c1b4d201a498e1d4682dcd87f61e49 Don't allow user_ip in GET params

Change-Id: I19e9f846fae2daf051a1a33258e2507e7c0f6bb1
---
D tests/Adapter/GatewayAdapterTest.php
D tests/DonationDataTest.php
2 files changed, 0 insertions(+), 701 deletions(-)


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

diff --git a/tests/Adapter/GatewayAdapterTest.php 
b/tests/Adapter/GatewayAdapterTest.php
deleted file mode 100644
index bcc2e97..000
--- a/tests/Adapter/GatewayAdapterTest.php
+++ /dev/null
@@ -1,288 +0,0 @@
-<<< HEAD   (0b75c5 Merge branch 'master' into deployment)
-===
-setMwGlobals( array(
-   'wgDonationInterfaceAllowedHtmlForms' => array(
-   'testytest' => array(
-   'gateway' => 'globalcollect', //RAR.
-   ),
-   'rapidFailError' => array(
-   'file' => 'error-cc.html',
-   'gateway' => array ( 'globalcollect', 
'adyen', 'amazon', 'astropay', 'paypal', 'worldpay' ),
-   'special_type' => 'error',
-   )
-   ),
-   ) );
-   }
-
-   /**
-*
-* @covers GatewayAdapter::__construct
-* @covers GatewayAdapter::defineVarMap
-* @covers GatewayAdapter::defineReturnValueMap
-* @covers GatewayAdapter::defineTransactions
-*/
-   public function testConstructor() {
-
-   $options = $this->getDonorTestData();
-   $class = $this->testAdapterClass;
-
-   $_SERVER['REQUEST_URI'] = 
GatewayFormChooser::buildPaymentsFormURL( 'testytest', array ( 'gateway' => 
$class::getIdentifier() ) );
-   $gateway = $this->getFreshGatewayObject( $options );
-
-   $this->assertInstanceOf( TESTS_ADAPTER_DEFAULT, $gateway );
-
-   $this->resetAllEnv();
-   $gateway = $this->getFreshGatewayObject( $options = array ( ) );
-   $this->assertInstanceOf( TESTS_ADAPTER_DEFAULT, $gateway, 
"Having trouble constructing a blank adapter." );
-   }
-
-   /**
-*
-* @covers GatewayAdapter::__construct
-* @covers DonationData::__construct
-*/
-   public function testConstructorHasDonationData() {
-
-   $_SERVER['REQUEST_URI'] = 
'/index.php/Special:GlobalCollectGateway?form_name=TwoStepAmount';
-   
-   $options = $this->getDonorTestData();
-   $gateway = $this->getFreshGatewayObject( $options );
-
-   $this->assertInstanceOf( 'TestingGlobalCollectAdapter', 
$gateway );
-
-   //please define this function only inside the 
TESTS_ADAPTER_DEFAULT, 
-   //which should be a test adapter object that descende from one 
of the 
-   //production adapters.
-   $exposed = TestingAccessWrapper::newFromObject( $gateway );
-   $this->assertInstanceOf( 'DonationData', $exposed->dataObj );
-   }
-
-   public function testLanguageChange() {
-   $options = $this->getDonorTestData( 'US' );
-   $options['payment_method'] = 'cc';
-   $options['payment_submethod'] = 'visa';
-   $gateway = $this->getFreshGatewayObject( $options );
-
-   $exposed = TestingAccessWrapper::newFromObject( $gateway );
-   $this->assertEquals( $exposed->getData_Staged( 'language' ), 
'en', "'US' donor's language was inproperly set. Should be 'en'" );
-   $gateway->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
-   //so we know it tried to screw with the session and such.
-
-   $options = $this->getDonorTestData( 'NO' );
-   $gateway = $this->getFreshGatewayObject( $options );
-   $exposed = TestingAccessWrapper::newFromObject( $gateway );
-   $this->assertEquals( $exposed->getData_Staged( 'language' ), 
'no', "'NO' donor's language was inproperly set. Should be 'no'" );
-   }
-
-   /**
-* Make sure data is cleared out when changing gateways.
-* In particular, ensure order IDs aren't leaking.
-*/
-   public function testResetOnGatewaySwitch() {
-   //Fill the session with some GlobalCollect stuff
-   $init = $this->getDonorTestData( 'FR' );
-   $init['contribution_tracking_id'] = mt_rand();
-   $globalcollect_gateway = new TestingGlobalCollectAdapter( array 
(
-  

[MediaWiki-commits] [Gerrit] Don't allow user_ip in GET params - change (mediawiki...DonationInterface)

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

Change subject: Don't allow user_ip in GET params
..


Don't allow user_ip in GET params

Bug: T122093
Change-Id: Ida425d8894dc9605d572655403520b54c549b2dd
---
M gateway_common/DonationData.php
M tests/Adapter/GatewayAdapterTest.php
M tests/DonationDataTest.php
3 files changed, 24 insertions(+), 8 deletions(-)

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



diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index f7e9473..cc9cfa7 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -353,24 +353,21 @@
 * Sets user_ip and server_ip. 
 */
protected function setIPAddresses(){
-   //if we are coming in from the orphan slayer, the client ip 
should 
-   //already be populated with something un-local, and we'd want 
to keep 
-   //that.
-   if ( !$this->isSomething( 'user_ip' ) || $this->getVal( 
'user_ip' ) === '127.0.0.1' ){
+   if ( !$this->gateway->isBatchProcessor() ) {
+   // Refresh the IP from something authoritative, unless 
we're running
+   // a batch process.
$userIp = WmfFramework::getIP();
if ( $userIp ) {
$this->setVal( 'user_ip', $userIp );
}
}
-   
+
if ( array_key_exists( 'SERVER_ADDR', $_SERVER ) ){
$this->setVal( 'server_ip', $_SERVER['SERVER_ADDR'] );
} else {
//command line? 
$this->setVal( 'server_ip', '127.0.0.1' );
}
-   
-   
}

/**
diff --git a/tests/Adapter/GatewayAdapterTest.php 
b/tests/Adapter/GatewayAdapterTest.php
index 2bee06c..d14412f 100644
--- a/tests/Adapter/GatewayAdapterTest.php
+++ b/tests/Adapter/GatewayAdapterTest.php
@@ -263,5 +263,23 @@
$expectedURL = wfAppendQuery( $expectedTitle->getFullURL(), 
'uselang=en' );
$this->assertEquals( $expectedURL, $page );
}
+
+   public function testCannotOverrideIp() {
+   $data = $this->getDonorTestData( 'FR' );
+   unset( $data['country'] );
+   $data['user_ip'] = '8.8.8.8';
+
+   $gateway = $this->getFreshGatewayObject( $data );
+   $this->assertEquals( '127.0.0.1', 
$gateway->getData_Unstaged_Escaped( 'user_ip' ) );
+   }
+
+   public function testCanOverrideIpInBatchMode() {
+   $data = $this->getDonorTestData( 'FR' );
+   unset( $data['country'] );
+   $data['user_ip'] = '8.8.8.8';
+
+   $gateway = $this->getFreshGatewayObject( $data, array( 
'batch_mode' => true ) );
+   $this->assertEquals( '8.8.8.8', 
$gateway->getData_Unstaged_Escaped( 'user_ip' ) );
+   }
 }
 
diff --git a/tests/DonationDataTest.php b/tests/DonationDataTest.php
index bf9c87b..82fb273 100644
--- a/tests/DonationDataTest.php
+++ b/tests/DonationDataTest.php
@@ -149,7 +149,8 @@
'recurring' => '',
);
 
-   $ddObj = new DonationData( $this->getFreshGatewayObject( 
self::$initial_vars ), $expected ); //external data
+   $adapter = $this->getFreshGatewayObject( self::$initial_vars, 
array( 'batch_mode' => true ) );
+   $ddObj = new DonationData( $adapter, $expected ); //external 
data
$returned = $ddObj->getDataEscaped();
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida425d8894dc9605d572655403520b54c549b2dd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fail validation and present error page for bad country - change (mediawiki...DonationInterface)

2015-12-23 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Fail validation and present error page for bad country
..

Fail validation and present error page for bad country

If the country code does not exist or is blocked, fail validation and do
not make any processor API calls.  Present the error page because this
is not recoverable.

Bug: T120727
Change-Id: If8a661f3daf4dfa888f076df12eb3425151c1710
---
M DonationInterface.php
M gateway_common/DataValidator.php
M gateway_common/DonationData.php
M gateway_common/DonationLoggerFactory.php
M gateway_common/GatewayPage.php
M tests/GatewayPageTest.php
M tests/GatewayValidationTest.php
A tests/includes/OutputPageStub.php
8 files changed, 66 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/85/260885/1

diff --git a/DonationInterface.php b/DonationInterface.php
index 29bed19..3d8692c 100644
--- a/DonationInterface.php
+++ b/DonationInterface.php
@@ -1064,6 +1064,7 @@
$wgAutoloadClasses['DonationInterfaceTestCase'] = $testDir . 
'DonationInterfaceTestCase.php';
$wgAutoloadClasses['MockAmazonClient'] = $testDir . 
'includes/MockAmazonClient.php';
$wgAutoloadClasses['MockAmazonResponse'] = $testDir . 
'includes/MockAmazonResponse.php';
+   $wgAutoloadClasses['OutputPageStub'] = $testDir . 
'includes/OutputPageStub.php';
$wgAutoloadClasses['TestingQueue'] = $testDir . 
'includes/TestingQueue.php';
$wgAutoloadClasses['TestingAdyenAdapter'] = $testDir . 
'includes/test_gateway/TestingAdyenAdapter.php';
$wgAutoloadClasses['TestingAmazonAdapter'] = $testDir . 
'includes/test_gateway/TestingAmazonAdapter.php';
diff --git a/gateway_common/DataValidator.php b/gateway_common/DataValidator.php
index f0b83fd..18b63e5 100644
--- a/gateway_common/DataValidator.php
+++ b/gateway_common/DataValidator.php
@@ -559,8 +559,7 @@
if ( in_array( strtoupper($value), 
$wgDonationInterfaceForbiddenCountries ) ){
return false;
}
-   // TODO: return DataValidator::is_valid_iso_country_code( 
$value );
-   return true;
+   return DataValidator::is_valid_iso_country_code( $value );
}
 
/**
diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index cc9cfa7..b2ac541 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -437,6 +437,18 @@
}
}
 
+   if ( $country === 'XX' ) {
+   // FIXME: We renormalize many times, this error should 
only be emitted once,
+   // and should be at warning level once we've closed 
T120727. Kludge ensues.
+   // Also, incorrectly logs "XX" when we pass "".
+   static $logged_on_this_request = false;
+   if ( !$logged_on_this_request ) {
+   $logged_on_this_request = true;
+   $this->logger->error(
+   "Failed to set a country from 
[{$this->getVal( 'country' )}], setting to \"XX\"." );
+   }
+   }
+
if ( $country != $this->getVal( 'country' ) ) {
$this->setVal( 'country', $country );
}
diff --git a/gateway_common/DonationLoggerFactory.php 
b/gateway_common/DonationLoggerFactory.php
index 47f1fd8..1e058b9 100644
--- a/gateway_common/DonationLoggerFactory.php
+++ b/gateway_common/DonationLoggerFactory.php
@@ -16,8 +16,10 @@
public static $overrideLogger = null;
 
/**
-* @param GatewayAdapter $gateway Get settings from this instance
-* @param string $suffix Append this string to the gateway identifier
+* @param GatewayAdapter|null $gateway Get settings from this instance, 
or
+*statically if null
+* @param string $suffix Append this string to the gateway identifier,
+*for example, "_validator".
 * @param LogPrefixProvider $prefixer Optionally use this to override
 *prefixing via the gateway.
 * @return \Psr\Log\LoggerInterface
diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php
index 0e97d5b..25b2662 100644
--- a/gateway_common/GatewayPage.php
+++ b/gateway_common/GatewayPage.php
@@ -120,6 +120,14 @@
public function displayForm() {
global $wgOut;
 
+   // TODO: We should have a general way to mark a validation 
error as unrecoverable.
+   $validation_errors = $this->adapter->getValidationErrors();
+   if ( isset( $validation_errors['country'] ) ) {
+   // This is not going to work, sorry.
+   $this->displayFai

[MediaWiki-commits] [Gerrit] Don't allow user_ip in GET params - change (mediawiki...DonationInterface)

2015-12-23 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: Don't allow user_ip in GET params
..

Don't allow user_ip in GET params

Bug: T122093
Change-Id: Ida425d8894dc9605d572655403520b54c549b2dd
---
M gateway_common/DonationData.php
M tests/Adapter/GatewayAdapterTest.php
M tests/DonationDataTest.php
3 files changed, 24 insertions(+), 8 deletions(-)


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

diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index f7e9473..cc9cfa7 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -353,24 +353,21 @@
 * Sets user_ip and server_ip. 
 */
protected function setIPAddresses(){
-   //if we are coming in from the orphan slayer, the client ip 
should 
-   //already be populated with something un-local, and we'd want 
to keep 
-   //that.
-   if ( !$this->isSomething( 'user_ip' ) || $this->getVal( 
'user_ip' ) === '127.0.0.1' ){
+   if ( !$this->gateway->isBatchProcessor() ) {
+   // Refresh the IP from something authoritative, unless 
we're running
+   // a batch process.
$userIp = WmfFramework::getIP();
if ( $userIp ) {
$this->setVal( 'user_ip', $userIp );
}
}
-   
+
if ( array_key_exists( 'SERVER_ADDR', $_SERVER ) ){
$this->setVal( 'server_ip', $_SERVER['SERVER_ADDR'] );
} else {
//command line? 
$this->setVal( 'server_ip', '127.0.0.1' );
}
-   
-   
}

/**
diff --git a/tests/Adapter/GatewayAdapterTest.php 
b/tests/Adapter/GatewayAdapterTest.php
index 2bee06c..d14412f 100644
--- a/tests/Adapter/GatewayAdapterTest.php
+++ b/tests/Adapter/GatewayAdapterTest.php
@@ -263,5 +263,23 @@
$expectedURL = wfAppendQuery( $expectedTitle->getFullURL(), 
'uselang=en' );
$this->assertEquals( $expectedURL, $page );
}
+
+   public function testCannotOverrideIp() {
+   $data = $this->getDonorTestData( 'FR' );
+   unset( $data['country'] );
+   $data['user_ip'] = '8.8.8.8';
+
+   $gateway = $this->getFreshGatewayObject( $data );
+   $this->assertEquals( '127.0.0.1', 
$gateway->getData_Unstaged_Escaped( 'user_ip' ) );
+   }
+
+   public function testCanOverrideIpInBatchMode() {
+   $data = $this->getDonorTestData( 'FR' );
+   unset( $data['country'] );
+   $data['user_ip'] = '8.8.8.8';
+
+   $gateway = $this->getFreshGatewayObject( $data, array( 
'batch_mode' => true ) );
+   $this->assertEquals( '8.8.8.8', 
$gateway->getData_Unstaged_Escaped( 'user_ip' ) );
+   }
 }
 
diff --git a/tests/DonationDataTest.php b/tests/DonationDataTest.php
index bf9c87b..82fb273 100644
--- a/tests/DonationDataTest.php
+++ b/tests/DonationDataTest.php
@@ -149,7 +149,8 @@
'recurring' => '',
);
 
-   $ddObj = new DonationData( $this->getFreshGatewayObject( 
self::$initial_vars ), $expected ); //external data
+   $adapter = $this->getFreshGatewayObject( self::$initial_vars, 
array( 'batch_mode' => true ) );
+   $ddObj = new DonationData( $adapter, $expected ); //external 
data
$returned = $ddObj->getDataEscaped();
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida425d8894dc9605d572655403520b54c549b2dd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight 

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


[MediaWiki-commits] [Gerrit] url_downloader: Restrict to $INTERNAL only - change (operations/puppet)

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

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

Change subject: url_downloader: Restrict to $INTERNAL only
..

url_downloader: Restrict to $INTERNAL only

Change-Id: I330555b542298dd7c74fee04b8f8b5a578973512
---
M manifests/role/url_downloader.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/72/260872/1

diff --git a/manifests/role/url_downloader.pp b/manifests/role/url_downloader.pp
index e620fe7..aac0074 100644
--- a/manifests/role/url_downloader.pp
+++ b/manifests/role/url_downloader.pp
@@ -79,7 +79,7 @@
 ferm::service { 'url_downloader':
 proto  => 'tcp',
 port   => '8080',
-srange => '$ALL_NETWORKS',
+srange => '$INTERNAL',
 }
 
 # Monitoring

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

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

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


[MediaWiki-commits] [Gerrit] WIP: Port mediawiki.util to requires module - change (mediawiki/core)

2015-12-23 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: WIP: Port mediawiki.util to requires module
..

WIP: Port mediawiki.util to requires module

Change-Id: I8a4323bd56476caccb559b15ca543d64c5281f7c
---
M resources/src/mediawiki.special/mediawiki.special.unwatchedPages.js
M resources/src/mediawiki/mediawiki.jqueryMsg.js
M resources/src/mediawiki/mediawiki.util.js
3 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/83/260883/1

diff --git 
a/resources/src/mediawiki.special/mediawiki.special.unwatchedPages.js 
b/resources/src/mediawiki.special/mediawiki.special.unwatchedPages.js
index 7628ff8..3cdf0c3 100644
--- a/resources/src/mediawiki.special/mediawiki.special.unwatchedPages.js
+++ b/resources/src/mediawiki.special/mediawiki.special.unwatchedPages.js
@@ -2,13 +2,15 @@
  * JavaScript for Special:UnwatchedPages
  */
 ( function ( mw, $ ) {
+   var util = require( 'mediawiki.util' );
+
$( function () {
$( 'a.mw-watch-link' ).click( function ( e ) {
var promise,
api = new mw.Api(),
$link = $( this ),
$subjectLink = $link.closest( 'li' ).children( 
'a' ).eq( 0 ),
-   title = mw.util.getParamValue( 'title', 
$link.attr( 'href' ) );
+   title = util.getParamValue( 'title', 
$link.attr( 'href' ) );
// nice format
title = mw.Title.newFromText( title ).toText();
// Disable link whilst we're busy to avoid double 
handling
diff --git a/resources/src/mediawiki/mediawiki.jqueryMsg.js 
b/resources/src/mediawiki/mediawiki.jqueryMsg.js
index e905f69..1f186d8 100644
--- a/resources/src/mediawiki/mediawiki.jqueryMsg.js
+++ b/resources/src/mediawiki/mediawiki.jqueryMsg.js
@@ -12,6 +12,7 @@
 */
 
var oldParser,
+   util = require( 'mediawiki.util' ),
slice = Array.prototype.slice,
parserDefaults = {
magic: {
@@ -1030,7 +1031,7 @@
if ( page.charAt( 0 ) === ':' ) {
page = page.slice( 1 );
}
-   url = mw.util.getUrl( page );
+   url = util.getUrl( page );
 
if ( nodes.length === 1 ) {
// [[Some Page]] or [[Namespace:Some Page]]
diff --git a/resources/src/mediawiki/mediawiki.util.js 
b/resources/src/mediawiki/mediawiki.util.js
index 4cec813..924222b 100644
--- a/resources/src/mediawiki/mediawiki.util.js
+++ b/resources/src/mediawiki/mediawiki.util.js
@@ -548,5 +548,6 @@
}, 'Use mw.notify instead.' );
 
mw.util = util;
-
+   module.exports = util;
+   mw.log.deprecate( mw, 'util', util, 'Use `require("mediawiki.util")` 
instead.')
 }( mediaWiki, jQuery ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a4323bd56476caccb559b15ca543d64c5281f7c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] Allow blocking talk page access and send email access option... - change (mediawiki...CheckUser)

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

Change subject: Allow blocking talk page access and send email access optionally
..


Allow blocking talk page access and send email access optionally

Add two checkboxes for optionally disabling editing own talk page
and preventing from sending email to other users in block interface
at 'Get users'.

Bug: T41213
Change-Id: Ic1d8378007f1f1f05ae665b64ccd78247be7f6f0
---
M i18n/en.json
M i18n/qqq.json
M specials/SpecialCheckUser.php
3 files changed, 76 insertions(+), 23 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 4e7809e..c3fc7d1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -49,6 +49,8 @@
"checkuser-localonly": "Not unified",
"checkuser-massblock": "Block selected users",
"checkuser-massblock-text": "Selected accounts will be blocked 
indefinitely, with autoblocking of IP addresses enabled and account creation 
disabled.\nIP addresses will be blocked for one week for anonymous users only 
and account creation will be disabled.",
+   "checkuser-blockemail": "Prevent from sending email",
+   "checkuser-blocktalk": "Prevent from editing their own talk page while 
blocked",
"checkuser-blocktag": "Replace user pages with:",
"checkuser-blocktag-talk": "Replace talk pages with:",
"checkuser-massblock-commit": "Block selected users",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 37dd803..d6228b8 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -70,6 +70,8 @@
"checkuser-massblock-text": "Used as intro text for the form 
{{msg-mw|checkuser-massblock}}.",
"checkuser-blocktag": "[[File:Special-checkuser-get-users 
en.png|thumb|Checkuser interface]]Used as checkbox label in 
[[Special:CheckUser]].\n\nThis message is followed by \"tag\" input box. The 
input box is for text which replaces the entire wikitext of the concerned 
page.\n\nSee also:\n* {{msg-mw|Checkuser-blocktag-talk}}",
"checkuser-blocktag-talk": "[[File:Special-checkuser-get-users 
en.png|thumb|Checkuser interface]]Used as checkbox label in 
[[Special:CheckUser]].\n\nThis message is followed by \"talktag\" input box. 
The input box is for text which replaces the entire wikitext of the concerned 
page.\n\nSee also:\n* {{msg-mw|Checkuser-blocktag}}",
+   "checkuser-blockemail": "Used as a label for a checkbox asking to block 
email access.",
+   "checkuser-blocktalk": "Used as a label for a checkbox asking to block 
talk page access.",
"checkuser-massblock-commit": "Used as Submit button text in 
[[Special:CheckUser]].\n{{Identical|Block selected users}}",
"checkuser-block-success": "Used as success message in 
[[Special:CheckUser]].\n\nParameters:\n* $1 - a list of one or more 
usernames\n* $2 - the number of usernames in $1\n\nSee also:\n* 
{{msg-mw|Checkuser-block-failure}}\n* {{msg-mw|Checkuser-block-limit}}\n* 
{{msg-mw|Checkuser-block-noreason}}",
"checkuser-block-failure": "Used as failure message in 
[[Special:CheckUser]].\n\nSee also:\n* {{msg-mw|Checkuser-block-success}}\n* 
{{msg-mw|Checkuser-block-limit}}\n* {{msg-mw|Checkuser-block-noreason}}",
diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php
index 8bff1c6..624c3ad 100644
--- a/specials/SpecialCheckUser.php
+++ b/specials/SpecialCheckUser.php
@@ -17,7 +17,9 @@
$user = $request->getText( 'user', $request->getText( 'ip', 
$subpage ) );
$user = trim( $user );
$reason = $request->getText( 'reason' );
-   $blockreason = $request->getText( 'blockreason' );
+   $blockreason = $request->getText( 'blockreason', '' );
+   $disableUserTalk = $request->getBool( 'blocktalk', false );
+   $disableEmail = $request->getBool( 'blockemail', false );
$checktype = $request->getVal( 'checktype' );
$period = $request->getInt( 'period' );
$users = $request->getArray( 'users' );
@@ -25,6 +27,12 @@
trim( $request->getVal( 'tag' ) ) : '';
$talkTag = $request->getBool( 'usettag' ) ?
trim( $request->getVal( 'talktag' ) ) : '';
+
+   $blockParams = array(
+   'reason' => $blockreason,
+   'talk' => $disableUserTalk,
+   'email' => $disableEmail,
+   );
 
$m = array();
# An IPv4? An IPv6? CIDR included?
@@ -51,7 +59,7 @@
if ( !$this->getUser()->matchEditToken( 
$request->getVal( 'wpEditToken' ) ) ) {
$this->getOutput()->wrapWikiMsg( '$1', 'checkuser-token-fail' );
} elseif ( $request->getVal( 'action' ) === 'block' ) {
-   $this->doMassUserBlo

[MediaWiki-commits] [Gerrit] Add integration tests to each commit - change (mediawiki...MultimediaViewer)

2015-12-23 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Add integration tests to each commit
..

Add integration tests to each commit

Change-Id: Ib7579a43adc37b6e4add8b0ab75f99b6ab994bb6
---
M tests/browser/features/mmv.download.feature
M tests/browser/features/mmv.navigation.feature
M tests/browser/features/mmv.options.feature
M tests/browser/features/mmv.performance.feature
M tests/browser/features/step_definitions/mmv_steps.rb
A tests/browser/samples/MediaViewerE2ETest.wikitext
6 files changed, 19 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/81/260881/1

diff --git a/tests/browser/features/mmv.download.feature 
b/tests/browser/features/mmv.download.feature
index 18c1b8e..6a9ad6e 100644
--- a/tests/browser/features/mmv.download.feature
+++ b/tests/browser/features/mmv.download.feature
@@ -1,4 +1,4 @@
-@en.wikipedia.beta.wmflabs.org @firefox @chrome @internet_explorer_9 
@internet_explorer_10 @internet_explorer_11 @safari @test2.wikipedia.org
+@integration @en.wikipedia.beta.wmflabs.org @firefox @chrome 
@internet_explorer_9 @internet_explorer_10 @internet_explorer_11 @safari 
@test2.wikipedia.org
 Feature: Download menu
 
   Background:
diff --git a/tests/browser/features/mmv.navigation.feature 
b/tests/browser/features/mmv.navigation.feature
index b7b5180..0efa966 100644
--- a/tests/browser/features/mmv.navigation.feature
+++ b/tests/browser/features/mmv.navigation.feature
@@ -1,4 +1,4 @@
-@en.wikipedia.beta.wmflabs.org @firefox @chrome @internet_explorer_9 
@internet_explorer_10 @internet_explorer_11 @safari @test2.wikipedia.org
+@integration @en.wikipedia.beta.wmflabs.org @firefox @chrome 
@internet_explorer_9 @internet_explorer_10 @internet_explorer_11 @safari 
@test2.wikipedia.org
 Feature: Navigation
 
   Background:
diff --git a/tests/browser/features/mmv.options.feature 
b/tests/browser/features/mmv.options.feature
index 4ac4dd1..340a48c 100644
--- a/tests/browser/features/mmv.options.feature
+++ b/tests/browser/features/mmv.options.feature
@@ -1,4 +1,4 @@
-@en.wikipedia.beta.wmflabs.org @firefox @chrome @internet_explorer_9 
@internet_explorer_10 @internet_explorer_11 @safari @test2.wikipedia.org
+@integration @en.wikipedia.beta.wmflabs.org @firefox @chrome 
@internet_explorer_9 @internet_explorer_10 @internet_explorer_11 @safari 
@test2.wikipedia.org
 Feature: Options
 
   Background:
diff --git a/tests/browser/features/mmv.performance.feature 
b/tests/browser/features/mmv.performance.feature
index 1b1637c..55bb164 100644
--- a/tests/browser/features/mmv.performance.feature
+++ b/tests/browser/features/mmv.performance.feature
@@ -1,4 +1,4 @@
-@en.wikipedia.beta.wmflabs.org @custom-browser @mediawiki.org @firefox 
@internet_explorer_8 @internet_explorer_9 @internet_explorer_10 
@internet_explorer_11 @test2.wikipedia.org
+@integration @en.wikipedia.beta.wmflabs.org @custom-browser @mediawiki.org 
@firefox @internet_explorer_8 @internet_explorer_9 @internet_explorer_10 
@internet_explorer_11 @test2.wikipedia.org
 Feature: Multimedia Viewer performance
 
   Background:
diff --git a/tests/browser/features/step_definitions/mmv_steps.rb 
b/tests/browser/features/step_definitions/mmv_steps.rb
index d39afd1..c07ebb2 100644
--- a/tests/browser/features/step_definitions/mmv_steps.rb
+++ b/tests/browser/features/step_definitions/mmv_steps.rb
@@ -1,6 +1,7 @@
 # encoding: utf-8
 
 Given /^I am at a wiki article with at least two embedded pictures$/ do
+  api.create_page 'MediaViewerE2ETest', 
File.read('samples/MediaViewerE2ETest.wikitext')
   visit(E2ETestPage)
   on(E2ETestPage).image1_in_article_element.when_present.should be_visible
 end
diff --git a/tests/browser/samples/MediaViewerE2ETest.wikitext 
b/tests/browser/samples/MediaViewerE2ETest.wikitext
new file mode 100644
index 000..a920e77
--- /dev/null
+++ b/tests/browser/samples/MediaViewerE2ETest.wikitext
@@ -0,0 +1,14 @@
+PLEASE DO NOT EDIT THIS PAGE! IT NEEDS TO STAY THE SAME FOR THE PURPOSE 
OF AUTOMATED TESTING
+
+==Test Images==
+Here are some sample images for testing different features of Media Viewer. 
+
+[[File:Sunrise over fishing boats in Kerala.jpg|thumb|left|Sunrise over 
fishing boats]] 
[[File:Wikimedia_Foundation_2013_All_Hands_Offsite_-_Day_2_-_Photo_24.jpg|thumb|Tropical
 Fish Aquarium]]  [[File:Wikimania 2013 - Hong Kong - Photo 
090.jpg|thumb|center|Hong Kong Harbor at night]] 
+
+
+[[File:Wikimedia_Foundation_2013_All_Hands_Offsite_-_Day_2_-_Photo_16.jpg|thumb|left|Nautilus
 Shell at California Academy of Sciences]] 
[[File:Multimedia_Team_-_Wikimedia_Foundation.jpg|thumb|center|Multimedia 
Team]] [[File:Zonotrichia atricapilla -British Columbia, 
Canada-8.jpg|thumb|Golden-crowned Sparrow]] 
+
+
+[[File:Multimedia Roundtable 5 Photo 2.jpg|thumb|left|Multimedia Roundtable]]  
[[File:Wikimedia Foundation - Team 1 - California Ac

[MediaWiki-commits] [Gerrit] Bump domino to 1.0.21 - change (mediawiki...parsoid)

2015-12-23 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has submitted this change and it was merged.

Change subject: Bump domino to 1.0.21
..


Bump domino to 1.0.21

Change-Id: Ibe59c77d678a30562dcc3f8e00998df086703cd3
---
M npm-shrinkwrap.json
M package.json
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Arlolra: Looks good to me, approved
  Subramanya Sastry: Verified; Looks good to me, approved



diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 0eb9dee..730b825 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -2,7 +2,7 @@
   "name": "parsoid",
   "version": "0.4.1-git",
   "npm-shrinkwrap-version": "200.4.0",
-  "node-version": "v4.2.1",
+  "node-version": "v0.10.26",
   "dependencies": {
 "alea": {
   "version": "0.0.9",
@@ -425,8 +425,8 @@
   "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.7.tgz";
 },
 "domino": {
-  "version": "1.0.20",
-  "resolved": "https://registry.npmjs.org/domino/-/domino-1.0.20.tgz";
+  "version": "1.0.21",
+  "resolved": "https://registry.npmjs.org/domino/-/domino-1.0.21.tgz";
 },
 "entities": {
   "version": "1.1.1",
diff --git a/package.json b/package.json
index e63323a..9d3c3a2 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
 "connect-busboy": "^0.0.2",
 "core-js": "^1.2.6",
 "diff": "^1.0.7",
-"domino": "^1.0.20",
+"domino": "^1.0.21",
 "entities": "^1.1.1",
 "express": "^4.13.3",
 "express-handlebars": "^2.0.1",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe59c77d678a30562dcc3f8e00998df086703cd3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry 
Gerrit-Reviewer: Arlolra 
Gerrit-Reviewer: Cscott 
Gerrit-Reviewer: Subramanya Sastry 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] File-based result storage - change (thumbor/result-storage)

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

Change subject: File-based result storage
..


File-based result storage

Note that the first hash is based on the source URL, not on the original
file's sha1. We always have the option to make something more custom
to our needs later, which might parse the source URL and extract the
sha1 from it.

Bug: T118439
Change-Id: Ib3ba1d4d8c5344bf425d6dbcb23ceb1250811ba3
---
A LICENSE
A README.md
A requirements.txt
A setup.cfg
A setup.py
A tox.ini
A wikimedia_thumbor_result_storage/__init__.py
7 files changed, 144 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..133846d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Gilles Dubuc, Wikimedia Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/README.md b/README.md
new file mode 100644
index 000..31e7680
--- /dev/null
+++ b/README.md
@@ -0,0 +1,2 @@
+# result-storage
+File-based result storage for Thumbor
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000..ef29d7d
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+thumbor
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 000..b88034e
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,2 @@
+[metadata]
+description-file = README.md
diff --git a/setup.py b/setup.py
new file mode 100644
index 000..8483981
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+from setuptools import setup, find_packages
+
+
+setup(
+name='wikimedia_thumbor_result_storage',
+version='0.1.1',
+url='https://github.com/wikimedia/thumbor-result-storage',
+license='MIT',
+author='Gilles Dubuc, Wikimedia Foundation',
+description='Thumbor result file storage',
+packages=find_packages(),
+include_package_data=True,
+zip_safe=False,
+platforms='any',
+install_requires=[
+'thumbor',
+],
+extras_require={
+'tests': [
+'pyvows',
+'coverage',
+],
+},
+classifiers=[
+'Development Status :: 4 - Beta',
+'Intended Audience :: Developers',
+'License :: OSI Approved :: MIT License',
+'Operating System :: OS Independent',
+'Programming Language :: Python',
+'Topic :: Software Development :: Libraries :: Python Modules'
+]
+)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000..157253d
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8, py27
+
+[testenv]
+setenv = VIRTUAL_ENV={envdir}
+deps = -r{toxinidir}/requirements.txt
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
diff --git a/wikimedia_thumbor_result_storage/__init__.py 
b/wikimedia_thumbor_result_storage/__init__.py
new file mode 100644
index 000..f172206
--- /dev/null
+++ b/wikimedia_thumbor_result_storage/__init__.py
@@ -0,0 +1,71 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# Licensed under the MIT license:
+# http://www.opensource.org/licenses/mit-license
+# Copyright (c) 2015 Wikimedia Foundation
+
+import hashlib
+import shutil
+import urllib
+from os.path import exists, join
+
+from thumbor.result_storages.file_storage import Storage as BaseFileStorage
+
+
+class Storage(BaseFileStorage):
+def normalize_path(self, path):
+root_path = self.context.config.RESULT_STORAGE_FILE_STORAGE_ROOT_PATH
+rstripped_root_path = root_path.rstrip('/')
+path_segments = [
+rstripped_root_path,
+Storage.PATH_FORMAT_VERSION,
+]
+
+if self.is_auto_webp:
+path_segments.append('webp')
+
+decoded_path = urllib.unquote(path)
+
+# Hack, but thumbor passes the full path to this function
+# which doesn't let us disting

[MediaWiki-commits] [Gerrit] Add TIFF support - change (thumbor/vips-engine)

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

Change subject: Add TIFF support
..


Add TIFF support

Bug: T120203
Change-Id: I57e10664aa8515240f2d2d795d7f1dbee465d8df
---
M requirements.txt
M setup.py
M wikimedia_thumbor_vips_engine/__init__.py
3 files changed, 37 insertions(+), 4 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/requirements.txt b/requirements.txt
index ef29d7d..f89a389 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1 +1,2 @@
 thumbor
+wikimedia_thumbor_base_engine
diff --git a/setup.py b/setup.py
index 723e57d..a8a9dd0 100644
--- a/setup.py
+++ b/setup.py
@@ -16,6 +16,7 @@
 platforms='any',
 install_requires=[
 'thumbor',
+'wikimedia_thumbor_base_engine'
 ],
 extras_require={
 'tests': [
diff --git a/wikimedia_thumbor_vips_engine/__init__.py 
b/wikimedia_thumbor_vips_engine/__init__.py
index 04e5312..78d6b34 100644
--- a/wikimedia_thumbor_vips_engine/__init__.py
+++ b/wikimedia_thumbor_vips_engine/__init__.py
@@ -17,14 +17,45 @@
 from gi.repository import Vips
 
 from thumbor.engines import BaseEngine
+from wikimedia_thumbor_base_engine import BaseWikimediaEngine
+
+
+BaseWikimediaEngine.add_format(
+'image/tiff',
+'.tiff',
+lambda buffer: (
+buffer.startswith('II*\x00') or buffer.startswith('MM\x00*')
+)
+)
 
 
 class Engine(BaseEngine):
 def create_image(self, buffer):
-return Vips.Image().new_from_buffer(data=buffer, option_string=None)
+self.original_buffer = buffer
+option_string = None
+
+if BaseEngine.get_mimetype(buffer) == 'image/tiff':
+try:
+option_string = 'page=%d' % (self.context.request.page - 1)
+except AttributeError:
+pass
+
+img = Vips.Image().new_from_buffer(
+data=buffer,
+option_string=option_string
+)
+
+return img
 
 def read(self, extension=None, quality=None):
-return self.image.write_to_buffer(format_string=extension)
+# Save the potentially multipage original for TIFFs
+if extension == '.tiff' and quality is None:
+return self.original_buffer
+
+if extension in ('.tiff', '.jpg'):
+return self.image.write_to_buffer('.jpg')
+
+return self.image.write_to_buffer('.png')
 
 def resize(self, width, height):
 # In the context of thumbnailing we're fine with a resize
@@ -45,10 +76,10 @@
 )
 
 def should_run(self, extension, buffer):
-if extension != '.png':
+if extension not in ('.png', '.tiff'):
 return False
 
-image = self.create_image(buffer)
+image = Vips.Image().new_from_buffer(buffer, option_string=None)
 pixels = image.width * image.height
 
 if self.context.config.VIPS_ENGINE_MIN_PIXELS is None:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I57e10664aa8515240f2d2d795d7f1dbee465d8df
Gerrit-PatchSet: 4
Gerrit-Project: thumbor/vips-engine
Gerrit-Branch: master
Gerrit-Owner: Gilles 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Minimal VIPS engine - change (thumbor/vips-engine)

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

Change subject: Minimal VIPS engine
..


Minimal VIPS engine

Only supports resizing at the moment, which is all we need for PNGs.

Bug: T119184
Change-Id: I934fa827d9a8b958544c15930ed3a5608ad90fec
---
A LICENSE
A requirements.txt
A setup.py
A tox.ini
A wikimedia_thumbor_vips_engine/__init__.py
5 files changed, 133 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..133846d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Gilles Dubuc, Wikimedia Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000..ef29d7d
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+thumbor
diff --git a/setup.py b/setup.py
new file mode 100644
index 000..723e57d
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+from setuptools import setup, find_packages
+
+
+setup(
+name='wikimedia_thumbor_vips_engine',
+version='0.1.1',
+url='https://github.com/wikimedia/thumbor-vips-engine',
+license='MIT',
+author='Gilles Dubuc, Wikimedia Foundation',
+description='Thumbor VIPS engine',
+packages=find_packages(),
+include_package_data=True,
+zip_safe=False,
+platforms='any',
+install_requires=[
+'thumbor',
+],
+extras_require={
+'tests': [
+'pyvows',
+'coverage',
+],
+},
+classifiers=[
+'Development Status :: 4 - Beta',
+'Intended Audience :: Developers',
+'License :: OSI Approved :: MIT License',
+'Operating System :: OS Independent',
+'Programming Language :: Python',
+'Topic :: Software Development :: Libraries :: Python Modules'
+]
+)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000..9e359d2
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8
+
+[testenv]
+setenv = VIRTUAL_ENV={envdir}
+deps = -r{toxinidir}/requirements.txt
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
diff --git a/wikimedia_thumbor_vips_engine/__init__.py 
b/wikimedia_thumbor_vips_engine/__init__.py
new file mode 100644
index 000..04e5312
--- /dev/null
+++ b/wikimedia_thumbor_vips_engine/__init__.py
@@ -0,0 +1,64 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# thumbor imaging service
+# https://github.com/thumbor/thumbor/wiki
+
+# Licensed under the MIT license:
+# http://www.opensource.org/licenses/mit-license
+# Copyright (c) 2011 globo.com timeh...@corp.globo.com
+# Copyright (c) 2015 Wikimedia Foundation
+
+# VIPS engine
+# Very minimal, only supports resizing and cropping, no filters
+
+import gi
+gi.require_version('Vips', '8.0')
+from gi.repository import Vips
+
+from thumbor.engines import BaseEngine
+
+
+class Engine(BaseEngine):
+def create_image(self, buffer):
+return Vips.Image().new_from_buffer(data=buffer, option_string=None)
+
+def read(self, extension=None, quality=None):
+return self.image.write_to_buffer(format_string=extension)
+
+def resize(self, width, height):
+# In the context of thumbnailing we're fine with a resize
+# that always conserves the original aspect ratio, which is
+# what vips_resize() does.
+#
+# This is how Thumbor behaves for basic AxB requests anyway,
+# it resizes while keeping the aspect ratio first, then calls
+# crop().
+self.image = self.image.resize(width / self.size[0])
+
+def crop(self, left, top, right, bottom):
+self.image = self.image.extract_area(
+left,
+top,
+right - left,
+  

[MediaWiki-commits] [Gerrit] DjVu engine - change (thumbor/djvu-engine)

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

Change subject: DjVu engine
..


DjVu engine

Bug: T120202
Change-Id: I6c250ed28e4a4e838dbe3e1534ee39acb8845e4d
---
A LICENSE
A requirements.txt
A setup.py
A tox.ini
A wikimedia_thumbor_djvu_engine/__init__.py
5 files changed, 141 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..133846d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Gilles Dubuc, Wikimedia Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000..0ece6fc
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+thumbor
+wikimedia_thumbor_tiff_engine
\ No newline at end of file
diff --git a/setup.py b/setup.py
new file mode 100644
index 000..30f078b
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+
+from setuptools import setup, find_packages
+
+
+setup(
+name='wikimedia_thumbor_djvu_engine',
+version='0.1.1',
+url='https://github.com/wikimedia/thumbor-djvu-engine',
+license='MIT',
+author='Gilles Dubuc, Wikimedia Foundation',
+description='Thumbor DjVu engine',
+packages=find_packages(),
+include_package_data=True,
+zip_safe=False,
+platforms='any',
+install_requires=[
+'thumbor',
+'wikimedia_thumbor_tiff_engine'
+],
+extras_require={
+'tests': [
+'pyvows',
+'coverage',
+],
+},
+classifiers=[
+'Development Status :: 4 - Beta',
+'Intended Audience :: Developers',
+'License :: OSI Approved :: MIT License',
+'Operating System :: OS Independent',
+'Programming Language :: Python',
+'Topic :: Software Development :: Libraries :: Python Modules'
+]
+)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000..9e359d2
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8
+
+[testenv]
+setenv = VIRTUAL_ENV={envdir}
+deps = -r{toxinidir}/requirements.txt
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
diff --git a/wikimedia_thumbor_djvu_engine/__init__.py 
b/wikimedia_thumbor_djvu_engine/__init__.py
new file mode 100644
index 000..4cc8c27
--- /dev/null
+++ b/wikimedia_thumbor_djvu_engine/__init__.py
@@ -0,0 +1,70 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# thumbor imaging service
+# https://github.com/thumbor/thumbor/wiki
+
+# Licensed under the MIT license:
+# http://www.opensource.org/licenses/mit-license
+# Copyright (c) 2011 globo.com timeh...@corp.globo.com
+# Copyright (c) 2015 Wikimedia Foundation
+
+# DjVu engine
+
+from wikimedia_thumbor_tiff_engine import Engine as TiffEngine
+
+
+TiffEngine.add_format(
+'image/vnd.djvu',
+'.djvu',
+lambda buffer: buffer.startswith('FORM', 4, 8) and
+(
+buffer.startswith('DJVU', 12, 16) or
+buffer.startswith('DJVM', 12, 16) or
+buffer.startswith('PM44', 12, 16) or
+buffer.startswith('BM44', 12, 16)
+)
+)
+
+
+class Engine(TiffEngine):
+def should_run(self, extension, buffer):
+return extension == '.djvu'
+
+def create_image(self, buffer):
+self.djvu_buffer = buffer
+self.prepare_temp_files(buffer)
+
+try:
+page = self.context.request.page
+except AttributeError:
+page = 1
+
+command = [
+self.context.config.DDJVU_PATH,
+'-format=tiff',
+'-page=%d' % page,
+self.source.name,
+self.destination.name
+]
+
+tiff = self.exec_command(command)
+self.extension = '.tiff'
+
+# TiffEngine reads page a we

[MediaWiki-commits] [Gerrit] Ghostscript engine - change (thumbor/ghostscript-engine)

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

Change subject: Ghostscript engine
..


Ghostscript engine

Bug: T120207
Change-Id: I60d92731c0806bace1e4012009f9d20ba8ee0df1
---
A LICENSE
A requirements.txt
A setup.py
A tox.ini
A wikimedia_thumbor_ghostscript_engine/__init__.py
5 files changed, 135 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..133846d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Gilles Dubuc, Wikimedia Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000..6f55aaa
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+thumbor
+wikimedia_thumbor_base_engine
\ No newline at end of file
diff --git a/setup.py b/setup.py
new file mode 100644
index 000..a9a5691
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+
+from setuptools import setup, find_packages
+
+
+setup(
+name='wikimedia_thumbor_ghostscript_engine',
+version='0.1.1',
+url='https://github.com/wikimedia/thumbor-ghostscript-engine',
+license='MIT',
+author='Gilles Dubuc, Wikimedia Foundation',
+description='Thumbor Ghostscript engine',
+packages=find_packages(),
+include_package_data=True,
+zip_safe=False,
+platforms='any',
+install_requires=[
+'thumbor',
+'wikimedia_thumbor_base_engine'
+],
+extras_require={
+'tests': [
+'pyvows',
+'coverage',
+],
+},
+classifiers=[
+'Development Status :: 4 - Beta',
+'Intended Audience :: Developers',
+'License :: OSI Approved :: MIT License',
+'Operating System :: OS Independent',
+'Programming Language :: Python',
+'Topic :: Software Development :: Libraries :: Python Modules'
+]
+)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000..9e359d2
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8
+
+[testenv]
+setenv = VIRTUAL_ENV={envdir}
+deps = -r{toxinidir}/requirements.txt
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
diff --git a/wikimedia_thumbor_ghostscript_engine/__init__.py 
b/wikimedia_thumbor_ghostscript_engine/__init__.py
new file mode 100644
index 000..59da1df
--- /dev/null
+++ b/wikimedia_thumbor_ghostscript_engine/__init__.py
@@ -0,0 +1,64 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# thumbor imaging service
+# https://github.com/thumbor/thumbor/wiki
+
+# Licensed under the MIT license:
+# http://www.opensource.org/licenses/mit-license
+# Copyright (c) 2011 globo.com timeh...@corp.globo.com
+# Copyright (c) 2015 Wikimedia Foundation
+
+# Ghostscript engine
+
+from wikimedia_thumbor_base_engine import BaseWikimediaEngine
+
+
+BaseWikimediaEngine.add_format(
+'application/pdf',
+'.pdf',
+lambda buffer: buffer.startswith('%PDF')
+)
+
+
+class Engine(BaseWikimediaEngine):
+def should_run(self, extension, buffer):
+return extension == '.pdf'
+
+def create_image(self, buffer):
+self.pdf_buffer = buffer
+self.prepare_temp_files(buffer)
+
+try:
+page = self.context.request.page
+except AttributeError:
+page = 1
+
+command = [
+self.context.config.GHOSTSCRIPT_PATH,
+"-sDEVICE=jpeg",
+"-sOutputFile=%s" % self.destination.name,
+"-dFirstPage=%d" % page,
+"-dLastPage=%d" % page,
+"-r150",
+"-dBATCH",
+"-dNOPAUSE",
+"-q",
+"-f%s" % self.source.name
+]
+
+jpg = self.exec_command(command)
+self.extension 

[MediaWiki-commits] [Gerrit] TIFF engine - change (thumbor/tiff-engine)

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

Change subject: TIFF engine
..


TIFF engine

Bug: T120203
Change-Id: I3a1c12707f329e7e49937b51de049719aacae597
---
A LICENSE
A requirements.txt
A setup.py
A tox.ini
A wikimedia_thumbor_tiff_engine/__init__.py
5 files changed, 123 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..133846d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Gilles Dubuc, Wikimedia Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000..6f55aaa
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+thumbor
+wikimedia_thumbor_base_engine
\ No newline at end of file
diff --git a/setup.py b/setup.py
new file mode 100644
index 000..26cb9aa
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+
+from setuptools import setup, find_packages
+
+
+setup(
+name='wikimedia_thumbor_tiff_engine',
+version='0.1.1',
+url='https://github.com/wikimedia/thumbor-tiff-engine',
+license='MIT',
+author='Gilles Dubuc, Wikimedia Foundation',
+description='Thumbor TIFF engine',
+packages=find_packages(),
+include_package_data=True,
+zip_safe=False,
+platforms='any',
+install_requires=[
+'thumbor',
+'wikimedia_thumbor_base_engine'
+],
+extras_require={
+'tests': [
+'pyvows',
+'coverage',
+],
+},
+classifiers=[
+'Development Status :: 4 - Beta',
+'Intended Audience :: Developers',
+'License :: OSI Approved :: MIT License',
+'Operating System :: OS Independent',
+'Programming Language :: Python',
+'Topic :: Software Development :: Libraries :: Python Modules'
+]
+)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000..9e359d2
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8
+
+[testenv]
+setenv = VIRTUAL_ENV={envdir}
+deps = -r{toxinidir}/requirements.txt
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
diff --git a/wikimedia_thumbor_tiff_engine/__init__.py 
b/wikimedia_thumbor_tiff_engine/__init__.py
new file mode 100644
index 000..642dcc2
--- /dev/null
+++ b/wikimedia_thumbor_tiff_engine/__init__.py
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# thumbor imaging service
+# https://github.com/thumbor/thumbor/wiki
+
+# Licensed under the MIT license:
+# http://www.opensource.org/licenses/mit-license
+# Copyright (c) 2011 globo.com timeh...@corp.globo.com
+# Copyright (c) 2015 Wikimedia Foundation
+
+# TIFF engine
+
+from wikimedia_thumbor_base_engine import BaseWikimediaEngine
+
+
+BaseWikimediaEngine.add_format(
+'image/tiff',
+'.tiff',
+lambda buffer: buffer.startswith('II*\x00') or buffer.startswith('MM\x00*')
+)
+
+
+class Engine(BaseWikimediaEngine):
+def should_run(self, extension, buffer):
+return extension == '.tiff'
+
+def create_image(self, buffer):
+self.tiff_buffer = buffer
+img = super(Engine, self).create_image(buffer)
+
+try:
+page = self.context.request.page
+img.seek(page - 1)
+except (AttributeError, EOFError):
+page = 1
+img.seek(0)
+
+self.extension = '.jpg'
+
+return img
+
+def read(self, extension=None, quality=None):
+if extension == '.tiff' and quality is None:
+# We're saving the source, let's save the TIFF
+return self.tiff_buffer
+
+# Beyond this point we're saving the JPG result
+if extension == '.tiff':
+extension = '.jpg'
+
+

[MediaWiki-commits] [Gerrit] XCF engine - change (thumbor/xcf-engine)

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

Change subject: XCF engine
..


XCF engine

Bug: T120201
Change-Id: I6bdb53b9ab8f259a92675fbfe132a9f1f5e4d079
---
A LICENSE
A requirements.txt
A setup.py
A tox.ini
A wikimedia_thumbor_xcf_engine/__init__.py
5 files changed, 124 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..133846d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Gilles Dubuc, Wikimedia Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000..6f55aaa
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+thumbor
+wikimedia_thumbor_base_engine
\ No newline at end of file
diff --git a/setup.py b/setup.py
new file mode 100644
index 000..1419d29
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+
+from setuptools import setup, find_packages
+
+
+setup(
+name='wikimedia_thumbor_xcf_engine',
+version='0.1.1',
+url='https://github.com/wikimedia/thumbor-xcf-engine',
+license='MIT',
+author='Gilles Dubuc, Wikimedia Foundation',
+description='Thumbor XCF engine',
+packages=find_packages(),
+include_package_data=True,
+zip_safe=False,
+platforms='any',
+install_requires=[
+'thumbor',
+'wikimedia_thumbor_base_engine'
+],
+extras_require={
+'tests': [
+'pyvows',
+'coverage',
+],
+},
+classifiers=[
+'Development Status :: 4 - Beta',
+'Intended Audience :: Developers',
+'License :: OSI Approved :: MIT License',
+'Operating System :: OS Independent',
+'Programming Language :: Python',
+'Topic :: Software Development :: Libraries :: Python Modules'
+]
+)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000..9e359d2
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8
+
+[testenv]
+setenv = VIRTUAL_ENV={envdir}
+deps = -r{toxinidir}/requirements.txt
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
diff --git a/wikimedia_thumbor_xcf_engine/__init__.py 
b/wikimedia_thumbor_xcf_engine/__init__.py
new file mode 100644
index 000..501c901
--- /dev/null
+++ b/wikimedia_thumbor_xcf_engine/__init__.py
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# thumbor imaging service
+# https://github.com/thumbor/thumbor/wiki
+
+# Licensed under the MIT license:
+# http://www.opensource.org/licenses/mit-license
+# Copyright (c) 2011 globo.com timeh...@corp.globo.com
+# Copyright (c) 2015 Wikimedia Foundation
+
+# XCF engine
+
+from wikimedia_thumbor_base_engine import BaseWikimediaEngine
+
+
+BaseWikimediaEngine.add_format(
+'image/xcf',
+'.xcf',
+lambda buffer: buffer.startswith('gimp xcf')
+)
+
+
+class Engine(BaseWikimediaEngine):
+def should_run(self, extension, buffer):
+return extension == '.xcf'
+
+def create_image(self, buffer):
+self.xcf_buffer = buffer
+self.prepare_temp_files(buffer)
+
+command = [
+self.context.config.XCF2PNG_PATH,
+self.source.name,
+'-o',
+self.destination.name
+]
+
+png = self.exec_command(command)
+self.extension = '.png'
+
+return super(Engine, self).create_image(png)
+
+def read(self, extension=None, quality=None):
+if extension == '.xcf' and quality is None:
+# We're saving the source, let's save the XCF
+return self.xcf_buffer
+
+# Beyond this point we're saving the PNG result
+if extension == '.xcf':
+extension = '.png'
+
+return 

[MediaWiki-commits] [Gerrit] Page filter - change (thumbor/page)

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

Change subject: Page filter
..


Page filter

Needed by multipage formats (PDF, DjVu, TIFF)

Bug: T120207
Bug: T120202
Bug: T120203
Change-Id: I0e6cfb805c60b6bcbcad9be4d71dc2f5e8f8d74f
---
A LICENSE
A requirements.txt
A setup.py
A tox.ini
A wikimedia_thumbor_page/__init__.py
5 files changed, 91 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..133846d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Gilles Dubuc, Wikimedia Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000..ef29d7d
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+thumbor
diff --git a/setup.py b/setup.py
new file mode 100644
index 000..61a0de0
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+from setuptools import setup, find_packages
+
+
+setup(
+name='wikimedia_thumbor_page',
+version='0.1.1',
+url='https://github.com/wikimedia/thumbor-page',
+license='MIT',
+author='Gilles Dubuc, Wikimedia Foundation',
+description='Thumbor filter to pass page number',
+packages=find_packages(),
+include_package_data=True,
+zip_safe=False,
+platforms='any',
+install_requires=[
+'thumbor',
+],
+extras_require={
+'tests': [
+'pyvows',
+'coverage',
+],
+},
+classifiers=[
+'Development Status :: 4 - Beta',
+'Intended Audience :: Developers',
+'License :: OSI Approved :: MIT License',
+'Operating System :: OS Independent',
+'Programming Language :: Python',
+'Topic :: Software Development :: Libraries :: Python Modules'
+]
+)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000..9e359d2
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8
+
+[testenv]
+setenv = VIRTUAL_ENV={envdir}
+deps = -r{toxinidir}/requirements.txt
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
diff --git a/wikimedia_thumbor_page/__init__.py 
b/wikimedia_thumbor_page/__init__.py
new file mode 100644
index 000..5620a6d
--- /dev/null
+++ b/wikimedia_thumbor_page/__init__.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# thumbor imaging service
+# https://github.com/thumbor/thumbor/wiki
+
+# Licensed under the MIT license:
+# http://www.opensource.org/licenses/mit-license
+# Copyright (c) 2011 globo.com timeh...@corp.globo.com
+# Copyright (c) 2015 Wikimedia Foundation
+
+# Simply passes the page parameter
+
+from thumbor.filters import BaseFilter, filter_method, PHASE_PRE_LOAD
+
+
+class Filter(BaseFilter):
+phase = PHASE_PRE_LOAD
+
+@filter_method(BaseFilter.PositiveNumber)
+def page(self, value):
+self.context.request.page = value

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e6cfb805c60b6bcbcad9be4d71dc2f5e8f8d74f
Gerrit-PatchSet: 1
Gerrit-Project: thumbor/page
Gerrit-Branch: master
Gerrit-Owner: Gilles 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Thumbor filter to sharpen conditionally - change (thumbor/conditional-sharpen)

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

Change subject: Thumbor filter to sharpen conditionally
..


Thumbor filter to sharpen conditionally

Bug: T112545
Change-Id: I49ec108d11a2bfd544e454e073f872f52b9148c1
---
A LICENSE
A requirements.txt
A setup.py
A tox.ini
A wikimedia_thumbor_conditional_sharpen/__init__.py
5 files changed, 118 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..133846d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Gilles Dubuc, Wikimedia Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000..ef29d7d
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+thumbor
diff --git a/setup.py b/setup.py
new file mode 100644
index 000..e0b9b3c
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+from setuptools import setup, find_packages
+
+
+setup(
+name='wikimedia_thumbor_conditional_sharpen',
+version='0.1.1',
+url='https://github.com/wikimedia/thumbor-conditional-sharpen',
+license='MIT',
+author='Gilles Dubuc, Wikimedia Foundation',
+description='Thumbor filter sharpening conditionally',
+packages=find_packages(),
+include_package_data=True,
+zip_safe=False,
+platforms='any',
+install_requires=[
+'thumbor',
+],
+extras_require={
+'tests': [
+'pyvows',
+'coverage',
+],
+},
+classifiers=[
+'Development Status :: 4 - Beta',
+'Intended Audience :: Developers',
+'License :: OSI Approved :: MIT License',
+'Operating System :: OS Independent',
+'Programming Language :: Python',
+'Topic :: Software Development :: Libraries :: Python Modules'
+]
+)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000..9e359d2
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8
+
+[testenv]
+setenv = VIRTUAL_ENV={envdir}
+deps = -r{toxinidir}/requirements.txt
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
diff --git a/wikimedia_thumbor_conditional_sharpen/__init__.py 
b/wikimedia_thumbor_conditional_sharpen/__init__.py
new file mode 100644
index 000..d799833
--- /dev/null
+++ b/wikimedia_thumbor_conditional_sharpen/__init__.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# thumbor imaging service
+# https://github.com/thumbor/thumbor/wiki
+
+# Licensed under the MIT license:
+# http://www.opensource.org/licenses/mit-license
+# Copyright (c) 2011 globo.com timeh...@corp.globo.com
+# Copyright (c) 2015 Wikimedia Foundation
+
+# This is a fork of the thumbor.filters.sharpen filter
+# This version only applies the sharpening if the thumbnail resize
+# ratio is smaller than the resize ratio threshold passed as the
+# last parameter
+
+from thumbor.filters import BaseFilter, filter_method
+from thumbor.ext.filters import _sharpen
+
+
+class Filter(BaseFilter):
+
+@filter_method(
+BaseFilter.DecimalNumber,
+BaseFilter.DecimalNumber,
+BaseFilter.Boolean,
+BaseFilter.DecimalNumber
+)
+def conditional_sharpen(
+self,
+amount,
+radius,
+luminance_only,
+resize_ratio_threshold):
+
+width, height = self.engine.size
+original_width = self.engine.source_width
+original_height = self.engine.source_height
+mode, data = self.engine.image_data_as_rgb()
+source_sum = float(original_width + original_height)
+destination_sum = float(width + height)
+resize_ratio = destination_sum / source_sum
+
+if resize_r

[MediaWiki-commits] [Gerrit] ClippableElement: Try to prevent unnecessary scrollbars - change (oojs/ui)

2015-12-23 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: ClippableElement: Try to prevent unnecessary scrollbars
..

ClippableElement: Try to prevent unnecessary scrollbars

scOffset and ccOffset values, and thus also desiredWidth and
desiredHeight, can apparently be fractional. Browsers will actually
round them up when displaying, though, which means our code generated
unnecessary disabled scrollbars in some cases. Not sure how much sense
this change makes.

Bug: T122379
Change-Id: I17c08cc374dca423a3568a92edfa332065e438e4
---
M src/mixins/ClippableElement.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/80/260880/1

diff --git a/src/mixins/ClippableElement.js b/src/mixins/ClippableElement.js
index 68af84b..3b33a44 100644
--- a/src/mixins/ClippableElement.js
+++ b/src/mixins/ClippableElement.js
@@ -215,8 +215,8 @@
ccWidth + ccOffset.left :
( scOffset.left + scrollLeft + scWidth ) - ccOffset.left;
desiredHeight = ( scOffset.top + scrollTop + scHeight ) - ccOffset.top;
-   allotedWidth = desiredWidth - extraWidth;
-   allotedHeight = desiredHeight - extraHeight;
+   allotedWidth = Math.ceil( desiredWidth - extraWidth );
+   allotedHeight = Math.ceil( desiredHeight - extraHeight );
naturalWidth = this.$clippable.prop( 'scrollWidth' );
naturalHeight = this.$clippable.prop( 'scrollHeight' );
clipWidth = allotedWidth < naturalWidth;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I17c08cc374dca423a3568a92edfa332065e438e4
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] Bump domino to 1.0.21 - change (mediawiki...parsoid)

2015-12-23 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review.

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

Change subject: Bump domino to 1.0.21
..

Bump domino to 1.0.21

Change-Id: Ibe59c77d678a30562dcc3f8e00998df086703cd3
---
M npm-shrinkwrap.json
M package.json
2 files changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 0eb9dee..730b825 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -2,7 +2,7 @@
   "name": "parsoid",
   "version": "0.4.1-git",
   "npm-shrinkwrap-version": "200.4.0",
-  "node-version": "v4.2.1",
+  "node-version": "v0.10.26",
   "dependencies": {
 "alea": {
   "version": "0.0.9",
@@ -425,8 +425,8 @@
   "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.7.tgz";
 },
 "domino": {
-  "version": "1.0.20",
-  "resolved": "https://registry.npmjs.org/domino/-/domino-1.0.20.tgz";
+  "version": "1.0.21",
+  "resolved": "https://registry.npmjs.org/domino/-/domino-1.0.21.tgz";
 },
 "entities": {
   "version": "1.1.1",
diff --git a/package.json b/package.json
index e63323a..9d3c3a2 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
 "connect-busboy": "^0.0.2",
 "core-js": "^1.2.6",
 "diff": "^1.0.7",
-"domino": "^1.0.20",
+"domino": "^1.0.21",
 "entities": "^1.1.1",
 "express": "^4.13.3",
 "express-handlebars": "^2.0.1",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe59c77d678a30562dcc3f8e00998df086703cd3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry 

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


[MediaWiki-commits] [Gerrit] Change wiki title styles to improve screen reader experience - change (mediawiki...Blueprint)

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

Change subject: Change wiki title styles to improve screen reader experience
..


Change wiki title styles to improve screen reader experience

Removing `text-decoration: uppercase` from wiki title to better
address screen reader usage. Also changing some styles to clarify
title.

Bug: T121569
Change-Id: I4b5f3b3a15cc6b3066cfabd78d7205dc0284d2b6
---
M resources/master.less
1 file changed, 2 insertions(+), 3 deletions(-)

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



diff --git a/resources/master.less b/resources/master.less
index a8917f8..abc31f7 100644
--- a/resources/master.less
+++ b/resources/master.less
@@ -246,9 +246,8 @@
margin-left: -2px;
padding-left: 27px;
padding-right: 40px;
-   font-size: .9em;
-   font-weight: 500;
-   text-transform: uppercase;
+   font-size: 1.1em;
+   font-weight: bold;
}
 
.navbar-head {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b5f3b3a15cc6b3066cfabd78d7205dc0284d2b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Blueprint
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: VolkerE 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Change wiki title styles to improve screen reader experience - change (mediawiki...Blueprint)

2015-12-23 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: Change wiki title styles to improve screen reader experience
..

Change wiki title styles to improve screen reader experience

Removing `text-decoration: uppercase` from wiki title to better
address screen reader usage. Also changing some styles to clarify
title.

Bug: T121569
Change-Id: I4b5f3b3a15cc6b3066cfabd78d7205dc0284d2b6
---
M resources/master.less
1 file changed, 2 insertions(+), 3 deletions(-)


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

diff --git a/resources/master.less b/resources/master.less
index a8917f8..abc31f7 100644
--- a/resources/master.less
+++ b/resources/master.less
@@ -246,9 +246,8 @@
margin-left: -2px;
padding-left: 27px;
padding-right: 40px;
-   font-size: .9em;
-   font-weight: 500;
-   text-transform: uppercase;
+   font-size: 1.1em;
+   font-weight: bold;
}
 
.navbar-head {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b5f3b3a15cc6b3066cfabd78d7205dc0284d2b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Blueprint
Gerrit-Branch: master
Gerrit-Owner: VolkerE 

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


[MediaWiki-commits] [Gerrit] Enable the jjb browser test job for RelatedArticles - change (integration/config)

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

Change subject: Enable the jjb browser test job for RelatedArticles
..


Enable the jjb browser test job for RelatedArticles

Bug: T120715
Change-Id: I39b9f292e95363addf8983eec5d08a0af527a163
---
M zuul/layout.yaml
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 2388f52..d8069a2 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -6953,6 +6953,10 @@
 check:
   - jsonlint
   - jshint
+test:
+  - mwext-mw-selenium
+postmerge:
+  - mwext-mw-selenium
 
   - name: mediawiki/extensions/RelatedSites
 template:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I39b9f292e95363addf8983eec5d08a0af527a163
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Shim the , , and pseudo-extensions - change (mediawiki...parsoid)

2015-12-23 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: Shim the , , and  pseudo-extensions
..

Shim the , , and  pseudo-extensions

Bug: T92997
Change-Id: I591e4ced70f6abda7112da9beb4a85b4ba7efa44
---
M bin/parserTests.js
A lib/ext/tag/Tag.js
M tests/parserTests-blacklist.js
M tests/parserTests.txt
4 files changed, 146 insertions(+), 7 deletions(-)


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

diff --git a/bin/parserTests.js b/bin/parserTests.js
index 62e8261..2583807 100755
--- a/bin/parserTests.js
+++ b/bin/parserTests.js
@@ -25,6 +25,7 @@
 var Util = require('../lib/utils/Util.js').Util;
 var Diff = require('../lib/utils/Diff.js').Diff;
 var Cite = require('../lib/ext/cite/Cite.js').Cite;
+var Tag = require('../lib/ext/tag/Tag.js');
 
 // Fetch up some of our wacky parser bits...
 var MWParserEnvironment = 
require('../lib/config/MWParserEnvironment.js').MWParserEnvironment;
@@ -1654,7 +1655,7 @@
 
// Enable  and  tags since we want to
// test Parsoid's native implementation of these tags.
-   var extensions = [Cite];
+   var extensions = [Cite, Tag];
 
// Send all requests to the mock API server.
parsoidConfig.mwApiMap.forEach(function(apiConf) {
diff --git a/lib/ext/tag/Tag.js b/lib/ext/tag/Tag.js
new file mode 100644
index 000..bc5d16b
--- /dev/null
+++ b/lib/ext/tag/Tag.js
@@ -0,0 +1,74 @@
+'use strict';
+require('../../../core-upgrade.js');
+
+var defines = require('../../wt2html/parser.defines.js');
+var Util = require('../../utils/Util.js').Util;
+var DU = require('../../utils/DOMUtils.js').DOMUtils;
+
+// Define some constructor shortcuts
+var KV = defines.KV;
+var TagTk = defines.TagTk;
+var EndTagTk = defines.EndTagTk;
+var SelfclosingTagTk = defines.SelfclosingTagTk;
+
+/**
+ * See tests/parser/parserTestsParserHook.php in core.
+ */
+
+var myLittleHelper = function(env, extToken, argDict, html, cb) {
+   var tsr = extToken.dataAttribs.tsr;
+
+   if (!extToken.dataAttribs.tagWidths[1]) {
+   argDict.body = null;  // Serialize to self-closing.
+   }
+
+   var addWrapperAttrs = function(firstNode) {
+   firstNode.setAttribute('typeof', 'mw:Extension/' + 
argDict.name);
+   DU.storeDataMw(firstNode, argDict);
+   DU.storeDataParsoid(firstNode, {
+   tsr: Util.clone(tsr),
+   src: extToken.dataAttribs.src,
+   });
+   };
+
+   var tokens = DU.buildDOMFragmentTokens(
+   env, extToken, html, addWrapperAttrs,
+   { setDSR: true, isForeignContent: true }
+   );
+
+   cb({ tokens: tokens });
+};
+
+var dumpHook = function(manager, pipelineOpts, extToken, cb) {
+   // All the interesting info is in data-mw.
+   var html = '';
+   var argDict = Util.getArgInfo(extToken).dict;
+   myLittleHelper(manager.env, extToken, argDict, html, cb);
+}
+
+// Async processing means this isn't guaranteed to be in the right order.
+// Plus, parserTests reuses the environment so state is bound to clash.
+var staticTagHook = function(manager, pipelineOpts, extToken, cb) {
+   var argDict = Util.getArgInfo(extToken).dict;
+   var html;
+   if (argDict.attrs.action === 'flush') {
+   html = '' + this.state.buf + '';
+   this.state.buf = '';  // Reset.
+   } else {
+   // FIXME: Choose a better DOM representation that doesn't mess 
with
+   // newline constraints.
+   html = '';
+   this.state.buf += argDict.body.extsrc;
+   }
+   myLittleHelper(manager.env, extToken, argDict, html, cb);
+}
+
+// Tag constructor
+module.exports = function() {
+   this.state = { buf: '' };
+   this.tokenHandlers = {
+   'tag': dumpHook,
+   'tåg': dumpHook,
+   'statictag': staticTagHook.bind(this),
+   };
+};
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index a039543..8b2e252 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -357,6 +357,7 @@
 add("wt2wt", "Opera -o-link CSS", "X");
 add("wt2wt", "Table attribute legitimate extension", "{|\n! 
style=\"color:blue\" + | status\n|}");
 add("wt2wt", "Table attribute safety", "{|\n! 
style=\"border-width:expression(0+alert(document.cookie))\" + 
| status\n|}");
+add("wt2wt", "Parser hook: nested tags", 
"");
 add("wt2wt", "Sanitizer: Validating that  and  work, but only for 
Microdata", "\n\t\n\t\n\t\n\t\n\t\n\t\n");
 add("wt2wt", "Fuzz testing: Parser13", "{| \n| http: / a |\n|}");
 add("wt2wt", "Fuzz testing: Parser14-table", "==a==\n{| 
style=\"__TOC__\"\n|}");
@@ -548,6 +549,7 @@
 add("html2html", "Table attribute safety", "\n\n 
status\n\n");
 add("html2html

[MediaWiki-commits] [Gerrit] Pass in env when constructing WikiConf - change (mediawiki...parsoid)

2015-12-23 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: Pass in env when constructing WikiConf
..

Pass in env when constructing WikiConf

 * Reverts some of d29d0cdf0da857ca50251683e208934f3f2cdcac ...

Change-Id: I11dd57c3a324965907b4c891339b658eb57e19da
---
M lib/config/MWParserEnvironment.js
M lib/config/WikiConfig.js
2 files changed, 19 insertions(+), 22 deletions(-)


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

diff --git a/lib/config/MWParserEnvironment.js 
b/lib/config/MWParserEnvironment.js
index a96be77..acbcbee 100644
--- a/lib/config/MWParserEnvironment.js
+++ b/lib/config/MWParserEnvironment.js
@@ -69,11 +69,7 @@
// `ConfigRequest` along the way. Perhaps worth seeing if that can be
// eliminated so `WikiConfig` can't be instantiated without a 
`resultConf`.
console.assert(parsoidConfig.mwApiMap.has(options.prefix));
-   this.conf.wiki = new WikiConfig(
-   null, options.prefix,
-   parsoidConfig.mwApiMap.get(options.prefix).uri,
-   this.getAPIProxy(options.prefix)
-   );
+   this.conf.wiki = new WikiConfig(this, null, options.prefix);
 
// Store this in the environment to manipulate it on each request,
// if necessary. Avoids having to clone the config.
@@ -344,18 +340,18 @@
var nothingToDo = {};  // unique marker value
var parsoid = env.conf.parsoid;
 
-   var uri;
+   var uri, proxy;
var getConfigPromise = Promise.method(function() {
if (!prefix || !parsoid.mwApiMap.has(prefix)) {
throw new Error('No API URI available for prefix: ' + 
prefix);
} else {
uri = parsoid.mwApiMap.get(prefix).uri;
+   proxy = env.getAPIProxy(prefix);
if (env.confCache[prefix]) {
env.conf.wiki = env.confCache[prefix];
return nothingToDo;
} else if (parsoid.fetchConfig) {
-   return ConfigRequest
-   .promise(uri, env, 
env.getAPIProxy(prefix));
+   return ConfigRequest.promise(uri, env, proxy);
} else {
// Load the config from cached config on disk
var localConfigFile = './baseconfig/' + prefix 
+ '.json';
@@ -372,15 +368,7 @@
 
return getConfigPromise().then(function(resultConf) {
if (resultConf === nothingToDo) { return; }
-   // Warn about older versions ( 1.21 matches baseconfigs )
-   var generator = resultConf.general.generator || '';
-   var apiVersion = parseFloat(generator.substr('MediaWiki 
'.length));
-   if (Number.isNaN(apiVersion) || apiVersion < 1.21) {
-   env.log('warning', 'The MediaWiki API appears to be 
very old and' +
-   ' may not support necessary features. Proceed 
with caution!');
-   }
-   env.conf.wiki = new WikiConfig(resultConf, prefix, uri,
-   env.getAPIProxy(prefix));
+   env.conf.wiki = new WikiConfig(env, resultConf, prefix);
env.confCache[prefix] = env.conf.wiki;
}).nodify(cb);
 };
diff --git a/lib/config/WikiConfig.js b/lib/config/WikiConfig.js
index 5de3bbc..be8bf9a 100644
--- a/lib/config/WikiConfig.js
+++ b/lib/config/WikiConfig.js
@@ -18,12 +18,11 @@
  * Per-wiki configuration object.
  *
  * @constructor
+ * @param {MWParserEnvironment} env Pointer to the environment that 
constructed this conf.
  * @param {Object} resultConf The configuration object from a MediaWiki API 
request. See the #ConfigRequest class in lib/mediawiki.ApiRequest.js for 
information about how we get this object. If null, we use the contents of 
lib/mediawiki.BaseConfig.json instead.
  * @param {string} prefix The interwiki prefix this config will represent. 
Will be used for caching elsewhere in the code.
- * @param {string} apiURI The URI that represents this wiki's API endpoint. 
Usually ends in api.php.
- * @param {string} [apiProxy] The proxy that should be used to access apiURI.
  */
-function WikiConfig(resultConf, prefix, apiURI, apiProxy) {
+function WikiConfig(env, resultConf, prefix) {
var nsid, name;
var conf = this;
 
@@ -32,6 +31,14 @@
resultConf = baseConfig;
}
var general = resultConf.general;
+
+   // Warn about older versions ( 1.21 matches baseconfigs )
+   var generator = general.generator || '';
+   var apiVersion = parseFloat(generator.substr('MediaWiki '.length));
+   if (Number.isNaN(apiVersion) || apiVersion < 1.21) {
+   env.lo

[MediaWiki-commits] [Gerrit] Make getLagFromPtHeartbeat() always use the LB cluster maste... - change (mediawiki/core)

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

Change subject: Make getLagFromPtHeartbeat() always use the LB cluster master 
entry
..


Make getLagFromPtHeartbeat() always use the LB cluster master entry

Before, it just used the immediate master entry, which could be another
slave. In that case, it may not even exists at all.

Bug: T119648
Change-Id: Iea970b81ad2c9855aafcccf0bb0662fc0b3a8d4d
---
M includes/db/Database.php
M includes/db/DatabaseMysqlBase.php
M includes/db/loadbalancer/LoadBalancer.php
M tests/phpunit/includes/db/DatabaseMysqlBaseTest.php
M tests/phpunit/includes/db/LBFactoryTest.php
5 files changed, 164 insertions(+), 23 deletions(-)

Approvals:
  Jcrespo: Looks good to me, but someone else must approve
  Legoktm: Looks good to me, approved
  Hashar: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/db/Database.php b/includes/db/Database.php
index dea4a59..31e2653 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -148,6 +148,9 @@
 */
private $mTrxWriteDuration = 0.0;
 
+   /** @var IDatabase|null Lazy handle to the master DB this server 
replicates from */
+   private $lazyMasterHandle;
+
/**
 * @since 1.21
 * @var resource File handle for upgrade
@@ -329,6 +332,25 @@
}
 
/**
+* Set a lazy-connecting DB handle to the master DB (for replication 
status purposes)
+*
+* @param IDatabase $conn
+* @since 1.27
+*/
+   public function setLazyMasterHandle( IDatabase $conn ) {
+   $this->lazyMasterHandle = $conn;
+   }
+
+   /**
+* @return IDatabase|null
+* @see setLazyMasterHandle()
+* @since 1.27
+*/
+   public function getLazyMasterHandle() {
+   return $this->lazyMasterHandle;
+   }
+
+   /**
 * @return TransactionProfiler
 */
protected function getTransactionProfiler() {
diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index ca568ad..c3cdf35 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -621,11 +621,18 @@
abstract protected function mysqlPing();
 
function getLag() {
-   if ( $this->lagDetectionMethod === 'pt-heartbeat' ) {
+   if ( $this->getLagDetectionMethod() === 'pt-heartbeat' ) {
return $this->getLagFromPtHeartbeat();
} else {
return $this->getLagFromSlaveStatus();
}
+   }
+
+   /**
+* @return string
+*/
+   protected function getLagDetectionMethod() {
+   return $this->lagDetectionMethod;
}
 
/**
@@ -645,35 +652,82 @@
 * @return bool|float
 */
protected function getLagFromPtHeartbeat() {
-   $key = wfMemcKey( 'mysql', 'master-server-id', 
$this->getServer() );
-   $masterId = intval( $this->srvCache->get( $key ) );
-   if ( !$masterId ) {
-   $res = $this->query( 'SHOW SLAVE STATUS', __METHOD__ );
-   $row = $res ? $res->fetchObject() : false;
-   if ( $row && strval( $row->Master_Server_Id ) !== '' ) {
-   $masterId = intval( $row->Master_Server_Id );
-   $this->srvCache->set( $key, $masterId, 30 );
-   }
+   $masterInfo = $this->getMasterServerInfo();
+   if ( !$masterInfo ) {
+   return false; // could not get master server ID
}
 
-   if ( !$masterId ) {
-   return false;
-   }
+   list( $time, $nowUnix ) = $this->getHeartbeatData( 
$masterInfo['serverId'] );
+   if ( $time !== null ) {
+   // @time is in ISO format like 
"2015-09-25T16:48:10.000510"
+   $dateTime = new DateTime( $time, new DateTimeZone( 
'UTC' ) );
+   $timeUnix = (int)$dateTime->format( 'U' ) + 
$dateTime->format( 'u' ) / 1e6;
 
-   $res = $this->query(
-   "SELECT TIMESTAMPDIFF(MICROSECOND,ts,UTC_TIMESTAMP(6)) 
AS Lag " .
-   "FROM heartbeat.heartbeat WHERE server_id = $masterId"
-   );
-   $row = $res ? $res->fetchObject() : false;
-   if ( $row ) {
-   return max( floatval( $row->Lag ) / 1e6, 0.0 );
+   return max( $nowUnix - $timeUnix, 0.0 );
}
 
return false;
}
 
+   protected function getMasterServerInfo() {
+   $cache = $this->srvCache;
+   $key = $cache->makeGlobalKey(
+   'mysql',
+   'master-info'

[MediaWiki-commits] [Gerrit] VE: Mark all graphs with ver 1 - change (mediawiki...Graph)

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

Change subject: VE: Mark all graphs with ver 1
..


VE: Mark all graphs with ver 1

At the moment all graphs generated by Graph VE ext are saved
without the version, which will be required soon because the 
default is about to be changed.

Bug: T121915
Change-Id: Ic748290593ea7a3415bc236df16715f8325ebc6e
(cherry picked from commit 6d781b2f038a357eaa48e3d51d01d1bb2b5f58a6)
---
M modules/ve-graph/tests/ext.graph.visualEditor.test.js
M modules/ve-graph/ve.dm.MWGraphNode.js
2 files changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/modules/ve-graph/tests/ext.graph.visualEditor.test.js 
b/modules/ve-graph/tests/ext.graph.visualEditor.test.js
index 23de4ea..fd53477 100644
--- a/modules/ve-graph/tests/ext.graph.visualEditor.test.js
+++ b/modules/ve-graph/tests/ext.graph.visualEditor.test.js
@@ -11,6 +11,7 @@
 
var sampleSpecs = {
areaGraph: {
+   version: 1,
width: 500,
height: 200,
padding: {
@@ -95,6 +96,7 @@
},
 
stackedAreaGraph: {
+   version: 1,
width: 500,
height: 200,
padding: {
@@ -245,6 +247,7 @@
},
 
invalidAxesBarGraph: {
+   version: 1,
width: 500,
height: 200,
padding: {
@@ -404,6 +407,7 @@
]
},
areaGraphRemovalExpected = {
+   version: 1,
width: 500,
height: 200,
padding: {
diff --git a/modules/ve-graph/ve.dm.MWGraphNode.js 
b/modules/ve-graph/ve.dm.MWGraphNode.js
index 1545c5d..9876aac 100644
--- a/modules/ve-graph/ve.dm.MWGraphNode.js
+++ b/modules/ve-graph/ve.dm.MWGraphNode.js
@@ -55,6 +55,7 @@
 ve.dm.MWGraphNode.static.extensionName = 'graph';
 
 ve.dm.MWGraphNode.static.defaultSpec = {
+   version: 1,
width: 400,
height: 200,
data: [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic748290593ea7a3415bc236df16715f8325ebc6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: wmf/1.27.0-wmf.9
Gerrit-Owner: Yurik 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Initial commit - Setup fabric deployment for wikimetrics - change (analytics/wikimetrics-deploy)

2015-12-23 Thread Madhuvishy (Code Review)
Madhuvishy has submitted this change and it was merged.

Change subject: Initial commit - Setup fabric deployment for wikimetrics
..


Initial commit - Setup fabric deployment for wikimetrics

Change-Id: Ia9d336450921ad8d031fe61479788ea72773cbcf
---
A .gitignore
A requirements.txt
2 files changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..0d20b64
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.pyc
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000..e1bd974
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+git+https://gerrit.wikimedia.org/r/analytics/wikimetrics@master#egg=wikimetrics
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9d336450921ad8d031fe61479788ea72773cbcf
Gerrit-PatchSet: 2
Gerrit-Project: analytics/wikimetrics-deploy
Gerrit-Branch: master
Gerrit-Owner: Madhuvishy 
Gerrit-Reviewer: Madhuvishy 

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


[MediaWiki-commits] [Gerrit] WIP Testing mwext-mw-selenium job - change (mediawiki...MultimediaViewer)

2015-12-23 Thread Dduvall (Code Review)
Dduvall has uploaded a new change for review.

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

Change subject: WIP Testing mwext-mw-selenium job
..

WIP Testing mwext-mw-selenium job

Change-Id: I3ee07d0e1335287578b5d6c97e763feabad51a85
---
M tests/browser/features/mmv.options.feature
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/tests/browser/features/mmv.options.feature 
b/tests/browser/features/mmv.options.feature
index 4ac4dd1..eae7680 100644
--- a/tests/browser/features/mmv.options.feature
+++ b/tests/browser/features/mmv.options.feature
@@ -4,6 +4,7 @@
   Background:
 Given I am viewing an image using MMV
 
+  @integration
   Scenario: Clicking the X icon on the enable confirmation closes the options 
menu
 Given I reenable MMV
 When I click the enable X icon
@@ -41,4 +42,4 @@
   Scenario: Disabling media viewer makes the next thumbnail click go to the 
file page
 Given I disable and close MMV
 When I click on the first image in the article
-Then I am taken to the file page
\ No newline at end of file
+Then I am taken to the file page

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ee07d0e1335287578b5d6c97e763feabad51a85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Dduvall 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: fa66dae..3231220 - change (mediawiki/extensions)

2015-12-23 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: fa66dae..3231220
..


Syncronize VisualEditor: fa66dae..3231220

Change-Id: I4061ffec388772074920fa56939f0f314d33601b
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index fa66dae..3231220 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit fa66daef6c52e8a55315d71d2201cfe8a2f8fbaf
+Subproject commit 3231220774f90caf8ca83e33ef429e46a8d3ab81

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4061ffec388772074920fa56939f0f314d33601b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 
Gerrit-Reviewer: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: fa66dae..3231220 - change (mediawiki/extensions)

2015-12-23 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: fa66dae..3231220
..

Syncronize VisualEditor: fa66dae..3231220

Change-Id: I4061ffec388772074920fa56939f0f314d33601b
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions 
refs/changes/74/260874/1

diff --git a/VisualEditor b/VisualEditor
index fa66dae..3231220 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit fa66daef6c52e8a55315d71d2201cfe8a2f8fbaf
+Subproject commit 3231220774f90caf8ca83e33ef429e46a8d3ab81

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4061ffec388772074920fa56939f0f314d33601b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] SET: Don't try to do any client-side section link magic if w... - change (mediawiki...VisualEditor)

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

Change subject: SET: Don't try to do any client-side section link magic if 
we're not supposed to.
..


SET: Don't try to do any client-side section link magic if we're not supposed 
to.

Ugh.

Bug: T121599
Change-Id: I47a93d5dbedc5ae989a2973fb793ac99edfb139a
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 11 insertions(+), 1 deletion(-)

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



diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 55cd5ff..d43a775 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -20,7 +20,7 @@
 ( function () {
var conf, tabMessages, uri, pageExists, viewUri, veEditUri, isViewPage, 
isEditPage,
pageCanLoadVE, init, support, targetPromise, enable, 
tempdisable, autodisable,
-   userPrefEnabled, initialWikitext,
+   userPrefEnabled, initialWikitext, multipleSectionEditLinks,
active = false,
progressStep = 0,
progressSteps = [
@@ -477,6 +477,14 @@
var $editsections = $( '#mw-content-text 
.mw-editsection' ),
bodyDir = $( 'body' ).css( 'direction' );
 
+   if ( !multipleSectionEditLinks ) {
+   // More horrible stuff to prevent the weird 
caller in
+   // 
ve.init.mw.DesktopArticleTarget.prototype.saveComplete
+   // from having any effect when we wouldn't 
normally get
+   // called at all.
+   return;
+   }
+
// Match direction of the user interface
// TODO: Why is this needed? It seems to work fine 
without.
if ( $editsections.css( 'direction' ) !== bodyDir ) {
@@ -788,6 +796,7 @@
mw.user.options.get( 'visualeditor-tabs' ) !== 
'multi-tab' &&
userPrefEnabled
) {
+   multipleSectionEditLinks = false;
if (
pageCanLoadVE && (
mw.user.options.get( 
'visualeditor-tabs' ) === 'prefer-ve' ||
@@ -809,6 +818,7 @@
} );
}
} else if ( userPrefEnabled ) {
+   multipleSectionEditLinks = true;
init.setupSkin();
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I47a93d5dbedc5ae989a2973fb793ac99edfb139a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Run MultimediaViewer browser tests on each commit - change (integration/config)

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

Change subject: Run MultimediaViewer browser tests on each commit
..


Run MultimediaViewer browser tests on each commit

Note this will run no browser tests until certain browser
tests are marked @integration

Bug: T113620
Change-Id: I78727ce68b45f3a6305291e6e1e596b62069fc21
---
M zuul/layout.yaml
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 78332ec..2388f52 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -4164,7 +4164,10 @@
   - name: npm
 check:
   - jsonlint
+test:
+  - mwext-mw-selenium
 postmerge:
+  - mwext-mw-selenium
   - mwext-MultimediaViewer-jsduck-publish
 
   - name: mediawiki/extensions/MwEmbedSupport

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I78727ce68b45f3a6305291e6e1e596b62069fc21
Gerrit-PatchSet: 3
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Added links to online API documentation in docstrings of som... - change (pywikibot/core)

2015-12-23 Thread Yujwey (Code Review)
Yujwey has uploaded a new change for review.

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

Change subject: Added links to online API documentation in docstrings of some 
APISite methods
..

Added links to online API documentation in docstrings of some APISite methods

Change-Id: Ice6342f49b7ccde14e1d0e83af0f69ef1014c8f3
---
M pywikibot/site.py
1 file changed, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/73/260873/1

diff --git a/pywikibot/site.py b/pywikibot/site.py
index 0bbf596..9c49241 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2000,7 +2000,11 @@
 return auth_token is not None and len(auth_token) == 4
 
 def login(self, sysop=False):
-"""Log the user in if not already logged in."""
+"""
+Log the user in if not already logged in.
+
+U{https://www.mediawiki.org/wiki/API:Login}
+"""
 # TODO: this should include an assert that loginstatus
 #   is not already IN_PROGRESS, however the
 #   login status may be left 'IN_PROGRESS' because
@@ -2074,6 +2078,8 @@
 Also logs out of the global account if linked to the user.
 
 @raises APIError: Logout is not available when OAuth enabled.
+
+U{https://www.mediawiki.org/wiki/API:Logout}
 """
 if self.is_oauth_token_available():
 pywikibot.warning('Using OAuth suppresses logout function')
@@ -2097,6 +2103,8 @@
 
 @param force: force to retrieve userinfo ignoring cache
 @type force: bool
+
+U{https://www.mediawiki.org/wiki/API:Userinfo}
 """
 if force or not hasattr(self, '_userinfo'):
 uirequest = self._simple_request(
@@ -2155,6 +2163,8 @@
 @param sysop: If true, log in to sysop account (if available)
 @type sysop: bool
 @rtype: bool
+
+U{https://www.mediawiki.org/wiki/API:Userinfo}
 """
 if not self.logged_in(sysop):
 self.login(sysop)
@@ -2234,6 +2244,8 @@
 * Actions: edit, move, delete, protect, upload
 * User levels: autoconfirmed, sysop, bot
 
+U{https://www.mediawiki.org/wiki/API:Userinfo}
+
 """
 if not self.logged_in(sysop):
 self.login(sysop)
@@ -2245,6 +2257,8 @@
 Possible values of 'group' may vary depending on wiki settings,
 but will usually include bot.
 
+U{https://www.mediawiki.org/wiki/API:Userinfo}
+
 """
 if not self.logged_in(sysop):
 self.login(sysop)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice6342f49b7ccde14e1d0e83af0f69ef1014c8f3
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Yujwey 

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


[MediaWiki-commits] [Gerrit] Add bounding box searches - change (mediawiki...GeoData)

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

Change subject: Add bounding box searches
..


Add bounding box searches

Bug: T112034
Change-Id: I0f64b8f60d9f0433e7143ff65d7cd5270d7c23cb
---
M GeoData.php
M api/ApiQueryGeoSearch.php
M api/ApiQueryGeoSearchDb.php
M api/ApiQueryGeoSearchElastic.php
M i18n/en.json
M i18n/qqq.json
A includes/BoundingBox.php
M includes/Coord.php
M includes/GeoData.body.php
M includes/GeoDataHooks.php
M includes/GeoDataMath.php
A tests/BoundingBoxTest.php
M tests/CoordTest.php
M tests/GeoDataMathTest.php
A tests/GeoSearchTest.php
15 files changed, 298 insertions(+), 97 deletions(-)

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



diff --git a/GeoData.php b/GeoData.php
index 9ea451a..7346bfa 100644
--- a/GeoData.php
+++ b/GeoData.php
@@ -18,6 +18,7 @@
 $wgAutoloadClasses['ApiQueryGeoSearchDb'] = "$dir/api/ApiQueryGeoSearchDb.php";
 $wgAutoloadClasses['ApiQueryGeoSearchElastic'] = 
"$dir/api/ApiQueryGeoSearchElastic.php";
 
+$wgAutoloadClasses['BoundingBox'] = "$dir/includes/BoundingBox.php";
 $wgAutoloadClasses['Coord'] = "$dir/includes/Coord.php";
 $wgAutoloadClasses['CoordinatesOutput'] = 
"$dir/includes/CoordinatesOutput.php";
 $wgAutoloadClasses['CoordinatesParserFunction'] = 
"$dir/includes/CoordinatesParserFunction.php";
@@ -61,7 +62,9 @@
 // === start configuration settings ===
 
 /**
- * Maximum radius for geospatial searches.
+ * Maximum radius in metres for geospatial searches around a point.
+ * For bounding box based searches, the area must not exceed R^2*4.
+ *
  * The greater this variable is, the louder your server ouches.
  */
 $wgMaxGeoSearchRadius = 1; // 10km
diff --git a/api/ApiQueryGeoSearch.php b/api/ApiQueryGeoSearch.php
index d649778..1677927 100644
--- a/api/ApiQueryGeoSearch.php
+++ b/api/ApiQueryGeoSearch.php
@@ -3,7 +3,25 @@
 abstract class ApiQueryGeoSearch extends ApiQueryGeneratorBase {
const MIN_RADIUS = 10;
 
-   protected $lat, $lon, $radius, $idToExclude;
+   /**
+* @var Coord The center of search area
+*/
+   protected $coord;
+
+   /**
+* @var BoundingBox Bounding box to search in
+*/
+   protected $bbox;
+
+   /**
+* @var int Search radius
+*/
+   protected $radius;
+
+   /**
+* @var int Id of the page to search around, exclude from results
+*/
+   protected $idToExclude;
 
public function __construct( $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'gs' );
@@ -21,20 +39,43 @@
$this->run( $resultPageSet );
}
 
+   private function parseBbox( $bbox ) {
+   global $wgMaxGeoSearchRadius;
+
+   $parts = explode( '|', $bbox );
+   $vals = array_map( 'floatval', $parts );
+   if ( count( $parts ) != 4
+   // Pass $parts here for extra validation
+   || !GeoData::validateCoord( $parts[0], $parts[1] )
+   || !GeoData::validateCoord( $parts[2], $parts[3] )
+   || $vals[0] <= $vals[2]
+   ) {
+   $this->dieUsage( 'Invalid bounding box', 
'_invalid-bbox' );
+   }
+   $bbox = new BoundingBox( $vals[0], $vals[1], $vals[2], $vals[3] 
);
+   $area = $bbox->area();
+   if ( $area > $wgMaxGeoSearchRadius * $wgMaxGeoSearchRadius * 4
+   || $area < 100
+   ) {
+   $this->dieUsage( 'Bounding box is too big', '_toobig' );
+   }
+
+   return $bbox;
+   }
+
/**
 * @param ApiPageSet $resultPageSet
 */
protected function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
 
-   $this->requireOnlyOneParameter( $params, 'coord', 'page' );
+   $this->requireOnlyOneParameter( $params, 'coord', 'page', 
'bbox' );
if ( isset( $params['coord'] ) ) {
$arr = explode( '|', $params['coord'] );
if ( count( $arr ) != 2 || !GeoData::validateCoord( 
$arr[0], $arr[1], $params['globe'] ) ) {
$this->dieUsage( 'Invalid coordinate provided', 
'_invalid-coord' );
}
-   $lat = $arr[0];
-   $lon = $arr[1];
+   $this->coord = new Coord( floatval( $arr[0] ), 
floatval( $arr[1] ), $params['globe'] );
} elseif ( isset( $params['page'] ) ) {
$t = Title::newFromText( $params['page'] );
if ( !$t || !$t->canExist() ) {
@@ -43,13 +84,17 @@
if ( !$t->exists() ) {
$this->dieUsage( "Page ``{$params['page']}'' 
does not ex

[MediaWiki-commits] [Gerrit] Allow $wgInterwikiCache to be an associative array - change (mediawiki/core)

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

Change subject: Allow $wgInterwikiCache to be an associative array
..


Allow $wgInterwikiCache to be an associative array

For the same reasons wikiversions.cdb was converted to a PHP file -- viz., that
static arrays in PHP files get cached in HHVM's bytecode cache and are
therefore faster to use with HHVM than CDB files.

Bug: T122362
Change-Id: I5a979f047031ef211622f399df9b3b388797f53a
---
M includes/DefaultSettings.php
M includes/interwiki/Interwiki.php
2 files changed, 30 insertions(+), 15 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  Ori.livneh: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 54216fd..a1cda86 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3884,10 +3884,13 @@
  */
 
 /**
- *$wgInterwikiCache specifies path to constant database file.
+ * Interwiki cache, either as an associative array or a path to a constant
+ * database (.cdb) file.
  *
- * This cdb database is generated by dumpInterwiki from maintenance and has
- * such key formats:
+ * This data structure database is generated by the `dumpInterwiki` maintenance
+ * script (which lives in the WikimediaMaintenance repository) and has key
+ * formats such as the following:
+ *
  *  - dbname:key - a simple key (e.g. enwiki:meta)
  *  - _sitename:key - site-scope key (e.g. wiktionary:meta)
  *  - __global:key - global-scope key (e.g. __global:meta)
@@ -3895,6 +3898,8 @@
  *
  * Sites mapping just specifies site name, other keys provide "local url"
  * data layout.
+ *
+ * @var bool|array|string
  */
 $wgInterwikiCache = false;
 
diff --git a/includes/interwiki/Interwiki.php b/includes/interwiki/Interwiki.php
index bd8291f..be16bcf 100644
--- a/includes/interwiki/Interwiki.php
+++ b/includes/interwiki/Interwiki.php
@@ -137,7 +137,7 @@
$value = self::getInterwikiCacheEntry( $prefix );
 
$s = new Interwiki( $prefix );
-   if ( $value != '' ) {
+   if ( $value ) {
// Split values
list( $local, $url ) = explode( ' ', $value, 2 );
$s->mURL = $url;
@@ -155,34 +155,31 @@
 * @note More logic is explained in DefaultSettings.
 *
 * @param string $prefix Database key
-* @return string The interwiki entry
+* @return bool|string The interwiki entry or false if not found
 */
protected static function getInterwikiCacheEntry( $prefix ) {
-   global $wgInterwikiCache, $wgInterwikiScopes, 
$wgInterwikiFallbackSite;
-   static $db, $site;
+   global $wgInterwikiScopes, $wgInterwikiFallbackSite;
+   static $site;
 
wfDebug( __METHOD__ . "( $prefix )\n" );
$value = false;
try {
-   if ( !$db ) {
-   $db = CdbReader::open( $wgInterwikiCache );
-   }
-   /* Resolve site name */
+   // Resolve site name
if ( $wgInterwikiScopes >= 3 && !$site ) {
-   $site = $db->get( '__sites:' . wfWikiID() );
+   $site = self::getCacheValue( '__sites:' . 
wfWikiID() );
if ( $site == '' ) {
$site = $wgInterwikiFallbackSite;
}
}
 
-   $value = $db->get( wfMemcKey( $prefix ) );
+   $value = self::getCacheValue( wfMemcKey( $prefix ) );
// Site level
if ( $value == '' && $wgInterwikiScopes >= 3 ) {
-   $value = $db->get( "_{$site}:{$prefix}" );
+   $value = self::getCacheValue( 
"_{$site}:{$prefix}" );
}
// Global Level
if ( $value == '' && $wgInterwikiScopes >= 2 ) {
-   $value = $db->get( "__global:{$prefix}" );
+   $value = self::getCacheValue( 
"__global:{$prefix}" );
}
if ( $value == 'undef' ) {
$value = '';
@@ -195,6 +192,19 @@
return $value;
}
 
+   private static function getCacheValue( $key ) {
+   global $wgInterwikiCache;
+   static $reader;
+   if ( $reader === null ) {
+   $reader = is_array( $wgInterwikiCache ) ? false : 
CdbReader::open( $wgInterwikiCache );
+   }
+   if ( $reader ) {
+   return $reader->get( $key );
+   

[MediaWiki-commits] [Gerrit] Promote skins.minerva.beta.images icons to stable - change (mediawiki...MobileFrontend)

2015-12-23 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Promote skins.minerva.beta.images icons to stable
..

Promote skins.minerva.beta.images icons to stable

These were originally added way back in the days we were adding
the max-width and when pushing to stable these were overlooked.

So let's correct this wrong, remove the need for skins.minerva.beta.images
and delete the unused icons for the menu experiment we ran that we
are currently sending to all our beta users.

Change-Id: I099ee5cf3d20ddbb25ce238effe102dffe50fc10
---
D images/icons/beta/back-ltr.svg
D images/icons/beta/edit.svg
D images/icons/beta/editLocked.svg
D images/icons/beta/watch.svg
D images/icons/beta/watched.svg
M images/icons/edit.svg
M images/icons/editLocked.svg
D images/icons/magnifying-glass.svg
M images/icons/watch.svg
M includes/Resources.php
M includes/skins/SkinMinervaBeta.php
11 files changed, 36 insertions(+), 101 deletions(-)


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

diff --git a/images/icons/beta/back-ltr.svg b/images/icons/beta/back-ltr.svg
deleted file mode 100644
index 71c1f8a..000
--- a/images/icons/beta/back-ltr.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
-http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px" viewBox="0 0 24 24" 
enable-background="new 0 0 24 24" xml:space="preserve">
-
-   
-   
-
-
\ No newline at end of file
diff --git a/images/icons/beta/edit.svg b/images/icons/beta/edit.svg
deleted file mode 100644
index e21a14e..000
--- a/images/icons/beta/edit.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
-http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
-viewBox="0 0 24 24" enable-background="new 0 0 24 24" 
xml:space="preserve">
-
-
-
-   
-
-
diff --git a/images/icons/beta/editLocked.svg b/images/icons/beta/editLocked.svg
deleted file mode 100644
index 24032bc..000
--- a/images/icons/beta/editLocked.svg
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
-http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
-viewBox="0 0 24 24" enable-background="new 0 0 24 24" 
xml:space="preserve">
-
-
-
-   
-   
-   
-   
-
-
diff --git a/images/icons/beta/watch.svg b/images/icons/beta/watch.svg
deleted file mode 100644
index f088d9d..000
--- a/images/icons/beta/watch.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
-http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
-viewBox="0 0 24 24" enable-background="new 0 0 24 24" 
xml:space="preserve">
-
-
diff --git a/images/icons/beta/watched.svg b/images/icons/beta/watched.svg
deleted file mode 100644
index c2fa585..000
--- a/images/icons/beta/watched.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-http://www.w3.org/2000/svg"; viewBox="0 0 24 22.915254" 
enable-background="new 0 0 24 24">
-
-
-
-
diff --git a/images/icons/edit.svg b/images/icons/edit.svg
index 66f0fce..e21a14e 100644
--- a/images/icons/edit.svg
+++ b/images/icons/edit.svg
@@ -1,6 +1,12 @@
-
-http://www.w3.org/2000/svg"; viewBox="0 -410 2048 2048" width="24" 
height="24">
-
-
-
-
+
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+viewBox="0 0 24 24" enable-background="new 0 0 24 24" 
xml:space="preserve">
+
+
+
+   
+
+
diff --git a/images/icons/editLocked.svg b/images/icons/editLocked.svg
index 74c750c..24032bc 100644
--- a/images/icons/editLocked.svg
+++ b/images/icons/editLocked.svg
@@ -1,6 +1,16 @@
-
-http://www.w3.org/2000/svg"; viewBox="0 -410 2048 2048" width="24" 
height="24" fill="#777">
-
-
-
-
+
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+viewBox="0 0 24 24" enable-background="new 0 0 24 24" 
xml:space="preserve">
+
+
+
+   
+   
+   
+   
+
+
diff --git a/images/icons/magnifying-glass.svg 
b/images/icons/magnifying-glass.svg
deleted file mode 100644
index 8c375d0..000
--- a/images/icons/magnifying-glass.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-http://www.w3.org/2000/svg"; viewBox="0 0 24 24" 
enable-background="new 0 0 612 792">
-
-
diff --git a/images/icons/watch.svg b/images/icons/watch.svg
index 67e5a72..f088d9d 100644
--- a/images/icons/watch.svg
+++ b/images/icons/watch.svg
@@ -1,6 +1,8 @@
-
-http://www.w3.org/2000/svg"; viewBox="0 0 24.01 22.909092" 
enable-background="new 0 0 24 24">
-
-
-
-
+
+
+

[MediaWiki-commits] [Gerrit] Added links to online API documentation in docstrings of som... - change (pywikibot/core)

2015-12-23 Thread Yujwey (Code Review)
Yujwey has uploaded a new change for review.

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

Change subject: Added links to online API documentation in docstrings of some 
APISite methods
..

Added links to online API documentation in docstrings of some APISite methods

Change-Id: I23d2c5704d758776e30b618f4168e442f4111066
---
M pywikibot/site.py
1 file changed, 16 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/70/260870/1

diff --git a/pywikibot/site.py b/pywikibot/site.py
index 0bbf596..1fc07c5 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2000,7 +2000,11 @@
 return auth_token is not None and len(auth_token) == 4
 
 def login(self, sysop=False):
-"""Log the user in if not already logged in."""
+"""
+Log the user in if not already logged in.
+
+U{https://www.mediawiki.org/wiki/API:Login}
+"""
 # TODO: this should include an assert that loginstatus
 #   is not already IN_PROGRESS, however the
 #   login status may be left 'IN_PROGRESS' because
@@ -2074,6 +2078,8 @@
 Also logs out of the global account if linked to the user.
 
 @raises APIError: Logout is not available when OAuth enabled.
+
+U{https://www.mediawiki.org/wiki/API:Logout}
 """
 if self.is_oauth_token_available():
 pywikibot.warning('Using OAuth suppresses logout function')
@@ -2097,6 +2103,8 @@
 
 @param force: force to retrieve userinfo ignoring cache
 @type force: bool
+
+U{https://www.mediawiki.org/wiki/API:Userinfo}
 """
 if force or not hasattr(self, '_userinfo'):
 uirequest = self._simple_request(
@@ -2155,6 +2163,8 @@
 @param sysop: If true, log in to sysop account (if available)
 @type sysop: bool
 @rtype: bool
+
+U{https://www.mediawiki.org/wiki/API:Userinfo}
 """
 if not self.logged_in(sysop):
 self.login(sysop)
@@ -2233,6 +2243,8 @@
 
 * Actions: edit, move, delete, protect, upload
 * User levels: autoconfirmed, sysop, bot
+
+U{https://www.mediawiki.org/wiki/API:Userinfo}
 
 """
 if not self.logged_in(sysop):
@@ -2244,7 +2256,9 @@
 
 Possible values of 'group' may vary depending on wiki settings,
 but will usually include bot.
-
+
+U{https://www.mediawiki.org/wiki/API:Userinfo}
+
 """
 if not self.logged_in(sysop):
 self.login(sysop)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23d2c5704d758776e30b618f4168e442f4111066
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Yujwey 

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


[MediaWiki-commits] [Gerrit] Add script to populate rev_content_model for $wgFlowOccupyPages - change (mediawiki...Flow)

2015-12-23 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Add script to populate rev_content_model for $wgFlowOccupyPages
..

Add script to populate rev_content_model for $wgFlowOccupyPages

This should be deployed and run as the first step of T105574.
No pages can be occupied using $wgFlowOccupyPages after it is run
(we haven't been adding them for a while this way anyway).

Bug: T105574
Change-Id: Ida772d1299f9b03aae1ebe0f4f0237d781eb4377
(cherry picked from commit d90073b42711772c7fe8d3537555afcfb3e3ac83)
---
A maintenance/FlowUpdateRevContentModelFromOccupyPages.php
1 file changed, 75 insertions(+), 0 deletions(-)


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

diff --git a/maintenance/FlowUpdateRevContentModelFromOccupyPages.php 
b/maintenance/FlowUpdateRevContentModelFromOccupyPages.php
new file mode 100644
index 000..b26de04
--- /dev/null
+++ b/maintenance/FlowUpdateRevContentModelFromOccupyPages.php
@@ -0,0 +1,75 @@
+https://gerrit.wikimedia.org/r/#/c/228267/ .
+ *
+ * It sets rev_content_model to flow-board for the last revision of all 
occupied pages.
+ *
+ * @ingroup Maintenance
+ */
+class FlowUpdateRevContentModelFromOccupyPages extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+
+   $this->mDescription = 'Sets rev_content_model from 
wgFlowOccupyPages, in preparation for dropping that config variable.';
+
+   // Given the number of occupied pages, this probably doesn't 
need to be
+   // batched; just being cautious.
+   $this->setBatchSize( 10 );
+   }
+
+   public function execute() {
+   global $wgFlowOccupyPages;
+
+   $dbw = wfGetDB( DB_MASTER );
+
+   $pageCount = count( $wgFlowOccupyPages );
+   $overallInd = 0;
+   $updatedCount = 0;
+   $skippedCount = 0;
+
+   while ( $overallInd < $pageCount ) {
+   $dbw->begin();
+   $batchInd = 0;
+   while( $overallInd < $pageCount && $batchInd < 
$this->mBatchSize ) {
+   $pageName = $wgFlowOccupyPages[$overallInd];
+   $title = Title::newFromTextThrow( $pageName );
+   $revId = $title->getLatestRevID( 
Title::GAID_FOR_UPDATE );
+   if ( $revId !== 0 ) {
+   $dbw->update(
+   'revision',
+   array(
+   'rev_content_model' =>
+   CONTENT_MODEL_FLOW_BOARD
+   ),
+   array( 'rev_id' => $revId ),
+   __METHOD__
+   );
+   $updatedCount++;
+   $this->output( "Set content model for 
\"{$title->getPrefixedDBkey()}\"\n" );
+   } else {
+   $skippedCount++;
+   $this->output( "WARNING: Skipped 
\"{$title->getPrefixedDBkey()}\" because it does not exist\n" );
+   }
+
+   $overallInd++;
+   $batchInd++;
+   }
+
+   $dbw->commit();
+   $this->output( "Completed batch.\n\n" );
+   }
+
+   $this->output( "Set content model for $updatedCount pages; 
skipped $skippedCount pages.\n" );
+   }
+}
+
+$maintClass = 'FlowUpdateRevContentModelFromOccupyPages';
+require_once( RUN_MAINTENANCE_IF_MAIN );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida772d1299f9b03aae1ebe0f4f0237d781eb4377
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: REL1_25
Gerrit-Owner: Mattflaschen 

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


[MediaWiki-commits] [Gerrit] Add README pointing to Extension:Flow - change (mediawiki...Flow)

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

Change subject: Add README pointing to Extension:Flow
..


Add README pointing to Extension:Flow

Bug: T65125
Change-Id: I624aee2d04567f09d210ba3f93969180c20e887b
---
A README
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/README b/README
new file mode 100644
index 000..e791695
--- /dev/null
+++ b/README
@@ -0,0 +1,3 @@
+Flow is an extension that provides a discussion system for MediaWiki wikis.
+
+See https://www.mediawiki.org/wiki/Extension:Flow for more information.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I624aee2d04567f09d210ba3f93969180c20e887b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 
Gerrit-Reviewer: Mooeypoo 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] SpecialMediaSattistics: Add header for "Total file size" - change (mediawiki/core)

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

Change subject: SpecialMediaSattistics: Add header for "Total file size"
..


SpecialMediaSattistics: Add header for "Total file size"

Bug: T122208
Change-Id: I1fb9f3c80e2def9623ce8b5d4e3765fe9cbafa25
---
M includes/specials/SpecialMediaStatistics.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/includes/specials/SpecialMediaStatistics.php 
b/includes/specials/SpecialMediaStatistics.php
index aeebc42..6e67df0 100644
--- a/includes/specials/SpecialMediaStatistics.php
+++ b/includes/specials/SpecialMediaStatistics.php
@@ -139,6 +139,8 @@
}
if ( $prevMediaType !== null ) {
$this->outputTableEnd();
+   // add total size of all files
+   $this->outputMediaType( 'total' );
$this->getOutput()->addWikiText(
$this->msg( 'mediastatistics-allbytes' )
->numParams( $this->totalSize )
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index ca4c88e..1665e21 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -3876,6 +3876,7 @@
"mediastatistics-header-text": "Textual",
"mediastatistics-header-executable": "Executables",
"mediastatistics-header-archive": "Compressed formats",
+   "mediastatistics-header-total": "All files",
"json-warn-trailing-comma": "$1 trailing {{PLURAL:$1|comma was|commas 
were}} removed from JSON",
"json-error-unknown": "There was a problem with the JSON. Error: $1",
"json-error-depth": "The maximum stack depth has been exceeded",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 2b54491..87470bf 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -4051,6 +4051,7 @@
"mediastatistics-header-text": "Header on [[Special:MediaStatistics]] 
for file types that are in the text category. This includes simple text 
formats, including plain text formats, json, csv, and xml. Source code of 
compiled programming languages may be included here in the future, but isn't 
currently.",
"mediastatistics-header-executable": "Header on 
[[Special:MediaStatistics]] for file types that are in the executable category. 
This includes things like source files for interpreted programming language 
(Shell scripts, javascript, etc).",
"mediastatistics-header-archive": "Header on 
[[Special:MediaStatistics]] for file types that are in the archive category. 
Includes things like tar, zip, gzip etc.",
+   "mediastatistics-header-total": "Header on [[Special:MediaStatistics]] 
for a summary of all file types.",
"json-warn-trailing-comma": "A warning message notifying that JSON text 
was automatically corrected by removing erroneous commas.\n\nParameters:\n* $1 
- number of commas that were removed\n{{Related|Json-error}}",
"json-error-unknown": "User error message when there’s an unknown 
error.\n\nThis error is shown if we received an unexpected value from PHP. See 
http://php.net/manual/en/function.json-last-error.php\n\nParameters:\n* $1 - 
integer error code\n{{Related|Json-error}}",
"json-error-depth": "User error message when the maximum stack depth is 
exceeded.\nSee 
http://php.net/manual/en/function.json-last-error.php\n{{Related|Json-error}}",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1fb9f3c80e2def9623ce8b5d4e3765fe9cbafa25
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] VE: Mark all graphs with ver 1 - change (mediawiki...Graph)

2015-12-23 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: VE: Mark all graphs with ver 1
..

VE: Mark all graphs with ver 1

At the moment all graphs generated by Graph VE ext are saved
without the version, which will be required soon because the 
default is about to be changed.

Bug: T121915
Change-Id: Ic748290593ea7a3415bc236df16715f8325ebc6e
(cherry picked from commit 6d781b2f038a357eaa48e3d51d01d1bb2b5f58a6)
---
M modules/ve-graph/tests/ext.graph.visualEditor.test.js
M modules/ve-graph/ve.dm.MWGraphNode.js
2 files changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Graph 
refs/changes/68/260868/1

diff --git a/modules/ve-graph/tests/ext.graph.visualEditor.test.js 
b/modules/ve-graph/tests/ext.graph.visualEditor.test.js
index 23de4ea..fd53477 100644
--- a/modules/ve-graph/tests/ext.graph.visualEditor.test.js
+++ b/modules/ve-graph/tests/ext.graph.visualEditor.test.js
@@ -11,6 +11,7 @@
 
var sampleSpecs = {
areaGraph: {
+   version: 1,
width: 500,
height: 200,
padding: {
@@ -95,6 +96,7 @@
},
 
stackedAreaGraph: {
+   version: 1,
width: 500,
height: 200,
padding: {
@@ -245,6 +247,7 @@
},
 
invalidAxesBarGraph: {
+   version: 1,
width: 500,
height: 200,
padding: {
@@ -404,6 +407,7 @@
]
},
areaGraphRemovalExpected = {
+   version: 1,
width: 500,
height: 200,
padding: {
diff --git a/modules/ve-graph/ve.dm.MWGraphNode.js 
b/modules/ve-graph/ve.dm.MWGraphNode.js
index 1545c5d..9876aac 100644
--- a/modules/ve-graph/ve.dm.MWGraphNode.js
+++ b/modules/ve-graph/ve.dm.MWGraphNode.js
@@ -55,6 +55,7 @@
 ve.dm.MWGraphNode.static.extensionName = 'graph';
 
 ve.dm.MWGraphNode.static.defaultSpec = {
+   version: 1,
width: 400,
height: 200,
data: [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic748290593ea7a3415bc236df16715f8325ebc6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: wmf/1.27.0-wmf.9
Gerrit-Owner: Yurik 

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


[MediaWiki-commits] [Gerrit] Enable the jjb browser test job for RelatedArticles - change (integration/config)

2015-12-23 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Enable the jjb browser test job for RelatedArticles
..

Enable the jjb browser test job for RelatedArticles

Bug: T120715
Change-Id: I39b9f292e95363addf8983eec5d08a0af527a163
---
M zuul/layout.yaml
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/67/260867/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 78332ec..8bf8aa8 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -6950,6 +6950,10 @@
 check:
   - jsonlint
   - jshint
+test:
+  - mwext-mw-selenium
+postmerge:
+  - mwext-mw-selenium
 
   - name: mediawiki/extensions/RelatedSites
 template:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39b9f292e95363addf8983eec5d08a0af527a163
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] Flow Nuke: remove join on user - change (mediawiki...Flow)

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

Change subject: Flow Nuke: remove join on user
..


Flow Nuke: remove join on user

Refactor FlowHooks::onNukeGetNewPages to get the topics
and backfill with usernames as a separate step instead
of joining between Flow tables and user table.

In production those tables are not in the same
database.

Bug: T121828
Change-Id: I4e2af80171f6f7462f4afe8d0ade35581cddbc73
---
M Hooks.php
1 file changed, 124 insertions(+), 71 deletions(-)

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



diff --git a/Hooks.php b/Hooks.php
index 068d271..1135d55 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -1854,85 +1854,138 @@
 
// how many are we allowed to retrieve now
$newLimit = $limit - count( $pages );
-   if ( $newLimit > 0 ) {
 
-   $dbFactory = Container::get( 'db.factory' );
-   $dbr = $dbFactory->getDB( DB_SLAVE );
+   // we can't add anything
+   if ( $newLimit < 1 ) {
+   return true;
+   }
 
-   $userSelect = array( 'username' => 
"IFNULL(tree_orig_user_ip, user_name)" );
-   $userWhere = array();
-   if ( $username ) {
-   $userSelect = array();
-   $user = User::newFromName( $username );
-   if ( $user ) {
-   $userWhere = array( 'tree_orig_user_id' 
=> $user->getId() );
-   } else {
-   $userWhere = array( 'tree_orig_user_ip' 
=> $username );
+   $dbFactory = Container::get( 'db.factory' );
+   /** @var Database $dbr */
+   $dbr = $dbFactory->getDB( DB_SLAVE );
+
+   // if a username is specified, search only for that user
+   $userWhere = array();
+   if ( $username ) {
+   $user = User::newFromName( $username );
+   if ( $user ) {
+   $userWhere = array( 'tree_orig_user_id' => 
$user->getId() );
+   } else {
+   $userWhere = array( 'tree_orig_user_ip' => 
$username );
+   }
+   }
+
+   // limit results to the range of RC
+   global $wgRCMaxAge;
+   $rcTimeLimit = UUID::getComparisonUUID( strtotime("-$wgRCMaxAge 
seconds") );
+
+   // get latest revision id for each topic
+   $result = $dbr->select(
+   array(
+   'r' => 'flow_revision',
+   'flow_tree_revision',
+   'flow_workflow',
+   ),
+   array(
+   'revId' => 'MAX(r.rev_id)',
+   'userIp' => "tree_orig_user_ip",
+   'userId' => "tree_orig_user_id",
+   ),
+   array_merge( array(
+   'tree_parent_id' => null,
+   'r.rev_type' => 'post',
+   'workflow_wiki' => wfWikiId(),
+   'workflow_id > ' . $dbr->addQuotes( 
$rcTimeLimit->getBinary() )
+   ), $userWhere ),
+   __METHOD__,
+   array(
+   'GROUP BY' => 'r.rev_type_id'
+   ),
+   array(
+   'flow_tree_revision' => array( 'INNER JOIN', 
'r.rev_type_id=tree_rev_descendant_id' ),
+   'flow_workflow' => array( 'INNER JOIN', 
'r.rev_type_id=workflow_id' ),
+   )
+   );
+
+   if ( $result->numRows() < 1 ) {
+   return true;
+   }
+
+   $revIds = array();
+   foreach( $result as $r ) {
+   $revIds[$r->revId] = array( 'userIp' => $r->userIp, 
'userId' => $r->userId, 'name' => false );
+   }
+
+   // get non-moderated revisions
+   $result = $dbr->select(
+   'flow_revision',
+   array(
+   'topicId' => 'rev_type_id',
+   'revId' => 'rev_id'
+   ),
+   array(
+   'rev_mod_state' => '',
+   'rev_id' => array_keys( $revIds )
+   ),
+   __METHOD__,
+   array(
+   'LIMIT' => $newLimit,
+   'ORDER BY' => 'rev_t

[MediaWiki-commits] [Gerrit] Run MultimediaViewer browser tests on each commit - change (integration/config)

2015-12-23 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Run MultimediaViewer browser tests on each commit
..

Run MultimediaViewer browser tests on each commit

Bug: T113620
Change-Id: I78727ce68b45f3a6305291e6e1e596b62069fc21
---
M zuul/layout.yaml
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/66/260866/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 78332ec..32643b2 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -4164,6 +4164,9 @@
   - name: npm
 check:
   - jsonlint
+  - mwext-mw-selenium
+gate-and-submit:
+  - mwext-mw-selenium
 postmerge:
   - mwext-MultimediaViewer-jsduck-publish
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78727ce68b45f3a6305291e6e1e596b62069fc21
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] VE: Mark all graphs with ver 1 - change (mediawiki...Graph)

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

Change subject: VE: Mark all graphs with ver 1
..


VE: Mark all graphs with ver 1

At the moment all graphs generated by Graph VE ext are saved
without the version, which will be required soon because the 
default is about to be changed.

Bug: T121915
Change-Id: Ic748290593ea7a3415bc236df16715f8325ebc6e
---
M modules/ve-graph/tests/ext.graph.visualEditor.test.js
M modules/ve-graph/ve.dm.MWGraphNode.js
2 files changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/modules/ve-graph/tests/ext.graph.visualEditor.test.js 
b/modules/ve-graph/tests/ext.graph.visualEditor.test.js
index 23de4ea..fd53477 100644
--- a/modules/ve-graph/tests/ext.graph.visualEditor.test.js
+++ b/modules/ve-graph/tests/ext.graph.visualEditor.test.js
@@ -11,6 +11,7 @@
 
var sampleSpecs = {
areaGraph: {
+   version: 1,
width: 500,
height: 200,
padding: {
@@ -95,6 +96,7 @@
},
 
stackedAreaGraph: {
+   version: 1,
width: 500,
height: 200,
padding: {
@@ -245,6 +247,7 @@
},
 
invalidAxesBarGraph: {
+   version: 1,
width: 500,
height: 200,
padding: {
@@ -404,6 +407,7 @@
]
},
areaGraphRemovalExpected = {
+   version: 1,
width: 500,
height: 200,
padding: {
diff --git a/modules/ve-graph/ve.dm.MWGraphNode.js 
b/modules/ve-graph/ve.dm.MWGraphNode.js
index 1545c5d..9876aac 100644
--- a/modules/ve-graph/ve.dm.MWGraphNode.js
+++ b/modules/ve-graph/ve.dm.MWGraphNode.js
@@ -55,6 +55,7 @@
 ve.dm.MWGraphNode.static.extensionName = 'graph';
 
 ve.dm.MWGraphNode.static.defaultSpec = {
+   version: 1,
width: 400,
height: 200,
data: [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic748290593ea7a3415bc236df16715f8325ebc6e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: Yurik 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: Ferdbold 
Gerrit-Reviewer: Mooeypoo 
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 some explanatory comments to Piwik role - change (operations/puppet)

2015-12-23 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Add some explanatory comments to Piwik role
..


Add some explanatory comments to Piwik role

Change-Id: I310f4467375a11d52c66a757623908d5ccc6b9a6
---
M manifests/role/piwik.pp
1 file changed, 16 insertions(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/manifests/role/piwik.pp b/manifests/role/piwik.pp
index fb193b3..059d5e3 100644
--- a/manifests/role/piwik.pp
+++ b/manifests/role/piwik.pp
@@ -4,7 +4,22 @@
 # It powers .
 #
 # Q: Why is there no piwik module?
-# A: Piwik has no good configuration mechanism apart from the web installer.
+# A: The only sanctioned way of configuring Piwik is via the web
+#installer. It is possible to provision a config.ini.php via Puppet,
+#but then you can't get to the web installer, so you are left with
+#no way to initialize the database, short of doing a bulk MySQL
+#import of a dump of an already-initialized Piwik database.
+#
+#See #1586: Headless install / command line piwik remote install
+#.
+#Closed with "We have implemented this plugin for Piwik PRO, please
+#get in touch if you are interested."
+#
+# Q: So where are the credentials?
+# A: In pwstore.
+#
+# Q: Where did the package come from?
+# A: http://debian.piwik.org/, imported to jessie-wikimedia.
 #
 class role::piwik {
 include ::apache::mod::authnz_ldap

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I310f4467375a11d52c66a757623908d5ccc6b9a6
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Add some explanatory comments to Piwik role - change (operations/puppet)

2015-12-23 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Add some explanatory comments to Piwik role
..

Add some explanatory comments to Piwik role

Change-Id: I310f4467375a11d52c66a757623908d5ccc6b9a6
---
M manifests/role/piwik.pp
1 file changed, 16 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/65/260865/1

diff --git a/manifests/role/piwik.pp b/manifests/role/piwik.pp
index fb193b3..059d5e3 100644
--- a/manifests/role/piwik.pp
+++ b/manifests/role/piwik.pp
@@ -4,7 +4,22 @@
 # It powers .
 #
 # Q: Why is there no piwik module?
-# A: Piwik has no good configuration mechanism apart from the web installer.
+# A: The only sanctioned way of configuring Piwik is via the web
+#installer. It is possible to provision a config.ini.php via Puppet,
+#but then you can't get to the web installer, so you are left with
+#no way to initialize the database, short of doing a bulk MySQL
+#import of a dump of an already-initialized Piwik database.
+#
+#See #1586: Headless install / command line piwik remote install
+#.
+#Closed with "We have implemented this plugin for Piwik PRO, please
+#get in touch if you are interested."
+#
+# Q: So where are the credentials?
+# A: In pwstore.
+#
+# Q: Where did the package come from?
+# A: http://debian.piwik.org/, imported to jessie-wikimedia.
 #
 class role::piwik {
 include ::apache::mod::authnz_ldap

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I310f4467375a11d52c66a757623908d5ccc6b9a6
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Typo fix - change (pywikibot/core)

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

Change subject: Typo fix
..


Typo fix

Change-Id: I7553a1a72a02025d03ad857c3481ed636da51776
---
M scripts/welcome.py
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/scripts/welcome.py b/scripts/welcome.py
index 8e4995a..7ebcfa6 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -151,7 +151,7 @@
 *  *
 * The regex to load the user might be slightly different from project to   *
 * project. (In this case, write to Filnik or the PWRF for help...) *
-* Use a class to group toghether the functions used.   *
+* Use a class to group together the functions used.*
 *  *
  Badwords **
 
@@ -164,7 +164,7 @@
 or deleting.
 
 Some words, like "Administrator" or "Dio" (God in italian) or "Jimbo" aren't
-badword at all but can be used for some bad-nickname.
+badwords at all but can be used for some bad-nickname.
 """
 #
 # (C) Alfio, 2005

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7553a1a72a02025d03ad857c3481ed636da51776
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hazard-SJ 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Switch dashboards over to use automata detection in ZRR comp... - change (wikimedia...rainbow)

2015-12-23 Thread OliverKeyes (Code Review)
OliverKeyes has uploaded a new change for review.

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

Change subject: Switch dashboards over to use automata detection in ZRR 
computation
..

Switch dashboards over to use automata detection in ZRR computation

Don't deploy it yet, I still need to stitch the data sources together -
but it works!

Bug: T121434
Change-Id: I5715a542765d964a228badbcb997115970e3ca3f
---
M server.R
M tab_documentation/failure_rate.md
M ui.R
M utils.R
4 files changed, 65 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/rainbow 
refs/changes/64/260864/1

diff --git a/server.R b/server.R
index 4320bb1..0661385 100644
--- a/server.R
+++ b/server.R
@@ -201,28 +201,29 @@
 
   # Failure plots
   output$failure_rate_plot <- renderDygraph({
-failure_dygraph_set %>%
+polloi::data_select(input$failure_rate_automata, 
failure_data_with_automata, failure_data_no_automata) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_failure_rate)) %>%
   
polloi::subset_by_date_range(time_frame_range(input$failure_rate_timeframe, 
input$failure_rate_timeframe_daterange)) %>%
-  polloi::make_dygraph(xlab = "Date", ylab = "Queries", title = "Search 
Queries with Zero Results, by day")
+  polloi::make_dygraph(xlab = "Date", ylab = "Zero Results Rate (%)", 
title = "Zero Results Rate, by day",
+   legend_name = "ZRR")
   })
 
   output$failure_rate_change_plot <- renderDygraph({
-failure_roc_dygraph_set[, c(1, 3)] %>%
+polloi::data_select(input$failure_rate_automata, 
failure_roc_with_automata, failure_roc_no_automata) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_failure_rate)) %>%
   
polloi::subset_by_date_range(time_frame_range(input$failure_rate_timeframe, 
input$failure_rate_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Change (%)", title = "Zero 
Results rate change, by day", legend_name = "Change")
   })
 
   output$failure_breakdown_plot <- renderDygraph({
-failure_breakdown_dygraph_set %>%
+polloi::data_select(input$failure_breakdown_automata, 
failure_breakdown_with_automata, failure_breakdown_no_automata) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_failure_breakdown)) %>%
   
polloi::subset_by_date_range(time_frame_range(input$failure_breakdown_timeframe,
 input$failure_breakdown_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Zero Results Rate (%)", 
title = "Zero result rate by search type")
   })
 
   output$suggestion_dygraph_plot <- renderDygraph({
-suggestion_dygraph_set %>%
+polloi::data_select(input$failure_suggestions_automata, 
suggestion_with_automata, suggestion_no_automata) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_failure_suggestions)) %>%
   
polloi::subset_by_date_range(time_frame_range(input$failure_suggestions_timeframe,
 input$failure_suggestions_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Zero Results Rate (%)", 
title = "Zero Result Rates with Search Suggestions")
@@ -310,22 +311,22 @@
   })
   output$kpi_summary_box_zero_results <- renderValueBox({
 date_range <- input$kpi_summary_date_range_selector
-x <- polloi::subset_by_date_range(failure_dygraph_set, from = 
start_date(date_range), to = Sys.Date() - 1)
-x <- transform(x, Rate = `Zero Result Queries` / `Search Queries`)$Rate
+x <- polloi::subset_by_date_range(failure_data_with_automata, from = 
start_date(date_range), to = Sys.Date() - 1)
+x <- transform(x, Rate = rate)$Rate
 if (date_range == "quarterly") {
   return(valueBox(subtitle = "Zero results rate", color = "orange",
-  value = sprintf("%.1f%%", median(100 * x
+  value = sprintf("%.1f%%", median(x
 }
-y1 <- median(polloi::half(x)); y2 <- median(polloi::half(x, FALSE)); z <- 
100 * (y2 - y1)/y1
+y1 <- median(polloi::half(x)); y2 <- median(polloi::half(x, FALSE)); z <- 
(y2 - y1)/y1
 if (abs(z) > 0) {
   return(valueBox(
 subtitle = sprintf("Zero results rate (%.1f%%)", z),
-value = sprintf("%.1f%%", 100 * y2),
+value = sprintf("%.1f%%", y2),
 icon = cond_icon(z > 0), color = polloi::cond_color(z > 0, "red")
   ))
 }
 return(valueBox(subtitle = "Zero results rate (no change)",
-value = sprintf("%.1f%%", 100 * y2), color = "orange"))
+value = sprintf("%.1f%%", y2), color = "orange"))
   })
   output$kpi_summary_box_api_usage <- renderValueBox({
 date_range <- input$kpi_summary_date_range_selector
@@ -426,9 +427,9 @@
   output$kpi_zero_results_series <- renderDygraph({

[MediaWiki-commits] [Gerrit] Fix unit test dependencies - change (mediawiki...Graph)

2015-12-23 Thread Ferdbold (Code Review)
Ferdbold has uploaded a new change for review.

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

Change subject: Fix unit test dependencies
..

Fix unit test dependencies

Bug: T121638
Change-Id: I2baf743dff4691542c91b3d65c74bb73f03edfbc
---
M Graph.hooks.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Graph 
refs/changes/63/260863/1

diff --git a/Graph.hooks.php b/Graph.hooks.php
index 36dcb6d..9bf158d 100644
--- a/Graph.hooks.php
+++ b/Graph.hooks.php
@@ -103,7 +103,8 @@

'modules/ve-graph/tests/ext.graph.visualEditor.test.js'
),
'dependencies' => array(
-   'ext.graph.visualEditor'
+   'ext.graph.visualEditor',
+   'ext.graph.vega1'
),
'localBasePath' => __DIR__,
'remoteExtPath' => 'Graph'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2baf743dff4691542c91b3d65c74bb73f03edfbc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: Ferdbold 

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


[MediaWiki-commits] [Gerrit] pywikibot.WARNING -> pywikibot.logging.WARNING - change (pywikibot/core)

2015-12-23 Thread Hazard-SJ (Code Review)
Hazard-SJ has uploaded a new change for review.

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

Change subject: pywikibot.WARNING -> pywikibot.logging.WARNING
..

pywikibot.WARNING -> pywikibot.logging.WARNING

compat imported WARNING directly into wikipedia.py,
but core does not do that in pywikibot.

Change-Id: Id11c1650cd869873c3de6a945b05e54236dfed7c
---
M pywikibot/page.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/62/260862/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 34f30b6..6d6b4c3 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -2579,7 +2579,7 @@
 if targetCat.exists():
 pywikibot.output(u'Target page %s already exists!'
  % targetCat.title(),
- level=pywikibot.WARNING)
+ level=pywikibot.logging.WARNING)
 return False
 else:
 pywikibot.output('Moving text from %s to %s.'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id11c1650cd869873c3de6a945b05e54236dfed7c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hazard-SJ 

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


[MediaWiki-commits] [Gerrit] Typo fix - change (pywikibot/core)

2015-12-23 Thread Hazard-SJ (Code Review)
Hazard-SJ has uploaded a new change for review.

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

Change subject: Typo fix
..

Typo fix

Change-Id: I2b273f1c5c56fd3aebd9959ad250c2f9c5f7a431
---
M scripts/welcome.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/61/260861/1

diff --git a/scripts/welcome.py b/scripts/welcome.py
index b77d9e2..effd12c 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -151,7 +151,7 @@
 *  *
 * The regex to load the user might be slightly different from project to   *
 * project. (In this case, write to Filnik or the PWRF for help...) *
-* Use a class to group toghether the functions used.   *
+* Use a class to group together the functions used.*
 *  *
  Badwords **
 
@@ -164,7 +164,7 @@
 or deleting.
 
 Some words, like "Administrator" or "Dio" (God in italian) or "Jimbo" aren't
-badword at all but can be used for some bad-nickname.
+badwords at all but can be used for some bad-nickname.
 """
 #
 # (C) Alfio, 2005

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b273f1c5c56fd3aebd9959ad250c2f9c5f7a431
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hazard-SJ 

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


[MediaWiki-commits] [Gerrit] Various fixes for wikitext saving error handling - change (mediawiki...MobileFrontend)

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

Change subject: Various fixes for wikitext saving error handling
..


Various fixes for wikitext saving error handling

Bug: T121079
Change-Id: I4f1a5727b83e01ecd5f83c4796e6ee0f50a64a45
---
M resources/mobile.editor.overlay/EditorOverlay.js
1 file changed, 4 insertions(+), 7 deletions(-)

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



diff --git a/resources/mobile.editor.overlay/EditorOverlay.js 
b/resources/mobile.editor.overlay/EditorOverlay.js
index 7944fcd..7be9a82 100644
--- a/resources/mobile.editor.overlay/EditorOverlay.js
+++ b/resources/mobile.editor.overlay/EditorOverlay.js
@@ -426,12 +426,12 @@
'blocked',
'autoblocked'
],
-   key = response.error.code,
+   key = response && 
response.error && response.error.code,
typeMap = {
editconflict: 
'editConflict',
wasdeleted: 
'editPageDeleted',

'abusefilter-disallowed': 'extensionAbuseFilter',
-   captcha: 
'extensionConfirmEdit',
+   captcha: 
'extensionCaptcha',
spamprotectiontext: 
'extensionSpamBlacklist',

'titleblacklist-forbidden-edit': 'extensionTitleBlacklist'
};
@@ -443,12 +443,9 @@
} else if ( data.type === 'abusefilter' 
) {
self._showAbuseFilter( 
data.details.type, data.details.message );
} else {
-   if ( data.details === 
'editconflict' ) {
+   if ( key === 'editconflict' ) {
msg = mw.msg( 
'mobile-frontend-editor-error-conflict' );
-   } else if (
-   response.error &&
-   $.inArray( 
response.error.code, whitelistedErrorInfo ) > -1
-   ) {
+   } else if ( $.inArray( key, 
whitelistedErrorInfo ) > -1 ) {
msg = 
response.error.info;
} else {
msg = mw.msg( 
'mobile-frontend-editor-error' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f1a5727b83e01ecd5f83c4796e6ee0f50a64a45
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Typo fix - change (pywikibot/core)

2015-12-23 Thread Hazard-SJ (Code Review)
Hazard-SJ has uploaded a new change for review.

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

Change subject: Typo fix
..

Typo fix

Change-Id: I7553a1a72a02025d03ad857c3481ed636da51776
---
M scripts/welcome.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/60/260860/1

diff --git a/scripts/welcome.py b/scripts/welcome.py
index 8e4995a..7ebcfa6 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -151,7 +151,7 @@
 *  *
 * The regex to load the user might be slightly different from project to   *
 * project. (In this case, write to Filnik or the PWRF for help...) *
-* Use a class to group toghether the functions used.   *
+* Use a class to group together the functions used.*
 *  *
  Badwords **
 
@@ -164,7 +164,7 @@
 or deleting.
 
 Some words, like "Administrator" or "Dio" (God in italian) or "Jimbo" aren't
-badword at all but can be used for some bad-nickname.
+badwords at all but can be used for some bad-nickname.
 """
 #
 # (C) Alfio, 2005

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7553a1a72a02025d03ad857c3481ed636da51776
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hazard-SJ 

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


[MediaWiki-commits] [Gerrit] Configure thumbor video support - change (mediawiki/vagrant)

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

Change subject: Configure thumbor video support
..


Configure thumbor video support

Bug: T120205
Change-Id: Ic6deb34e05e2ee5d19f64b0dd579afdcbaad0e1e
---
M puppet/modules/role/manifests/thumbor.pp
M puppet/modules/role/templates/thumbor/local_repo.php.erb
M puppet/modules/thumbor/manifests/init.pp
M puppet/modules/thumbor/templates/thumbor.conf.erb
M puppet/modules/thumbor/templates/varnish.vcl.erb
5 files changed, 36 insertions(+), 11 deletions(-)

Approvals:
  Dduvall: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/puppet/modules/role/manifests/thumbor.pp 
b/puppet/modules/role/manifests/thumbor.pp
index 7a9ccce..28b0f3a 100644
--- a/puppet/modules/role/manifests/thumbor.pp
+++ b/puppet/modules/role/manifests/thumbor.pp
@@ -8,6 +8,7 @@
 require ::role::memcached
 require ::role::sentry
 require ::role::swift
+require ::role::timedmediahandler
 require ::role::thumb_on_404
 include ::apache::mod::proxy
 include ::apache::mod::proxy_http
@@ -30,6 +31,8 @@
 'jpeg',
 'xcf',
 'svg',
+'ogv',
+'webm',
 ],
 },
 }
diff --git a/puppet/modules/role/templates/thumbor/local_repo.php.erb 
b/puppet/modules/role/templates/thumbor/local_repo.php.erb
index 0847991..8e486fb 100644
--- a/puppet/modules/role/templates/thumbor/local_repo.php.erb
+++ b/puppet/modules/role/templates/thumbor/local_repo.php.erb
@@ -15,6 +15,8 @@
 'png' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 'gif' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 'svg' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
+'ogg' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
+'webm' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 ),
 ),
 ),
diff --git a/puppet/modules/thumbor/manifests/init.pp 
b/puppet/modules/thumbor/manifests/init.pp
index a4715e3..37978fc 100644
--- a/puppet/modules/thumbor/manifests/init.pp
+++ b/puppet/modules/thumbor/manifests/init.pp
@@ -46,6 +46,9 @@
 # For SVG engine
 require_package('librsvg2-bin')
 
+# For Video engine
+require_package('ffmpeg')
+
 $statsd_host = 'localhost'
 $statsd_prefix = 'Thumbor'
 
@@ -76,6 +79,7 @@
 'git+https://gerrit.wikimedia.org/r/thumbor/proxy-engine',
 'git+https://gerrit.wikimedia.org/r/thumbor/base-engine',
 'git+https://gerrit.wikimedia.org/r/thumbor/svg-engine',
+'git+https://gerrit.wikimedia.org/r/thumbor/video-engine',
 ],
 require  => [
 Package['libjpeg-progs'],
@@ -136,7 +140,7 @@
 varnish::backend { 'thumbor':
 host   => '127.0.0.1',
 port   => '',
-onlyif => 'req.url ~ 
"^/images/thumb/.*\.(jpeg|jpg|jpe|png|apng|gif|svg)"',
+onlyif => 'req.url ~ 
"^/images/thumb/.*\.(jpeg|jpg|jpe|png|apng|gif|svg|ogv|webm)"',
 }
 
 varnish::backend { 'swift':
diff --git a/puppet/modules/thumbor/templates/thumbor.conf.erb 
b/puppet/modules/thumbor/templates/thumbor.conf.erb
index 7b9cf82..5072fb9 100644
--- a/puppet/modules/thumbor/templates/thumbor.conf.erb
+++ b/puppet/modules/thumbor/templates/thumbor.conf.erb
@@ -434,7 +434,7 @@
 ## List of optimizers that thumbor will use to optimize images
 ## Defaults to: []
 OPTIMIZERS = [
-   'wikimedia_thumbor_exif_optimizer',
+'wikimedia_thumbor_exif_optimizer',
 ]
 
 
@@ -444,7 +444,7 @@
 
 ## Path for the ffmpeg binary used to generate gifv(h.264)
 ## Defaults to: /usr/local/bin/ffmpeg
-#FFMPEG_PATH = '/usr/local/bin/ffmpeg'
+FFMPEG_PATH = '/usr/bin/ffmpeg'
 
 

 
@@ -594,6 +594,12 @@
 
 RSVG_CONVERT_PATH = '/usr/bin/rsvg-convert'
 
-PROXY_ENGINE_ENGINES = [ 'wikimedia_thumbor_svg_engine', 'thumbor.engines.pil' 
]
+FFPROBE_PATH = '/usr/bin/ffprobe'
+
+PROXY_ENGINE_ENGINES = [
+'wikimedia_thumbor_svg_engine',
+'wikimedia_thumbor_video_engine',
+'thumbor.engines.pil'
+]
 
 

diff --git a/puppet/modules/thumbor/templates/varnish.vcl.erb 
b/puppet/modules/thumbor/templates/varnish.vcl.erb
index f5bef39..c90a1c0 100644
--- a/puppet/modules/thumbor/templates/varnish.vcl.erb
+++ b/puppet/modules/thumbor/templates/varnish.vcl.erb
@@ -58,16 +58,24 @@
 }
 
 # qlow jpg thumbs (thumbor)
-if (req.url ~ "^/images/thumb/(.*)/qlow-(\d+)px-.*\.(jpg|jpeg|jpe)") {
-set req.url = "/unsafe/" + regsub(req.url, 
"^/images/thumb/(.*)/qlow-(\d+)px-.*\.(jpg|jpeg|jpe)", "\2") + 
"x/filters:quality(40):sharpen(0.6,0.01,false)/127.0.0.1:<%= 
scope['::swift::port'] %>/v1/

[MediaWiki-commits] [Gerrit] Configure thumbor SVG support - change (mediawiki/vagrant)

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

Change subject: Configure thumbor SVG support
..


Configure thumbor SVG support

Bug: T120204
Change-Id: If219dc72090d97980ac96eef631405fdb5ead9f2
---
M puppet/modules/role/manifests/thumbor.pp
M puppet/modules/role/templates/thumbor/local_repo.php.erb
M puppet/modules/thumbor/manifests/init.pp
M puppet/modules/thumbor/templates/thumbor.conf.erb
4 files changed, 11 insertions(+), 2 deletions(-)

Approvals:
  Dduvall: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/puppet/modules/role/manifests/thumbor.pp 
b/puppet/modules/role/manifests/thumbor.pp
index 6877173..7a9ccce 100644
--- a/puppet/modules/role/manifests/thumbor.pp
+++ b/puppet/modules/role/manifests/thumbor.pp
@@ -29,6 +29,7 @@
 'jpg',
 'jpeg',
 'xcf',
+'svg',
 ],
 },
 }
diff --git a/puppet/modules/role/templates/thumbor/local_repo.php.erb 
b/puppet/modules/role/templates/thumbor/local_repo.php.erb
index ab3f2c4..0847991 100644
--- a/puppet/modules/role/templates/thumbor/local_repo.php.erb
+++ b/puppet/modules/role/templates/thumbor/local_repo.php.erb
@@ -14,6 +14,7 @@
 'jpg' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 'png' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 'gif' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
+'svg' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 ),
 ),
 ),
diff --git a/puppet/modules/thumbor/manifests/init.pp 
b/puppet/modules/thumbor/manifests/init.pp
index 69886f1..a4715e3 100644
--- a/puppet/modules/thumbor/manifests/init.pp
+++ b/puppet/modules/thumbor/manifests/init.pp
@@ -43,6 +43,9 @@
 # For GIF engine
 require_package('gifsicle')
 
+# For SVG engine
+require_package('librsvg2-bin')
+
 $statsd_host = 'localhost'
 $statsd_prefix = 'Thumbor'
 
@@ -71,6 +74,8 @@
 'pylibmc', # For memcache original file storage
 'git+https://gerrit.wikimedia.org/r/thumbor/exif-optimizer',
 'git+https://gerrit.wikimedia.org/r/thumbor/proxy-engine',
+'git+https://gerrit.wikimedia.org/r/thumbor/base-engine',
+'git+https://gerrit.wikimedia.org/r/thumbor/svg-engine',
 ],
 require  => [
 Package['libjpeg-progs'],
@@ -131,7 +136,7 @@
 varnish::backend { 'thumbor':
 host   => '127.0.0.1',
 port   => '',
-onlyif => 'req.url ~ "^/images/thumb/.*\.(jpeg|jpg|jpe|png|apng|gif)"',
+onlyif => 'req.url ~ 
"^/images/thumb/.*\.(jpeg|jpg|jpe|png|apng|gif|svg)"',
 }
 
 varnish::backend { 'swift':
diff --git a/puppet/modules/thumbor/templates/thumbor.conf.erb 
b/puppet/modules/thumbor/templates/thumbor.conf.erb
index 54a010e..7b9cf82 100644
--- a/puppet/modules/thumbor/templates/thumbor.conf.erb
+++ b/puppet/modules/thumbor/templates/thumbor.conf.erb
@@ -592,6 +592,8 @@
 SUBPROCESS_CGEXEC_PATH = '/usr/bin/cgexec'
 SUBPROCESS_CGROUP = 'memory:thumbor'
 
-PROXY_ENGINE_ENGINES = [ 'thumbor.engines.pil' ]
+RSVG_CONVERT_PATH = '/usr/bin/rsvg-convert'
+
+PROXY_ENGINE_ENGINES = [ 'wikimedia_thumbor_svg_engine', 'thumbor.engines.pil' 
]
 
 


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

Gerrit-MessageType: merged
Gerrit-Change-Id: If219dc72090d97980ac96eef631405fdb5ead9f2
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gilles 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Configure thumbor subprocess limits - change (mediawiki/vagrant)

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

Change subject: Configure thumbor subprocess limits
..


Configure thumbor subprocess limits

Bug: T120940
Change-Id: I95ce526c535fccb508e3a48cd83ddf58da8e6181
---
M puppet/modules/role/settings/thumbor.yaml
M puppet/modules/thumbor/manifests/init.pp
M puppet/modules/thumbor/templates/thumbor.conf.erb
3 files changed, 8 insertions(+), 4 deletions(-)

Approvals:
  Dduvall: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/puppet/modules/role/settings/thumbor.yaml 
b/puppet/modules/role/settings/thumbor.yaml
index 46a23c4..2427d90 100644
--- a/puppet/modules/role/settings/thumbor.yaml
+++ b/puppet/modules/role/settings/thumbor.yaml
@@ -1,3 +1,4 @@
+vagrant_ram: 256
 forward_ports:
   :  # thumbor
   6081: 6081 # varnish
diff --git a/puppet/modules/thumbor/manifests/init.pp 
b/puppet/modules/thumbor/manifests/init.pp
index 5118c71..69886f1 100644
--- a/puppet/modules/thumbor/manifests/init.pp
+++ b/puppet/modules/thumbor/manifests/init.pp
@@ -3,9 +3,7 @@
 # This Puppet class installs and configures a Thumbor instance
 #
 # Thumbor is installed as a Python package, and as part of that,
-# pip compiles lxml. This is memory-intensive; you might have to
-# increase the memory available to the VM with something like
-# 'vagrant config vagrant_ram 2048; vagrant reload'.
+# pip compiles lxml.
 #
 # === Parameters
 #
@@ -106,7 +104,7 @@
 }
 
 cgroup::config { 'thumbor':
-limits  => 'memory { memory.limit_in_bytes = "104857600"; }', # 100MB
+limits  => "perm { task { uid = thumbor; gid = thumbor; } admin { uid 
= thumbor; gid = thumbor; } } memory { memory.limit_in_bytes = \"1048576000\"; 
}", # 1GB
 cgrules => '@thumbor memory thumbor',
 }
 
diff --git a/puppet/modules/thumbor/templates/thumbor.conf.erb 
b/puppet/modules/thumbor/templates/thumbor.conf.erb
index 2b9ee7d..54a010e 100644
--- a/puppet/modules/thumbor/templates/thumbor.conf.erb
+++ b/puppet/modules/thumbor/templates/thumbor.conf.erb
@@ -587,6 +587,11 @@
 EXIF_TINYRGB_PATH = '/srv/thumbor/tinyrgb.icc'
 EXIF_TINYRGB_ICC_REPLACE = 'IEC 61966-2.1 Default RGB colour space - sRGB'
 
+SUBPROCESS_TIMEOUT_PATH = '/usr/bin/timeout'
+SUBPROCESS_TIMEOUT = 60
+SUBPROCESS_CGEXEC_PATH = '/usr/bin/cgexec'
+SUBPROCESS_CGROUP = 'memory:thumbor'
+
 PROXY_ENGINE_ENGINES = [ 'thumbor.engines.pil' ]
 
 


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

Gerrit-MessageType: merged
Gerrit-Change-Id: I95ce526c535fccb508e3a48cd83ddf58da8e6181
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gilles 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] SpecialContributions: Simplify check for 'Special:Contributi... - change (mediawiki/core)

2015-12-23 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: SpecialContributions: Simplify check for 
'Special:Contributions/newbies'
..

SpecialContributions: Simplify check for 'Special:Contributions/newbies'

Added in 54615b5ea1a05caf40461b46193b4779e912f528 (per T36659)
as a possibly temporary workaround, it has stuck around for six
release versions now. It's not going to suddenly disappear
and we shouldn't optimize this code for ease of removal :)

Bug: T36659
Change-Id: I946ae7cf164f5c71b2ea4023161df7452bd1745a
---
M includes/specials/SpecialContributions.php
1 file changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/59/260859/1

diff --git a/includes/specials/SpecialContributions.php 
b/includes/specials/SpecialContributions.php
index fc9f750..bf3ab90 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -49,11 +49,7 @@
$target = $request->getVal( 'target' );
}
 
-   // check for radiobox
-   if ( $request->getVal( 'contribs' ) == 'newbie' ) {
-   $target = 'newbies';
-   $this->opts['contribs'] = 'newbie';
-   } elseif ( $par === 'newbies' ) { // b/c for WMF
+   if ( $request->getVal( 'contribs' ) == 'newbie' || $par === 
'newbies' ) {
$target = 'newbies';
$this->opts['contribs'] = 'newbie';
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I946ae7cf164f5c71b2ea4023161df7452bd1745a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] Don't show WikidataPageBanner when printing - change (mediawiki...WikidataPageBanner)

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

Change subject: Don't show WikidataPageBanner when printing
..


Don't show WikidataPageBanner when printing

Add a print-only stylesheet that will reset the header to its default state.
Task done as part of GCI2015.

Bug: T110201
Change-Id: Id72a76eda2b8ad6adc4d0cbde202eb1848e5fee1
---
M extension.json
M includes/WikidataPageBanner.functions.php
A 
resources/ext.WikidataPageBanner.print.styles/ext.WikidataPageBanner.print.less
M templates/banner.mustache
4 files changed, 30 insertions(+), 1 deletion(-)

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



diff --git a/extension.json b/extension.json
index 29a6886..abec042 100644
--- a/extension.json
+++ b/extension.json
@@ -49,6 +49,18 @@
],
"position": "top"
},
+   "ext.WikidataPageBanner.print.styles": {
+   "styles": {
+   
"ext.WikidataPageBanner.print.styles/ext.WikidataPageBanner.print.less": {
+   "media": "print"
+   }
+   },
+   "targets": [
+   "desktop",
+   "mobile"
+   ],
+   "position": "top"
+   },
"ext.WikidataPageBanner.positionBanner": {
"scripts": [

"ext.WikidataPageBanner.positionBanner/ext.WikidataPageBanner.positionBanner.js"
diff --git a/includes/WikidataPageBanner.functions.php 
b/includes/WikidataPageBanner.functions.php
index 29e005a..92101ed 100644
--- a/includes/WikidataPageBanner.functions.php
+++ b/includes/WikidataPageBanner.functions.php
@@ -304,6 +304,7 @@
 
// Add common resources
$out->addModuleStyles( 'ext.WikidataPageBanner' );
+   $out->addModuleStyles( 'ext.WikidataPageBanner.print.styles' );
$out->addModules( 'ext.WikidataPageBanner.positionBanner' );
}
 
diff --git 
a/resources/ext.WikidataPageBanner.print.styles/ext.WikidataPageBanner.print.less
 
b/resources/ext.WikidataPageBanner.print.styles/ext.WikidataPageBanner.print.less
new file mode 100644
index 000..4729748
--- /dev/null
+++ 
b/resources/ext.WikidataPageBanner.print.styles/ext.WikidataPageBanner.print.less
@@ -0,0 +1,16 @@
+/* Reset style on print */
+.ext-wpb-pagebanner {
+  .wpb-topbanner .wpb-name {
+position: initial;
+margin: 0;
+background: none;
+color: initial;
+padding: initial;
+line-height: initial;
+font-size: 1.8em;
+  }
+
+  .image, .wpb-iconbox, .wpb-topbanner-toc {
+display: none;
+  }
+}
diff --git a/templates/banner.mustache b/templates/banner.mustache
index 0a6bebc..7b78e19 100644
--- a/templates/banner.mustache
+++ b/templates/banner.mustache
@@ -1,4 +1,4 @@
-
+

{{#isHeadingOverrideEnabled}}{{title}}{{/isHeadingOverrideEnabled}}


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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id72a76eda2b8ad6adc4d0cbde202eb1848e5fee1
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/WikidataPageBanner
Gerrit-Branch: master
Gerrit-Owner: Scimonster 
Gerrit-Reviewer: Aklapper 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Scimonster 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Improved handling of newline as delimiter - change (mediawiki...Cargo)

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

Change subject: Improved handling of newline as delimiter
..


Improved handling of newline as delimiter

Change-Id: I1aec8b9f2bfd3bbd4dba1e7280d777124d326a92
---
M CargoFieldDescription.php
1 file changed, 2 insertions(+), 5 deletions(-)

Approvals:
  Yaron Koren: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CargoFieldDescription.php b/CargoFieldDescription.php
index b824511..982826a 100644
--- a/CargoFieldDescription.php
+++ b/CargoFieldDescription.php
@@ -114,11 +114,8 @@
}
 
function getDelimiter() {
-   // Make "\n" represent a newline
-   if ( $this->mDelimiter == '\n' ) {
-   return "\n";
-   }
-   return $this->mDelimiter;
+   // Make "\n" represent a newline.
+   return str_replace( '\n', "\n", $this->mDelimiter );
}
 
function setDelimiter( $delimiter ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1aec8b9f2bfd3bbd4dba1e7280d777124d326a92
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Revert "Revert "Use back-end parser for "commons" and "url""" - change (mediawiki...Wikibase)

2015-12-23 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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

Change subject: Revert "Revert "Use back-end parser for "commons" and "url"""
..

Revert "Revert "Use back-end parser for "commons" and "url"""

The backend parsers exist these days, so use them. This
makes way for normalizing commons media and url values.

This reverts commit a74d09ab08769a7dfb98a454675ebf1582c0644f.

Bug: T64193
Bug: T64192
Change-Id: Ifeda8fe38f487f47f5a215aa148258ca3cf01229
---
M repo/resources/parsers/getStore.js
1 file changed, 16 insertions(+), 0 deletions(-)


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

diff --git a/repo/resources/parsers/getStore.js 
b/repo/resources/parsers/getStore.js
index 659b885..8257807 100644
--- a/repo/resources/parsers/getStore.js
+++ b/repo/resources/parsers/getStore.js
@@ -42,6 +42,22 @@
parserStore.registerDataValueParser( Parser, dvType );
} );
 
+   parserStore.registerDataTypeParser(
+   util.inherit(
+   ApiBasedValueParser,
+   { API_VALUE_PARSER_ID: 'commonsMedia'}
+   ),
+   'commonsMedia'
+   );
+
+   parserStore.registerDataTypeParser(
+   util.inherit(
+   ApiBasedValueParser,
+   { API_VALUE_PARSER_ID: 'url'}
+   ),
+   'url'
+   );
+
return parserStore;
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifeda8fe38f487f47f5a215aa148258ca3cf01229
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 2afd7c9..fa66dae - change (mediawiki/extensions)

2015-12-23 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: 2afd7c9..fa66dae
..

Syncronize VisualEditor: 2afd7c9..fa66dae

Change-Id: Idba4dcaf33d752731dec67eb4e19746f1c7cf16e
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions 
refs/changes/57/260857/1

diff --git a/VisualEditor b/VisualEditor
index 2afd7c9..fa66dae 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 2afd7c903d86c79b5923dfb8261c7d5550743684
+Subproject commit fa66daef6c52e8a55315d71d2201cfe8a2f8fbaf

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idba4dcaf33d752731dec67eb4e19746f1c7cf16e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 2afd7c9..fa66dae - change (mediawiki/extensions)

2015-12-23 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: 2afd7c9..fa66dae
..


Syncronize VisualEditor: 2afd7c9..fa66dae

Change-Id: Idba4dcaf33d752731dec67eb4e19746f1c7cf16e
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index 2afd7c9..fa66dae 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 2afd7c903d86c79b5923dfb8261c7d5550743684
+Subproject commit fa66daef6c52e8a55315d71d2201cfe8a2f8fbaf

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idba4dcaf33d752731dec67eb4e19746f1c7cf16e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 
Gerrit-Reviewer: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Add README pointing to Extension:Flow - change (mediawiki...Flow)

2015-12-23 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Add README pointing to Extension:Flow
..

Add README pointing to Extension:Flow

Bug: T65125
Change-Id: I624aee2d04567f09d210ba3f93969180c20e887b
---
A README
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/README b/README
new file mode 100644
index 000..e791695
--- /dev/null
+++ b/README
@@ -0,0 +1,3 @@
+Flow is an extension that provides a discussion system for MediaWiki wikis.
+
+See https://www.mediawiki.org/wiki/Extension:Flow for more information.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I624aee2d04567f09d210ba3f93969180c20e887b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 

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


[MediaWiki-commits] [Gerrit] Improved handling of newline as delimiter - change (mediawiki...Cargo)

2015-12-23 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Improved handling of newline as delimiter
..

Improved handling of newline as delimiter

Change-Id: I1aec8b9f2bfd3bbd4dba1e7280d777124d326a92
---
M CargoFieldDescription.php
1 file changed, 2 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/51/260851/1

diff --git a/CargoFieldDescription.php b/CargoFieldDescription.php
index b824511..982826a 100644
--- a/CargoFieldDescription.php
+++ b/CargoFieldDescription.php
@@ -114,11 +114,8 @@
}
 
function getDelimiter() {
-   // Make "\n" represent a newline
-   if ( $this->mDelimiter == '\n' ) {
-   return "\n";
-   }
-   return $this->mDelimiter;
+   // Make "\n" represent a newline.
+   return str_replace( '\n', "\n", $this->mDelimiter );
}
 
function setDelimiter( $delimiter ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1aec8b9f2bfd3bbd4dba1e7280d777124d326a92
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] Fix misaligned search bar on tablet size - change (mediawiki...MobileFrontend)

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

Change subject: Fix misaligned search bar on tablet size
..


Fix misaligned search bar on tablet size

Unnecessary pulling of search bar to the left for tablet screens
(only necessary on desktop)

Bug: T119918
Change-Id: Idb4da00eee8508c8c026902a739ac5d4125f026b
---
M resources/mobile.overlays/Overlay.less
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/resources/mobile.overlays/Overlay.less 
b/resources/mobile.overlays/Overlay.less
index 9586b2f..a98e572 100644
--- a/resources/mobile.overlays/Overlay.less
+++ b/resources/mobile.overlays/Overlay.less
@@ -367,7 +367,9 @@
padding: 12px @contentPaddingTablet;
}
}
+}
 
+@media all and (min-width: @wgMFDeviceWidthDesktop) {
.overlay-header {
.cancel {
// so that the icon image is aligned with the content
@@ -380,4 +382,3 @@
}
}
 }
-

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb4da00eee8508c8c026902a739ac5d4125f026b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Sn1per 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Jdlrobson 
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 missing test for DataTypeSelector - change (mediawiki...Wikibase)

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

Change subject: Add missing test for DataTypeSelector
..


Add missing test for DataTypeSelector

Change-Id: I63048d5f5e83d63c1849ff77d8dac6b483025b52
---
A repo/tests/phpunit/includes/DataTypeSelectorTest.php
1 file changed, 95 insertions(+), 0 deletions(-)

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



diff --git a/repo/tests/phpunit/includes/DataTypeSelectorTest.php 
b/repo/tests/phpunit/includes/DataTypeSelectorTest.php
new file mode 100644
index 000..d261b0a
--- /dev/null
+++ b/repo/tests/phpunit/includes/DataTypeSelectorTest.php
@@ -0,0 +1,95 @@
+', '' ) ),
+   'qqx'
+   );
+   }
+
+   /**
+* @dataProvider getHtmlProvider
+*/
+   public function testGetHtml( array $dataTypes, $selectedTypeId, 
$expected ) {
+   $selector = $this->newInstance( $dataTypes );
+   $html = $selector->getHtml( '', '', $selectedTypeId );
+   $this->assertSame( $expected, $html );
+   }
+
+   public function getHtmlProvider() {
+   return array(
+   array(
+   array(),
+   '',
+   ''
+   . ''
+   ),
+   array(
+   array( new DataType( '', '' ) ),
+   '',
+   ''
+   . '(datatypes-type-)'
+   . ''
+   ),
+   array(
+   array( new DataType( 'PT1', 'VT1' ), new 
DataType( 'PT2', 'VT2' ) ),
+   'PT2',
+   ''
+   . '(datatypes-type-PT1)'
+   . '(datatypes-type-PT2)'
+   . ''
+   ),
+   );
+   }
+
+   public function testGetOptionsArray() {
+   $selector = $this->newInstance();
+   $options = $selector->getOptionsArray();
+   $this->assertSame( array( '' => '(datatypes-type-)' ), 
$options );
+   }
+
+   /**
+* @dataProvider testGetOptionsHtmlProvider
+*/
+   public function testGetOptionsHtml( $selectedTypeId, $expected ) {
+   $selector = $this->newInstance();
+   $html = $selector->getOptionsHtml( $selectedTypeId );
+   $this->assertSame( $expected, $html );
+   }
+
+   public function testGetOptionsHtmlProvider() {
+   return array(
+   array(
+   '',
+   '(datatypes-type-)'
+   ),
+   array(
+   '',
+   '(datatypes-type-)'
+   ),
+   );
+   }
+
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I63048d5f5e83d63c1849ff77d8dac6b483025b52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Jeroen De Dauw 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


  1   2   3   >