[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Update .mailmap file

2017-08-04 Thread devunt (Code Review)
devunt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370307 )

Change subject: Update .mailmap file
..

Update .mailmap file

Fix cases and orders in my name
Also updates CREDITS by running maintenance/updateCredits.php

Change-Id: I230208132e3fc89286d7184b2cc5876d6c8fdc30
---
M .mailmap
M CREDITS
2 files changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/07/370307/1

diff --git a/.mailmap b/.mailmap
index 2134fc5..5a76fb9 100644
--- a/.mailmap
+++ b/.mailmap
@@ -63,6 +63,7 @@
 Audrey Tang 
 Audrey Tang  
 ayush_garg 
+Bae Junehyeon 
 Bahodir Mansurov 
 Bartosz Dziewoński 
 Bartosz Dziewoński  
@@ -227,7 +228,6 @@
 Jon Robson  
 Juliusz Gonera 
 Juliusz Gonera  
-JuneHyeon Bae 
 Jure Kajzer 
 Jure Kajzer  
 Justin Du 
diff --git a/CREDITS b/CREDITS
index 14c454e..94b10cd 100644
--- a/CREDITS
+++ b/CREDITS
@@ -78,6 +78,7 @@
 * awu42
 * ayush_garg
 * Azliq7
+* Bae Junehyeon
 * Bagariavivek
 * Bahodir Mansurov
 * balloonguy

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Score[master]: Run lilypond from inside firejail

2017-08-04 Thread Ebe123 (Code Review)
Ebe123 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370306 )

Change subject: Run lilypond from inside firejail
..

Run lilypond from inside firejail

Firejail prevents the execution of malicious code and is used by
Wikimedia when running commands such as `convert`. This change
replaces the current line of defence in Lilypond code, of which used
the `-dsafe` argument, with Firejail.

A new global: `$wgScoreFirejail` has been created for Firejail's path,
and a profile (based on puppet's) was added to the extension.

This change resolves T171372 and its subtasks, even though the subtasks
appear to be unrelated. The were nonetheless all caused by the very
restrictive `safe` argument, of which Firejail supercedes.

Bug: T171372
Bug: T54883
Bug: T60526
Bug: T161293
Change-Id: I926fbe6b31b7ef95a0994c6a460972e46a07b4ae
---
M README
M Score.body.php
M Score.hooks.php
M extension.json
A firejail.profile
5 files changed, 56 insertions(+), 3 deletions(-)


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

diff --git a/README b/README
index bece82e..b5a5d6a 100644
--- a/README
+++ b/README
@@ -33,6 +33,8 @@
 5. Add the lines
 
require_once("$IP/extensions/Score/Score.php");
+   $wgScoreFirejail = '/path/to/your/firejail/executable'; /* required for
+  security */
$wgScoreLilyPond = '/path/to/your/lilypond/executable'; /* required */
$wgScoreAbc2Ly = '/path/to/your/abc2ly/executable'; /* if you want ABC to
   LilyPond conversion 
*/
diff --git a/Score.body.php b/Score.body.php
index 0a6517f..2c01986 100644
--- a/Score.body.php
+++ b/Score.body.php
@@ -517,10 +517,14 @@
 * @throws ScoreException on error.
 */
private static function generatePngAndMidi( $code, $options, &$metaData 
) {
-   global $wgScoreLilyPond, $wgScoreTrim;
+   global $wgScoreLilyPond, $wgScoreFirejail, $wgScoreTrim;
 
if ( !is_executable( $wgScoreLilyPond ) ) {
throw new ScoreException( wfMessage( 
'score-notexecutable', $wgScoreLilyPond ) );
+   }
+
+   if ( !is_executable( $wgScoreFirejail ) ) {
+   throw new ScoreException( wfMessage( 
'score-notexecutable', $wgScoreFirejail ) );
}
 
/* Create the working environment */
@@ -564,8 +568,9 @@
// probably won't do anything.
$env = [ 'LILYPOND_GC_YIELD' => '25' ];
 
-   $cmd = wfEscapeShellArg( $wgScoreLilyPond )
-   . ' ' . wfEscapeShellArg( '-dsafe=#t' )
+   $cmd = wfEscapeShellArg( $wgScoreFirejail ) // Setup Firejail
+   . ' --profile=' . wfEscapeShellArg( __DIR__ ) . 
'/firejail.profile '
+   . wfEscapeShellArg( $wgScoreLilyPond )
. ' -dmidi-extension=midi' // midi needed for Windows 
to generate the file
. ' -dbackend=ps --png --header=texidoc '
. wfEscapeShellArg( $factoryLy )
diff --git a/Score.hooks.php b/Score.hooks.php
index 855a7b4..f36d17c 100644
--- a/Score.hooks.php
+++ b/Score.hooks.php
@@ -18,8 +18,24 @@
public static function onSoftwareInfo( array &$software ) {
try {
$software[ '[http://lilypond.org/ LilyPond]' ] = 
Score::getLilypondVersion();
+   $software[ '[https://firejail.wordpress.com/ Firejail]' 
] = self::getFJVersion();
} catch ( ScoreException $ex ) {
// LilyPond executable can't found
}
}
+
+   private static function getFJVersion() {
+   global $wgScoreFirejail;
+
+   if ( !is_executable( $wgScoreFirejail ) ) {
+   throw new ScoreException( wfMessage( 
'score-notexecutable', $wgScoreFirejail ) );
+   }
+
+   $cmd = wfEscapeShellArg( $wgScoreFirejail ) . ' --version 2>&1';
+   $output = wfShellExec( $cmd, $rc );
+   if ( $rc != 0 ) {
+   self::throwCallException( wfMessage( 'score-versionerr' 
), $output );
+   }
+   return sscanf( $output, 'firejail version %s' )[0];
+   }
 }
diff --git a/extension.json b/extension.json
index f585433..d37b58c 100644
--- a/extension.json
+++ b/extension.json
@@ -68,6 +68,7 @@
},
"config": {
"ScoreTrim": null,
+   "ScoreFirejail": "/usr/bin/firejail",
"ScoreLilyPond": "/usr/bin/lilypond",
"ScoreAbc2Ly": "/usr/bin/abc2ly",
"ScoreTimidity": "/usr/bin/timidity",
diff --git a/firejail.profile b/firejail.profile
new file mode 100644
index 000..b0431c8
--- /dev/null

[MediaWiki-commits] [Gerrit] operations/puppet[production]: toolforge: Add qstat-full to bastions

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370298 )

Change subject: toolforge: Add qstat-full to bastions
..


toolforge: Add qstat-full to bastions

This is a handy way to get untruncated output from qstat that I started
using this week. Chase thought it was neat enough that we should have it
on all of the bastions.

Change-Id: I323b1bd7faf1289151d56d3e6169c1ff240ab5c5
---
A modules/toollabs/files/qstat-full
M modules/toollabs/manifests/bastion.pp
2 files changed, 28 insertions(+), 0 deletions(-)

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



diff --git a/modules/toollabs/files/qstat-full 
b/modules/toollabs/files/qstat-full
new file mode 100755
index 000..4c5095f
--- /dev/null
+++ b/modules/toollabs/files/qstat-full
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Display full qstat data.
+#
+# Normal usage of `qstat` will truncate columns to fit to the screen. This
+# version instead reads from the "xml" output format and formats as columns
+# using a crazy pants tr & sed pipeline. Very nice for doing things like:
+#
+#   # list of all running jobs grouped by tool and sorted by start time
+#   qstat-full -u '*' |
+#   awk 'BEGIN { OFS="\t" } {print $1, $3, $6, $5}' |
+#   sort -n -k 3 |
+#   sort -s -k 2
+#
+
+qstat -xml "$@" |
+tr '\n' ' ' |
+sed 's#]*>#\n#g' |
+sed 's#<[^>]*>##g' |
+grep ' ' |
+column -t
diff --git a/modules/toollabs/manifests/bastion.pp 
b/modules/toollabs/manifests/bastion.pp
index b66db11..43dada5 100644
--- a/modules/toollabs/manifests/bastion.pp
+++ b/modules/toollabs/manifests/bastion.pp
@@ -235,4 +235,12 @@
 mode   => '0655',
 source => 'puppet:///modules/toollabs/exec-manage',
 }
+
+file { '/usr/local/sbin/qstat-full':
+ensure => file,
+owner  => 'root',
+group  => 'root',
+mode   => '0655',
+source => 'puppet:///modules/toollabs/qstat-full',
+}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I323b1bd7faf1289151d56d3e6169c1ff240ab5c5
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Madhuvishy 
Gerrit-Reviewer: Rush 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Score[master]: Update documentation

2017-08-04 Thread Ebe123 (Code Review)
Ebe123 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370305 )

Change subject: Update documentation
..

Update documentation

Rendered the installation guide up-to-date and
matched the documentation of the tag attributes
to the code.

Bug: T113046
Change-Id: Ie4818d6a9edc18c1cefdbcbff217ed0721130f1c
---
M README
1 file changed, 15 insertions(+), 21 deletions(-)


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

diff --git a/README b/README
index bece82e..834e7bf 100644
--- a/README
+++ b/README
@@ -15,24 +15,22 @@
 
 for more information.
 
-This extension was tested with LilyPond 2.12.3.
+This extension was tested with LilyPond 2.12.3 through 2.18.2.
 
 
 Setup
 =
 
 1. Change to the "extensions" directory of your MediaWiki installation.
-2. Create a new subdirectory named "Score".
-3. Copy the files Score.php, Score.body.php and Score.i18n.php into the new
-   subdirectory. Make sure they are readable by your webserver.
-4. Create a subdirectory named "lilypond" in your $wgUploadDirectory (usually
+2. Clone this repository.
+3. Create a subdirectory named "lilypond" in your $wgUploadDirectory (usually
the directory named "images" in in your MediaWiki directory). Make sure
the directory is writable by your webserver. If you do not create this
directory, the Score extension will attempt to create it for you with the
rights available to it.
-5. Add the lines
+4. Add the lines
 
-   require_once("$IP/extensions/Score/Score.php");
+   wfLoadExtension( 'score' );
$wgScoreLilyPond = '/path/to/your/lilypond/executable'; /* required */
$wgScoreAbc2Ly = '/path/to/your/abc2ly/executable'; /* if you want ABC to
   LilyPond conversion 
*/
@@ -79,9 +77,8 @@
   .
 
 * Attribute: midi
-  Allowed values: 0 (default), 1
-  Effect: If set to 1, the rendered image(s) will be embedded into a hyperlink
-  to an appropriate MIDI file.
+  Effect: If included in the tag, the rendered image(s) will be embedded into a
+  hyperlink to an appropriate MIDI file.
 
 * Attribute: override_ogg
   Allowed values: Known file name, that is, if override_ogg="name" is given,
@@ -95,16 +92,13 @@
   page, if you prefer.
 
 * Attribute: raw
-  Allowed valued: 0 (default), 1
-  Effect: If set to 1, the score code is interpreted as a complete LilyPond
-  file. Use this option if you want to create more complex scores.
-  If the score language (lang attribute) is not set to lilypond, this
-  attribute is ignored.
+  Effect: If included in the tag, the score code is interpreted as a complete
+  LilyPond file. Use this option if you want to create more complex
+  scores. If the score language (lang attribute) is not set to
+  lilypond, this attribute is ignored.
 
 * Attribute: vorbis
-  Allowed values: 0 (default), 1
-  Effect: If set to 1, an Ogg/Vorbis file will be generated for the score,
-  provided you installed and configured the OggHandler extension.
-  An Ogg/Vorbis player will be embedded in the HTML below the score
-  image(s).
-
+  Effect: If included in the tag, an Ogg/Vorbis file will be generated for the
+  score, provided you installed and configured the OggHandler
+  extension. An Ogg/Vorbis player will be embedded in the HTML below
+  the score image(s).

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4818d6a9edc18c1cefdbcbff217ed0721130f1c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Score
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] mediawiki...GlobalPreferences[master]: Globalize preferences that specify class instead of type

2017-08-04 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370304 )

Change subject: Globalize preferences that specify class instead of type
..

Globalize preferences that specify class instead of type

Bug: T172083
Change-Id: I33bb4fabe6156c3d35a776d6ca2d68ba832c86b7
---
M GlobalPreferences.hooks.php
1 file changed, 36 insertions(+), 9 deletions(-)


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

diff --git a/GlobalPreferences.hooks.php b/GlobalPreferences.hooks.php
index fecc178..df40271 100644
--- a/GlobalPreferences.hooks.php
+++ b/GlobalPreferences.hooks.php
@@ -7,7 +7,7 @@
 * Special:GlobalPrefs
 * @var array
 */
-   protected static $badPrefs = [
+   protected static $prefsBlacklist = [
// Stored in user table, doesn't work yet
'realname',
// @todo Show CA user id / shared user table id?
@@ -23,10 +23,21 @@
 * Preference types that we should not add a checkbox for
 * @var array
 */
-   protected static $badTypes = [
+   protected static $typeBlacklist = [
'info',
'hidden',
'api',
+   ];
+
+   /**
+* Preference classes that are allowed to be global
+* @var array
+*/
+   protected static $classWhitelist = [
+   'HTMLSelectOrOtherField',
+   'CirrusSearch\HTMLCompletionProfileSettings',
+   'NewHTMLCheckField',
+   'HTMLFeatureField',
];
 
/**
@@ -126,7 +137,7 @@
foreach ( $formData as $name => $value ) {
if ( substr( $name, -strlen( 'global' ) ) === 'global' 
&& $value === true ) {
$realName = substr( $name, 0, -strlen( 
'-global' ) );
-   if ( isset( $formData[$realName] ) && 
!in_array( $realName, self::$badPrefs ) ) {
+   if ( isset( $formData[$realName] ) && 
!in_array( $realName, self::$prefsBlacklist ) ) {
$prefs[$realName] = 
$formData[$realName];
} else {
// FIXME: Handle checkbox matrixes 
properly
@@ -196,11 +207,8 @@
}
foreach ( $prefs as $name => $info ) {
// FIXME: This whole code section sucks
-   if ( isset( $info['type'] )
-   && substr( $name, -strlen( 'global' ) ) 
!== 'global'
-   && !isset( $prefs["$name-global"] )
-   && !in_array( $info['type'], 
self::$badTypes )
-   && !in_array( $name, self::$badPrefs )
+   if ( !isset( $prefs["$name-global"] )
+   && self::isGlobalizablePreference( 
$name, $info )
) {
$prefs = wfArrayInsertAfter( $prefs, [
"$name-global" => [
@@ -211,7 +219,7 @@
'cssclass' => 
'mw-globalprefs-global-check',
]
], $name );
-   } elseif ( in_array( $name, self::$badPrefs ) ) 
{
+   } elseif ( in_array( $name, 
self::$prefsBlacklist ) ) {
$prefs[$name]['type'] = 'hidden';
}
}
@@ -256,4 +264,23 @@
 
return true;
}
+
+   /**
+* Checks whether the given preference is localizable
+*
+* @param string $name Preference name
+* @param array|mixed $info Preference description, by reference to 
avoid unnecessary cloning
+* @return bool
+*/
+   private static function isGlobalizablePreference( $name, &$info ) {
+   $isAllowedType = isset( $info['type'] )
+   && !in_array( $info['type'], self::$typeBlacklist )
+   && !in_array( $name, self::$prefsBlacklist );
+
+   $isAllowedClass = isset( $info['class'] )
+   && in_array( $info['class'], self::$classWhitelist );
+
+   return substr( $name, -strlen( 'global' ) ) !== 'global'
+   && ( $isAllowedType || $isAllowedClass );
+   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33bb4fabe6156c3d35a776d6ca2d68ba832c86b7
Gerrit-PatchSet: 1
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] mediawiki...Score[master]: Set file extension to fix "No MIDI file generated" error on ...

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/147015 )

Change subject: Set file extension to fix "No MIDI file generated" error on 
Windows
..


Set file extension to fix "No MIDI file generated" error on Windows

As Lilypond uses .mid as default extension on Windows, 
pass "-dmidi-extension=midi" as command line parameter.
See http://www.lilypond.org/doc/v2.17/Documentation/usage/command_002dline-usage

Bug: T49703

Change-Id: Ib1d98103047424f8e82873fb14728f3f30c76233
---
M Score.body.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/Score.body.php b/Score.body.php
index 6cb8304..0a6517f 100644
--- a/Score.body.php
+++ b/Score.body.php
@@ -566,6 +566,7 @@
 
$cmd = wfEscapeShellArg( $wgScoreLilyPond )
. ' ' . wfEscapeShellArg( '-dsafe=#t' )
+   . ' -dmidi-extension=midi' // midi needed for Windows 
to generate the file
. ' -dbackend=ps --png --header=texidoc '
. wfEscapeShellArg( $factoryLy )
. ' 2>&1';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1d98103047424f8e82873fb14728f3f30c76233
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: Gnosygnu 
Gerrit-Reviewer: Aarcos 
Gerrit-Reviewer: Aklapper 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Ebe123 
Gerrit-Reviewer: Gnosygnu 
Gerrit-Reviewer: MarkTraceur 
Gerrit-Reviewer: Qgil 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Don't declare ApiQueryLinks::$titlesParam dynamically

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370243 )

Change subject: Don't declare ApiQueryLinks::$titlesParam dynamically
..


Don't declare ApiQueryLinks::$titlesParam dynamically

Change-Id: Ie7b553b2d368766df2c3989d58e42f1b6d3d6779
---
M includes/api/ApiQueryLinks.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php
index 29c0b74..3639c06 100644
--- a/includes/api/ApiQueryLinks.php
+++ b/includes/api/ApiQueryLinks.php
@@ -34,7 +34,7 @@
const LINKS = 'links';
const TEMPLATES = 'templates';
 
-   private $table, $prefix, $helpUrl;
+   private $table, $prefix, $titlesParam, $helpUrl;
 
public function __construct( ApiQuery $query, $moduleName ) {
switch ( $moduleName ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7b553b2d368766df2c3989d58e42f1b6d3d6779
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...wmf[master]: [WIP] Add functions for working with interleaved experiments

2017-08-04 Thread Bearloga (Code Review)
Bearloga has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370303 )

Change subject: [WIP] Add functions for working with interleaved experiments
..

[WIP] Add functions for working with interleaved experiments

Bug: T150032
Change-Id: Ie6aa90fad2b25a07b200a2c822f5a34227cca8c8
---
A .lintr
M DESCRIPTION
M NAMESPACE
M NEWS.md
A R/RcppExports.R
A R/chisq_test.R
M R/dataviz.R
M R/global.R
M R/hive.R
A R/interleaved.R
M R/logs.R
M R/mysql.R
D R/power.R
M R/proxies.R
M R/time.R
M R/wmf.R
M R/writers.R
M README.md
A data/interleaved_data.rda
A data/interleaved_data_a.rda
A data/interleaved_data_b.rda
M man/FiveThirtyNine.Rd
M man/build_query.Rd
A man/chisq_test_effect.Rd
R man/chisq_test_odds.Rd
M man/date_clause.Rd
A man/exact_binom.Rd
M man/get_logfile.Rd
M man/global_query.Rd
A man/interleaved.Rd
M man/mysql.Rd
M man/query_hive.Rd
M man/read_sampled_log.Rd
M man/rewrite_conditional.Rd
D man/sample_size_effect.Rd
M man/set_proxies.Rd
A man/theme_facet.Rd
A man/theme_min.Rd
M man/timeconverters.Rd
A man/wmf.Rd
M man/write_conditional.Rd
A src/.gitignore
A src/RcppExports.cpp
A src/exact_binom.cpp
A tests/testthat/test-interleaved.R
A tests/testthat/test-power.R
A tests/testthat/test-queries.R
A tests/testthat/test-syntax.R
D tests/testthat/testSampleSizeCalcs.R
M wmf.Rproj
50 files changed, 1,338 insertions(+), 724 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/wmf 
refs/changes/03/370303/1

diff --git a/.lintr b/.lintr
new file mode 100644
index 000..997b47c
--- /dev/null
+++ b/.lintr
@@ -0,0 +1,5 @@
+linters: with_defaults(line_length_linter(120), object_usage_linter = NULL, 
closed_curly_linter = NULL, open_curly_linter = NULL, 
spaces_left_parentheses_linter = NULL)
+exclusions: list("R/RcppExports.R")
+exclude: "# Exclude Linting"
+exclude_start: "# Begin Exclude Linting"
+exclude_end: "# End Exclude Linting"
diff --git a/DESCRIPTION b/DESCRIPTION
index f739244..c3bf5dc 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,24 +1,35 @@
 Package: wmf
 Type: Package
 Title: R Code for Wikimedia Foundation Internal Usage
-Version: 0.2.6
-Date: 2017-01-23
+Version: 0.3.0
+Date: 2017-08-04
 Authors@R: c(
-  person("Oliver", "Keyes", role = "aut"),
-  person("Mikhail", "Popov", email = "mpo...@wikimedia.org", role = c("aut", 
"cre")))
-Description: More about what it does (maybe more than one line).
+person("Mikhail", "Popov", email = "mikh...@wikimedia.org", role = 
c("aut", "cre")),
+person("Oliver", "Keyes", role = "aut", comment = "No longer employed at 
the Foundation"),
+person("Chelsy", "Xie", email = "c...@wikimedia.org", role = "ctb")
+)
+Description: This package contains functions made for Analysts at Wikimedia
+Foundation, but can be used by people outside of the Foundation.
 License: Uh
-LazyData: TRUE
-Imports:
-RMySQL,
-urltools,
-pwr,
-ggplot2,
-readr,
-ggthemes
 URL: https://phabricator.wikimedia.org/diffusion/1821/
 BugReports: https://phabricator.wikimedia.org/maniphest/task/create/?
 projects=Discovery-Analysis
+Imports:
+RMySQL,
+Rcpp,
+urltools,
+pwr,
+readr,
+ggplot2,
+ggthemes,
+lubridate,
+progress
 Suggests:
+lintr,
 testthat
-RoxygenNote: 5.0.1
+LinkingTo:
+Rcpp,
+BH
+LazyData: TRUE
+Roxygen: list(markdown = TRUE)
+RoxygenNote: 6.0.1
diff --git a/NAMESPACE b/NAMESPACE
index 4a137c4..b2754ea 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,11 +1,16 @@
 # Generated by roxygen2: do not edit by hand
 
 export(build_query)
+export(chisq_test_effect)
+export(chisq_test_odds)
 export(date_clause)
+export(exact_binom)
 export(from_log)
 export(from_mediawiki)
 export(get_logfile)
 export(global_query)
+export(interleaved_preference)
+export(interleaved_sample_size)
 export(mysql_close)
 export(mysql_connect)
 export(mysql_disconnect)
@@ -15,8 +20,6 @@
 export(query_hive)
 export(read_sampled_log)
 export(rewrite_conditional)
-export(sample_size_effect)
-export(sample_size_odds)
 export(set_proxies)
 export(theme_fivethirtynine)
 export(to_log)
@@ -24,14 +27,8 @@
 export(write_conditional)
 import(ggplot2)
 import(ggthemes)
+importFrom(Rcpp,sourceCpp)
 importFrom(pwr,pwr.chisq.test)
 importFrom(readr,read_tsv)
 importFrom(urltools,url_decode)
-importMethodsFrom(RMySQL,dbClearResult)
-importMethodsFrom(RMySQL,dbConnect)
-importMethodsFrom(RMySQL,dbDisconnect)
-importMethodsFrom(RMySQL,dbExistsTable)
-importMethodsFrom(RMySQL,dbListResults)
-importMethodsFrom(RMySQL,dbSendQuery)
-importMethodsFrom(RMySQL,dbWriteTable)
-importMethodsFrom(RMySQL,fetch)
+useDynLib(wmf)
diff --git a/NEWS.md b/NEWS.md
index a414f5d..b267be2 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,11 @@
+wmf 0.3.0
+=
+* C++-based `exact_binomial()` to estimate sample size for exact binomial tests
+* Functions for working with interleaved search results experiments; see 
`?interleaved` for details
+* 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SpecialWatchlist: Always apply a LIMIT

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370302 )

Change subject: SpecialWatchlist: Always apply a LIMIT
..


SpecialWatchlist: Always apply a LIMIT

In non-extended mode, the query that SpecialWatchlist ran
was unlimited, which is a very bad idea, since some users
have tens of thousands of pages on their watchlist.
There are broader performance issues with large watchlists,
but this doesn't help.

With this patch the wllimit preference is used to limit
the number of results both in expanded and in non-expanded mode.

Bug: T171027
Change-Id: Ifcefe6f77fa4adeca2e50714813004018819aee8
---
M includes/specials/SpecialWatchlist.php
M languages/i18n/en.json
2 files changed, 5 insertions(+), 7 deletions(-)

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



diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index 549362f..9e01d2d 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -277,7 +277,6 @@
 
# Toggle watchlist content (all recent edits or just the latest)
if ( $opts['extended'] ) {
-   $limitWatchlist = $user->getIntOption( 'wllimit' );
$usePage = false;
} else {
# Top log Ids for a page are not stored
@@ -292,14 +291,16 @@
LIST_OR
);
}
-   $limitWatchlist = 0;
$usePage = true;
}
 
$tables = array_merge( [ 'recentchanges', 'watchlist' ], 
$tables );
$fields = array_merge( RecentChange::selectFields(), $fields );
 
-   $query_options = array_merge( [ 'ORDER BY' => 'rc_timestamp 
DESC' ], $query_options );
+   $query_options = array_merge( [
+   'ORDER BY' => 'rc_timestamp DESC',
+   'LIMIT' => $user->getIntOption( 'wllimit' )
+   ], $query_options );
$join_conds = array_merge(
[
'watchlist' => [
@@ -316,9 +317,6 @@
 
if ( $this->getConfig()->get( 'ShowUpdatedMarker' ) ) {
$fields[] = 'wl_notificationtimestamp';
-   }
-   if ( $limitWatchlist ) {
-   $query_options['LIMIT'] = $limitWatchlist;
}
 
$rollbacker = $user->isAllowed( 'rollback' );
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index aa1254c..a14e926 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1021,7 +1021,7 @@
"prefs-editwatchlist-clear": "Clear your watchlist",
"prefs-watchlist-days": "Days to show in watchlist:",
"prefs-watchlist-days-max": "Maximum $1 {{PLURAL:$1|day|days}}",
-   "prefs-watchlist-edits": "Maximum number of changes to show in expanded 
watchlist:",
+   "prefs-watchlist-edits": "Maximum number of changes to show in 
watchlist:",
"prefs-watchlist-edits-max": "Maximum number: 1000",
"prefs-watchlist-token": "Watchlist token:",
"prefs-misc": "Misc",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifcefe6f77fa4adeca2e50714813004018819aee8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Set a min and max on the rclimit preference

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370301 )

Change subject: Set a min and max on the rclimit preference
..


Set a min and max on the rclimit preference

The same values as wllimit.

Change-Id: I1fbc063455799f7d886d26c7030662f431feb627
---
M includes/Preferences.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/includes/Preferences.php b/includes/Preferences.php
index de6d681..15ed2d4 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -901,6 +901,8 @@
];
$defaultPreferences['rclimit'] = [
'type' => 'int',
+   'min' => 0,
+   'max' => 1000,
'label-message' => 'recentchangescount',
'help-message' => 'prefs-help-recentchangescount',
'section' => 'rc/displayrc',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1fbc063455799f7d886d26c7030662f431feb627
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Update GUI

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370240 )

Change subject: Update GUI
..


Update GUI

Change-Id: If66b78d7d012de4fd6108b099348d730c3154630
---
M gui
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/gui b/gui
index 9e444d5..2009b22 16
--- a/gui
+++ b/gui
@@ -1 +1 @@
-Subproject commit 9e444d5d4a84aeae56547b6ecf96899fac788813
+Subproject commit 2009b2255840495773d9a2a8ae0042e97219c244

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If66b78d7d012de4fd6108b099348d730c3154630
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...EducationProgram[master]: Remove unused code, unused function parameters, and unused r...

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/361417 )

Change subject: Remove unused code, unused function parameters, and unused 
returns
..


Remove unused code, unused function parameters, and unused returns

Change-Id: I374d8c38c40d7d13b4d3b7ef1d427051d1b87958
---
M EducationProgram.hooks.php
M includes/actions/EditCourseAction.php
M includes/pagers/EPPager.php
M includes/specials/VerySpecialPage.php
M includes/tables/PageTable.php
M resources/ep.js
6 files changed, 4 insertions(+), 30 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve



diff --git a/EducationProgram.hooks.php b/EducationProgram.hooks.php
index 3d2ea69..9c4a898 100755
--- a/EducationProgram.hooks.php
+++ b/EducationProgram.hooks.php
@@ -646,8 +646,7 @@
// This will return only unique values.
$userCourseFinder = new UPCUserCourseFinder( $dbw );
 
-   $courseIds =
-   $userCourseFinder->getCoursesForUsers( $oldId, [], 
false );
+   $courseIds = $userCourseFinder->getCoursesForUsers( $oldId );
 
// Fields with arrays of the ids of users that have a role in a 
course
$roleFields = [
diff --git a/includes/actions/EditCourseAction.php 
b/includes/actions/EditCourseAction.php
index 88ee847..9251c29 100644
--- a/includes/actions/EditCourseAction.php
+++ b/includes/actions/EditCourseAction.php
@@ -168,8 +168,6 @@
protected function getFormFields() {
$fields = parent::getFormFields();
 
-   $orgOptions = Orgs::singleton()->selectFields( [ 'name', 'id' ] 
);
-
$messageMethod = [ $this, 'msg' ];
 
// Show description ("page text") field to all users
diff --git a/includes/pagers/EPPager.php b/includes/pagers/EPPager.php
index e567fa3..1db0ab4 100644
--- a/includes/pagers/EPPager.php
+++ b/includes/pagers/EPPager.php
@@ -272,7 +272,7 @@
 
if ( $this->enableFilter ) {
$filterOptions = $this->getFilterOptions();
-   $this->addFilterValues( $filterOptions, false );
+   $this->addFilterValues( $filterOptions );
 
foreach ( $filterOptions as $optionName => $optionData 
) {
if ( array_key_exists( 'value', $optionData ) 
&& $optionData['value'] !== '' ) {
diff --git a/includes/specials/VerySpecialPage.php 
b/includes/specials/VerySpecialPage.php
index 8356ccf..3288a1f 100644
--- a/includes/specials/VerySpecialPage.php
+++ b/includes/specials/VerySpecialPage.php
@@ -54,8 +54,6 @@
 * @since 0.1
 *
 * @param string|null $subPage
-*
-* @return bool
 */
public function execute( $subPage ) {
$this->cacheEnabled = Settings::get( 'enablePageCache' );
@@ -69,12 +67,10 @@
// If the user is authorized, display the page, if not, show an 
error.
if ( !$this->userCanExecute( $this->getUser() ) ) {
$this->displayRestrictionError();
-   return false;
+   return;
}
 
Utils::displayResult( $this->getContext() );
-
-   return true;
}
 
/**
@@ -127,21 +123,6 @@
protected function displayNavigation() {
$menu = new Menu( $this->getContext() );
$menu->display();
-   }
-
-   /**
-* Display the summary data.
-*
-* @since 0.1
-*
-* @param IORMRow $item
-* @param boolean $collapsed
-* @param array $summaryData
-*/
-   protected function displaySummary(
-   IORMRow $item, $collapsed = false, array $summaryData = null
-   ) {
-   $this->getOutput()->addHTML( $item, $collapsed, $summaryData );
}
 
/**
diff --git a/includes/tables/PageTable.php b/includes/tables/PageTable.php
index dd58101..d459049 100644
--- a/includes/tables/PageTable.php
+++ b/includes/tables/PageTable.php
@@ -187,7 +187,7 @@
// Linker has no hook that allows us to figure out if the page 
actually exists :(
// FIXME: now it does
return Linker::linkKnown(
-   $this->getTitleFor( $identifierValue, $action ),
+   $this->getTitleFor( $identifierValue ),
is_null( $html ) ? htmlspecialchars( $identifierValue ) 
: $html,
$customAttribs,
$query
diff --git a/resources/ep.js b/resources/ep.js
index 05afb59..fadde6e 100644
--- a/resources/ep.js
+++ b/resources/ep.js
@@ -50,10 +50,6 @@
else {
return 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix return type documentation in WikiPageEntityMetaDataLookup

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370164 )

Change subject: Fix return type documentation in WikiPageEntityMetaDataLookup
..


Fix return type documentation in WikiPageEntityMetaDataLookup

This code is guaranteed to return arrays (and the array is guaranteed
to be made of plain stdClass objects). It can't return false, but throws
an exception if a DB query fails.

Change-Id: If52cd3415ec2d789ede9a4de133f5b6469eef3e4
---
M lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php
1 file changed, 7 insertions(+), 8 deletions(-)

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



diff --git a/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php 
b/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php
index 8aca094..62017ad 100644
--- a/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php
+++ b/lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php
@@ -59,12 +59,10 @@
 * @throws DBQueryError
 * @throws InvalidArgumentException When some of $entityIds does not 
belong the repository of this lookup
 *
-* @return array Array of entity id serialization => object or false if 
entity id is not found.
+* @return array Array mapping entity ID serializations to either 
objects or false if an entity
+*  could not be found.
 */
-   public function loadRevisionInformation(
-   array $entityIds,
-   $mode
-   ) {
+   public function loadRevisionInformation( array $entityIds, $mode ) {
$rows = [];
 
foreach ( $entityIds as $entityId ) {
@@ -206,7 +204,8 @@
 * @param int $connType DB_REPLICA or DB_MASTER
 *
 * @throws DBQueryError If the query fails.
-* @return array Array of entity id serialization => object or false 
(if not found).
+* @return array Array mapping entity ID serializations to either 
objects or false if an entity
+*  could not be found.
 */
private function selectRevisionInformationMultiple( array $entityIds, 
$connType ) {
$db = $this->getConnection( $connType );
@@ -238,8 +237,8 @@
 * @param EntityId[] $entityIds
 * @param ResultWrapper $res
 *
-* @return array Array of entity id serialization => object or false if 
entity id
-*   serialization is not present in $res.
+* @return array Array mapping entity ID serializations to either 
objects or false if an entity
+*  is not present in $res.
 */
private function indexResultByEntityId( array $entityIds, ResultWrapper 
$res ) {
$rows = [];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If52cd3415ec2d789ede9a4de133f5b6469eef3e4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Jakob 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Ladsgroup 
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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SpecialDoubleRedirects: Use more descriptive aliases in the ...

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370141 )

Change subject: SpecialDoubleRedirects: Use more descriptive aliases in the 
query
..


SpecialDoubleRedirects: Use more descriptive aliases in the query

Change-Id: I88e579be8452da30b474d36cf7a9fba3ffdbf78a
---
M includes/specials/SpecialDoubleRedirects.php
1 file changed, 30 insertions(+), 25 deletions(-)

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



diff --git a/includes/specials/SpecialDoubleRedirects.php 
b/includes/specials/SpecialDoubleRedirects.php
index 64b378c..ba14c66 100644
--- a/includes/specials/SpecialDoubleRedirects.php
+++ b/includes/specials/SpecialDoubleRedirects.php
@@ -66,15 +66,15 @@
'title' => 'pa.page_title',
'value' => 'pa.page_title',
 
-   'nsb' => 'pb.page_namespace',
-   'tb' => 'pb.page_title',
+   'b_namespace' => 'pb.page_namespace',
+   'b_title' => 'pb.page_title',
 
// Select fields from redirect instead of page. 
Because there may
// not actually be a page table row for this 
target (e.g. for interwiki redirects)
-   'nsc' => 'rb.rd_namespace',
-   'tc' => 'rb.rd_title',
-   'fc' => 'rb.rd_fragment',
-   'iwc' => 'rb.rd_interwiki',
+   'c_namespace' => 'rb.rd_namespace',
+   'c_title' => 'rb.rd_title',
+   'c_fragment' => 'rb.rd_fragment',
+   'c_interwiki' => 'rb.rd_interwiki',
],
'conds' => [
'ra.rd_from = pa.page_id',
@@ -117,14 +117,12 @@
 * @return string
 */
function formatResult( $skin, $result ) {
-   $titleA = Title::makeTitle( $result->namespace, $result->title 
);
-
-   // If only titleA is in the query, it means this came from
-   // querycache (which only saves 3 columns).
+   // If no Title B or C is in the query, it means this came from
+   // querycache (which only saves the 3 columns for title A).
// That does save the bulk of the query cost, but now we need to
// get a little more detail about each individual entry quickly
// using the filter of reallyGetQueryInfo.
-   if ( $result && !isset( $result->nsb ) ) {
+   if ( $result && !isset( $result->b_namespace ) ) {
$dbr = wfGetDB( DB_REPLICA );
$qi = $this->reallyGetQueryInfo(
$result->namespace,
@@ -141,20 +139,13 @@
$result = $dbr->fetchObject( $res );
}
}
+
+   $titleA = Title::makeTitle( $result->namespace, $result->title 
);
+
$linkRenderer = $this->getLinkRenderer();
if ( !$result ) {
return '' . $linkRenderer->makeLink( $titleA, 
null, [], [ 'redirect' => 'no' ] ) . '';
}
-
-   $titleB = Title::makeTitle( $result->nsb, $result->tb );
-   $titleC = Title::makeTitle( $result->nsc, $result->tc, 
$result->fc, $result->iwc );
-
-   $linkA = $linkRenderer->makeKnownLink(
-   $titleA,
-   null,
-   [],
-   [ 'redirect' => 'no' ]
-   );
 
// if the page is editable, add an edit link
if (
@@ -173,6 +164,14 @@
$edit = '';
}
 
+   $linkA = $linkRenderer->makeKnownLink(
+   $titleA,
+   null,
+   [],
+   [ 'redirect' => 'no' ]
+   );
+
+   $titleB = Title::makeTitle( $result->b_namespace, 
$result->b_title );
$linkB = $linkRenderer->makeKnownLink(
$titleB,
null,
@@ -180,6 +179,12 @@
[ 'redirect' => 'no' ]
);
 
+   $titleC = Title::makeTitle(
+   $result->c_namespace,
+   $result->c_title,
+   $result->c_fragment,
+   $result->c_interwiki
+   );
$linkC = $linkRenderer->makeKnownLink( $titleC, 
$titleC->getFullText() );
 
$lang = $this->getLanguage();
@@ -202,13 +207,13 @@

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: build: Ignore package-lock.json for fewer surprising npm out...

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/367689 )

Change subject: build: Ignore package-lock.json for fewer surprising npm 
outcomes
..


build: Ignore package-lock.json for fewer surprising npm outcomes

Change-Id: I9dd641e1ebbb531876dd547d80f0842a87d0f8e1
---
M Gruntfile.js
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/Gruntfile.js b/Gruntfile.js
index 705f171..d2500f9 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -265,6 +265,7 @@
},
src: [
'**/*.{js,json,less,css,txt}',
+   '!package-lock.json',
'!build/typos.json',
'!lib/**',
'!i18n/**',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9dd641e1ebbb531876dd547d80f0842a87d0f8e1
Gerrit-PatchSet: 3
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add strict "array" type hints to "$…Ids" method parameters

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370163 )

Change subject: Add strict "array" type hints to "$…Ids" method parameters
..


Add strict "array" type hints to "$…Ids" method parameters

I did a regex search for method parameters that end with plural "IDs".

Change-Id: I06ad4141350e4ac1eb316e35bc579ab01e94f3d9
---
M client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php
M client/tests/phpunit/includes/ChangeNotificationJobTest.php
M 
client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
M lib/tests/phpunit/Store/DispatchingTermBufferTest.php
M lib/tests/phpunit/Store/Sql/SqlEntityInfoBuilderTest.php
M repo/tests/phpunit/includes/ParserOutput/PageImagesDataUpdaterTest.php
M repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php
7 files changed, 16 insertions(+), 10 deletions(-)

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



diff --git 
a/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php 
b/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php
index 29e7189..f74fbaa 100644
--- a/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php
+++ b/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php
@@ -543,7 +543,7 @@
 *
 * @return array[]
 */
-   public function orderProperties( $propertyIds ) {
+   public function orderProperties( array $propertyIds ) {
if ( $propertyIds === [] ) {
return [ [] ];
}
diff --git a/client/tests/phpunit/includes/ChangeNotificationJobTest.php 
b/client/tests/phpunit/includes/ChangeNotificationJobTest.php
index 220f4cb..815f692 100644
--- a/client/tests/phpunit/includes/ChangeNotificationJobTest.php
+++ b/client/tests/phpunit/includes/ChangeNotificationJobTest.php
@@ -38,7 +38,7 @@
/**
 * @dataProvider provideToString
 */
-   public function testToString( $changeIds, $regex ) {
+   public function testToString( array $changeIds, $regex ) {
$job = new ChangeNotificationJob(
Title::newMainPage(),
[ 'repo' => 'repo-db', 'changeIds' => $changeIds ]
diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
index 284f277..7cfc1ff 100644
--- 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php
@@ -193,7 +193,7 @@
/**
 * @dataProvider getEntityUrlProvider
 */
-   public function testGetEntityUrl( $expected, $entityIdSerialization ) {
+   public function testGetEntityUrl( array $expected, 
$entityIdSerialization ) {
$cacheSplit = false;
$luaWikibaseLibrary = $this->newScribuntoLuaWikibaseLibrary( 
$cacheSplit );
$luaWikibaseLibrary->setRepoLinker( $this->getRepoLinker() );
@@ -427,7 +427,7 @@
/**
 * @dataProvider provideOrderProperties
 */
-   public function testOrderProperties( $propertyIds, 
$providedPropertyOrder, $expected ) {
+   public function testOrderProperties( array $propertyIds, array 
$providedPropertyOrder, array $expected ) {
$luaWikibaseLibrary = $this->newScribuntoLuaWikibaseLibrary();
 
$luaWikibaseLibrary->setPropertyOrderProvider(
@@ -441,7 +441,7 @@
/**
 * @dataProvider provideGetPropertyOrder
 */
-   public function testGetPropertyOrder( $providedPropertyOrder, $expected 
) {
+   public function testGetPropertyOrder( array $providedPropertyOrder, 
array $expected ) {
$luaWikibaseLibrary = $this->newScribuntoLuaWikibaseLibrary();
 
$luaWikibaseLibrary->setPropertyOrderProvider(
@@ -456,7 +456,7 @@
 * @param string[] $propertyOrder
 * @return PropertyOrderProvider $propertyOrderProvider
 */
-   private function getPropertyOrderProvider( $propertyOrder ) {
+   private function getPropertyOrderProvider( array $propertyOrder ) {
$propertyOrderProvider = $this->getMock( 
PropertyOrderProvider::class );
 
$propertyOrderProvider->method( 'getPropertyOrder' )
diff --git a/lib/tests/phpunit/Store/DispatchingTermBufferTest.php 
b/lib/tests/phpunit/Store/DispatchingTermBufferTest.php
index 47f2d24..6f70aa3 100644
--- a/lib/tests/phpunit/Store/DispatchingTermBufferTest.php
+++ b/lib/tests/phpunit/Store/DispatchingTermBufferTest.php
@@ -51,7 +51,7 @@
/**
 * @dataProvider entityIdsFromDifferentReposProvider
 */
-   public function 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SpecialWatchlist: Always apply a LIMIT

2017-08-04 Thread Catrope (Code Review)
Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370302 )

Change subject: SpecialWatchlist: Always apply a LIMIT
..

SpecialWatchlist: Always apply a LIMIT

In non-extended mode, the query that SpecialWatchlist ran
was unlimited, which is a very bad idea, since some users
have tens of thousands of pages on their watchlist.
There are broader performance issues with large watchlists,
but this doesn't help.

With this patch the wllimit preference is used to limit
the number of results both in expanded and in non-expanded mode.

Bug: T171027
Change-Id: Ifcefe6f77fa4adeca2e50714813004018819aee8
---
M includes/specials/SpecialWatchlist.php
M languages/i18n/en.json
2 files changed, 5 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/370302/1

diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index 549362f..9e01d2d 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -277,7 +277,6 @@
 
# Toggle watchlist content (all recent edits or just the latest)
if ( $opts['extended'] ) {
-   $limitWatchlist = $user->getIntOption( 'wllimit' );
$usePage = false;
} else {
# Top log Ids for a page are not stored
@@ -292,14 +291,16 @@
LIST_OR
);
}
-   $limitWatchlist = 0;
$usePage = true;
}
 
$tables = array_merge( [ 'recentchanges', 'watchlist' ], 
$tables );
$fields = array_merge( RecentChange::selectFields(), $fields );
 
-   $query_options = array_merge( [ 'ORDER BY' => 'rc_timestamp 
DESC' ], $query_options );
+   $query_options = array_merge( [
+   'ORDER BY' => 'rc_timestamp DESC',
+   'LIMIT' => $user->getIntOption( 'wllimit' )
+   ], $query_options );
$join_conds = array_merge(
[
'watchlist' => [
@@ -316,9 +317,6 @@
 
if ( $this->getConfig()->get( 'ShowUpdatedMarker' ) ) {
$fields[] = 'wl_notificationtimestamp';
-   }
-   if ( $limitWatchlist ) {
-   $query_options['LIMIT'] = $limitWatchlist;
}
 
$rollbacker = $user->isAllowed( 'rollback' );
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index aa1254c..a14e926 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1021,7 +1021,7 @@
"prefs-editwatchlist-clear": "Clear your watchlist",
"prefs-watchlist-days": "Days to show in watchlist:",
"prefs-watchlist-days-max": "Maximum $1 {{PLURAL:$1|day|days}}",
-   "prefs-watchlist-edits": "Maximum number of changes to show in expanded 
watchlist:",
+   "prefs-watchlist-edits": "Maximum number of changes to show in 
watchlist:",
"prefs-watchlist-edits-max": "Maximum number: 1000",
"prefs-watchlist-token": "Watchlist token:",
"prefs-misc": "Misc",

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Set a min and max on the rclimit preference

2017-08-04 Thread Catrope (Code Review)
Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370301 )

Change subject: Set a min and max on the rclimit preference
..

Set a min and max on the rclimit preference

The same values as wllimit.

Change-Id: I1fbc063455799f7d886d26c7030662f431feb627
---
M includes/Preferences.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/01/370301/1

diff --git a/includes/Preferences.php b/includes/Preferences.php
index de6d681..15ed2d4 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -901,6 +901,8 @@
];
$defaultPreferences['rclimit'] = [
'type' => 'int',
+   'min' => 0,
+   'max' => 1000,
'label-message' => 'recentchangescount',
'help-message' => 'prefs-help-recentchangescount',
'section' => 'rc/displayrc',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Make tests QUnit 2 compatible

2017-08-04 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370300 )

Change subject: Make tests QUnit 2 compatible
..

Make tests QUnit 2 compatible

* Remove testCount in favour of assert.expect().
* Remove QUnit.expect() in favour of assert.expect().
* Replace QUnit.stop/start with assert.async().

Remove redundant use of assert.expect() where the async handler
is already strict.

Bug: T170515
Change-Id: Ib1a8b6dfacf851d569c697ee3780c7e8f2bb052c
---
M view/tests/qunit/jquery/ui/jquery.ui.tagadata.tests.js
M view/tests/qunit/jquery/wikibase/jquery.wikibase.aliasesview.tests.js
M view/tests/qunit/jquery/wikibase/jquery.wikibase.entityselector.tests.js
3 files changed, 29 insertions(+), 48 deletions(-)


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

diff --git a/view/tests/qunit/jquery/ui/jquery.ui.tagadata.tests.js 
b/view/tests/qunit/jquery/ui/jquery.ui.tagadata.tests.js
index 5a594a0..515d0e1 100644
--- a/view/tests/qunit/jquery/ui/jquery.ui.tagadata.tests.js
+++ b/view/tests/qunit/jquery/ui/jquery.ui.tagadata.tests.js
@@ -96,19 +96,17 @@
} );
 
QUnit.test( 'removeTag()', function ( assert ) {
-   assert.expect( 2 );
var $tagadata = createTagadata(),
-   tagadata = $tagadata.data( 'tagadata' );
-
-   QUnit.stop();
+   tagadata = $tagadata.data( 'tagadata' ),
+   done = assert.async( 2 );
 
$tagadata.one( 'tagadatatagremoved', function () {
-   QUnit.start();
-
assert.ok(
true,
'Removed tag.'
);
+
+   done();
} );
 
tagadata.removeTag( tagadata.getTag( 'B' ) );
@@ -118,23 +116,23 @@
false,
'Trying to remove non-existent tag returns "false".'
);
+
+   done();
} );
 
-   QUnit.test( 'removeAll()', 1, function ( assert ) {
+   QUnit.test( 'removeAll()', function ( assert ) {
var $tagadata = createTagadata(),
tagadata = $tagadata.data( 'tagadata' ),
+   done = assert.async(),
i = tagadata.getTags().length;
-
-   QUnit.stop();
 
$tagadata.on( 'tagadatatagremoved', function () {
if ( --i === 0 ) {
-   QUnit.start();
-
assert.ok(
true,
'Removed all tags.'
);
+   done();
}
} );
 
diff --git 
a/view/tests/qunit/jquery/wikibase/jquery.wikibase.aliasesview.tests.js 
b/view/tests/qunit/jquery/wikibase/jquery.wikibase.aliasesview.tests.js
index 0441199..9adaf13 100644
--- a/view/tests/qunit/jquery/wikibase/jquery.wikibase.aliasesview.tests.js
+++ b/view/tests/qunit/jquery/wikibase/jquery.wikibase.aliasesview.tests.js
@@ -68,33 +68,23 @@
} );
 
QUnit.test( 'Instantiating tagadata widget on startEditing()', function 
( assert ) {
-   assert.expect( 1 );
var $aliasesview = createAliasesview(),
aliasesview = $aliasesview.data( 'aliasesview' );
 
-   QUnit.stop();
-
-   aliasesview.startEditing()
-   .done( function () {
+   return aliasesview.startEditing().done( function () {
assert.ok(
aliasesview.$list.data( 'tagadata' ) !== 
undefined,
'Instantiated tagadata widget.'
);
-   } )
-   .fail( function () {
-   assert.ok(
-   false,
-   'Failed to start edit mode.'
-   );
-   } )
-   .always( function () {
-   QUnit.start();
} );
} );
 
-   QUnit.test( 'startEditing() & stopEditing()', 6, function ( assert ) {
+   QUnit.test( 'startEditing() & stopEditing()', function ( assert ) {
var $aliasesview = createAliasesview(),
-   aliasesview = $aliasesview.data( 'aliasesview' );
+   aliasesview = $aliasesview.data( 'aliasesview' ),
+   done = assert.async();
+
+   assert.expect( 6 );
 
$aliasesview
.on( 'aliasesviewafterstartediting', function ( event ) {
@@ -150,10 +140,10 @@
expectingEvent = true;
}

[MediaWiki-commits] [Gerrit] oojs/ui[master]: tests: Prepare for qunit 2.x

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370287 )

Change subject: tests: Prepare for qunit 2.x
..


tests: Prepare for qunit 2.x

Change-Id: I60c6f267bc95563a40a2fa14db6f53aa84dcc5d4
---
M tests/Element.test.js
M tests/JSPHP.test.karma.js
M tests/JSPHP.test.standalone.js
M tests/QUnit.assert.equalDomElement.js
M tests/core.test.js
M tests/widgets/NumberInputWidget.test.js
6 files changed, 23 insertions(+), 10 deletions(-)

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



diff --git a/tests/Element.test.js b/tests/Element.test.js
index 723781e..c5be298 100644
--- a/tests/Element.test.js
+++ b/tests/Element.test.js
@@ -1,5 +1,5 @@
 QUnit.module( 'Element', {
-   setup: function () {
+   beforeEach: function () {
this.fixture = document.createElement( 'div' );
document.body.appendChild( this.fixture );
 
@@ -9,7 +9,7 @@
return ( frame.contentWindow && 
frame.contentWindow.document ) || frame.contentDocument;
};
},
-   teardown: function () {
+   afterEach: function () {
this.fixture.parentNode.removeChild( this.fixture );
this.fixture = null;
}
diff --git a/tests/JSPHP.test.karma.js b/tests/JSPHP.test.karma.js
index 0d5e75b..c0d3e33 100644
--- a/tests/JSPHP.test.karma.js
+++ b/tests/JSPHP.test.karma.js
@@ -18,8 +18,11 @@
}
 
function makeTest( theme, klassName, infuseOnly, tests, output ) {
-   QUnit.test( theme + ': ' + klassName, tests.length * ( 
infuseOnly ? 1 : 2 ), function ( assert ) {
+   QUnit.test( theme + ': ' + klassName, function ( assert ) {
var test, config, instance, infused, $fromPhp, i, 
testName;
+
+   assert.expect( tests.length * ( infuseOnly ? 1 : 2 ) );
+
OO.ui.theme = themes[ theme ];
for ( i = 0; i < tests.length; i++ ) {
test = tests[ i ];
diff --git a/tests/JSPHP.test.standalone.js b/tests/JSPHP.test.standalone.js
index 20b926f..66fe8ed 100644
--- a/tests/JSPHP.test.standalone.js
+++ b/tests/JSPHP.test.standalone.js
@@ -18,8 +18,11 @@
}
 
function makeTest( theme, klassName, infuseOnly, tests ) {
-   QUnit.test( theme + ': ' + klassName, tests.length * ( 
infuseOnly ? 1 : 2 ), function ( assert ) {
+   QUnit.test( theme + ': ' + klassName, function ( assert ) {
var test, config, instance, infused, id, fromPhp, i, 
testName;
+
+   assert.expect( tests.length * ( infuseOnly ? 1 : 2 ) );
+
OO.ui.theme = themes[ theme ];
for ( i = 0; i < tests.length; i++ ) {
test = tests[ i ];
diff --git a/tests/QUnit.assert.equalDomElement.js 
b/tests/QUnit.assert.equalDomElement.js
index 7a86a6b..933af72 100644
--- a/tests/QUnit.assert.equalDomElement.js
+++ b/tests/QUnit.assert.equalDomElement.js
@@ -162,9 +162,12 @@
actualSummaryHtml = JSON.stringify( actualSummaryHtml, null, 2 
);
expectedSummaryHtml = JSON.stringify( expectedSummaryHtml, 
null, 2 );
 
-   QUnit.push(
-   QUnit.equiv( actualSummary, expectedSummary ), 
actualSummaryHtml, expectedSummaryHtml, message
-   );
+   this.pushResult( {
+   result: QUnit.equiv( actualSummary, expectedSummary ),
+   actual: actualSummaryHtml,
+   expected: expectedSummaryHtml,
+   message: message
+   } );
};
 
 }( QUnit ) );
diff --git a/tests/core.test.js b/tests/core.test.js
index 8624a72..a758e65 100644
--- a/tests/core.test.js
+++ b/tests/core.test.js
@@ -85,7 +85,7 @@
}
];
 
-   QUnit.expect( cases.length );
+   assert.expect( cases.length );
for ( i = 0; i < cases.length; i++ ) {
$html = $( cases[ i ].html ).appendTo( 'body' );
result = OO.ui.isFocusableElement( cases[ i ].selector ? 
$html.find( cases[ i ].selector ) : $html );
diff --git a/tests/widgets/NumberInputWidget.test.js 
b/tests/widgets/NumberInputWidget.test.js
index 21abf64..b05b733 100644
--- a/tests/widgets/NumberInputWidget.test.js
+++ b/tests/widgets/NumberInputWidget.test.js
@@ -1,7 +1,7 @@
 ( function () {
QUnit.module( 'NumberInputWidget' );
 
-   QUnit.test( 'validate number', 7, function ( assert ) {
+   QUnit.test( 'validate number', function ( assert ) {
var widget = new OO.ui.NumberInputWidget( {
allowInteger: true,
min: -10,
@@ -9,6 +9,8 @@
step: 1,
required: false
  

[MediaWiki-commits] [Gerrit] oojs/ui[master]: build: Upgrade devDependencies to latest and make pass

2017-08-04 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370299 )

Change subject: build: Upgrade devDependencies to latest and make pass
..

build: Upgrade devDependencies to latest and make pass

 grunt-contrib-clean  1.0.0  →   1.1.0
 grunt-contrib-cssmin 2.0.0  →   2.2.1
 grunt-contrib-uglify 2.2.0  →   3.0.1
 grunt-eslint19.0.0  →  20.0.0
 grunt-exec   1.0.1  →   3.0.0
 karma1.1.1  →   1.7.0
 karma-chrome-launcher1.0.1  →   2.2.0
 karma-coverage   1.1.0  →   1.1.1
 karma-firefox-launcher   1.0.0  →   1.0.1
 karma-qunit  1.1.0  →   1.2.1
 q1.4.1  →   1.5.0
 qunitjs 1.22.0  →   2.4.0

Held back grunt-image (2.x doesn't work on Macs) and stylelint (Wikimedia
config preset needs updating to be compatible with 8.x first).

Change-Id: I736ff8215dc0329319a90c3883e857ccf663ec64
---
M package.json
M src/Tool.js
M src/mixins/IconElement.js
M src/mixins/IndicatorElement.js
M src/widgets/MenuSelectWidget.js
M src/widgets/SelectWidget.js
M src/widgets/TagMultiselectWidget.js
7 files changed, 23 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/99/370299/1

diff --git a/package.json b/package.json
index a6a2365..7c8947f 100644
--- a/package.json
+++ b/package.json
@@ -31,16 +31,16 @@
 "eslint-config-wikimedia": "0.4.0",
 "grunt": "1.0.1",
 "grunt-banana-checker": "0.6.0",
-"grunt-contrib-clean": "1.0.0",
+"grunt-contrib-clean": "1.1.0",
 "grunt-contrib-concat": "1.0.1",
 "grunt-contrib-copy": "1.0.0",
-"grunt-contrib-cssmin": "2.0.0",
+"grunt-contrib-cssmin": "2.2.1",
 "grunt-contrib-less": "1.4.1",
-"grunt-contrib-uglify": "2.2.0",
+"grunt-contrib-uglify": "3.0.1",
 "grunt-contrib-watch": "1.0.0",
 "grunt-cssjanus": "0.4.0",
-"grunt-eslint": "19.0.0",
-"grunt-exec": "1.0.1",
+"grunt-eslint": "20.0.0",
+"grunt-exec": "3.0.0",
 "grunt-file-exists": "0.1.4",
 "grunt-image": "1.5.2",
 "grunt-jsonlint": "1.1.0",
@@ -51,15 +51,15 @@
 "grunt-svg2png": 
"git://github.com/jdforrester/grunt-svg2png.git#v0.2.7-wmf.1",
 "grunt-tyops": "0.1.0",
 "javascript-stringify": "1.6.0",
-"karma": "1.1.1",
-"karma-chrome-launcher": "1.0.1",
-"karma-coverage": "1.1.0",
-"karma-firefox-launcher": "1.0.0",
-"karma-qunit": "1.1.0",
+"karma": "1.7.0",
+"karma-chrome-launcher": "2.2.0",
+"karma-coverage": "1.1.1",
+"karma-firefox-launcher": "1.0.1",
+"karma-qunit": "1.2.1",
 "karma-remap-istanbul": "0.6.0",
 "prismjs": "1.6.0",
-"q": "1.4.1",
-"qunitjs": "1.22.0",
+"q": "1.5.0",
+"qunitjs": "2.4.0",
 "stylelint": "7.8.0",
 "stylelint-config-wikimedia": "0.4.1"
   }
diff --git a/src/Tool.js b/src/Tool.js
index d1319d3..ab9af2f 100644
--- a/src/Tool.js
+++ b/src/Tool.js
@@ -84,7 +84,7 @@
this.$element
.data( 'oo-ui-tool', this )
.addClass( 'oo-ui-tool' )
-   .addClass( 'oo-ui-tool-name-' + 
this.constructor.static.name.replace( /^([^\/]+)\/([^\/]+).*$/, '$1-$2' ) )
+   .addClass( 'oo-ui-tool-name-' + 
this.constructor.static.name.replace( /^([^/]+)\/([^/]+).*$/, '$1-$2' ) )
.toggleClass( 'oo-ui-tool-with-label', 
this.constructor.static.displayBothIconAndLabel )
.append( this.$link );
this.setTitle( config.title || this.constructor.static.title );
diff --git a/src/mixins/IconElement.js b/src/mixins/IconElement.js
index 85e7f59..c969de9 100644
--- a/src/mixins/IconElement.js
+++ b/src/mixins/IconElement.js
@@ -152,8 +152,8 @@
  * @chainable
  */
 OO.ui.mixin.IconElement.prototype.setIconTitle = function ( iconTitle ) {
-   iconTitle = typeof iconTitle === 'function' ||
-   ( typeof iconTitle === 'string' && iconTitle.length ) ?
+   iconTitle =
+   ( typeof iconTitle === 'function' || ( typeof iconTitle === 
'string' && iconTitle.length ) ) ?
OO.ui.resolveMsg( iconTitle ) : null;
 
if ( this.iconTitle !== iconTitle ) {
diff --git a/src/mixins/IndicatorElement.js b/src/mixins/IndicatorElement.js
index 953584d..9fd2bcf 100644
--- a/src/mixins/IndicatorElement.js
+++ b/src/mixins/IndicatorElement.js
@@ -131,8 +131,8 @@
  * @chainable
  */
 OO.ui.mixin.IndicatorElement.prototype.setIndicatorTitle = function ( 
indicatorTitle ) {
-   indicatorTitle = typeof indicatorTitle === 'function' ||
-   ( typeof indicatorTitle === 'string' && indicatorTitle.length ) 
?
+   indicatorTitle =
+   ( typeof indicatorTitle === 'function' || ( typeof 
indicatorTitle === 'string' && indicatorTitle.length ) ) ?
OO.ui.resolveMsg( indicatorTitle ) : null;
 
if ( this.indicatorTitle !== indicatorTitle ) {
diff --git 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: toolforge: Add qstat-full to bastions

2017-08-04 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370298 )

Change subject: toolforge: Add qstat-full to bastions
..

toolforge: Add qstat-full to bastions

This is a handy way to get untruncated output from qstat that I started
using this week. Chase thought it was neat enough that we should have it
on all of the bastions.

Change-Id: I323b1bd7faf1289151d56d3e6169c1ff240ab5c5
---
A modules/toollabs/files/qstat-full
M modules/toollabs/manifests/bastion.pp
2 files changed, 28 insertions(+), 0 deletions(-)


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

diff --git a/modules/toollabs/files/qstat-full 
b/modules/toollabs/files/qstat-full
new file mode 100755
index 000..4c5095f
--- /dev/null
+++ b/modules/toollabs/files/qstat-full
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Display full qstat data.
+#
+# Normal usage of `qstat` will truncate columns to fit to the screen. This
+# version instead reads from the "xml" output format and formats as columns
+# using a crazy pants tr & sed pipeline. Very nice for doing things like:
+#
+#   # list of all running jobs grouped by tool and sorted by start time
+#   qstat-full -u '*' |
+#   awk 'BEGIN { OFS="\t" } {print $1, $3, $6, $5}' |
+#   sort -n -k 3 |
+#   sort -s -k 2
+#
+
+qstat -xml "$@" |
+tr '\n' ' ' |
+sed 's#]*>#\n#g' |
+sed 's#<[^>]*>##g' |
+grep ' ' |
+column -t
diff --git a/modules/toollabs/manifests/bastion.pp 
b/modules/toollabs/manifests/bastion.pp
index b66db11..43dada5 100644
--- a/modules/toollabs/manifests/bastion.pp
+++ b/modules/toollabs/manifests/bastion.pp
@@ -235,4 +235,12 @@
 mode   => '0655',
 source => 'puppet:///modules/toollabs/exec-manage',
 }
+
+file { '/usr/local/sbin/qstat-full':
+ensure => file,
+owner  => 'root',
+group  => 'root',
+mode   => '0655',
+source => 'puppet:///modules/toollabs/qstat-full',
+}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: DefaultSettings: Update wgLocalVirtualHosts documentation

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369824 )

Change subject: DefaultSettings: Update wgLocalVirtualHosts documentation
..


DefaultSettings: Update wgLocalVirtualHosts documentation

Change-Id: I4fb4724b78a1270df951e59c58c7482f0fb5ff34
---
M includes/DefaultSettings.php
1 file changed, 9 insertions(+), 4 deletions(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 51320e2..a28aa5b 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -8279,10 +8279,15 @@
  * Local virtual hosts.
  *
  * This lists domains that are configured as virtual hosts on the same machine.
- * If a request is to be made to a domain listed here, or any subdomain 
thereof,
- * then no proxy will be used.
- * Command-line scripts are not affected by this setting and will always use
- * proxy if it is configured.
+ *
+ * This affects the following:
+ * - MWHttpRequest: If a request is to be made to a domain listed here, or any
+ *   subdomain thereof, then no proxy will be used.
+ *   Command-line scripts are not affected by this setting and will always use
+ *   the proxy if it is configured.
+ * - ChronologyProtector: Decide to shutdown LBFactory asynchronously instead
+ *   synchronously if the current response redirects to a local virtual host.
+ *
  * @since 1.25
  */
 $wgLocalVirtualHosts = [];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4fb4724b78a1270df951e59c58c7482f0fb5ff34
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: phabricator: Auto rsync phab1001 to phab2001 (codfw)

2017-08-04 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370179 )

Change subject: phabricator: Auto rsync phab1001 to phab2001 (codfw)
..


phabricator: Auto rsync phab1001 to phab2001 (codfw)

We can now enable automatic syncing from phab1001 (active_server)
to phab2001 (passive server).

The following things have been done to fix the issue with rsync
breaking permissions.

 !log phab2001 - changing UID/GID for phd user
   from 997:997 to 498:498 to make it match phab1001
   to fix rsync breaking permissions.
(rsync forces --numeric-ids when fetching from and rsyncd configured
with chroot=yes). (also see T79786#1831969)

chown -R phw:www-data /srv/repos/

< mutante> !log "reserved" UID 498 for phd on
https://wikitech.wikimedia.org/wiki/UID
phab2001: find -exec chown  to fix all the files , restart cron

Bug: T137928
Change-Id: Ib5ed3fa9abe647da23eee185340e54d6da15cc2d
---
M modules/profile/manifests/phabricator/main.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/profile/manifests/phabricator/main.pp 
b/modules/profile/manifests/phabricator/main.pp
index dfa48db..3e4c8bb 100644
--- a/modules/profile/manifests/phabricator/main.pp
+++ b/modules/profile/manifests/phabricator/main.pp
@@ -296,7 +296,7 @@
 ensure  => present,
 source_host => $active_server,
 dest_host   => $passive_server,
-auto_sync   => false,
+auto_sync   => true,
 module_path => '/srv/repos',
   }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib5ed3fa9abe647da23eee185340e54d6da15cc2d
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Improve some parameter docs

2017-08-04 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370297 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: I03fa9b58c72bcd28985c5a3467b82d8b98f3a0fc
---
M AbuseFilter.hooks.php
M Views/AbuseFilterViewDiff.php
M includes/AbuseFilter.class.php
M includes/parser/AbuseFilterTokenizer.php
4 files changed, 54 insertions(+), 54 deletions(-)


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

diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php
index 55be162..e0b29cf 100644
--- a/AbuseFilter.hooks.php
+++ b/AbuseFilter.hooks.php
@@ -224,10 +224,10 @@
 * @param bool $minoredit
 * @param bool $watchthis
 * @param string $sectionanchor
-* @param integer $flags
+* @param int $flags
 * @param Revision $revision
-* @param $status Status
-* @param $baseRevId
+* @param Status $status
+* @param int $baseRevId
 * @return bool
 */
public static function onPageContentSaveComplete(
@@ -288,8 +288,8 @@
 
/**
 * Check if two article objects are identical or have an identical 
WikiPage
-* @param $page1 Article|WikiPage
-* @param $page2 Article|WikiPage
+* @param Article|WikiPage $page1
+* @param Article|WikiPage $page2
 * @return bool
 */
protected static function identicalPageObjects( $page1, $page2 ) {
@@ -304,8 +304,8 @@
}
 
/**
-* @param $user
-* @param $promote
+* @param User $user
+* @param array $promote
 * @return bool
 */
public static function onGetAutoPromoteGroups( $user, &$promote ) {
@@ -346,11 +346,11 @@
}
 
/**
-* @param $oldTitle Title
-* @param $newTitle Title
-* @param $user User
-* @param $error
-* @param $reason
+* @param Title $oldTitle
+* @param Title $newTitle
+* @param User $user
+* @param string $error
+* @param string $reason
 * @return bool
 */
public static function onAbortMove( $oldTitle, $newTitle, $user, 
&$error, $reason ) {
@@ -400,9 +400,9 @@
}
 
/**
-* @param $user User
-* @param $message
-* @param $autocreate bool Indicates whether the account is created 
automatically.
+* @param User $user
+* @param string $message
+* @param bool $autocreate Indicates whether the account is created 
automatically.
 * @return bool
 * @deprecated AbuseFilterPreAuthenticationProvider will take over this 
functionality
 */
@@ -434,8 +434,8 @@
}
 
/**
-* @param $user User
-* @param $message
+* @param User $user
+* @param string $message
 * @return bool
 * @deprecated AbuseFilterPreAuthenticationProvider will take over this 
functionality
 */
@@ -444,8 +444,8 @@
}
 
/**
-* @param $user User
-* @param $message
+* @param User $user
+* @param string $message
 * @return bool
 * @deprecated AbuseFilterPreAuthenticationProvider will take over this 
functionality
 */
@@ -457,7 +457,7 @@
}
 
/**
-* @param $recentChange RecentChange
+* @param RecentChange $recentChange
 * @return bool
 */
public static function onRecentChangeSave( $recentChange ) {
@@ -584,7 +584,7 @@
}
 
/**
-* @param $updater DatabaseUpdater
+* @param DatabaseUpdater $updater
 * @throws MWException
 * @return bool
 */
@@ -728,8 +728,8 @@
 
/**
 * @param $id
-* @param $nt Title
-* @param $tools
+* @param Title $nt
+* @param array $tools
 * @param SpecialPage|null $sp for context in newer MW versions
 * @return bool
 */
diff --git a/Views/AbuseFilterViewDiff.php b/Views/AbuseFilterViewDiff.php
index 0f4f694..2525c53 100644
--- a/Views/AbuseFilterViewDiff.php
+++ b/Views/AbuseFilterViewDiff.php
@@ -124,8 +124,8 @@
/**
 * Get the history ID of the next change
 *
-* @param $historyId Integer: History id to find next change of
-* @return Integer|Null: Id of the next change or null if there isn't 
one
+* @param int $historyId History id to find next change of
+* @return int|null Id of the next change or null if there isn't one
 */
function getNextHistoryId( $historyId ) {
$dbr = wfGetDB( DB_SLAVE );
@@ -242,8 +242,8 @@
}
 
/**
-* @param $timestamp
-* @param $history_id
+* @param string $timestamp
+* @param int $history_id
 * @return string
 

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Add read-base-html route

2017-08-04 Thread BearND (Code Review)
BearND has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370295 )

Change subject: Add read-base-html route
..

Add read-base-html route

This new route is currently similar to read-html, except that it is
not optimized for payload size.In the future read-html will request
read-base-html and then run transformations to reduce the payload
and to prepare consumption by app clients.

Change-Id: I3752626fd9ff86dec7c57a8ffc10e95139772494
---
M lib/parsoid-access.js
M routes/read-html.js
A test/features/read-html/pagecontent-base.js
3 files changed, 57 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/95/370295/1

diff --git a/lib/parsoid-access.js b/lib/parsoid-access.js
index 24490f6..c6042bd 100644
--- a/lib/parsoid-access.js
+++ b/lib/parsoid-access.js
@@ -233,19 +233,21 @@
 /**
  * @param {!Object} app the application object
  * @param {!Object} req the request object
- * @param {?Boolean} [legacy] if enabled will apply additional transformations
- * including a legacy version of relocation of first paragraph
- * and hiding IPA via an inline style rather than clas.
+ * @param {?Boolean} [optimized] if true will apply additional transformations
+ * to reduce the payload
  * @return {!promise} Returns a promise to retrieve the page content from 
Parsoid
  */
-function pageHtmlPromise(app, req, legacy) {
+function pageHtmlPromise(app, req, optimized) {
 return getParsoidHtml(app, req)
 .then((response) => {
 const meta = { etag: response.headers && response.headers.etag };
 const doc = domino.createDocument(response.body);
 
-transforms.stripReferenceListContent(doc);
-transforms.stripUnneededMarkup(doc, legacy);
+if (optimized) {
+transforms.stripReferenceListContent(doc);
+transforms.stripUnneededMarkup(doc, false);
+}
+
 addSectionDivs(doc);
 
 const html = doc.outerHTML;
diff --git a/routes/read-html.js b/routes/read-html.js
index cc7a73a..7994789 100644
--- a/routes/read-html.js
+++ b/routes/read-html.js
@@ -15,11 +15,11 @@
 let app;
 
 /**
- * GET {domain}/v1/page/read-html/{title}/{revision?}/{tid?}
+ * GET {domain}/v1/page/read-base-html/{title}/{revision?}/{tid?}
  * Gets page content in HTML. This is based on Parsoid with some minor 
modifications more
  * suitable for the reading use cases.
  */
-router.get('/read-html/:title/:revision?/:tid?', (req, res) => {
+router.get('/read-base-html/:title/:revision?/:tid?', (req, res) => {
 return parsoid.pageHtmlPromise(app, req, false)
 .then((response) => {
 res.status(200);
@@ -29,6 +29,21 @@
 });
 });
 
+/**
+ * GET {domain}/v1/page/read-html/{title}/{revision?}/{tid?}
+ * Gets page content in HTML. This is a more optimized for direct consumption 
by reading
+ * clients.
+ */
+router.get('/read-html/:title/:revision?/:tid?', (req, res) => {
+return parsoid.pageHtmlPromise(app, req, true)
+.then((response) => {
+res.status(200);
+res.type('html');
+res.set('etag', response.meta.etag);
+res.send(response.html).end();
+});
+});
+
 module.exports = function(appObj) {
 app = appObj;
 return {
diff --git a/test/features/read-html/pagecontent-base.js 
b/test/features/read-html/pagecontent-base.js
new file mode 100644
index 000..b7ae121
--- /dev/null
+++ b/test/features/read-html/pagecontent-base.js
@@ -0,0 +1,32 @@
+'use strict';
+
+const domino = require('domino');
+const preq   = require('preq');
+const assert = require('../../utils/assert.js');
+const headers = require('../../utils/headers.js');
+const server = require('../../utils/server.js');
+
+describe('read-html', function() {
+
+this.timeout(2); // eslint-disable-line no-invalid-this
+
+before(() => { return server.start(); });
+
+const localUri = (title, domain = 'en.wikipedia.org') => {
+return `${server.config.uri}${domain}/v1/page/read-base-html/${title}`;
+};
+
+it('should respond to GET request with expected headers, incl. CORS and 
CSP headers', () => {
+const uri = localUri('Foobar');
+return headers.checkHeaders(uri, headers.HTML_CONTENT_TYPE_REGEX);
+});
+
+it('HTML should be sectioned', () => {
+const uri = localUri('Foobar/788941783');
+return preq.get({ uri })
+.then((res) => {
+const document = domino.createDocument(res.body);
+assert.selectorExistsNTimes(document, 'section', 7, 'should have 7 
sections');
+});
+});
+});

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3752626fd9ff86dec7c57a8ffc10e95139772494
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: WIP: Change reference endpoint to return structured referenc...

2017-08-04 Thread BearND (Code Review)
BearND has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370296 )

Change subject: WIP: Change reference endpoint to return structured reference 
sections
..

WIP: Change reference endpoint to return structured reference sections

TODO:
[] add tests
[] cleanup getListItemContent()
[] remove console.log/warn()s

Bug: T170690
Change-Id: I1ea018190a5d3c153476233504627bdc3f16f99e
---
A lib/transformations/structureReferenceSections.js
M lib/transforms.js
M routes/mobile-sections.js
3 files changed, 158 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/96/370296/1

diff --git a/lib/transformations/structureReferenceSections.js 
b/lib/transformations/structureReferenceSections.js
new file mode 100644
index 000..bcedc16
--- /dev/null
+++ b/lib/transformations/structureReferenceSections.js
@@ -0,0 +1,142 @@
+"use strict";
+
+/*
+See https://phabricator.wikimedia.org/T170690
+Turns reference list content into a JSON structure.
+*/
+
+const domino = require('domino');
+
+const removeAllChildNodes = (node) => {
+while (node.hasChildNodes()) {
+node.removeChild(node.lastChild);
+}
+};
+
+const structureBackLinks = (listItemElement) => {
+const resultArray = [];
+const child = listItemElement.firstChild;
+if (child.tagName === 'A') {
+// single back link directly
+resultArray.push(child.outerHTML);
+} else if (child.tagName === 'SPAN') {
+// multiple back links inside a 
+const spanChildren = child.childNodes;
+for (let i = 0; i < spanChildren.length; i++) {
+const spanChild = spanChildren[i];
+if (spanChild.tagName === 'A') {
+resultArray.push(spanChild.outerHTML);
+}
+}
+} else {
+console.warn(`unexpected child tag: ${child.tagName}`);
+}
+return resultArray;
+};
+
+const getCiteType = (child) => {
+const classes = child.getAttribute('class');
+return classes && classes.startsWith('citation ') && classes.substring(9);
+};
+
+const addHtmlToResultArray = (resultArray, type, html) => {
+const previous = resultArray[resultArray.length - 1];
+if (previous && previous.type === type && type === 'html') {
+previous.html += html; // same html type, just append to the previous 
item
+} else {
+resultArray.push({ type, html });
+}
+};
+
+const structureListItemChildren = (children) => {
+const resultArray = [];
+for (let i = 0; i < children.length; i++) {
+const child = children[i];
+if (child.tagName === 'UL') {
+resultArray.push({
+type: 'ul',
+list_items: structureListItemChildren(child.childNodes)
+});
+} else if (child.tagName === 'CITE') {
+addHtmlToResultArray(resultArray,
+`html cite ${getCiteType(child)}`,
+child.outerHTML || child.textContent);
+} else {
+addHtmlToResultArray(resultArray,
+`html`,
+child.outerHTML || child.textContent);
+}
+}
+return resultArray;
+};
+
+const getListItemContent = (listItemElement) => {
+let content = '';
+let node = listItemElement.firstChild.nextSibling;
+while (node) {
+if (node.tagName === 'SPAN') {
+return structureListItemChildren(node.childNodes);
+} else if (node.nodeType === 3) {
+content += node.textContent; // TODO: that one is suspect, the one 
above, too, if
+// there's meaningful content.
+} else {
+console.warn(`unexpected child tag: ${node.tagName}`);
+}
+node = node.nextSibling;
+}
+return content;
+};
+
+const getCiteNoteId = (listItemElement) => {
+const id = listItemElement.getAttribute('id');
+return id && id.replace(/^cite_note-/, '');
+};
+
+const buildReferenceItem = (listItemElement) => {
+return {
+id: getCiteNoteId(listItemElement),
+backLinks: structureBackLinks(listItemElement),
+content: getListItemContent(listItemElement)
+};
+};
+
+const buildReferenceList = (refListElement) => {
+const resultArray = [];
+const children = refListElement.childNodes;
+for (let i = 0; i < children.length; i++) {
+const child = children[i];
+if (child.tagName === 'LI') {
+resultArray.push(buildReferenceItem(child));
+} else {
+console.warn(`unexpected child tag: ${child.tagName}`);
+}
+}
+return resultArray;
+};
+
+/**
+ * Scan the DOM document for reference lists
+ * @param {!String} html HTML string to scan for references
+ */
+function extractReferenceLists(html) {
+const items = [];
+const document = domino.createDocument(html);
+const refListElements = 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WANCacheReapUpdate: Handle special pages without exception

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370290 )

Change subject: WANCacheReapUpdate: Handle special pages without exception
..


WANCacheReapUpdate: Handle special pages without exception

Bug: T172560
Change-Id: I95a6da2c5303e5fc4e931734e39974825d4c3c53
---
M includes/deferred/WANCacheReapUpdate.php
1 file changed, 7 insertions(+), 1 deletion(-)

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



diff --git a/includes/deferred/WANCacheReapUpdate.php 
b/includes/deferred/WANCacheReapUpdate.php
index b12af19..cbeb1fc 100644
--- a/includes/deferred/WANCacheReapUpdate.php
+++ b/includes/deferred/WANCacheReapUpdate.php
@@ -104,7 +104,13 @@
/** @var WikiPage[]|LocalFile[]|User[] $entities */
$entities = [];
 
-   $entities[] = WikiPage::factory( Title::newFromTitleValue( $t ) 
);
+   // You can't create a WikiPage for special pages (-1) or other 
virtual
+   // namespaces, but special pages do appear in RC sometimes, 
e.g. for logs
+   // of AbuseFilter filter changes.
+   if ( $t->getNamespace() >= 0 ) {
+   $entities[] = WikiPage::factory( 
Title::newFromTitleValue( $t ) );
+   }
+
if ( $t->inNamespace( NS_FILE ) ) {
$entities[] = wfLocalFile( $t->getText() );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I95a6da2c5303e5fc4e931734e39974825d4c3c53
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: labs: Remove OAuth setting duplicating prod

2017-08-04 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370291 )

Change subject: labs: Remove OAuth setting duplicating prod
..

labs: Remove OAuth setting duplicating prod

Change-Id: Iaf9a77fbcd9b2a66911e96013998132e641de36e
---
M wmf-config/CommonSettings-labs.php
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/91/370291/1

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 71eff0e..3a1e78e 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -61,10 +61,6 @@
'proxies.dnsbl.sorbs.net.',
 ];
 
-if ( $wmgUseOAuth ) {
-   $wgMWOAuthCentralWiki = 'metawiki';
-}
-
 if ( $wmgUseFlow ) {
// Override CommonSettings.php, which has:
// $wgFlowExternalStore = $wgDefaultExternalStore;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf9a77fbcd9b2a66911e96013998132e641de36e
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Flow settings: wmg -> wg migration, part 1

2017-08-04 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370292 )

Change subject: Flow settings: wmg -> wg migration, part 1
..

Flow settings: wmg -> wg migration, part 1

Add checks around wmg* variables usage.

Change-Id: I63d290c5391c700802fb000a539a48f305cd61e2
---
M wmf-config/CommonSettings.php
1 file changed, 9 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/92/370292/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 32e6f83..c48982b 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2841,18 +2841,22 @@
$wgExtraNamespaces[2600] = 'Topic'; // NS_TOPIC
}
 
-   $wgFlowDefaultWikiDb = $wmgFlowDefaultWikiDb;
-   $wgFlowCluster = $wmgFlowCluster;
+   // Migration
+   if ( isset( $wmgFlowDefaultWikiDb ) ) {
+   $wgFlowDefaultWikiDb = $wmgFlowDefaultWikiDb;
+   $wgFlowCluster = $wmgFlowCluster;
+   $wgFlowMaintenanceMode = $wmgFlowMaintenanceMode;
+   $wgFlowEnableOptInBetaFeature = $wmgFlowEnableOptInBetaFeature;
+   }
+
$wgFlowExternalStore = $wgDefaultExternalStore;
-   $wgFlowMaintenanceMode = $wmgFlowMaintenanceMode;
 
$wgFlowEventLogging = true;
+
 
if ( $wmgFlowAllowAutoconfirmedEdit ) {
$wgGroupPermissions['autoconfirmed']['flow-edit-post'] = true;
}
-
-   $wgFlowEnableOptInBetaFeature = $wmgFlowEnableOptInBetaFeature;
 }
 
 if ( $wmgUseDisambiguator ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63d290c5391c700802fb000a539a48f305cd61e2
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Flow settings: wmg -> wg migration, part 2

2017-08-04 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370293 )

Change subject: Flow settings: wmg -> wg migration, part 2
..

Flow settings: wmg -> wg migration, part 2

Use all wg* varaibles defined by Flow.

Change-Id: Ic3991925f5975b3fc6d708826e9bbd4f641f6974
---
M wmf-config/InitialiseSettings-labs.php
M wmf-config/InitialiseSettings.php
2 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/93/370293/1

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index c20bd91..690227a 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -350,13 +350,13 @@
'flow_only_labs' => true,
],
# No separate Flow DB or cluster (yet) for labs.
-   '-wmgFlowDefaultWikiDb' => [
+   '-wgFlowDefaultWikiDb' => [
'default' => false,
],
-   '-wmgFlowCluster' => [
+   '-wgFlowCluster' => [
'default' => false,
],
-   'wmgFlowEnableOptInBetaFeature' => [
+   'wgFlowEnableOptInBetaFeature' => [
'enwiki' => true,
'hewiki' => true,
],
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index bea92dc..f4016c9 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -17398,19 +17398,19 @@
'default' => true,
 ],
 // Use separate database on extension1 cluster for all non-private wikis.
-'wmgFlowDefaultWikiDb' => [
+'wgFlowDefaultWikiDb' => [
'default' => 'flowdb',
'private' => false,
'wikitech' => false, // T127792
 ],
-'wmgFlowCluster' => [
+'wgFlowCluster' => [
'default' => 'extension1',
'private' => false,
 ],
-'wmgFlowMaintenanceMode' => [
+'wgFlowMaintenanceMode' => [
'default' => false,
 ],
-'wmgFlowEnableOptInBetaFeature' => [
+'wgFlowEnableOptInBetaFeature' => [
'default' => false,
'testwiki' => true,
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3991925f5975b3fc6d708826e9bbd4f641f6974
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Flow settings: wmg -> wg migration, part 3

2017-08-04 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370294 )

Change subject: Flow settings: wmg -> wg migration, part 3
..

Flow settings: wmg -> wg migration, part 3

Remove b/c checks.

Change-Id: I37052d0ea4a9aedf3484e3dafc1787beadc1bbfb
---
M wmf-config/CommonSettings.php
1 file changed, 0 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/94/370294/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index c48982b..ee52c92 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2841,18 +2841,9 @@
$wgExtraNamespaces[2600] = 'Topic'; // NS_TOPIC
}
 
-   // Migration
-   if ( isset( $wmgFlowDefaultWikiDb ) ) {
-   $wgFlowDefaultWikiDb = $wmgFlowDefaultWikiDb;
-   $wgFlowCluster = $wmgFlowCluster;
-   $wgFlowMaintenanceMode = $wmgFlowMaintenanceMode;
-   $wgFlowEnableOptInBetaFeature = $wmgFlowEnableOptInBetaFeature;
-   }
-
$wgFlowExternalStore = $wgDefaultExternalStore;
 
$wgFlowEventLogging = true;
-
 
if ( $wmgFlowAllowAutoconfirmedEdit ) {
$wgGroupPermissions['autoconfirmed']['flow-edit-post'] = true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I37052d0ea4a9aedf3484e3dafc1787beadc1bbfb
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WANCacheReapUpdate: Handle special pages without exception

2017-08-04 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370290 )

Change subject: WANCacheReapUpdate: Handle special pages without exception
..

WANCacheReapUpdate: Handle special pages without exception

Bug: T172560
Change-Id: I95a6da2c5303e5fc4e931734e39974825d4c3c53
---
M includes/deferred/WANCacheReapUpdate.php
1 file changed, 7 insertions(+), 1 deletion(-)


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

diff --git a/includes/deferred/WANCacheReapUpdate.php 
b/includes/deferred/WANCacheReapUpdate.php
index b12af19..cbeb1fc 100644
--- a/includes/deferred/WANCacheReapUpdate.php
+++ b/includes/deferred/WANCacheReapUpdate.php
@@ -104,7 +104,13 @@
/** @var WikiPage[]|LocalFile[]|User[] $entities */
$entities = [];
 
-   $entities[] = WikiPage::factory( Title::newFromTitleValue( $t ) 
);
+   // You can't create a WikiPage for special pages (-1) or other 
virtual
+   // namespaces, but special pages do appear in RC sometimes, 
e.g. for logs
+   // of AbuseFilter filter changes.
+   if ( $t->getNamespace() >= 0 ) {
+   $entities[] = WikiPage::factory( 
Title::newFromTitleValue( $t ) );
+   }
+
if ( $t->inNamespace( NS_FILE ) ) {
$entities[] = wfLocalFile( $t->getText() );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95a6da2c5303e5fc4e931734e39974825d4c3c53
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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] wikimedia...crm[master]: Set source fields correctly

2017-08-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370289 )

Change subject: Set source fields correctly
..

Set source fields correctly

This has been broken since we switched over to using QueueWrapper
:(

Bug: T95647
Change-Id: I6e5df30b4ad4b2431893c5a1ed28b0fdf212ddc4
---
M sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc
M sites/all/modules/globalcollect_audit/globalcollect_audit.module
M sites/all/modules/offline2civicrm/ChecksFile.php
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
M sites/all/modules/wmf_audit/wmf_audit.module
M sites/all/modules/wmf_common/wmf_common.module
7 files changed, 26 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/89/370289/1

diff --git 
a/sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc 
b/sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc
index 6f4a654..ee11ba2 100644
--- a/sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc
+++ b/sites/all/modules/globalcollect_audit/globalcollect_audit.drush.inc
@@ -70,7 +70,9 @@
  */
 function drush_globalcollect_audit() {
wmf_common_create_smashpig_context( 'ingenico_audit', 'ingenico' );
-
+   wmf_common_set_smashpig_message_source(
+   'audit', 'GlobalCollect WR1 Auditor'
+   );
//$args = drush_get_arguments();

//if the last execution died before we got back here
diff --git a/sites/all/modules/globalcollect_audit/globalcollect_audit.module 
b/sites/all/modules/globalcollect_audit/globalcollect_audit.module
index 4563706..d1e14b7 100644
--- a/sites/all/modules/globalcollect_audit/globalcollect_audit.module
+++ b/sites/all/modules/globalcollect_audit/globalcollect_audit.module
@@ -350,7 +350,7 @@
if ( $test_mode ){
$local_found_ids[] = $order_id;
} else {
-   globalcollect_audit_send_queue_message( 
'donations', $missing_txn_message );
+   QueueWrapper::push( 'donations', 
$missing_txn_message );
watchdog('globalcollect_audit', __FUNCTION__ . 
': Message sent to queue successfully: ' . print_r( $missing_txn_message, true 
), array(), WATCHDOG_INFO);
$local_found_ids[] = $order_id;
}
@@ -386,7 +386,7 @@
if ( $test_mode ){
$local_built_ids[] = $order_id;
} else {
-   globalcollect_audit_send_queue_message( 
'donations', $missing_txn_message );
+   QueueWrapper::push( 'donations', 
$missing_txn_message );
watchdog('globalcollect_audit', __FUNCTION__ . 
': Message sent to queue successfully: ' . print_r( $missing_txn_message, true 
), array(), WATCHDOG_INFO);
$local_built_ids[] = $order_id;
}
@@ -1032,7 +1032,7 @@
'type' => wr1_get_negative_type( $wr1 ), 
//refund or chargeback
);
echo print_r( $send_message, true );
-   globalcollect_audit_send_queue_message( 'refund', 
$send_message );
+   QueueWrapper::push( 'refund', $send_message );
$count += 1;
globalcollect_audit_echo( '.' );
unset( $missing[$index] ); //only unset if we killed it
@@ -1989,13 +1989,6 @@
}
return null;
}
-}
-
-function globalcollect_audit_send_queue_message( $queueId, $body ) {
-
-   wmf_common_set_message_source( $body, 'audit', 'GlobalCollect WR1 
Auditor' );
-
-QueueWrapper::push( $queueId, $body );
 }
 
 /**
diff --git a/sites/all/modules/offline2civicrm/ChecksFile.php 
b/sites/all/modules/offline2civicrm/ChecksFile.php
index 0a9abcb..bee1a96 100644
--- a/sites/all/modules/offline2civicrm/ChecksFile.php
+++ b/sites/all/modules/offline2civicrm/ChecksFile.php
@@ -1,5 +1,7 @@
 file_uri}..." );
+wmf_common_set_smashpig_message_source(
+'direct', 'Offline importer: ' . get_class( $this )
+);
 //TODO: $db->begin();
 
 ini_set( 'auto_detect_line_endings', true );
@@ -222,10 +227,9 @@
 
 $this->mungeMessage( $msg );
 
-$this->validateRequiredFields($msg);
+$this->validateRequiredFields( $msg );
 
-wmf_common_set_message_source( $msg, 'direct', 'Offline importer: ' . 
get_class( $this ) );
-
+SourceFields::addToMessage( $msg );
 return $msg;
 }
 
diff --git 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: openstack: keystone as module/profile/role for deployments

2017-08-04 Thread Rush (Code Review)
Rush has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370288 )

Change subject: openstack: keystone as module/profile/role for deployments
..

openstack: keystone as module/profile/role for deployments

Bug: T171494
Change-Id: I1167b5dac438f2127def1009c07410b31aa0127f
---
M hieradata/codfw/profile/openstack/labtest.yaml
M hieradata/codfw/profile/openstack/labtestn.yaml
A hieradata/codfw/profile/openstack/labtestn/keystone.yaml
M hieradata/common/profile/openstack/base.yaml
A hieradata/common/profile/openstack/base/keystone.yaml
M hieradata/eqiad/profile/openstack/main.yaml
A hieradata/eqiad/profile/openstack/main/keystone.yaml
A modules/openstack2/files/keystone-admin-uwsgi.logrotate
A modules/openstack2/files/keystone-public-uwsgi.logrotate
A modules/openstack2/files/liberty/keystone/keystone-paste.ini
A modules/openstack2/files/liberty/keystone/logging.conf
A modules/openstack2/files/liberty/keystone/policy.json
A 
modules/openstack2/files/liberty/keystone/wmfkeystoneauth.egg-info/entry_points.txt
A modules/openstack2/files/liberty/keystone/wmfkeystoneauth/__init__.py
A 
modules/openstack2/files/liberty/keystone/wmfkeystoneauth/password_whitelist.py
A modules/openstack2/files/liberty/keystone/wmfkeystoneauth/wikitechclient.py
A modules/openstack2/files/liberty/keystone/wmfkeystoneauth/wmtotp.py
A modules/openstack2/manifests/keystone/hooks.pp
A modules/openstack2/manifests/keystone/monitor.pp
A modules/openstack2/manifests/keystone/service.pp
A modules/openstack2/templates/liberty/keystone/keystone.conf.erb
A modules/profile/manifests/openstack/base/keystone/hooks.pp
A modules/profile/manifests/openstack/base/keystone/service.pp
A modules/profile/manifests/openstack/labtest/keystone/service.pp
A modules/profile/manifests/openstack/labtestn/keystone/service.pp
A modules/profile/manifests/openstack/main/keystone/service.pp
M modules/role/manifests/wmcs/openstack/labtest/control.pp
M modules/role/manifests/wmcs/openstack/labtestn/control.pp
M modules/role/manifests/wmcs/openstack/main/control.pp
29 files changed, 1,557 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/88/370288/1

diff --git a/hieradata/codfw/profile/openstack/labtest.yaml 
b/hieradata/codfw/profile/openstack/labtest.yaml
index 6213ee8..f7f07d8 100644
--- a/hieradata/codfw/profile/openstack/labtest.yaml
+++ b/hieradata/codfw/profile/openstack/labtest.yaml
@@ -1,4 +1,7 @@
 profile::openstack::labtest::version: 'liberty'
 profile::openstack::labtest::nova_controller: 
'labtestcontrol2001.wikimedia.org'
 profile::openstack::labtest::rabbit_monitor_user: 'monitoring'
-profile::openstack::labtest::rabbit_file_handles: 1024
+profile::openstack::labtest::rabbit_file_handles: 8192
+profile::openstack::labtest::osm_host: 'labtestwikitech.wikimedia.org'
+profile::openstack::labtest::keystone::db_host: 
'labtestcontrol2001.wikimedia.org'
+profile::openstack::labtest::keystone::token_driver: 'normal'
diff --git a/hieradata/codfw/profile/openstack/labtestn.yaml 
b/hieradata/codfw/profile/openstack/labtestn.yaml
index be7a3d2..d839262 100644
--- a/hieradata/codfw/profile/openstack/labtestn.yaml
+++ b/hieradata/codfw/profile/openstack/labtestn.yaml
@@ -2,3 +2,5 @@
 profile::openstack::labtestn::nova_controller: 
'labtestcontrol2003.wikimedia.org'
 profile::openstack::labtestn::rabbit_monitor_user: 'monitoring'
 profile::openstack::labtestn::rabbit_file_handles: 8192
+profile::openstack::labtestn::osm_host: 'labtestnwikitech.wikimedia.org'
+profile::openstack::labtestn::ldap_hosts: ['labtestservices1003.wikimedia.org']
diff --git a/hieradata/codfw/profile/openstack/labtestn/keystone.yaml 
b/hieradata/codfw/profile/openstack/labtestn/keystone.yaml
new file mode 100644
index 000..0ccb701
--- /dev/null
+++ b/hieradata/codfw/profile/openstack/labtestn/keystone.yaml
@@ -0,0 +1,2 @@
+profile::openstack::labtestn::keystone::db_host: 
'labtestcontrol2003.wikimedia.org'
+profile::openstack::labtestn::keystone::token_driver: 'normal'
diff --git a/hieradata/common/profile/openstack/base.yaml 
b/hieradata/common/profile/openstack/base.yaml
index f4a5a71..ccf32d5 100644
--- a/hieradata/common/profile/openstack/base.yaml
+++ b/hieradata/common/profile/openstack/base.yaml
@@ -1,2 +1,6 @@
 profile::openstack::base::region: "%{::site}"
 profile::openstack::base::observer_user: 'novaobserver'
+profile::openstack::base::ldap_base_dn: 'dc=wikimedia,dc=org'
+profile::openstack::base::ldap_user_id_attribute: 'uid'
+profile::openstack::base::ldap_user_name_attribute: 'cn'
+profile::openstack::base::ldap_user_dn: 
'uid=novaadmin,ou=people,dc=wikimedia,dc=org'
diff --git a/hieradata/common/profile/openstack/base/keystone.yaml 
b/hieradata/common/profile/openstack/base/keystone.yaml
new file mode 100644
index 000..3041820
--- /dev/null
+++ b/hieradata/common/profile/openstack/base/keystone.yaml
@@ -0,0 +1,5 @@

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Bring back old vs new marker in live update

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370244 )

Change subject: RCFilters: Bring back old vs new marker in live update
..


RCFilters: Bring back old vs new marker in live update

Bug: T163426
Change-Id: If019e07b100ca47927ee251513631ecb65156d3b
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index f0e3bd0..31effe1 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -1016,7 +1016,8 @@
$changesListContent,
$fieldset,
false,
-   updateMode === 
this.SHOW_NEW_CHANGES
+   // separator between old and 
new changes
+   updateMode === 
this.SHOW_NEW_CHANGES || updateMode === this.LIVE_UPDATE
);
}.bind( this )
// Do nothing for failure

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If019e07b100ca47927ee251513631ecb65156d3b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sbisson 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: tests: Prepare for qunit 2.x

2017-08-04 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370287 )

Change subject: tests: Prepare for qunit 2.x
..

tests: Prepare for qunit 2.x

Change-Id: I60c6f267bc95563a40a2fa14db6f53aa84dcc5d4
---
M tests/Element.test.js
M tests/JSPHP.test.karma.js
M tests/JSPHP.test.standalone.js
M tests/QUnit.assert.equalDomElement.js
M tests/core.test.js
M tests/widgets/NumberInputWidget.test.js
6 files changed, 18 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/87/370287/1

diff --git a/tests/Element.test.js b/tests/Element.test.js
index 723781e..c5be298 100644
--- a/tests/Element.test.js
+++ b/tests/Element.test.js
@@ -1,5 +1,5 @@
 QUnit.module( 'Element', {
-   setup: function () {
+   beforeEach: function () {
this.fixture = document.createElement( 'div' );
document.body.appendChild( this.fixture );
 
@@ -9,7 +9,7 @@
return ( frame.contentWindow && 
frame.contentWindow.document ) || frame.contentDocument;
};
},
-   teardown: function () {
+   afterEach: function () {
this.fixture.parentNode.removeChild( this.fixture );
this.fixture = null;
}
diff --git a/tests/JSPHP.test.karma.js b/tests/JSPHP.test.karma.js
index 0d5e75b..c0d3e33 100644
--- a/tests/JSPHP.test.karma.js
+++ b/tests/JSPHP.test.karma.js
@@ -18,8 +18,11 @@
}
 
function makeTest( theme, klassName, infuseOnly, tests, output ) {
-   QUnit.test( theme + ': ' + klassName, tests.length * ( 
infuseOnly ? 1 : 2 ), function ( assert ) {
+   QUnit.test( theme + ': ' + klassName, function ( assert ) {
var test, config, instance, infused, $fromPhp, i, 
testName;
+
+   assert.expect( tests.length * ( infuseOnly ? 1 : 2 ) );
+
OO.ui.theme = themes[ theme ];
for ( i = 0; i < tests.length; i++ ) {
test = tests[ i ];
diff --git a/tests/JSPHP.test.standalone.js b/tests/JSPHP.test.standalone.js
index 20b926f..66fe8ed 100644
--- a/tests/JSPHP.test.standalone.js
+++ b/tests/JSPHP.test.standalone.js
@@ -18,8 +18,11 @@
}
 
function makeTest( theme, klassName, infuseOnly, tests ) {
-   QUnit.test( theme + ': ' + klassName, tests.length * ( 
infuseOnly ? 1 : 2 ), function ( assert ) {
+   QUnit.test( theme + ': ' + klassName, function ( assert ) {
var test, config, instance, infused, id, fromPhp, i, 
testName;
+
+   assert.expect( tests.length * ( infuseOnly ? 1 : 2 ) );
+
OO.ui.theme = themes[ theme ];
for ( i = 0; i < tests.length; i++ ) {
test = tests[ i ];
diff --git a/tests/QUnit.assert.equalDomElement.js 
b/tests/QUnit.assert.equalDomElement.js
index 7a86a6b..3caa15f 100644
--- a/tests/QUnit.assert.equalDomElement.js
+++ b/tests/QUnit.assert.equalDomElement.js
@@ -162,7 +162,7 @@
actualSummaryHtml = JSON.stringify( actualSummaryHtml, null, 2 
);
expectedSummaryHtml = JSON.stringify( expectedSummaryHtml, 
null, 2 );
 
-   QUnit.push(
+   this.pushResult(
QUnit.equiv( actualSummary, expectedSummary ), 
actualSummaryHtml, expectedSummaryHtml, message
);
};
diff --git a/tests/core.test.js b/tests/core.test.js
index 8624a72..a758e65 100644
--- a/tests/core.test.js
+++ b/tests/core.test.js
@@ -85,7 +85,7 @@
}
];
 
-   QUnit.expect( cases.length );
+   assert.expect( cases.length );
for ( i = 0; i < cases.length; i++ ) {
$html = $( cases[ i ].html ).appendTo( 'body' );
result = OO.ui.isFocusableElement( cases[ i ].selector ? 
$html.find( cases[ i ].selector ) : $html );
diff --git a/tests/widgets/NumberInputWidget.test.js 
b/tests/widgets/NumberInputWidget.test.js
index 21abf64..b05b733 100644
--- a/tests/widgets/NumberInputWidget.test.js
+++ b/tests/widgets/NumberInputWidget.test.js
@@ -1,7 +1,7 @@
 ( function () {
QUnit.module( 'NumberInputWidget' );
 
-   QUnit.test( 'validate number', 7, function ( assert ) {
+   QUnit.test( 'validate number', function ( assert ) {
var widget = new OO.ui.NumberInputWidget( {
allowInteger: true,
min: -10,
@@ -9,6 +9,8 @@
step: 1,
required: false
} );
+
+   assert.expect( 7 );
 
assert.ok(
widget.validateNumber( 0 ),
@@ -44,7 +46,7 @@
);
} );
 
-   QUnit.test( 'adjust value', 4, function ( assert ) {
+   QUnit.test( 'adjust 

[MediaWiki-commits] [Gerrit] wikimedia...relevanceForge[master]: Update Analysis Analysis Tools

2017-08-04 Thread Tjones (Code Review)
Tjones has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370286 )

Change subject: Update Analysis Analysis Tools
..

Update Analysis Analysis Tools

In analyze_counts:
- catch _analyze errors and report them
- track line count ranges for error reporting
- properly escape tabs

In compare_counts:
- improve lost/found category definitions
- improve counting to distinguish net gains and losses
- prevent some uninitialized variable warnings
- restore missing close paren in output
- tidy up whitespace in the code
- update sample output files

Incidental to working on T170423.

Change-Id: Ia6f0a22c8053d1c55aa2c463a762421ebe0e7677
---
M other_tools/analysis_analysis/analyze_counts.pl
M other_tools/analysis_analysis/compare_counts.pl
M other_tools/analysis_analysis/samples/output/en.comp.folded_self.html
M other_tools/analysis_analysis/samples/output/en.comp.unfolded_vs_folded._f.txt
M other_tools/analysis_analysis/samples/output/en.comp.unfolded_vs_folded.txt
5 files changed, 91 insertions(+), 40 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/relevanceForge 
refs/changes/86/370286/1

diff --git a/other_tools/analysis_analysis/analyze_counts.pl 
b/other_tools/analysis_analysis/analyze_counts.pl
index d4cea87..6cf8b9d 100755
--- a/other_tools/analysis_analysis/analyze_counts.pl
+++ b/other_tools/analysis_analysis/analyze_counts.pl
@@ -36,6 +36,8 @@
chomp $line;
$linecnt++;
 
+   my $start_linecnt = $linecnt;
+
# ~30x speed up to process 100 lines at a time.
my $linelen = length($line);
foreach my $i (1..99) {
@@ -69,6 +71,11 @@
 
my $json = `curl -s localhost:9200/wiki_content/_analyze?pretty -d 
'{"analyzer": "text", "text" : "$escline" }'`;
$json = decode_utf8($json);
+
+   if ($json =~ /"error" :\s*{\s*"root_cause" :/s) {
+   print STDERR "\n_analyze error (somewhere on lines 
$start_linecnt-$linecnt):\n$json\n";
+   exit;
+   }
 
my %tokens = ();
my $hs_offset = 0;  # offset to compensate for errors caused by 
high-surrogate characters
@@ -137,6 +144,7 @@
$rv =~ s/\x{0}/ /g;
$rv =~ s/(["\\])/\\$1/g;
$rv =~ s/'/'"'"'/g;
+   $rv =~ s/\t/\\t/g;
return $rv;
 }
 
diff --git a/other_tools/analysis_analysis/compare_counts.pl 
b/other_tools/analysis_analysis/compare_counts.pl
index 5c075d9..c49ebb6 100755
--- a/other_tools/analysis_analysis/compare_counts.pl
+++ b/other_tools/analysis_analysis/compare_counts.pl
@@ -276,8 +276,21 @@
$mapping{$final}{old} ne $mapping{$final}{new}) 
{
my $mapo = $mapping{$final}{old};
my $mapn = $mapping{$final}{new};
-   my $ocnt = () = ($mapo =~ /\[(.*?)\]/g);
-   my $ncnt = () = ($mapn =~ /\[(.*?)\]/g);
+   my $ocnt = 0;
+   my $ncnt = 0;
+   my $o_token_cnt = 0;
+   my $n_token_cnt = 0;
+
+   while ($mapo =~ /\[(\d+) (.*?)\]/g) {
+   $ocnt++;
+   $o_token_cnt += $1;
+   }
+
+   while ($mapn =~ /\[(\d+) (.*?)\]/g) {
+   $ncnt++;
+   $n_token_cnt += $1;
+   }
+
if ($config{terse} > 0) {
$mapo =~ s/\[\d+ /[/g;
$mapn =~ s/\[\d+ /[/g;
@@ -288,7 +301,17 @@
next if $mapo eq $mapn;
}
}
-   push @{$old_v_new_results{($ocnt > 
$ncnt)?'decreased':'increased'}}, $final;
+
+   my $incrdecr = 'increased';
+
+   if ($ocnt > $ncnt) {
+   $incrdecr = 'decreased';
+   }
+   elsif ($ocnt == $ncnt && $o_token_cnt > $n_token_cnt ) {
+   $incrdecr = 'decreased';
+   }
+
+   push @{$old_v_new_results{$incrdecr}}, $final;
}
}
 
@@ -306,7 +329,7 @@
}
 
$statistics{count_histogram}{scalar(@terms)}++;
-   
+
my $final_len = length($final);
push @{$statistics{token_length}{$final_len}}, $final;
 
@@ -671,7 +694,7 @@
my $to = $language_data{fold}{strings}{$from};
if (defined $to) {
$term =~ s/$from/$to/g;
-   # account for differences in string 
+  

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: FIXMEs regarding processor_id column

2017-08-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370285 )

Change subject: FIXMEs regarding processor_id column
..

FIXMEs regarding processor_id column

Not so we actually fix the recurring globalcollect, but so we don't
repeat the mistake with the Connect tokenized payments.

Change-Id: I6c0f5013ddf082e80990c58fca74bd16183a6c85
---
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
M sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
2 files changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/85/370285/1

diff --git 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
index 83a0758..6ddd21f 100644
--- a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
+++ b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
@@ -313,7 +313,8 @@
   ) );
   $values = array(
   'amount' => $subscription->amount,
-  'effort_id' => $subscription->processor_id + 1,
+ // FIXME: should use 'installments' column, not processor_id
+ 'effort_id' => $subscription->processor_id + 1,
   'order_id' => $transaction->gateway_txn_id,
   'currency' => $subscription->currency,
   'payment_product' => '',
@@ -326,6 +327,7 @@
 
   // FIXME hack.  This is getting overriden by sad.
   $adapter->addRequestData( array(
+ // FIXME: should use 'installments' column, not processor_id
   'effort_id' => $subscription->processor_id + 1,
   ) );
 
@@ -377,6 +379,7 @@
 // Copy stuff from the subscription, and increment the EFFORTID
 'amount' => $contribution_recur['amount'],
 'contact_id' => $contribution_recur['contact_id'],
+   // FIXME: should use 'installements' column, not processor_id
 'effort_id' => $contribution_recur['processor_id'],
 'order_id' => $transaction->gateway_txn_id,
 'currency_code' => $contribution_recur['currency'],
diff --git 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
index 99dae1a..43758f0 100644
--- 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
+++ 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
@@ -155,7 +155,7 @@
  * There are two different queries in this function.
  * - payments need to be marked as failure
  * - payments need to be marked as cancelled if there have been two prior 
failures for this EFFORTID (`processor_id`)
- *
+ * FIXME: should use 'installements' column, not processor_id
  * These are the possible values for `contribution_status_id`:
  * XXX actually the ids are determined by querying the db
  * - [1] => Completed (previous donation succeeded, or new donation that has 
never been recurred before)
@@ -268,9 +268,9 @@
  *
  * Payments will be rescheduled for the following month.
  *
- * @param integer $id The primary key of the record.
+ * @param integer $id The primary key of the record.
  *
- * @return integer  Returns the number of affected rows.
+ * @return int Returns the number of affected rows.
  */
 function _recurring_globalcollect_update_record_success($id) {
 
@@ -292,6 +292,8 @@
   'contribution_status_id' => 
civicrm_api_contribution_status('Completed'),
   'next_sched_contribution_date' => $next_sched_contribution,
   ) )
+  // FIXME: misuse of processor_id - it should indicate which payment
+  // processor the recurring payment is registered with.
   ->expression( 'processor_id', "processor_id + 1" )
   ->condition( 'id', $id )
   ->execute();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c0f5013ddf082e80990c58fca74bd16183a6c85
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: admins/dzahn: update to my .bash_profile

2017-08-04 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370284 )

Change subject: admins/dzahn: update to my .bash_profile
..


admins/dzahn: update to my .bash_profile

I don't want the automatic sudo in front of puppet
commands anymore, it can be confusing.

Instead set a regular alias for puppet agent -tv that i must
have typed about a million times.

Change-Id: I94a619204cb75f6aaa349e633d6539783a1120e4
---
M modules/admin/files/home/dzahn/.bash_profile
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/modules/admin/files/home/dzahn/.bash_profile 
b/modules/admin/files/home/dzahn/.bash_profile
index 8c5336f..9eaf50e 100644
--- a/modules/admin/files/home/dzahn/.bash_profile
+++ b/modules/admin/files/home/dzahn/.bash_profile
@@ -1,4 +1,3 @@
-puppet() { sudo puppet "$@"; }
 alias ls="ls -hals"
 alias tulpen="netstat -tulpen"
 export VISUAL="vim" EDITOR="vim"
@@ -12,6 +11,8 @@
 
 export 
PS1='\[$BRIGHT\]\[$BLACK\][\[$HOSTCOLOR\]${HOSTNAME}\[$GREY\]:\[$RESET\]\[$GREY\]\w\[$BRIGHT\]\[$BLACK\]]\[$RESET\]
 $ '
 
+alias pa="sudo puppet agent -tv"
+
 alias cachemiscpuppet="sudo cumin -b 3 -s 10 'R:class = role::cache::misc' 
'run-puppet-agent -q'"
 
 # set the right base dir for reprepro, depending whether it's apt.wm.org or 
releases.wm.org

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I94a619204cb75f6aaa349e633d6539783a1120e4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: admins/dzahn: update to my .bash_profile

2017-08-04 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370284 )

Change subject: admins/dzahn: update to my .bash_profile
..

admins/dzahn: update to my .bash_profile

I don't want the automatic sudo in front of puppet
commands anymore, it can be confusing.

Instead set a regular alias for puppet agent -tv that i must
have typed about a million times.

Change-Id: I94a619204cb75f6aaa349e633d6539783a1120e4
---
M modules/admin/files/home/dzahn/.bash_profile
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/84/370284/1

diff --git a/modules/admin/files/home/dzahn/.bash_profile 
b/modules/admin/files/home/dzahn/.bash_profile
index 8c5336f..9eaf50e 100644
--- a/modules/admin/files/home/dzahn/.bash_profile
+++ b/modules/admin/files/home/dzahn/.bash_profile
@@ -1,4 +1,3 @@
-puppet() { sudo puppet "$@"; }
 alias ls="ls -hals"
 alias tulpen="netstat -tulpen"
 export VISUAL="vim" EDITOR="vim"
@@ -12,6 +11,8 @@
 
 export 
PS1='\[$BRIGHT\]\[$BLACK\][\[$HOSTCOLOR\]${HOSTNAME}\[$GREY\]:\[$RESET\]\[$GREY\]\w\[$BRIGHT\]\[$BLACK\]]\[$RESET\]
 $ '
 
+alias pa="sudo puppet agent -tv"
+
 alias cachemiscpuppet="sudo cumin -b 3 -s 10 'R:class = role::cache::misc' 
'run-puppet-agent -q'"
 
 # set the right base dir for reprepro, depending whether it's apt.wm.org or 
releases.wm.org

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...EducationProgram[master]: Check canHaveTalkPage() before calling getTalkPage()

2017-08-04 Thread SrishtiSethi (Code Review)
SrishtiSethi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370283 )

Change subject: Check canHaveTalkPage() before calling getTalkPage()
..

Check canHaveTalkPage() before calling getTalkPage()

Bug: T172146
Change-Id: I0ebb7e80de56521bd54539bae7e2251eb62103c8
---
M includes/UserRolesMessage.php
1 file changed, 9 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram 
refs/changes/83/370283/1

diff --git a/includes/UserRolesMessage.php b/includes/UserRolesMessage.php
index 2b0b2b6..660cb19 100644
--- a/includes/UserRolesMessage.php
+++ b/includes/UserRolesMessage.php
@@ -194,14 +194,18 @@
 
foreach ( $mainRoleCourses as $course ) {
$title = $course->getTitle();
-
-   $msg = $this->out->msg(
+   
+   $params = [

'ep-user-roles-message-course-link-for-list',
$title->getFullText(),
-   $course->getName(),
-   $title->getTalkPage()->getFullText()
-   );
+   $course->getName()
+   ];
 
+   if($title->canHaveTalkPage()) {
+   $params[] = 
$title->getTalkPage()->getFullText();
+   }
+   
+   $msg = $this->out->msg( $params );
$courseLinks[] = $msg->plain();
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ebb7e80de56521bd54539bae7e2251eb62103c8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: SrishtiSethi 

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Release mobile-sections 0.12.2

2017-08-04 Thread BearND (Code Review)
BearND has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370282 )

Change subject: Release mobile-sections 0.12.2
..

Release mobile-sections 0.12.2

Significant changes so far:
* T152441: Source coordinates from MW API instead of Parsoid HTML
* T103362: Remove the mobileview API call for most pages
   (use action=query instead)
* T172548: Remove redirect handling

Change-Id: I467cb1bfc5eb4e1b3414a4ccc127e710a226ba05
---
M lib/mobile-util.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/82/370282/1

diff --git a/lib/mobile-util.js b/lib/mobile-util.js
index 05f1ffd..d6c26b0 100644
--- a/lib/mobile-util.js
+++ b/lib/mobile-util.js
@@ -7,7 +7,7 @@
 
 
 mUtil.CONTENT_TYPES = {
-mobileSections: { name: 'mobile-sections', version: '0.12.1' },
+mobileSections: { name: 'mobile-sections', version: '0.12.2' },
 definition: { name: 'definition', version: '0.7.2' },
 random: { name: 'random', version: '0.6.0' },
 announcements: { name: 'announcements', version: '0.1.0' },

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I467cb1bfc5eb4e1b3414a4ccc127e710a226ba05
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: site/phabricator: remove phab role from iridium, make it a s...

2017-08-04 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370122 )

Change subject: site/phabricator: remove phab role from iridium, make it a spare
..


site/phabricator: remove phab role from iridium, make it a spare

Removing the role, so that puppet doesn't have to stay disabled.

Keeping the shell access for Phab admins.

Decom will continue after a grace period.

Bug: T163938
Change-Id: Iec5ef567014139234ba0cfbf605fcb69a502e0e5
---
A hieradata/hosts/iridium.yaml
M manifests/site.pp
2 files changed, 9 insertions(+), 1 deletion(-)

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



diff --git a/hieradata/hosts/iridium.yaml b/hieradata/hosts/iridium.yaml
new file mode 100644
index 000..5c27311
--- /dev/null
+++ b/hieradata/hosts/iridium.yaml
@@ -0,0 +1,3 @@
+admin::groups:
+  - phabricator-admin
+  - phabricator-roots
diff --git a/manifests/site.pp b/manifests/site.pp
index 571bff4..b3b2df9 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1001,6 +1001,11 @@
 interface::add_ip6_mapped { 'main': }
 }
 
+# to be decom'ed, formerly Phabricator (T163938)
+node 'iridium.eqiad.wmnet' {
+role(spare::system)
+}
+
 # irc.wikimedia.org
 node 'kraz.wikimedia.org' {
 role(mw_rc_irc)
@@ -1175,7 +1180,7 @@
 }
 
 # Phabricator
-node /^(iridium\.eqiad|phab1001\.eqiad|phab2001\.codfw)\.wmnet$/ {
+node /^(phab1001\.eqiad|phab2001\.codfw)\.wmnet$/ {
 role(phabricator_server)
 include ::ganglia
 interface::add_ip6_mapped { 'main': }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec5ef567014139234ba0cfbf605fcb69a502e0e5
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Josa[master]: Update author informations

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370260 )

Change subject: Update author informations
..


Update author informations

Change-Id: I632f065317f87a2f1ce56bf8d4a60696be20de4c
---
M COPYING
M Josa.class.php
M extension.json
M i18n/ko.json
4 files changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/COPYING b/COPYING
index 0722734..114273f 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) <2014-2015> 
+Copyright (c) 2014-2017 Bae Junehyeon 
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/Josa.class.php b/Josa.class.php
index 09ab21b..cad196a 100644
--- a/Josa.class.php
+++ b/Josa.class.php
@@ -1,7 +1,7 @@
 
+ * Author: Bae Junehyeon 
  * Original implementation by Park Shinjo 
  * License: MIT License
  */
diff --git a/extension.json b/extension.json
index 159eac5..54c2097 100644
--- a/extension.json
+++ b/extension.json
@@ -1,7 +1,7 @@
 {
"name": "Josa",
"version": "0.2.0",
-   "author": "Junehyeon Bae (devunt)",
+   "author": "Bae Junehyeon (devunt)",
"url": "https://www.mediawiki.org/wiki/Extension:Josa;,
"descriptionmsg": "josa-desc",
"license-name": "MIT",
diff --git a/i18n/ko.json b/i18n/ko.json
index 2cb9d97..3146224 100644
--- a/i18n/ko.json
+++ b/i18n/ko.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "JuneHyeon Bae"
+   "Bae Junehyeon"
]
},
"josa-desc": "한국어 조사 처리의 일부 과정을 자동화합니다"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I632f065317f87a2f1ce56bf8d4a60696be20de4c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Josa
Gerrit-Branch: master
Gerrit-Owner: devunt 
Gerrit-Reviewer: devunt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: clean up a few more labs-puppetmaster-eqiad refs

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370250 )

Change subject: clean up a few more labs-puppetmaster-eqiad refs
..


clean up a few more labs-puppetmaster-eqiad refs

Bug: T171786
Change-Id: I5ef31411b4e402290ce021455d218a4b38730e79
---
M hieradata/codfw.yaml
M modules/labs_bootstrapvz/manifests/init.pp
M modules/labs_vmbuilder/manifests/init.pp
3 files changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/hieradata/codfw.yaml b/hieradata/codfw.yaml
index 922c685..6ec14be 100644
--- a/hieradata/codfw.yaml
+++ b/hieradata/codfw.yaml
@@ -25,7 +25,7 @@
 #
 labs_nova_controller: "labcontrol1001.wikimedia.org"
 labs_glance_controller: "labcontrol1001.wikimedia.org"
-labs_puppet_master: "labs-puppetmaster-eqiad.wikimedia.org"
+labs_puppet_master: "labs-puppetmaster.wikimedia.org"
 labs_keystone_host: "labcontrol1001.wikimedia.org"
 labs_certmanager_hostname: "labservices1001.wikimedia.org"
 
diff --git a/modules/labs_bootstrapvz/manifests/init.pp 
b/modules/labs_bootstrapvz/manifests/init.pp
index bc9f316..f7646ea 100644
--- a/modules/labs_bootstrapvz/manifests/init.pp
+++ b/modules/labs_bootstrapvz/manifests/init.pp
@@ -61,7 +61,7 @@
 $fqdnregex = "s/${::fqdn}/_FQDN_/g"
 
 # We can't just use $::servername here because the master
-#  returns labcontrol1001 vs. the service name, labs-puppetmaster-eqiad
+#  returns labpuppetmaster1001 vs. the service name, labs-puppetmaster
 $puppetmaster = hiera('puppetmaster')
 $masterregex = "s/${puppetmaster}/_MASTER_/g"
 
diff --git a/modules/labs_vmbuilder/manifests/init.pp 
b/modules/labs_vmbuilder/manifests/init.pp
index 967272f..21fb649 100644
--- a/modules/labs_vmbuilder/manifests/init.pp
+++ b/modules/labs_vmbuilder/manifests/init.pp
@@ -85,7 +85,7 @@
 $fqdnregex= "s/${::fqdn}/_FQDN_/g"
 
 # We can't just use $::servername here because the master
-#  returns labcontrol1001 vs. the service name, labs-puppetmaster-eqiad
+#  returns labpuppetmastser1001 vs. the service name, labs-puppetmaster
 $puppetmaster = hiera('puppetmaster')
 $masterregex = "s/${puppetmaster}/_MASTER_/g"
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ef31411b4e402290ce021455d218a4b38730e79
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Josa[master]: Update author informations

2017-08-04 Thread devunt (Code Review)
devunt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370260 )

Change subject: Update author informations
..

Update author informations

Change-Id: I632f065317f87a2f1ce56bf8d4a60696be20de4c
---
M COPYING
M Josa.class.php
M extension.json
M i18n/ko.json
4 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Josa 
refs/changes/60/370260/1

diff --git a/COPYING b/COPYING
index 0722734..06f62d1 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) <2014-2015> 
+Copyright (c) <2014-2017> 
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/Josa.class.php b/Josa.class.php
index 09ab21b..cad196a 100644
--- a/Josa.class.php
+++ b/Josa.class.php
@@ -1,7 +1,7 @@
 
+ * Author: Bae Junehyeon 
  * Original implementation by Park Shinjo 
  * License: MIT License
  */
diff --git a/extension.json b/extension.json
index 159eac5..54c2097 100644
--- a/extension.json
+++ b/extension.json
@@ -1,7 +1,7 @@
 {
"name": "Josa",
"version": "0.2.0",
-   "author": "Junehyeon Bae (devunt)",
+   "author": "Bae Junehyeon (devunt)",
"url": "https://www.mediawiki.org/wiki/Extension:Josa;,
"descriptionmsg": "josa-desc",
"license-name": "MIT",
diff --git a/i18n/ko.json b/i18n/ko.json
index 2cb9d97..3146224 100644
--- a/i18n/ko.json
+++ b/i18n/ko.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "JuneHyeon Bae"
+   "Bae Junehyeon"
]
},
"josa-desc": "한국어 조사 처리의 일부 과정을 자동화합니다"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I632f065317f87a2f1ce56bf8d4a60696be20de4c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Josa
Gerrit-Branch: master
Gerrit-Owner: devunt 

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


[MediaWiki-commits] [Gerrit] mediawiki...Josa[master]: Change the way how parameters work

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/217285 )

Change subject: Change the way how parameters work
..


Change the way how parameters work

Change-Id: I269c756c89d0f1dc5d44becd4349742214e1dcf1
---
M Josa.class.php
M extension.json
M tests/parserTests.txt
3 files changed, 173 insertions(+), 6 deletions(-)

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



diff --git a/Josa.class.php b/Josa.class.php
index 6dbad1c..09ab21b 100644
--- a/Josa.class.php
+++ b/Josa.class.php
@@ -41,18 +41,53 @@
 */
public static function onParserFirstCallInit( Parser &$parser ) {
foreach ( self::$josaMap as $key => $value ) {
-   $parser->setFunctionHook( $key, function ( $parser, 
$str, $with_str = true ) use ( $key ) {
+   // @codingStandardsIgnoreLine
+   $parser->setFunctionHook( $key, function ( $parser, 
$str, $param1 = null, $param2 = null ) use ( $key ) {
$josa = Josa::getJosa( $key, $str );
-   if ( $with_str ) {
-   return $str . $josa;
-   } else {
-   return $josa;
+
+   foreach ( [ $param1, $param2 ] as $param ) {
+   if ( $param === null ) {
+   break;
+   }
+
+   $override = Josa::checkOverrideParam( 
$param );
+   if ( $override !== false ) {
+   $josa = $override;
+   continue;
+   }
+
+   $josaonly = Josa::checkJosaonlyParam( 
$param );
+   if ( $josaonly === true ) {
+   $str = '';
+   continue;
+   }
}
+
+   return $str . $josa;
} );
}
return true;
}
 
+   /**
+* @param string $param String to check
+* @return bool|string Value of override param or false if it isn't 
presented
+*/
+   public static function checkOverrideParam( $param ) {
+   if ( preg_match( '/^(override|덮어쓰기|오버라이드)=(.*)$/', $param, 
$matches ) === 0 ) {
+   return false;
+   }
+   return $matches[2];
+   }
+
+   /**
+* @param string $param String to check
+* @return bool Existence of josaonly param
+*/
+   public static function checkJosaonlyParam( $param ) {
+   return ( $param === 'josaonly' || $param === '조사만' );
+   }
+
/*
 * @param string $type Type of the last letter in the word (see 
Josa::$josaMap's keys)
 * @param string $str Word to determine the josa
diff --git a/extension.json b/extension.json
index 523d618..159eac5 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Josa",
-   "version": "0.1.1",
+   "version": "0.2.0",
"author": "Junehyeon Bae (devunt)",
"url": "https://www.mediawiki.org/wiki/Extension:Josa;,
"descriptionmsg": "josa-desc",
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 384bafb..a8ae48a 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -174,6 +174,138 @@
 !! end
 
 !! test
+Josa with override (in first position) (1)
+!! options
+language=ko
+!! input
+{{#을를:시약 100g|덮어쓰기=을}}
+!! result
+시약 100g을
+
+!! end
+
+!! test
+Josa with override (in first position) (2)
+!! options
+language=ko
+!! input
+{{#을를:시약 100g|오버라이드=을}}
+!! result
+시약 100g을
+
+!! end
+
+!! test
+Josa with override (in first position) (3)
+!! options
+language=ko
+!! input
+{{#을를:시약 100g|override=을}}
+!! result
+시약 100g을
+
+!! end
+
+!! test
+Josa with override (in second position) (1)
+!! options
+language=ko
+!! input
+{{#을를:시약 100g||override=을}}
+!! result
+시약 100g을
+
+!! end
+
+!! test
+Josa with override (in second position) (2)
+!! options
+language=ko
+!! input
+{{#을를:시약 100g|dummy|override=을}}
+!! result
+시약 100g을
+
+!! end
+
+!! test
+Josa with empty override
+!! options
+language=ko
+!! input
+{{#을를:시약 100g|override=}}
+!! result
+시약 100g
+
+!! end
+
+!! test
+Josa with josaonly (in first position) (1)
+!! options
+language=ko
+!! input
+{{#을를:나무|조사만}}
+!! result
+를
+
+!! end
+
+!! test
+Josa with josaonly (in first position) (2)
+!! options
+language=ko
+!! input
+{{#을를:나무|josaonly}}
+!! result
+를
+
+!! end
+
+!! test
+Josa with josaonly (in 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Various Block.php @since tags

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370216 )

Change subject: Various Block.php @since tags
..


Various Block.php @since tags

Followup to: I697e3eec2520792e98c193200c2b1c28c35bf382

Change-Id: I25a72f5f27023ec66939f1cd68fdd606658eac27
---
M includes/Block.php
1 file changed, 12 insertions(+), 0 deletions(-)

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



diff --git a/includes/Block.php b/includes/Block.php
index 2a04879..2ca56a5 100644
--- a/includes/Block.php
+++ b/includes/Block.php
@@ -958,6 +958,7 @@
 
/**
 * Get the system block type, if any
+* @since 1.29
 * @return string|null
 */
public function getSystemBlockType() {
@@ -1450,6 +1451,8 @@
 * Set the 'BlockID' cookie to this block's ID and expiry time. The 
cookie's expiry will be
 * the same as the block's, to a maximum of 24 hours.
 *
+* @since 1.29
+*
 * @param WebResponse $response The response on which to set the cookie.
 */
public function setCookie( WebResponse $response ) {
@@ -1472,6 +1475,8 @@
/**
 * Unset the 'BlockID' cookie.
 *
+* @since 1.29
+*
 * @param WebResponse $response The response on which to unset the 
cookie.
 */
public static function clearCookie( WebResponse $response ) {
@@ -1482,6 +1487,9 @@
 * Get the BlockID cookie's value for this block. This is usually the 
block ID concatenated
 * with an HMAC in order to avoid spoofing (T152951), but if 
wgSecretKey is not set will just
 * be the block ID.
+*
+* @since 1.29
+*
 * @return string The block ID, probably concatenated with "!" and the 
HMAC.
 */
public function getCookieValue() {
@@ -1500,7 +1508,11 @@
/**
 * Get the stored ID from the 'BlockID' cookie. The cookie's value is 
usually a combination of
 * the ID and a HMAC (see Block::setCookie), but will sometimes only be 
the ID.
+*
+* @since 1.29
+*
 * @param string $cookieValue The string in which to find the ID.
+*
 * @return integer|null The block ID, or null if the HMAC is present 
and invalid.
 */
public static function getIdFromCookieValue( $cookieValue ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I25a72f5f27023ec66939f1cd68fdd606658eac27
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] labs/icinga2[master]: rm dupe checks on gerrit-mysql

2017-08-04 Thread Paladox (Code Review)
Paladox has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370255 )

Change subject: rm dupe checks on gerrit-mysql
..


rm dupe checks on gerrit-mysql

Change-Id: I8df0e0fe2fdc20c19529cab3eea8352416ab0585
---
M templates/apt.conf.erb
1 file changed, 1 insertion(+), 8 deletions(-)

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



diff --git a/templates/apt.conf.erb b/templates/apt.conf.erb
index 5a76e7a..4287ca8 100644
--- a/templates/apt.conf.erb
+++ b/templates/apt.conf.erb
@@ -1,8 +1 @@
-# TODO: Zppix remove the parts below then remove this message and leave #
-apply Service "apt" {
-  import "generic-service"
-
-  check_command = "apt"
-
-  assign where host.name == NodeName
-}
+#
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8df0e0fe2fdc20c19529cab3eea8352416ab0585
Gerrit-PatchSet: 3
Gerrit-Project: labs/icinga2
Gerrit-Branch: master
Gerrit-Owner: Zppix 
Gerrit-Reviewer: Paladox 

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


[MediaWiki-commits] [Gerrit] labs/icinga2[master]: rm dupe checks on gerrit-mysql

2017-08-04 Thread Zppix (Code Review)
Zppix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370255 )

Change subject: rm dupe checks on gerrit-mysql
..

rm dupe checks on gerrit-mysql

Change-Id: I8df0e0fe2fdc20c19529cab3eea8352416ab0585
---
M templates/apt.conf.erb
1 file changed, 1 insertion(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/icinga2 
refs/changes/55/370255/3

diff --git a/templates/apt.conf.erb b/templates/apt.conf.erb
index 5a76e7a..4287ca8 100644
--- a/templates/apt.conf.erb
+++ b/templates/apt.conf.erb
@@ -1,8 +1 @@
-# TODO: Zppix remove the parts below then remove this message and leave #
-apply Service "apt" {
-  import "generic-service"
-
-  check_command = "apt"
-
-  assign where host.name == NodeName
-}
+#
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8df0e0fe2fdc20c19529cab3eea8352416ab0585
Gerrit-PatchSet: 3
Gerrit-Project: labs/icinga2
Gerrit-Branch: master
Gerrit-Owner: Zppix 

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


[MediaWiki-commits] [Gerrit] labs/icinga2[master]: Add apt.conf file

2017-08-04 Thread Paladox (Code Review)
Paladox has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370258 )

Change subject: Add apt.conf file
..


Add apt.conf file

Change-Id: Ieae7b58eb5b8741cb0c1a375e189329fe60df73c
---
M manifests/init.pp
A templates/apt.conf.erb
2 files changed, 16 insertions(+), 0 deletions(-)

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



diff --git a/manifests/init.pp b/manifests/init.pp
index 3e7e86d..f2ccc6b 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -76,6 +76,14 @@
 notify  => Base::Service_unit['icinga2'],
 }
 
+file { '/etc/icinga2/conf.d/apt.conf':
+ensure => present,
+content => template('icinga2/apt.conf.erb'),
+owner  => 'root',
+group  => 'root',
+notify  => Base::Service_unit['icinga2'],
+}
+
 file { '/etc/icinga2/conf.d/commands.conf':
 ensure => present,
 content => template('icinga2/commands.conf.erb'),
diff --git a/templates/apt.conf.erb b/templates/apt.conf.erb
new file mode 100644
index 000..5a76e7a
--- /dev/null
+++ b/templates/apt.conf.erb
@@ -0,0 +1,8 @@
+# TODO: Zppix remove the parts below then remove this message and leave #
+apply Service "apt" {
+  import "generic-service"
+
+  check_command = "apt"
+
+  assign where host.name == NodeName
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieae7b58eb5b8741cb0c1a375e189329fe60df73c
Gerrit-PatchSet: 2
Gerrit-Project: labs/icinga2
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Paladox 

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


[MediaWiki-commits] [Gerrit] labs/icinga2[master]: Add apt.conf file

2017-08-04 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370258 )

Change subject: Add apt.conf file
..

Add apt.conf file

Change-Id: Ieae7b58eb5b8741cb0c1a375e189329fe60df73c
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/icinga2 
refs/changes/58/370258/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieae7b58eb5b8741cb0c1a375e189329fe60df73c
Gerrit-PatchSet: 1
Gerrit-Project: labs/icinga2
Gerrit-Branch: master
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs-puppetmaster: use new labs-puppetmaster host for enc

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370249 )

Change subject: labs-puppetmaster: use new labs-puppetmaster host for enc
..


labs-puppetmaster: use new labs-puppetmaster host for enc

Change-Id: I85a447aca40f9ae9cf2c795138e33b1dc12b6a95
---
M modules/puppetmaster/files/labs.hiera.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/puppetmaster/files/labs.hiera.yaml 
b/modules/puppetmaster/files/labs.hiera.yaml
index 5a1fa0d..7cdd12f 100644
--- a/modules/puppetmaster/files/labs.hiera.yaml
+++ b/modules/puppetmaster/files/labs.hiera.yaml
@@ -12,7 +12,7 @@
 :secret:
   :datadir: /etc/puppet/secret/hieradata
 :httpyaml:
-  :url_prefix: http://labs-puppetmaster-eqiad.wikimedia.org:8100/v1/
+  :url_prefix: http://labs-puppetmaster.wikimedia.org:8100/v1/
 :hierarchy:
   - "labs/hosts/%{::hostname}"
   - "labs/%{::labsproject}/host/%{::hostname}"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I85a447aca40f9ae9cf2c795138e33b1dc12b6a95
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: icinga/certs: add monitoring for status.wm.org cert expiry

2017-08-04 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370248 )

Change subject: icinga/certs: add monitoring for status.wm.org cert expiry
..


icinga/certs: add monitoring for status.wm.org cert expiry

Bug: T172285
Change-Id: Ie763fbe75d5e151958fe9e45d9cf76198e39b6cf
---
M modules/icinga/manifests/monitor/certs.pp
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/modules/icinga/manifests/monitor/certs.pp 
b/modules/icinga/manifests/monitor/certs.pp
index e31fba5..2a91784 100644
--- a/modules/icinga/manifests/monitor/certs.pp
+++ b/modules/icinga/manifests/monitor/certs.pp
@@ -68,4 +68,11 @@
 host  => 'wikitech-static.wikimedia.org',
 contact_group => 'wikitech-static',
 }
+
+monitoring::service { 'https_status-wikimedia':
+description   => 'HTTPS-status-wikimedia-org',
+check_command => 'check_ssl_http_letsencrypt!status.wikimedia.org',
+host  => 'wikitech-static.wikimedia.org',
+contact_group => 'wikitech-static',
+}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie763fbe75d5e151958fe9e45d9cf76198e39b6cf
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Herron 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Scrub #coordinates from response

2017-08-04 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370253 )

Change subject: Scrub #coordinates from response
..

Scrub #coordinates from response

Now we are using the MediaWiki coordinates
prop to source coordinates there is no need to keep this element in
the HTML. On many pages it may be the first paragraph so removing it
will help us serve the first paragraph of content to our users

Bug: T172021
Change-Id: Ia854f7f6808a745634d9b72e12ea2880fe579c66
---
M lib/transforms.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/53/370253/1

diff --git a/lib/transforms.js b/lib/transforms.js
index e0f59b7..b0fb92d 100644
--- a/lib/transforms.js
+++ b/lib/transforms.js
@@ -255,6 +255,7 @@
 'span.Z3988',  // Remove 
 'span:empty',  // Remove empty 
 'link',
+'#coordinates',
 'table.navbox',
 '.geo-nondefault',
 '.geo-multi-punct',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia854f7f6808a745634d9b72e12ea2880fe579c66
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
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] operations/puppet[production]: clean up a few more labs-puppetmaster-eqiad refs

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370250 )

Change subject: clean up a few more labs-puppetmaster-eqiad refs
..

clean up a few more labs-puppetmaster-eqiad refs

Bug: T171786
Change-Id: I5ef31411b4e402290ce021455d218a4b38730e79
---
M hieradata/codfw.yaml
M modules/labs_bootstrapvz/manifests/init.pp
M modules/labs_vmbuilder/manifests/init.pp
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/50/370250/1

diff --git a/hieradata/codfw.yaml b/hieradata/codfw.yaml
index 922c685..6ec14be 100644
--- a/hieradata/codfw.yaml
+++ b/hieradata/codfw.yaml
@@ -25,7 +25,7 @@
 #
 labs_nova_controller: "labcontrol1001.wikimedia.org"
 labs_glance_controller: "labcontrol1001.wikimedia.org"
-labs_puppet_master: "labs-puppetmaster-eqiad.wikimedia.org"
+labs_puppet_master: "labs-puppetmaster.wikimedia.org"
 labs_keystone_host: "labcontrol1001.wikimedia.org"
 labs_certmanager_hostname: "labservices1001.wikimedia.org"
 
diff --git a/modules/labs_bootstrapvz/manifests/init.pp 
b/modules/labs_bootstrapvz/manifests/init.pp
index bc9f316..f7646ea 100644
--- a/modules/labs_bootstrapvz/manifests/init.pp
+++ b/modules/labs_bootstrapvz/manifests/init.pp
@@ -61,7 +61,7 @@
 $fqdnregex = "s/${::fqdn}/_FQDN_/g"
 
 # We can't just use $::servername here because the master
-#  returns labcontrol1001 vs. the service name, labs-puppetmaster-eqiad
+#  returns labpuppetmaster1001 vs. the service name, labs-puppetmaster
 $puppetmaster = hiera('puppetmaster')
 $masterregex = "s/${puppetmaster}/_MASTER_/g"
 
diff --git a/modules/labs_vmbuilder/manifests/init.pp 
b/modules/labs_vmbuilder/manifests/init.pp
index 967272f..21fb649 100644
--- a/modules/labs_vmbuilder/manifests/init.pp
+++ b/modules/labs_vmbuilder/manifests/init.pp
@@ -85,7 +85,7 @@
 $fqdnregex= "s/${::fqdn}/_FQDN_/g"
 
 # We can't just use $::servername here because the master
-#  returns labcontrol1001 vs. the service name, labs-puppetmaster-eqiad
+#  returns labpuppetmastser1001 vs. the service name, labs-puppetmaster
 $puppetmaster = hiera('puppetmaster')
 $masterregex = "s/${puppetmaster}/_MASTER_/g"
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ef31411b4e402290ce021455d218a4b38730e79
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs-puppetmaster: use new labs-puppetmaster host for enc

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370249 )

Change subject: labs-puppetmaster: use new labs-puppetmaster host for enc
..

labs-puppetmaster: use new labs-puppetmaster host for enc

Change-Id: I85a447aca40f9ae9cf2c795138e33b1dc12b6a95
---
M modules/puppetmaster/files/labs.hiera.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/49/370249/1

diff --git a/modules/puppetmaster/files/labs.hiera.yaml 
b/modules/puppetmaster/files/labs.hiera.yaml
index 5a1fa0d..7cdd12f 100644
--- a/modules/puppetmaster/files/labs.hiera.yaml
+++ b/modules/puppetmaster/files/labs.hiera.yaml
@@ -12,7 +12,7 @@
 :secret:
   :datadir: /etc/puppet/secret/hieradata
 :httpyaml:
-  :url_prefix: http://labs-puppetmaster-eqiad.wikimedia.org:8100/v1/
+  :url_prefix: http://labs-puppetmaster.wikimedia.org:8100/v1/
 :hierarchy:
   - "labs/hosts/%{::hostname}"
   - "labs/%{::labsproject}/host/%{::hostname}"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85a447aca40f9ae9cf2c795138e33b1dc12b6a95
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: toolschecker: use the new puppetmaster for manifest checks

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370251 )

Change subject: toolschecker: use the new puppetmaster for manifest checks
..

toolschecker: use the new puppetmaster for manifest checks

Bug: T171786
Change-Id: I7a1103813a9986237a617269458837eca1ddcf9c
---
M modules/toollabs/files/toolschecker.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/51/370251/1

diff --git a/modules/toollabs/files/toolschecker.py 
b/modules/toollabs/files/toolschecker.py
index 517af90..77e0004 100644
--- a/modules/toollabs/files/toolschecker.py
+++ b/modules/toollabs/files/toolschecker.py
@@ -38,7 +38,7 @@
 @check('/labs-puppetmaster/eqiad')
 def puppet_catalog_check():
 # Verify that we can get this host's catalog from the puppet server
-puppetmaster = "labs-puppetmaster-eqiad.wikimedia.org"
+puppetmaster = "labs-puppetmaster.wikimedia.org"
 fqdn = socket.getfqdn()
 keyfile = "/var/lib/toolschecker/puppetcerts/key.pem"
 certfile = "/var/lib/toolschecker/puppetcerts/cert.pem"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a1103813a9986237a617269458837eca1ddcf9c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: shinken: test the new labs puppetmaster

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370252 )

Change subject: shinken: test the new labs puppetmaster
..

shinken: test the new labs puppetmaster

Bug: T171786
Change-Id: I8538acdfe7b9ea69bb0d706bce875ed4d5e34756
---
M modules/shinken/files/labs/basic-infra-checks.cfg
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/52/370252/1

diff --git a/modules/shinken/files/labs/basic-infra-checks.cfg 
b/modules/shinken/files/labs/basic-infra-checks.cfg
index 53cb2c0..f48fa6e 100644
--- a/modules/shinken/files/labs/basic-infra-checks.cfg
+++ b/modules/shinken/files/labs/basic-infra-checks.cfg
@@ -1,6 +1,6 @@
 define host {
 host_name   labs-puppetmaster
-address labs-puppetmaster-eqiad.wikimedia.org
+address labs-puppetmaster.wikimedia.org
 alias   Wikimedia Labs puppetmaster
 contact_groups  labs-infra
 use generic-host

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8538acdfe7b9ea69bb0d706bce875ed4d5e34756
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: icinga/certs: add monitoring for status.wm.org cert expiry

2017-08-04 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370248 )

Change subject: icinga/certs: add monitoring for status.wm.org cert expiry
..

icinga/certs: add monitoring for status.wm.org cert expiry

Bug: T172285
Change-Id: Ie763fbe75d5e151958fe9e45d9cf76198e39b6cf
---
M modules/icinga/manifests/monitor/certs.pp
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/48/370248/1

diff --git a/modules/icinga/manifests/monitor/certs.pp 
b/modules/icinga/manifests/monitor/certs.pp
index e31fba5..2a91784 100644
--- a/modules/icinga/manifests/monitor/certs.pp
+++ b/modules/icinga/manifests/monitor/certs.pp
@@ -68,4 +68,11 @@
 host  => 'wikitech-static.wikimedia.org',
 contact_group => 'wikitech-static',
 }
+
+monitoring::service { 'https_status-wikimedia':
+description   => 'HTTPS-status-wikimedia-org',
+check_command => 'check_ssl_http_letsencrypt!status.wikimedia.org',
+host  => 'wikitech-static.wikimedia.org',
+contact_group => 'wikitech-static',
+}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Josa[master]: Add pronounce table of alphabet and numbers to help choosing...

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/217284 )

Change subject: Add pronounce table of alphabet and numbers to help choosing 
appropriate josa
..


Add pronounce table of alphabet and numbers to help choosing appropriate josa

Change-Id: I370e85b97587cef798a08462ea7ea718a841d6ff
---
M Josa.class.php
M tests/parserTests.txt
2 files changed, 417 insertions(+), 0 deletions(-)

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



diff --git a/Josa.class.php b/Josa.class.php
index 621f939..6dbad1c 100644
--- a/Josa.class.php
+++ b/Josa.class.php
@@ -17,6 +17,24 @@
'E/'  => [ '이', '', '(이)' ], // 태준이가 / 철수가
];
 
+   // This dictionary matches each numbers and alphabets to the 
corresponding hangul pronounces
+   private static $pronounceMap = [
+   '0' => '영', '1' => '일', '2' => '이',
+   '3' => '삼', '4' => '사', '5' => '오',
+   '6' => '육', '7' => '칠', '8' => '팔',
+   '9' => '구',
+
+   'A' => '이', 'B' => '비', 'C' => '씨',
+   'D' => '디', 'E' => '이', 'F' => '프',
+   'G' => '지', 'H' => '치', 'I' => '이',
+   'J' => '이', 'K' => '이', 'L' => '엘',
+   'M' => '엠', 'N' => '엔', 'O' => '오',
+   'P' => '피', 'Q' => '큐', 'R' => '알',
+   'S' => '스', 'T' => '티', 'U' => '유',
+   'V' => '이', 'W' => '유', 'X' => '스',
+   'Y' => '이', 'Z' => '지',
+   ];
+
/**
 * @param Parser $parser
 * @return bool
@@ -44,6 +62,9 @@
// @codingStandardsIgnoreLine
$str = preg_replace( 
'/[\x{}-\x{0027}\x{002A}-\x{002F}\x{003A}-\x{0040}\x{005B}-\x{0060}\x{007B}-\x{00FF}]/u',
 '', $str );
$chr = mb_substr( $str, -1, 1, 'utf-8' );
+   if ( array_key_exists( $chr, self::$pronounceMap ) ) {
+   $chr = self::$pronounceMap[$chr];
+   }
$code = self::convertToJohabCode( $chr );
if ( !$code ) {
// Not hangul
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 35cdd0c..384bafb 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -205,3 +205,399 @@
 사과 (과일)을(를)
 
 !! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (0)
+!! options
+language=ko
+!! input
+{{#을를:0}}
+!! result
+0을
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (1)
+!! options
+language=ko
+!! input
+{{#을를:1}}
+!! result
+1을
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (2)
+!! options
+language=ko
+!! input
+{{#을를:2}}
+!! result
+2를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (3)
+!! options
+language=ko
+!! input
+{{#을를:3}}
+!! result
+3을
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (4)
+!! options
+language=ko
+!! input
+{{#을를:4}}
+!! result
+4를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (5)
+!! options
+language=ko
+!! input
+{{#을를:5}}
+!! result
+5를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (6)
+!! options
+language=ko
+!! input
+{{#을를:6}}
+!! result
+6을
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (7)
+!! options
+language=ko
+!! input
+{{#을를:7}}
+!! result
+7을
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (8)
+!! options
+language=ko
+!! input
+{{#을를:8}}
+!! result
+8을
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Eul: Number (9)
+!! options
+language=ko
+!! input
+{{#을를:9}}
+!! result
+9를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (A)
+!! options
+language=ko
+!! input
+{{#을를:A}}
+!! result
+A를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (B)
+!! options
+language=ko
+!! input
+{{#을를:B}}
+!! result
+B를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (C)
+!! options
+language=ko
+!! input
+{{#을를:C}}
+!! result
+C를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (D)
+!! options
+language=ko
+!! input
+{{#을를:D}}
+!! result
+D를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (E)
+!! options
+language=ko
+!! input
+{{#을를:E}}
+!! result
+E를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (F)
+!! options
+language=ko
+!! input
+{{#을를:F}}
+!! result
+F를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (G)
+!! options
+language=ko
+!! input
+{{#을를:G}}
+!! result
+G를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (H)
+!! options
+language=ko
+!! input
+{{#을를:H}}
+!! result
+H를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (I)
+!! options
+language=ko
+!! input
+{{#을를:I}}
+!! result
+I를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: Uppercase Alphabet (J)
+!! options
+language=ko
+!! input
+{{#을를:J}}
+!! result
+J를
+
+!! end
+
+!! test
+Josa {{#Eul/Ruel:}} -> Ruel: 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: get $::labsproject from the certname

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/368606 )

Change subject: get $::labsproject from the certname
..


get $::labsproject from the certname

If we enforce ...wmflabs
certnames then we can rely on the project being
in the certname so there's no need to call out
to the metadata service.

Bug: T171289
Change-Id: Ie23f221e9a2c7906820c37dcfbddd121c1212eba
---
M manifests/realm.pp
D modules/base/lib/facter/labsprojectfrommetadata.rb
2 files changed, 13 insertions(+), 23 deletions(-)

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



diff --git a/manifests/realm.pp b/manifests/realm.pp
index 900ca27..d60e274 100644
--- a/manifests/realm.pp
+++ b/manifests/realm.pp
@@ -21,13 +21,21 @@
 }
 
 if $realm == 'labs' {
+# Pull the project name from the certname.
+# Labs certs are ...wmflabs
+$pieces = split($trusted['certname'], '[.]')
 
-$labs_metal = hiera('labs_metal', {})
-if has_key($labs_metal, $::hostname) {
-$labsproject = $labs_metal[$::hostname]['project']
-} else {
-$labsproject = $::labsprojectfrommetadata
+if $pieces[3] != 'wmflabs' {
+fail("Badly-formed puppet certname: ${trusted['certname']}")
 }
+if $pieces[2] != $site {
+fail("Incorrect site in certname.  Should be ${site} but is 
${pieces[2]}")
+}
+if $pieces[0] != $::hostname {
+fail("Cert hostname ${pieces[0]} does not match reported hostname 
${::hostname}")
+}
+
+$labsproject = $pieces[1]
 
 if $::labsproject == undef {
 fail('Failed to determine $::labsproject')
diff --git a/modules/base/lib/facter/labsprojectfrommetadata.rb 
b/modules/base/lib/facter/labsprojectfrommetadata.rb
deleted file mode 100644
index 8d738d3..000
--- a/modules/base/lib/facter/labsprojectfrommetadata.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# labsprojectfrommetadata.rb
-#
-# This fact pulls the labs project out of instance metadata
-
-require 'facter'
-
-Facter.add(:labsprojectfrommetadata) do
-  setcode do
-domain = Facter::Util::Resolution.exec("hostname -d").chomp
-if (domain.end_with? ".wmflabs") || (domain.end_with? ".labtest")
-  # query the nova metadata service at 169.254.169.254
-  metadata = Facter::Util::Resolution.exec("curl -f 
http://169.254.169.254/openstack/2015-10-15/meta_data.json/ 2> /dev/null | jq 
'.project_id'").chomp
-  metadata.slice(1, metadata.length - 2) # strip quotes
-else
-  nil
-end
-  end
-end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie23f221e9a2c7906820c37dcfbddd121c1212eba
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Switch labs to use labs-puppetmaster.wikimedia.org

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370246 )

Change subject: Switch labs to use labs-puppetmaster.wikimedia.org
..


Switch labs to use labs-puppetmaster.wikimedia.org

This is currently labpuppetmaster1001.wikimedia.org

This patch adds a hiera exception for labcontrol1001, keeping
the master set to the old value.  That's so labcontrol1001
doesn't rearrange itself until I'm ready... that file
can be removed shortly.

Change-Id: I661e05bee0a847ef6ee1be7b113e87f592da365e
---
M hieradata/eqiad.yaml
A hieradata/hosts/labcontrol1001.wikimedia.org
M hieradata/labs.yaml
3 files changed, 4 insertions(+), 3 deletions(-)

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



diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml
index cc350cd..e55b754 100644
--- a/hieradata/eqiad.yaml
+++ b/hieradata/eqiad.yaml
@@ -78,7 +78,7 @@
 labs_nova_controller_spare:  
"labcontrol1002.wikimedia.org"
 
 labs_glance_controller:  "labcontrol1001.wikimedia.org"
-labs_puppet_master:  "labs-puppetmaster-eqiad.wikimedia.org"
+labs_puppet_master:  "labs-puppetmaster.wikimedia.org"
 labs_keystone_host:  "labcontrol1001.wikimedia.org"
 
 labs_osm_host: "wikitech.wikimedia.org"
diff --git a/hieradata/hosts/labcontrol1001.wikimedia.org 
b/hieradata/hosts/labcontrol1001.wikimedia.org
new file mode 100644
index 000..b5ab240
--- /dev/null
+++ b/hieradata/hosts/labcontrol1001.wikimedia.org
@@ -0,0 +1 @@
+labs_puppet_master:  "labs-puppetmaster-eqiad.wikimedia.org"
diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index d6564be3..1b1bc8b 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -81,8 +81,8 @@
 profile::base::ssh_server_settings:
   disable_agent_forwarding: false
   challenge_response_auth: false
-labs_puppet_master: "labs-puppetmaster-eqiad.wikimedia.org"
-puppetmaster: "labs-puppetmaster-eqiad.wikimedia.org"
+labs_puppet_master: "labs-puppetmaster.wikimedia.org"
+puppetmaster: "labs-puppetmaster.wikimedia.org"
 saltmaster: "labs-puppetmaster-eqiad.wikimedia.org"
 mysql::server::use_apparmor: false  # The images we have for debian don't 
support it
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I661e05bee0a847ef6ee1be7b113e87f592da365e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: MCS no longer uses mobile view API under the hood

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369580 )

Change subject: MCS no longer uses mobile view API under the hood
..


MCS no longer uses mobile view API under the hood

After this change we will only use it for the mainpage
Yay!

Changes:
* Remove getMobileViewMetadata
* Remove call to getMobileViewMetadata
* getMetadata now returns a promise that returns a plain
object
* Drop pageMetadataPromise

Bug: T103362
Change-Id: Iebf446c29dfe9cb944f0bf8cc335513ded0abc72
---
M lib/mwapi.js
M routes/mobile-sections.js
2 files changed, 13 insertions(+), 44 deletions(-)

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



diff --git a/lib/mwapi.js b/lib/mwapi.js
index 357b99f..ce3c6fc 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -8,6 +8,7 @@
 const api = require('./api-util');
 const HTTPError = sUtil.HTTPError;
 const Title = require('mediawiki-title').Title;
+const anchorencode = require('./anchorencode');
 
 const mwapi = {};
 
@@ -127,30 +128,6 @@
 };
 
 /**
- * Builds the request to get page metadata from MW API action=mobileview.
- * The plan is to deprecate this method and usage of the mobileview api 
(T103362).
- * Please use getMetaData and queries that do not hit the mobileview api.
- * @param {!Object} app the application object
- * @param {!Object} req the request object
- * @return {!Promise} a promise resolving as an JSON object containing the 
response
- */
-function getMobileViewMetadata(app, req) {
-const props = [];
-
-const query = apiParams({
-action: 'mobileview',
-page: req.params.title,
-prop: props.join('|'),
-thumbwidth: mwapi.LEAD_IMAGE_XL
-});
-return api.mwApiGet(app, req.params.domain, query)
-.then((response) => {
-mwapi.checkForMobileviewInResponse(req.logger, response);
-return response;
-});
-}
-
-/**
  * Given protection status for an article simplify it to allow easy reference
  * @param {!Array} mwApiProtectionObj e.g.
  *  [ { type: 'edit', level: 'autoconfirmed', expiry: 'infinity' }
@@ -232,8 +209,11 @@
   && body.query.normalized[0].to;
   const displayTitle = pageprops && pageprops.displaytitle;
   const redirectInfo = body.query.redirects && body.query.redirects[0];
-  const redirected = redirectInfo && redirectInfo.to;
+  let redirected = redirectInfo && redirectInfo.to;
   const title = redirected || page.title;
+  if (redirectInfo && redirectInfo.tofragment) {
+  redirected += `#${anchorencode(redirectInfo.tofragment)}`;
+  }
   const thumbUrl = page.thumbnail && page.thumbnail.source;
   const thumb = thumbUrl ? {
   url: thumbUrl.replace('https:', '')
@@ -251,8 +231,10 @@
   return {
   geo,
   contentmodel: revision && revision.contentmodel,
+  title: page.title,
   displaytitle: displayTitle || title,
   normalizedtitle: normalized || title,
+  redirected,
   pageprops,
   image,
   id: page.pageid,
@@ -260,7 +242,6 @@
   lastmodified: revision && revision.timestamp,
   lastmodifier: modifier,
   thumb,
-  thumbnail: page.thumbnail,
   ns: page.ns,
   protection,
   editable: !protection.edit,
@@ -278,13 +259,9 @@
  * @return {!Promise} a promise resolving as an JSON object containing the 
response
  */
 mwapi.getMetadata = function(app, req) {
-return getMobileViewMetadata(app, req)
-  .then((mvResponse) => {
-  return getMetadataActionApi(app, req).then((actionResp) => {
-  Object.assign(mvResponse.body.mobileview, actionResp);
-  return mvResponse;
-  });
-  });
+return getMetadataActionApi(app, req).then((meta) => {
+return meta;
+});
 };
 
 /**
diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index 329b792..6110b35 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -49,14 +49,6 @@
 });
 }
 
-/** Returns a promise to retrieve the page content from MW API mobileview */
-function pageMetadataPromise(req) {
-return mwapi.getMetadata(app, req)
-.then((response) => {
-return response.body.mobileview;
-});
-}
-
 function buildLeadSections(sections) {
 const len = sections.length;
 const out = [];
@@ -128,8 +120,8 @@
 id: input.meta.id,
 issues,
 revision: input.page.revision,
-lastmodified: input.page.lastmodified,
-lastmodifier: input.meta.lastmodifiedby || { anon: true },
+lastmodified: input.meta.lastmodified,
+lastmodifier: input.meta.lastmodifier,
 displaytitle: input.meta.displaytitle,
 normalizedtitle: input.meta.normalizedtitle,

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Do not use MobileView to source metadata

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/368959 )

Change subject: Do not use MobileView to source metadata
..


Do not use MobileView to source metadata

* Rename getAllSections method to show what it is really doing -
using mobileview API to work out where the sections are for the
main page. It's not used for anything else.
* All metadata is now sourced from outside the mobileview api
** The code to use mobileview will be removed in a follow up.
* User gender is now no longer available due to the open bug. This is
okay given gender is not currently used in production anywhere and sending
unknown is backwards compatibility

Bug: T103362
Change-Id: Ica94d831d18faf0d2a7f220c7a1277da14efa20a
---
M lib/mwapi.js
M routes/mobile-sections.js
M test/features/mobile-sections-lead/pagecontent.js
A test/lib/mwapi/simplifyProtectionObject-test.js
4 files changed, 138 insertions(+), 13 deletions(-)

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



diff --git a/lib/mwapi.js b/lib/mwapi.js
index 3917f6f..357b99f 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -108,11 +108,13 @@
 });
 siteInfoCache[rp.domain] = api.mwApiGet(app, req.params.domain, query)
 .then((res) => {
+const general = res.body.query.general;
 return {
 general: {
-lang: res.body.query.general.lang,
-legaltitlechars: res.body.query.general.legaltitlechars,
-case: res.body.query.general.case
+mainpage: general.mainpage,
+lang: general.lang,
+legaltitlechars: general.legaltitlechars,
+case: general.case
 },
 namespaces: res.body.query.namespaces,
 namespacealiases: res.body.query.namespacealiases,
@@ -133,15 +135,12 @@
  * @return {!Promise} a promise resolving as an JSON object containing the 
response
  */
 function getMobileViewMetadata(app, req) {
-const props = ['languagecount', 'thumb', 'image', 'id', 'revision', 
'description',
-'lastmodified', 'lastmodifiedby', 'normalizedtitle', 'displaytitle', 
'protection',
-'editable', 'namespace', 'pageprops', 'contentmodel'];
+const props = [];
 
 const query = apiParams({
 action: 'mobileview',
 page: req.params.title,
 prop: props.join('|'),
-pageprops: 'wikibase_item|disambiguation',
 thumbwidth: mwapi.LEAD_IMAGE_XL
 });
 return api.mwApiGet(app, req.params.domain, query)
@@ -152,26 +151,74 @@
 }
 
 /**
+ * Given protection status for an article simplify it to allow easy reference
+ * @param {!Array} mwApiProtectionObj e.g.
+ *  [ { type: 'edit', level: 'autoconfirmed', expiry: 'infinity' }
+ * @return {!Object} { 'edit': ['autoconfirmed'] },
+ */
+mwapi.simplifyProtectionObject = function(mwApiProtectionObj) {
+const protection = {};
+mwApiProtectionObj.forEach((entry) => {
+const type = entry.type;
+const level = entry.level;
+
+if (!protection[type]) {
+protection[type] = [];
+}
+if (protection[type].indexOf(level) === -1) {
+protection[type].push(level);
+}
+});
+return protection;
+};
+
+/**
  * Builds the request to get page metadata from MW API action=query
  * @param {!Object} app the application object
  * @param {!Object} req the request object
  * @return {!Promise} a promise resolving as an JSON object containing the 
response
  */
 function getMetadataActionApi(app, req) {
-const props = ['coordinates'];
+let siteinfo;
+const props = ['coordinates','pageprops', 'pageimages', 'pageterms', 
'revisions',
+'info', 'langlinks'];
+
 const query = apiParams({
 action: 'query',
+lllimit: 'max',
+pilicense: 'any',
+pithumbsize: mwapi.LEAD_IMAGE_XL,
+pageprops: ['wikibase_item',
+'disambiguation', 'displaytitle', 'normalizedtitle'].join('|'),
+wbptterms: 'description',
+inprop: ['protection'].join('|'),
+rvprop: ['ids', 'timestamp', 'user', 'contentmodel'].join('|'),
 titles: req.params.title,
+redirects: 1,
 prop: props.join('|')
 });
 
-return api.mwApiGet(app, req.params.domain, query)
-  .then((apiResponse) => {
+return mwapi.getSiteInfo(app, req)
+  .then((si) => {
+  siteinfo = si;
+  return api.mwApiGet(app, req.params.domain, query);
+  }).then((apiResponse) => {
   const body = apiResponse.body;
   const page = body.query && body.query.pages
   && body.query.pages[0];
   const coords = page && page.coordinates && page.coordinates[0];
   let geo;
+  const revision = page 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Record user login timing

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/368310 )

Change subject: Record user login timing
..


Record user login timing

Not using existing Timing class because it makes sense only if
request start time is needed, otherwise it just introduces
unneeded complexity and dependency.

Bug: T171882
Change-Id: I984c9223a4481685a7bcb659a68002c8ec4d122a
---
M includes/specialpage/LoginSignupSpecialPage.php
1 file changed, 11 insertions(+), 0 deletions(-)

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



diff --git a/includes/specialpage/LoginSignupSpecialPage.php 
b/includes/specialpage/LoginSignupSpecialPage.php
index 0600642..9d6fd5b 100644
--- a/includes/specialpage/LoginSignupSpecialPage.php
+++ b/includes/specialpage/LoginSignupSpecialPage.php
@@ -26,7 +26,9 @@
 use MediaWiki\Auth\AuthManager;
 use MediaWiki\Auth\Throttler;
 use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
 use MediaWiki\Session\SessionManager;
+use Wikimedia\ScopedCallback;
 
 /**
  * Holds shared logic for login and account creation pages.
@@ -212,6 +214,15 @@
 * @param string|null $subPage
 */
public function execute( $subPage ) {
+   if ( $this->mPosted ) {
+   $time = microtime( true );
+   $profilingScope = new ScopedCallback( function () use ( 
$time ) {
+   $time = microtime( true ) - $time;
+   $statsd = 
MediaWikiServices::getInstance()->getStatsdDataFactory();
+   $statsd->timing( 
"timing.login.ui.{$this->authAction}", $time * 1000 );
+   } );
+   }
+
$authManager = AuthManager::singleton();
$session = SessionManager::getGlobalSession();
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I984c9223a4481685a7bcb659a68002c8ec4d122a
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Source coordinates from GeoData

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/368954 )

Change subject: Source coordinates from GeoData
..


Source coordinates from GeoData

Rather than rely on Parsoid HTML, source geodata from
the query prop API. It's more future-proof given the adoption of
MediaWiki indicators 
(https://www.mediawiki.org/wiki/Help:Page_status_indicators)
and the fact that HTML markup can change.

This will help us commence removing the mobile view API call
(T103362)

Update some existing tests to use the more accurate values.

Bug: T152441
Change-Id: Ifa8d271718475df5b950890ef3ca4c8f4e6e6794
---
M lib/mwapi.js
M lib/parseProperty.js
M lib/parsoid-access.js
M routes/mobile-sections.js
M test/features/mobile-sections-lead/pagecontent.js
5 files changed, 61 insertions(+), 43 deletions(-)

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



diff --git a/lib/mwapi.js b/lib/mwapi.js
index 4396f52..3917f6f 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -126,11 +126,13 @@
 
 /**
  * Builds the request to get page metadata from MW API action=mobileview.
+ * The plan is to deprecate this method and usage of the mobileview api 
(T103362).
+ * Please use getMetaData and queries that do not hit the mobileview api.
  * @param {!Object} app the application object
  * @param {!Object} req the request object
  * @return {!Promise} a promise resolving as an JSON object containing the 
response
  */
-mwapi.getMetadata = function(app, req) {
+function getMobileViewMetadata(app, req) {
 const props = ['languagecount', 'thumb', 'image', 'id', 'revision', 
'description',
 'lastmodified', 'lastmodifiedby', 'normalizedtitle', 'displaytitle', 
'protection',
 'editable', 'namespace', 'pageprops', 'contentmodel'];
@@ -147,6 +149,57 @@
 mwapi.checkForMobileviewInResponse(req.logger, response);
 return response;
 });
+}
+
+/**
+ * Builds the request to get page metadata from MW API action=query
+ * @param {!Object} app the application object
+ * @param {!Object} req the request object
+ * @return {!Promise} a promise resolving as an JSON object containing the 
response
+ */
+function getMetadataActionApi(app, req) {
+const props = ['coordinates'];
+const query = apiParams({
+action: 'query',
+titles: req.params.title,
+prop: props.join('|')
+});
+
+return api.mwApiGet(app, req.params.domain, query)
+  .then((apiResponse) => {
+  const body = apiResponse.body;
+  const page = body.query && body.query.pages
+  && body.query.pages[0];
+  const coords = page && page.coordinates && page.coordinates[0];
+  let geo;
+
+  // Extract coordinates from the API response
+  if (coords) {
+  geo = {
+  latitude: coords.lat,
+  longitude: coords.lon
+  };
+  }
+  return {
+  geo,
+  };
+  });
+}
+
+/**
+ * Builds the request to get page metadata
+ * @param {!Object} app the application object
+ * @param {!Object} req the request object
+ * @return {!Promise} a promise resolving as an JSON object containing the 
response
+ */
+mwapi.getMetadata = function(app, req) {
+return getMobileViewMetadata(app, req)
+  .then((mvResponse) => {
+  return getMetadataActionApi(app, req).then((actionResp) => {
+  Object.assign(mvResponse.body.mobileview, actionResp);
+  return mvResponse;
+  });
+  });
 };
 
 /**
diff --git a/lib/parseProperty.js b/lib/parseProperty.js
index 8f38bef..4e49ac5 100644
--- a/lib/parseProperty.js
+++ b/lib/parseProperty.js
@@ -28,38 +28,6 @@
 }
 
 /**
- * @param {?string} latLngStr a string consisting of latitude and longitude. 
The values should be
- * separated by ; or , or space.
- * @return {?Geo} if latitude or longitude is truthy, else undefined.
- */
-function latLngStrToGeo(latLngStr) {
-const latLng = latLngStr && latLngStr.split(/[;, ]+/) || [];
-const geo = latLng.length &&
-{ latitude: latLng[0] && parseFloat(latLng[0]),
-longitude: latLng[1] && parseFloat(latLng[1]) };
-return mUtil.defaultVal(mUtil.filterEmpty(geo));
-}
-
-/**
- * Searches for Geo coordinates and adds them to the given page object
- */
-function parseGeo(lead, page) {
-let lat;
-let lng;
-let coordinates = lead.querySelector('span#coordinates .geo');
-let geo = coordinates && latLngStrToGeo(coordinates.textContent);
-if (!geo) {
-coordinates = lead.querySelector('#geoCoord .geo');
-lat = coordinates && coordinates.querySelector('.latitude');
-lng = coordinates && coordinates.querySelector('.longitude');
-geo = lat && lng && 
latLngStrToGeo(`${lat.textContent};${lng.textContent}`);
-}
-if (geo) {
-page.geo = geo;
-}
-}
-
-/**
  * Searches for 

[MediaWiki-commits] [Gerrit] labs/private[master]: Add profile::openstack::main::observer_password

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370247 )

Change subject: Add profile::openstack::main::observer_password
..


Add profile::openstack::main::observer_password

To make the puppet compiler happy on labcontrol1001

Change-Id: I6296b7aba152bc0ecf6337d8e7f96b241b363dcf
---
M hieradata/eqiad.yaml
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Andrew Bogott: Verified; Looks good to me, approved



diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml
index 3d2253c..7f071ce 100644
--- a/hieradata/eqiad.yaml
+++ b/hieradata/eqiad.yaml
@@ -13,6 +13,7 @@
 observer_project: 'observer'
 observer_user: 'novaobserver'
 observer_password: 'Fs6Dq2RtG8KwmM2Z'
+profile::openstack::main::observer_password: 'Fs6Dq2RtG8KwmM2Z'
 
 wikitechstatusconfig:
   user: 'fakebotname'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6296b7aba152bc0ecf6337d8e7f96b241b363dcf
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] labs/private[master]: Add profile::openstack::main::observer_password

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370247 )

Change subject: Add profile::openstack::main::observer_password
..

Add profile::openstack::main::observer_password

To make the puppet compiler happy on labcontrol1001

Change-Id: I6296b7aba152bc0ecf6337d8e7f96b241b363dcf
---
M hieradata/eqiad.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/private 
refs/changes/47/370247/1

diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml
index 3d2253c..7f071ce 100644
--- a/hieradata/eqiad.yaml
+++ b/hieradata/eqiad.yaml
@@ -13,6 +13,7 @@
 observer_project: 'observer'
 observer_user: 'novaobserver'
 observer_password: 'Fs6Dq2RtG8KwmM2Z'
+profile::openstack::main::observer_password: 'Fs6Dq2RtG8KwmM2Z'
 
 wikitechstatusconfig:
   user: 'fakebotname'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6296b7aba152bc0ecf6337d8e7f96b241b363dcf
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Switch labs to use labs-puppetmaster.wikimedia.org

2017-08-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370246 )

Change subject: Switch labs to use labs-puppetmaster.wikimedia.org
..

Switch labs to use labs-puppetmaster.wikimedia.org

This is currently labpuppetmaster1001.wikimedia.org

This patch adds a hiera exception for labcontrol1001, keeping
the master set to the old value.  That's so labcontrol1001
doesn't rearrange itself until I'm ready... that file
can be removed shortly.

Change-Id: I661e05bee0a847ef6ee1be7b113e87f592da365e
---
M hieradata/eqiad.yaml
A hieradata/hosts/labcontrol1001.wikimedia.org
M hieradata/labs.yaml
3 files changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/46/370246/1

diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml
index cc350cd..e55b754 100644
--- a/hieradata/eqiad.yaml
+++ b/hieradata/eqiad.yaml
@@ -78,7 +78,7 @@
 labs_nova_controller_spare:  
"labcontrol1002.wikimedia.org"
 
 labs_glance_controller:  "labcontrol1001.wikimedia.org"
-labs_puppet_master:  "labs-puppetmaster-eqiad.wikimedia.org"
+labs_puppet_master:  "labs-puppetmaster.wikimedia.org"
 labs_keystone_host:  "labcontrol1001.wikimedia.org"
 
 labs_osm_host: "wikitech.wikimedia.org"
diff --git a/hieradata/hosts/labcontrol1001.wikimedia.org 
b/hieradata/hosts/labcontrol1001.wikimedia.org
new file mode 100644
index 000..b5ab240
--- /dev/null
+++ b/hieradata/hosts/labcontrol1001.wikimedia.org
@@ -0,0 +1 @@
+labs_puppet_master:  "labs-puppetmaster-eqiad.wikimedia.org"
diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index d6564be3..1b1bc8b 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -81,8 +81,8 @@
 profile::base::ssh_server_settings:
   disable_agent_forwarding: false
   challenge_response_auth: false
-labs_puppet_master: "labs-puppetmaster-eqiad.wikimedia.org"
-puppetmaster: "labs-puppetmaster-eqiad.wikimedia.org"
+labs_puppet_master: "labs-puppetmaster.wikimedia.org"
+puppetmaster: "labs-puppetmaster.wikimedia.org"
 saltmaster: "labs-puppetmaster-eqiad.wikimedia.org"
 mysql::server::use_apparmor: false  # The images we have for debian don't 
support it
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I661e05bee0a847ef6ee1be7b113e87f592da365e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Bring back anchorencode and locutus dependency

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369805 )

Change subject: Bring back anchorencode and locutus dependency
..


Bring back anchorencode and locutus dependency

This is in preparation for Iebf446c2. When using the action API
instead of mobileview redirects.tofragment is not encoded.
While this may be fine eventually, once Parsoid implements T152540.
It's a bit early for now. Once Parsoid also implements T152540
the usage of anchorencode can be removed and this commit could
be reverted.

FYI, this reverts some of the changes done earlier in I4a78ead3 and 
Ib774f286.

Bug: T103362
Change-Id: I7fc075d8626c07424662265226ad7f13d582ed7d
---
A lib/anchorencode.js
M package.json
A test/lib/anchorencode/anchorencode-test.js
3 files changed, 65 insertions(+), 0 deletions(-)

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



diff --git a/lib/anchorencode.js b/lib/anchorencode.js
new file mode 100644
index 000..bfe2c53
--- /dev/null
+++ b/lib/anchorencode.js
@@ -0,0 +1,23 @@
+'use strict';
+
+const urlencode = require('locutus/php/url/urlencode');
+
+/**
+ * Encodes an input string so that it can be used as an HTML anchor id
+ * (e.g. for a section in a page: ).
+ * See 
https://www.mediawiki.org/wiki/Manual:PAGENAMEE_encoding#Encodings_compared
+ * https://www.mediawiki.org/wiki/Special:Code/MediaWiki/16279
+ * core/include/parser/CoreParserFunctions.php
+ * https://phabricator.wikimedia.org/T9059
+ * https://gerrit.wikimedia.org/r/#/c/226032/
+ * @param {!string} input the input string (usually the heading text of a 
section heading)
+ * @return {!string} the sanitized version of the input string so it can be 
used as an anchor.
+ */
+function anchorencode(input) {
+const id = input.replace(/\s+/g, '_');
+return urlencode(id)
+.replace(/%3A/g, ':')
+.replace(/%/g, '.');
+}
+
+module.exports = anchorencode;
diff --git a/package.json b/package.json
index ace1ab6..6dbcb37 100644
--- a/package.json
+++ b/package.json
@@ -50,6 +50,7 @@
 "express": "^4.14.0",
 "js-yaml": "^3.7.0",
 "mediawiki-title": "^0.6.3",
+"locutus": "^2.0.5",
 "preq": "^0.5.1",
 "service-runner": "^2.2.5",
 "swagger-router": "^0.5.5",
diff --git a/test/lib/anchorencode/anchorencode-test.js 
b/test/lib/anchorencode/anchorencode-test.js
new file mode 100644
index 000..9c23c1c
--- /dev/null
+++ b/test/lib/anchorencode/anchorencode-test.js
@@ -0,0 +1,41 @@
+'use strict';
+
+const assert = require('../../utils/assert.js');
+const anchorencode = require('../../../lib/anchorencode');
+
+describe('lib:anchorencode', function() {
+
+this.timeout(2); // eslint-disable-line no-invalid-this
+
+it('anchorencode(empty) should return an empty string', () => {
+assert.deepEqual(anchorencode(''), '');
+});
+
+it('anchorencode("a") should return a', () => {
+assert.deepEqual(anchorencode('a'), 'a');
+});
+
+it('anchorencode("Z") should return Z', () => {
+assert.deepEqual(anchorencode('Z'), 'Z');
+});
+
+it('anchorencode("  Z  ") should return Z', () => {
+assert.deepEqual(anchorencode('  Z  '), 'Z');
+});
+
+it('anchorencode("a b c") should return a_b_c', () => {
+assert.deepEqual(anchorencode('a b c'), 'a_b_c');
+});
+
+it('anchorencode("a  b  c") should return a_b_c', () => {
+assert.deepEqual(anchorencode('a  b  c'), 'a_b_c');
+});
+
+it('anchorencode("!@#$%^&*()") should return 
21.40.23.24.25.5E.26.2A.28.29', () => {
+assert.deepEqual(anchorencode('!@#$%^&*()'), 
'21.40.23.24.25.5E.26.2A.28.29');
+});
+
+it('anchorencode(":") should not be converted', () => {
+assert.deepEqual(anchorencode(':'), ':');
+});
+});

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7fc075d8626c07424662265226ad7f13d582ed7d
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Fjalapeno 
Gerrit-Reviewer: GWicke 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Jhernandez 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Mhurd 
Gerrit-Reviewer: Mobrovac 
Gerrit-Reviewer: Niedzielski 
Gerrit-Reviewer: Ppchelko 
Gerrit-Reviewer: jenkins-bot <>

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

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix possible crash in Gallery.

2017-08-04 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370245 )

Change subject: Fix possible crash in Gallery.
..

Fix possible crash in Gallery.

This fixes a long-standing TODO in the metadata of gallery items,
that no longer retrieves metadata by reflection, and forces consumers
to use the explicit fields provided by ExtMetadata.

I've actually observed a crash that was caused by the old behavior,
and this patch resolves it.

java.lang.ClassCastException: java.lang.Long cannot be cast to 
org.wikipedia.gallery.ExtMetadata$Values
at org.wikipedia.gallery.ExtMetadata.toMap(ExtMetadata.java:64)
at org.wikipedia.gallery.GalleryItem.(GalleryItem.java:37)

Change-Id: I8e1a44d8ec76edc9be43addf43237dc69633f155
---
M app/src/main/java/org/wikipedia/gallery/ExtMetadata.java
M app/src/main/java/org/wikipedia/gallery/GalleryActivity.java
M app/src/main/java/org/wikipedia/gallery/GalleryItem.java
3 files changed, 28 insertions(+), 41 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/45/370245/1

diff --git a/app/src/main/java/org/wikipedia/gallery/ExtMetadata.java 
b/app/src/main/java/org/wikipedia/gallery/ExtMetadata.java
index 736c5ba..3d152b7 100644
--- a/app/src/main/java/org/wikipedia/gallery/ExtMetadata.java
+++ b/app/src/main/java/org/wikipedia/gallery/ExtMetadata.java
@@ -5,12 +5,6 @@
 
 import com.google.gson.annotations.SerializedName;
 
-import org.apache.commons.lang3.StringUtils;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-
 public class ExtMetadata {
 @SuppressWarnings("unused") @SerializedName("DateTime") @Nullable private 
Values dateTime;
 @SuppressWarnings("unused") @SerializedName("ObjectName") @Nullable 
private Values objectName;
@@ -43,6 +37,22 @@
 return license;
 }
 
+@Nullable public Values imageDescription() {
+return imageDescription;
+}
+
+@Nullable public Values objectName() {
+return objectName;
+}
+
+@Nullable public Values usageTerms() {
+return usageTerms;
+}
+
+@Nullable public Values artist() {
+return artist;
+}
+
 public class Values {
 @SuppressWarnings("unused,NullableProblems") @NonNull private String 
value;
 @SuppressWarnings("unused,NullableProblems") @NonNull private String 
source;
@@ -55,17 +65,5 @@
 @NonNull public String source() {
 return source;
 }
-}
-
-// TODO: Update consumers to use a ExtMetadata object and remove ASAP
-@Deprecated @NonNull Map toMap() throws 
IllegalAccessException {
-HashMap result = new HashMap<>();
-for (Field field : this.getClass().getDeclaredFields()) {
-Values values = (Values) field.get(this);
-if (values != null) {
-result.put(StringUtils.capitalize(field.getName()), 
values.value());
-}
-}
-return result;
 }
 }
diff --git a/app/src/main/java/org/wikipedia/gallery/GalleryActivity.java 
b/app/src/main/java/org/wikipedia/gallery/GalleryActivity.java
index 2d7e224..e74d996 100644
--- a/app/src/main/java/org/wikipedia/gallery/GalleryActivity.java
+++ b/app/src/main/java/org/wikipedia/gallery/GalleryActivity.java
@@ -577,10 +577,10 @@
 galleryAdapter.notifyFragments(galleryPager.getCurrentItem());
 
 CharSequence descriptionStr = "";
-if (item.getMetadata().containsKey("ImageDescription")) {
-descriptionStr = 
StringUtil.fromHtml(item.getMetadata().get("ImageDescription"));
-} else if (item.getMetadata().containsKey("ObjectName")) {
-descriptionStr = 
StringUtil.fromHtml(item.getMetadata().get("ObjectName"));
+if (item.getMetadata() != null && 
item.getMetadata().imageDescription() != null) {
+descriptionStr = 
StringUtil.fromHtml(item.getMetadata().imageDescription().value());
+} else if (item.getMetadata() != null && 
item.getMetadata().objectName() != null) {
+descriptionStr = 
StringUtil.fromHtml(item.getMetadata().objectName().value());
 }
 if (descriptionStr.length() > 0) {
 descriptionText.setText(strip(descriptionStr));
@@ -593,7 +593,8 @@
 licenseIcon.setImageResource(getLicenseIcon(item));
 // Set the icon's content description to the UsageTerms property.
 // (if UsageTerms is not present, then default to Fair Use)
-String usageTerms = item.getMetadata().get("UsageTerms");
+String usageTerms = (item.getMetadata() == null || 
item.getMetadata().usageTerms() == null)
+? null : item.getMetadata().usageTerms().value();
 if (TextUtils.isEmpty(usageTerms)) {
 usageTerms = getString(R.string.gallery_fair_use_license);
 }
@@ -602,9 +603,9 @@
 licenseIcon.setTag(item.getLicenseUrl());
 
 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Update CSS styles

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370061 )

Change subject: Update CSS styles
..


Update CSS styles

Change-Id: Ifa76bc229abc71b736e7a3f377a6a1b81ca739ae
---
M app/src/main/assets/preview.css
M app/src/main/assets/styles.css
2 files changed, 68 insertions(+), 48 deletions(-)

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



diff --git a/app/src/main/assets/preview.css b/app/src/main/assets/preview.css
index 63a581c..e1f419f 100644
--- a/app/src/main/assets/preview.css
+++ b/app/src/main/assets/preview.css
@@ -106,11 +106,6 @@
   color: #22;
   background: #fff;
 }
-.pre-content,
-.content,
-.post-content {
-  margin: 0 16px;
-}
 .content {
   line-height: 1.65;
   word-wrap: break-word;
@@ -137,19 +132,24 @@
 display: block;
   }
 }
+.content figure,
 .content .thumb {
   margin: 0.6em 0;
 }
+.content figure .thumbinner,
 .content .thumb .thumbinner {
   margin: 0 auto;
   max-width: 100% !important;
 }
+.content figcaption,
 .content .thumbcaption {
   margin: 0.5em 0 0;
   font-size: 0.8em;
   line-height: 1.5;
   padding: 0 !important;
   color: #54595d;
+}
+.content .thumbcaption {
   width: auto !important;
 }
 .content .thumbborder {
@@ -238,10 +238,26 @@
   position: relative;
   overflow: hidden;
 }
+/**
+ * This tweaks the default mediawiki.hlist module to provide performance 
optimisations
+ * as well as subtle tweaks to the appearance. It's a work in progress.
+ */
+.hlist > ul li,
+.hlist > dl li,
 .hlist > ul li,
 ul.hlist li {
   display: inline-block;
   margin-right: 8px;
+}
+.hlist-separated li:after {
+  content: '•';
+  padding-left: 8px;
+  color: #002bb8;
+  font-size: 16px;
+  line-height: 1;
+}
+.hlist-separated :last-child:after {
+  content: '';
 }
 .content {
   /* stylelint-disable no-descending-specificity */
@@ -293,16 +309,6 @@
  */
 body.mw-hide-empty-elt .mw-empty-elt {
   display: none;
-}
-.hlist-separated li:after {
-  content: '•';
-  padding-left: 8px;
-  color: #002bb8;
-  font-size: 16px;
-  line-height: 1;
-}
-.hlist-separated :last-child:after {
-  content: '';
 }
 a {
   text-decoration: none;
@@ -721,14 +727,13 @@
}

li.gallerybox div.thumb {
-   text-align: center;
+   background-color: #fff;
border: 1px solid #ccc;
-   margin: 2px;
}

div.gallerytext {
overflow: hidden;
-   font-size: 94%;
+   font-size: 10pt;
padding: 2px 4px;
word-wrap: break-word;
}}/* Galleries */
@@ -761,8 +766,6 @@
 
 li.gallerybox div.thumb {
text-align: center;
-   border: 1px solid #c8ccd1;
-   background-color: #f8f9fa;
margin: 2px;
 }
 
@@ -912,6 +915,14 @@
 
 .mw-gallery-slideshow-img-container a {
display: block;
+}
+
+@media screen {
+   /* Background and border colors are defined separately for print mode */
+   li.gallerybox div.thumb {
+   border: 1px solid #c8ccd1;
+   background-color: #f8f9fa;
+   }
 }.ipa_button {
   display: inline-block;
   margin-bottom: -3px;
@@ -1280,17 +1291,16 @@
 }/**
  * Style Parsoid HTML+RDFa output consistent with wikitext from PHP parser.
  */
-/*csslint regex-selectors:false */
 /*
  * Auto-numbered external links
  * Parsoid renders those as link without content, and lets CSS do the
  * counting. This way the counting style can be customized, and counts update
  * automatically when content is modified.
  */
-.mw-body-content {
+.mw-parser-output {
   counter-reset: mw-numbered-ext-link;
 }
-.mw-body-content a[rel~='mw:ExtLink']:empty:after {
+.mw-parser-output a[rel~='mw:ExtLink']:empty:after {
   content: '[' counter(mw-numbered-ext-link) ']';
   counter-increment: mw-numbered-ext-link;
 }
@@ -1433,4 +1443,4 @@
 figure[typeof~='mw:Video'] > figcaption,
 figure[typeof~='mw:Audio'] > figcaption {
   display: none;
-}
+}
\ No newline at end of file
diff --git a/app/src/main/assets/styles.css b/app/src/main/assets/styles.css
index 737d711..efacc33 100644
--- a/app/src/main/assets/styles.css
+++ b/app/src/main/assets/styles.css
@@ -106,11 +106,6 @@
   color: #22;
   background: #fff;
 }
-.pre-content,
-.content,
-.post-content {
-  margin: 0 16px;
-}
 .content {
   line-height: 1.65;
   word-wrap: break-word;
@@ -137,19 +132,24 @@
 display: block;
   }
 }
+.content figure,
 .content .thumb {
   margin: 0.6em 0;
 }
+.content figure .thumbinner,
 .content .thumb .thumbinner {
   margin: 0 auto;
   max-width: 100% !important;
 }
+.content figcaption,
 .content .thumbcaption {
   margin: 0.5em 0 0;
   font-size: 0.8em;
   line-height: 1.5;
   padding: 0 !important;
   color: #54595d;
+}
+.content .thumbcaption {
   width: auto !important;
 }
 .content .thumbborder {
@@ -238,10 +238,26 @@
   position: relative;
   overflow: hidden;
 }
+/**
+ 

[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Remove a workaround to clear broken 'background-image'

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370188 )

Change subject: Remove a workaround to clear broken 'background-image'
..


Remove a workaround to clear broken 'background-image'

No longer needed after Ib658651e04090ec4f5bc1f5bacbbfb0d7e7f893e
in WikiEditor.

Bug: T172500
Change-Id: I22e5a854ed6ee657d5f6c416cb4412184d10f1ac
---
M resources/ext.CodeMirror.js
1 file changed, 1 insertion(+), 4 deletions(-)

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



diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js
index 5a1ad48..fa6bb22 100644
--- a/resources/ext.CodeMirror.js
+++ b/resources/ext.CodeMirror.js
@@ -270,10 +270,7 @@
);
 
$codeMirrorButton = $( '#wpTextbox1' ).data( 
'wikiEditor-context' ).modules.toolbar.$toolbar.find( 'a.tool[rel=CodeMirror]' 
);
-   // FIXME in 
extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js
-   $codeMirrorButton
-   .css( 'background-image', '' )
-   .attr( 'id', 'mw-editbutton-codemirror' );
+   $codeMirrorButton.attr( 'id', 'mw-editbutton-codemirror' );
 
// eslint-disable-next-line no-use-before-define
updateToolbarButton();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I22e5a854ed6ee657d5f6c416cb4412184d10f1ac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Pastakhov 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: cache::misc/graphite: rename director, don't send cross-dc t...

2017-08-04 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370107 )

Change subject: cache::misc/graphite: rename director, don't send cross-dc 
traffic
..


cache::misc/graphite: rename director, don't send cross-dc traffic

The director itself should just be called "graphite" and not
contain any numbers. It's above datacenter-level.

It should have 2 backends, one in eqiad and one in codfw,
but until it truly is active-active, codfw won't be activated.

Also, note how the current setup uses a codfw hostname for eqiad
in the director called graphite2001. This would cause unencrypted
cross-DC traffic if the director was used.

This should not change anything, still graphite1001 will be used
as the only active backend, for now.

Change-Id: Ib9c817adbeb036671673618ad42431c54e94e566
---
M hieradata/role/common/cache/misc.yaml
1 file changed, 4 insertions(+), 6 deletions(-)

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



diff --git a/hieradata/role/common/cache/misc.yaml 
b/hieradata/role/common/cache/misc.yaml
index e9d003a..834484e 100644
--- a/hieradata/role/common/cache/misc.yaml
+++ b/hieradata/role/common/cache/misc.yaml
@@ -66,12 +66,10 @@
   contint1001:
 backends:
   eqiad: 'contint1001.wikimedia.org'
-  graphite1001:
+  graphite:
 backends:
   eqiad: 'graphite1001.eqiad.wmnet'
-  graphite2001:
-backends:
-  eqiad: 'graphite2001.codfw.wmnet'
+# codfw: 'graphite2001.codfw.wmnet'
   krypton:
 backends:
   eqiad: 'krypton.eqiad.wmnet'
@@ -189,7 +187,7 @@
   graphite-labs.wikimedia.org:
 director: 'labmon1001'
   graphite.wikimedia.org:
-director: 'graphite1001'
+director: 'graphite'
   horizon.wikimedia.org:
 director: 'californium'
   hue.wikimedia.org:
@@ -220,7 +218,7 @@
 director: 'rutherfordium'
 caching: 'pass'
   performance.wikimedia.org:
-director: 'graphite1001'
+director: 'graphite'
   phabricator.wikimedia.org:
 director: 'phabricator'
   phabricator-new.wikimedia.org:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9c817adbeb036671673618ad42431c54e94e566
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Bring back old vs new marker in live update

2017-08-04 Thread Sbisson (Code Review)
Sbisson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370244 )

Change subject: RCFilters: Bring back old vs new marker in live update
..

RCFilters: Bring back old vs new marker in live update

Bug: T163426
Change-Id: If019e07b100ca47927ee251513631ecb65156d3b
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/44/370244/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index f0e3bd0..31effe1 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -1016,7 +1016,8 @@
$changesListContent,
$fieldset,
false,
-   updateMode === 
this.SHOW_NEW_CHANGES
+   // separator between old and 
new changes
+   updateMode === 
this.SHOW_NEW_CHANGES || updateMode === this.LIVE_UPDATE
);
}.bind( this )
// Do nothing for failure

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Declare ApiQueryLinks::

2017-08-04 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370243 )

Change subject: Declare ApiQueryLinks::
..

Declare ApiQueryLinks::

Change-Id: Ie7b553b2d368766df2c3989d58e42f1b6d3d6779
---
M includes/api/ApiQueryLinks.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/43/370243/1

diff --git a/includes/api/ApiQueryLinks.php b/includes/api/ApiQueryLinks.php
index 29c0b74..3639c06 100644
--- a/includes/api/ApiQueryLinks.php
+++ b/includes/api/ApiQueryLinks.php
@@ -34,7 +34,7 @@
const LINKS = 'links';
const TEMPLATES = 'templates';
 
-   private $table, $prefix, $helpUrl;
+   private $table, $prefix, $titlesParam, $helpUrl;
 
public function __construct( ApiQuery $query, $moduleName ) {
switch ( $moduleName ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Replace remaining uses of deprecated DB_SLAVE with DB_REPLICA

2017-08-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370242 )

Change subject: Replace remaining uses of deprecated DB_SLAVE with DB_REPLICA
..

Replace remaining uses of deprecated DB_SLAVE with DB_REPLICA

Change 950cf6016c10953213e5f985dfc18a32d8673197 took care of the most,
but a few remain, either outside of includes/ and maintenance/
directories (which that change was limited to), or in code introduced
afterwards.

Change-Id: I9c363d0219ea7e71cde520faba39406949a36d27
---
M docs/database.txt
M includes/specials/SpecialUncategorizedcategories.php
M languages/Language.php
M profileinfo.php
M tests/phpunit/MediaWikiTestCase.php
M tests/phpunit/includes/RevisionStorageTest.php
M tests/phpunit/includes/WatchedItemQueryServiceUnitTest.php
M tests/phpunit/includes/WatchedItemStoreUnitTest.php
M tests/phpunit/includes/db/LBFactoryTest.php
M tests/phpunit/includes/page/WikiPageTest.php
10 files changed, 19 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/42/370242/1

diff --git a/docs/database.txt b/docs/database.txt
index 44ec764..dbc9204 100644
--- a/docs/database.txt
+++ b/docs/database.txt
@@ -17,7 +17,7 @@
 
 To make a read query, something like this usually suffices:
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 $res = $dbr->select( /* ...see docs... */ );
 foreach ( $res as $row ) {
...
diff --git a/includes/specials/SpecialUncategorizedcategories.php 
b/includes/specials/SpecialUncategorizedcategories.php
index 77b6926..5ff9e04 100644
--- a/includes/specials/SpecialUncategorizedcategories.php
+++ b/includes/specials/SpecialUncategorizedcategories.php
@@ -68,7 +68,7 @@
}
 
public function getQueryInfo() {
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$query = parent::getQueryInfo();
$exceptionList = $this->getExceptionList();
if ( $exceptionList ) {
diff --git a/languages/Language.php b/languages/Language.php
index 12f26c3..941f4b8 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -4537,7 +4537,7 @@
public function formatExpiry( $expiry, $format = true, $infinity = 
'infinity' ) {
static $dbInfinity;
if ( $dbInfinity === null ) {
-   $dbInfinity = wfGetDB( DB_SLAVE )->getInfinity();
+   $dbInfinity = wfGetDB( DB_REPLICA )->getInfinity();
}
 
if ( $expiry == '' || $expiry === 'infinity' || $expiry == 
$dbInfinity ) {
diff --git a/profileinfo.php b/profileinfo.php
index 466f26a..83ae193 100644
--- a/profileinfo.php
+++ b/profileinfo.php
@@ -150,7 +150,7 @@
exit( 1 );
 }
 
-$dbr = wfGetDB( DB_SLAVE );
+$dbr = wfGetDB( DB_REPLICA );
 
 if ( !$dbr->tableExists( 'profiling' ) ) {
echo 'No profiling table exists, so we can\'t show you 
anything.'
diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index 215d292..4afe710 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -1490,7 +1490,7 @@
' method should return true. Use @group 
Database or $this->tablesUsed.' );
}
 
-   $db = wfGetDB( DB_SLAVE );
+   $db = wfGetDB( DB_REPLICA );
 
$res = $db->select( $table, $fields, $condition, wfGetCaller(), 
[ 'ORDER BY' => $fields ] );
$this->assertNotEmpty( $res, "query failed: " . 
$db->lastError() );
diff --git a/tests/phpunit/includes/RevisionStorageTest.php 
b/tests/phpunit/includes/RevisionStorageTest.php
index 642ada2..3ba82a6 100644
--- a/tests/phpunit/includes/RevisionStorageTest.php
+++ b/tests/phpunit/includes/RevisionStorageTest.php
@@ -145,7 +145,7 @@
public function testConstructFromRow() {
$orig = $this->makeRevision();
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'revision', '*', [ 'rev_id' => 
$orig->getId() ] );
$this->assertTrue( is_object( $res ), 'query failed' );
 
@@ -163,7 +163,7 @@
public function testNewFromRow() {
$orig = $this->makeRevision();
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'revision', '*', [ 'rev_id' => 
$orig->getId() ] );
$this->assertTrue( is_object( $res ), 'query failed' );
 
@@ -187,7 +187,7 @@
$orig = $page->getRevision();
$page->doDeleteArticle( 'test Revision::newFromArchiveRow' );
 
-   $dbr = wfGetDB( DB_SLAVE );
+   $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'archive', '*', [ 'ar_rev_id' => 
$orig->getId() ] );

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Also drop pagelinks.pl_from and templatelinks.tl_from indexes

2017-08-04 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370241 )

Change subject: Also drop pagelinks.pl_from and templatelinks.tl_from indexes
..

Also drop pagelinks.pl_from and templatelinks.tl_from indexes

Bug: T172514
Change-Id: I844ddaea1da1bc6ef1bd38b0f262cb76caee6837
---
M includes/installer/MysqlUpdater.php
M includes/installer/SqliteUpdater.php
A maintenance/archives/patch-pagelinks-drop-index-pl_from.sql
A maintenance/archives/patch-templatelinks-drop-index-tl_from.sql
A maintenance/sqlite/archives/patch-pagelinks-drop-index-pl_from.sql
A maintenance/sqlite/archives/patch-templatelinks-drop-index-tl_from.sql
M maintenance/tables.sql
7 files changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/41/370241/1

diff --git a/includes/installer/MysqlUpdater.php 
b/includes/installer/MysqlUpdater.php
index a245b3c..bd8644c 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -321,6 +321,8 @@
[ 'renameIndex', 'transcache', 'tc_url_idx', 'PRIMARY', 
false, 'patch-transcache-fix-pk.sql' ],
[ 'renameIndex', 'user_former_groups', 
'ufg_user_group', 'PRIMARY', false, 'patch-user_former_groups-fix-pk.sql' ],
[ 'renameIndex', 'user_properties', 
'user_properties_user_property', 'PRIMARY', false, 
'patch-user_properties-fix-pk.sql' ],
+   [ 'dropIndex', 'pagelinks', 'pl_from', 
'patch-pagelinks-drop-index-pl_from.sql' ],
+   [ 'dropIndex', 'templatelinks', 'tl_from', 
'patch-templatelinks-drop-index-tl_from.sql' ],
];
}
 
diff --git a/includes/installer/SqliteUpdater.php 
b/includes/installer/SqliteUpdater.php
index fb55dd0..7899e84 100644
--- a/includes/installer/SqliteUpdater.php
+++ b/includes/installer/SqliteUpdater.php
@@ -185,6 +185,8 @@
[ 'renameIndex', 'transcache', 'tc_url_idx', 'PRIMARY', 
false, 'patch-transcache-fix-pk.sql' ],
[ 'renameIndex', 'user_former_groups', 
'ufg_user_group', 'PRIMARY', false, 'patch-user_former_groups-fix-pk.sql' ],
[ 'renameIndex', 'user_properties', 
'user_properties_user_property', 'PRIMARY', false, 
'patch-user_properties-fix-pk.sql' ],
+   [ 'dropIndex', 'pagelinks', 'pl_from', 
'patch-pagelinks-drop-index-pl_from.sql' ],
+   [ 'dropIndex', 'templatelinks', 'tl_from', 
'patch-templatelinks-drop-index-tl_from.sql' ],
];
}
 
diff --git a/maintenance/archives/patch-pagelinks-drop-index-pl_from.sql 
b/maintenance/archives/patch-pagelinks-drop-index-pl_from.sql
new file mode 100644
index 000..757c600
--- /dev/null
+++ b/maintenance/archives/patch-pagelinks-drop-index-pl_from.sql
@@ -0,0 +1 @@
+ALTER TABLE /*_*/pagelinks DROP INDEX /*i*/pl_from;
diff --git a/maintenance/archives/patch-templatelinks-drop-index-tl_from.sql 
b/maintenance/archives/patch-templatelinks-drop-index-tl_from.sql
new file mode 100644
index 000..ae7a1d2
--- /dev/null
+++ b/maintenance/archives/patch-templatelinks-drop-index-tl_from.sql
@@ -0,0 +1 @@
+ALTER TABLE /*_*/templatelinks DROP INDEX /*i*/tl_from;
diff --git a/maintenance/sqlite/archives/patch-pagelinks-drop-index-pl_from.sql 
b/maintenance/sqlite/archives/patch-pagelinks-drop-index-pl_from.sql
new file mode 100644
index 000..64e8128
--- /dev/null
+++ b/maintenance/sqlite/archives/patch-pagelinks-drop-index-pl_from.sql
@@ -0,0 +1 @@
+DROP INDEX /*i*/pl_from;
diff --git 
a/maintenance/sqlite/archives/patch-templatelinks-drop-index-tl_from.sql 
b/maintenance/sqlite/archives/patch-templatelinks-drop-index-tl_from.sql
new file mode 100644
index 000..3fb7ac9
--- /dev/null
+++ b/maintenance/sqlite/archives/patch-templatelinks-drop-index-tl_from.sql
@@ -0,0 +1 @@
+DROP INDEX /*i*/tl_from;
diff --git a/maintenance/tables.sql b/maintenance/tables.sql
index 071272e..47339fa 100644
--- a/maintenance/tables.sql
+++ b/maintenance/tables.sql
@@ -555,9 +555,6 @@
   PRIMARY KEY (pl_from,pl_namespace,pl_title)
 ) /*$wgDBTableOptions*/;
 
--- Forward index, for page edit, save
-CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks 
(pl_from,pl_namespace,pl_title);
-
 -- Reverse index, for Special:Whatlinkshere
 CREATE INDEX /*i*/pl_namespace ON /*_*/pagelinks 
(pl_namespace,pl_title,pl_from);
 
@@ -582,9 +579,6 @@
   tl_title varchar(255) binary NOT NULL default '',
   PRIMARY KEY (tl_from,tl_namespace,tl_title)
 ) /*$wgDBTableOptions*/;
-
--- Forward index, for page edit, save
-CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks 
(tl_from,tl_namespace,tl_title);
 
 -- Reverse index, for Special:Whatlinkshere
 CREATE INDEX /*i*/tl_namespace ON /*_*/templatelinks 
(tl_namespace,tl_title,tl_from);

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

[MediaWiki-commits] [Gerrit] wikidata...gui-deploy[production]: Merging from 2009b2255840495773d9a2a8ae0042e97219c244:

2017-08-04 Thread Smalyshev (Code Review)
Smalyshev has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370239 )

Change subject: Merging from 2009b2255840495773d9a2a8ae0042e97219c244:
..


Merging from 2009b2255840495773d9a2a8ae0042e97219c244:

Increase limit for default query to 100

Change-Id: I1e1994615687b013090881d1f141d5dd6df73b8f
---
R css/embed.style.min.479d924b7fa16566e9a6.css
R css/style.min.0d7eafbda8bb1aa11051.css
M embed.html
M i18n/bs.json
M i18n/ca.json
M i18n/ec.json
M i18n/en.json
M i18n/eo.json
M i18n/es.json
M i18n/kab.json
M i18n/nb.json
M i18n/qqq.json
M i18n/sl.json
M index.html
D js/embed.vendor.min.3c2d4a52b6b63c1310ff.js
A js/embed.vendor.min.89d64436db1886d6d516.js
R js/embed.wdqs.min.26ff5500f94692207a86.js
D js/vendor.min.263f5fcc4546fbb91430.js
A js/vendor.min.36486d42309ebb56c3be.js
D js/wdqs.min.8a4ad15fdf185c210fb2.js
A js/wdqs.min.a4357bd3f1cdbeaec2c6.js
21 files changed, 19 insertions(+), 19 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1e1994615687b013090881d1f141d5dd6df73b8f
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui-deploy
Gerrit-Branch: production
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Smalyshev 

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Update GUI

2017-08-04 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370240 )

Change subject: Update GUI
..

Update GUI

Change-Id: If66b78d7d012de4fd6108b099348d730c3154630
---
M gui
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/40/370240/1

diff --git a/gui b/gui
index 9e444d5..2009b22 16
--- a/gui
+++ b/gui
@@ -1 +1 @@
-Subproject commit 9e444d5d4a84aeae56547b6ecf96899fac788813
+Subproject commit 2009b2255840495773d9a2a8ae0042e97219c244

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If66b78d7d012de4fd6108b099348d730c3154630
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] wikidata...gui-deploy[production]: Merging from 2009b2255840495773d9a2a8ae0042e97219c244:

2017-08-04 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370239 )

Change subject: Merging from 2009b2255840495773d9a2a8ae0042e97219c244:
..

Merging from 2009b2255840495773d9a2a8ae0042e97219c244:

Increase limit for default query to 100

Change-Id: I1e1994615687b013090881d1f141d5dd6df73b8f
---
R css/embed.style.min.479d924b7fa16566e9a6.css
R css/style.min.0d7eafbda8bb1aa11051.css
M embed.html
M i18n/bs.json
M i18n/ca.json
M i18n/ec.json
M i18n/en.json
M i18n/eo.json
M i18n/es.json
M i18n/kab.json
M i18n/nb.json
M i18n/qqq.json
M i18n/sl.json
M index.html
D js/embed.vendor.min.3c2d4a52b6b63c1310ff.js
A js/embed.vendor.min.89d64436db1886d6d516.js
R js/embed.wdqs.min.26ff5500f94692207a86.js
D js/vendor.min.263f5fcc4546fbb91430.js
A js/vendor.min.36486d42309ebb56c3be.js
D js/wdqs.min.8a4ad15fdf185c210fb2.js
A js/wdqs.min.a4357bd3f1cdbeaec2c6.js
21 files changed, 19 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui-deploy 
refs/changes/39/370239/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e1994615687b013090881d1f141d5dd6df73b8f
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui-deploy
Gerrit-Branch: production
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Increase limit for default query to 100

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369872 )

Change subject: Increase limit for default query to 100
..


Increase limit for default query to 100

Change-Id: I3057fa40942472c5b992158e21c596ab2d667d3d
---
M wikibase/queryService/ui/App.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js
index d9a20f6..de59300 100644
--- a/wikibase/queryService/ui/App.js
+++ b/wikibase/queryService/ui/App.js
@@ -8,7 +8,7 @@
var SHORTURL_API = '//tinyurl.com/api-create.php?url=',
RAWGRAPHS_BASE_URL = 'http://wikidata.rawgraphs.io/?url=',
TRACKING_NAMESPACE = 'wikibase.queryService.ui.app.',
-   DEFAULT_QUERY = 'SELECT * WHERE {  SERVICE wikibase:label { 
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } LIMIT 20';
+   DEFAULT_QUERY = 'SELECT * WHERE {  SERVICE wikibase:label { 
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } LIMIT 100';
 
/**
 * A ui application for the Wikibase query service

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3057fa40942472c5b992158e21c596ab2d667d3d
Gerrit-PatchSet: 3
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) 
Gerrit-Reviewer: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Josa[master]: Make Josa::getJosa method ignore all ascii characters except...

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/217283 )

Change subject: Make Josa::getJosa method ignore all ascii characters except 
parenthesis
..


Make Josa::getJosa method ignore all ascii characters except parenthesis

Change-Id: I63bfceb39e2f0b39010d9210b36bc63f542cfbea
---
M Josa.class.php
M tests/parserTests.txt
2 files changed, 37 insertions(+), 4 deletions(-)

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



diff --git a/Josa.class.php b/Josa.class.php
index 161009a..621f939 100644
--- a/Josa.class.php
+++ b/Josa.class.php
@@ -41,10 +41,10 @@
 * @return string Josa
 */
public static function getJosa( $type, $str ) {
-   if ( mb_substr( $str, -2, 2, 'utf-8' ) == ']]' ) { # if end 
with internel link
-   $str = mb_substr( $str, 0, -2, 'utf-8' );
-   }
-   $code = self::convertToJohabCode( mb_substr( $str, -1, 1, 
'utf-8' ) );
+   // @codingStandardsIgnoreLine
+   $str = preg_replace( 
'/[\x{}-\x{0027}\x{002A}-\x{002F}\x{003A}-\x{0040}\x{005B}-\x{0060}\x{007B}-\x{00FF}]/u',
 '', $str );
+   $chr = mb_substr( $str, -1, 1, 'utf-8' );
+   $code = self::convertToJohabCode( $chr );
if ( !$code ) {
// Not hangul
$idx = 2;
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index ea98c11..35cdd0c 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -172,3 +172,36 @@
 영희가
 
 !! end
+
+!! test
+Josa with trailing ascii characters (1)
+!! options
+language=ko
+!! input
+{{#을를:[[도로]]}}
+!! result
+도로를
+
+!! end
+
+!! test
+Josa with trailing ascii characters (2)
+!! options
+language=ko
+!! input
+{{#을를:'''기차'''}}
+!! result
+기차를
+
+!! end
+
+!! test
+Josa with trailing ascii characters (3)
+!! options
+language=ko
+!! input
+{{#을를:사과 (과일)}}
+!! result
+사과 (과일)을(를)
+
+!! end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I63bfceb39e2f0b39010d9210b36bc63f542cfbea
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Josa
Gerrit-Branch: master
Gerrit-Owner: devunt 
Gerrit-Reviewer: Aklapper 
Gerrit-Reviewer: Revi 
Gerrit-Reviewer: devunt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370238 )

Change subject: Merge branch 'master' into deployment
..


Merge branch 'master' into deployment

bd3c0dab2 audit_echochar: handle more methods, don't crash

Change-Id: I1e075e376ed86145304a5c3899a1a01d6e6c18d2
---
0 files changed, 0 insertions(+), 0 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1e075e376ed86145304a5c3899a1a01d6e6c18d2
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

2017-08-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370238 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

bd3c0dab2 audit_echochar: handle more methods, don't crash

Change-Id: I1e075e376ed86145304a5c3899a1a01d6e6c18d2
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/38/370238/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e075e376ed86145304a5c3899a1a01d6e6c18d2
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix return hint type in DatabaseSqlite::makeUpdateOptionsArray

2017-08-04 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370237 )

Change subject: Fix return hint type in DatabaseSqlite::makeUpdateOptionsArray
..

Fix return hint type in DatabaseSqlite::makeUpdateOptionsArray

Change-Id: Id45ddcef9212dfa8fd9545b70aff67cd29dda1d9
---
M includes/libs/rdbms/database/DatabaseSqlite.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/370237/1

diff --git a/includes/libs/rdbms/database/DatabaseSqlite.php 
b/includes/libs/rdbms/database/DatabaseSqlite.php
index 9242414d..870fc3e 100644
--- a/includes/libs/rdbms/database/DatabaseSqlite.php
+++ b/includes/libs/rdbms/database/DatabaseSqlite.php
@@ -567,7 +567,7 @@
 
/**
 * @param array $options
-* @return string
+* @return array
 */
protected function makeUpdateOptionsArray( $options ) {
$options = parent::makeUpdateOptionsArray( $options );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: sanitizer: Match Parsoid's attribute sanitation

2017-08-04 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370236 )

Change subject: sanitizer: Match Parsoid's attribute sanitation
..

sanitizer: Match Parsoid's attribute sanitation

Change-Id: I23323dced95c80eb24aa65df68dcbe5ecbad1c75
---
M includes/Sanitizer.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/370236/1

diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php
index 907da16..787fb61 100644
--- a/includes/Sanitizer.php
+++ b/includes/Sanitizer.php
@@ -1914,7 +1914,7 @@
# Not usually allowed, but may be used for 
extension-style hooks
# such as  when it is rasterized, or if 
$wgAllowImageTag is
# true
-   'img'=> array_merge( $common, [ 'alt', 'src', 
'width', 'height' ] ),
+   'img'=> array_merge( $common, [ 'alt', 'src', 
'width', 'height', 'srcset' ] ),
 
'video'  => array_merge( $common, [ 'poster', 
'controls', 'preload', 'width', 'height' ] ),
'source' => array_merge( $common, [ 'type', 'src' ] 
),
@@ -1951,6 +1951,10 @@
# https://www.w3.org/TR/REC-MathML/
'math'   => [ 'class', 'style', 'id', 'title' ],
 
+   // HTML 5 section 4.5
+   'figure' => $common,
+   'figcaption' => $common,
+
# HTML 5 section 4.6
'bdi' => $common,
 
@@ -1966,7 +1970,7 @@
// (ie: validateTag rejects tags missing the attributes 
needed for Microdata)
// So we don't bother including $common attributes that 
have no purpose.
'meta' => [ 'itemprop', 'content' ],
-   'link' => [ 'itemprop', 'href' ],
+   'link' => [ 'itemprop', 'href', 'title' ],
];
 
return $whitelist;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Match php parser's attribute sanitizer

2017-08-04 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370235 )

Change subject: Match php parser's attribute sanitizer
..

Match php parser's attribute sanitizer

Change-Id: Ia1e1bf9806c92945aee5e6106b0401c500826feb
---
M lib/wt2html/tt/Sanitizer.js
1 file changed, 45 insertions(+), 23 deletions(-)


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

diff --git a/lib/wt2html/tt/Sanitizer.js b/lib/wt2html/tt/Sanitizer.js
index 628b7d7..1d9812a 100644
--- a/lib/wt2html/tt/Sanitizer.js
+++ b/lib/wt2html/tt/Sanitizer.js
@@ -372,23 +372,35 @@
// attrWhiteList code would have to be redone to cache the 
white list in the
// Sanitizer object rather than in the SanitizerConstants 
object.
function computeAttrWhiteList(config) {
-   // base list
var common = ["id", "class", "lang", "dir", "title", 
"style"];
 
+   // WAI-ARIA
+   common = common.concat([
+   'aria-describedby',
+   'aria-flowto',
+   'aria-label',
+   'aria-labelledby',
+   'aria-owns',
+   'role',
+   ]);
+
// RDFa attributes
+   // These attributes are specified in section 9 of
+   // https://www.w3.org/TR/2008/REC-rdfa-syntax-20081014
var rdfa = ["about", "property", "resource", 
"datatype", "typeof"];
if (config.allowRdfaAttrs) {
common = common.concat(rdfa);
}
 
-   // MicroData attrs
+   // Microdata. These are specified by
+   // 
https://html.spec.whatwg.org/multipage/microdata.html#the-microdata-model
var mda = ["itemid", "itemprop", "itemref", 
"itemscope", "itemtype"];
if (config.allowMicrodataAttrs) {
common = common.concat(mda);
}
 
var block = common.concat(["align"]);
-   var tablealign = ["align", "char", "charoff", "valign"];
+   var tablealign = ["align", "valign"];
var tablecell = [
"abbr", "axis", "headers", "scope", "rowspan", 
"colspan",
// these next 4 are deprecated
@@ -401,7 +413,7 @@
// 7.5.4
'div':block,
'center': common, // deprecated
-   'span':   block,  // ??
+   'span':   common,
 
// 7.5.5
'h1': block,
@@ -441,7 +453,10 @@
'p': block,
 
// 9.3.2
-   'br': [ 'id', 'class', 'title', 'style', 
'clear' ],
+   'br': common.concat([ 'clear' ]),
+
+   // 
https://www.w3.org/TR/html5/text-level-semantics.html#the-wbr-element
+   'wbr': common,
 
// 9.3.4
'pre': common.concat([ 'width' ]),
@@ -452,7 +467,7 @@
 
// 10.2
'ul': common.concat([ 'type' ]),
-   'ol': common.concat([ 'type', 'start' ]),
+   'ol': common.concat([ 'type', 'start', 
'reversed' ]),
'li': common.concat([ 'type', 'value' ]),
 
// 10.3
@@ -468,29 +483,28 @@
]),
 
// 11.2.2
-   'caption': common.concat([ 'align' ]),
+   'caption': block,
 
// 11.2.3
-   'thead': common.concat(tablealign),
-   'tfoot': common.concat(tablealign),
-   'tbody': common.concat(tablealign),
+   'thead': common,
+   'tfoot': common,
+   'tbody': common,
 
// 11.2.4
-   'colgroup': common.concat([ 'span', 'width' 
]).concat(tablealign),
-   'col':  common.concat([ 'span', 'width' 
]).concat(tablealign),
+   'colgroup': common.concat([ 'span' ]),
+   'col':  

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Remove redirect handling

2017-08-04 Thread BearND (Code Review)
BearND has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370233 )

Change subject: Remove redirect handling
..

Remove redirect handling

RESTBase handles redirects for us. So, there is no point in MCS having
its own redirect handling or testing it.

Bug: T172548
Change-Id: Icf8eca957e7bd320dedc98032332b7d0b8b24bd4
---
M lib/mwapi.js
M routes/mobile-sections.js
M test/features/mobile-sections/pagecontent.js
3 files changed, 1 insertion(+), 65 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/33/370233/1

diff --git a/lib/mwapi.js b/lib/mwapi.js
index ce3c6fc..796adeb 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -8,7 +8,6 @@
 const api = require('./api-util');
 const HTTPError = sUtil.HTTPError;
 const Title = require('mediawiki-title').Title;
-const anchorencode = require('./anchorencode');
 
 const mwapi = {};
 
@@ -171,7 +170,6 @@
 inprop: ['protection'].join('|'),
 rvprop: ['ids', 'timestamp', 'user', 'contentmodel'].join('|'),
 titles: req.params.title,
-redirects: 1,
 prop: props.join('|')
 });
 
@@ -208,12 +206,7 @@
   && body.query.normalized && body.query.normalized[0]
   && body.query.normalized[0].to;
   const displayTitle = pageprops && pageprops.displaytitle;
-  const redirectInfo = body.query.redirects && body.query.redirects[0];
-  let redirected = redirectInfo && redirectInfo.to;
-  const title = redirected || page.title;
-  if (redirectInfo && redirectInfo.tofragment) {
-  redirected += `#${anchorencode(redirectInfo.tofragment)}`;
-  }
+  const title = page.title;
   const thumbUrl = page.thumbnail && page.thumbnail.source;
   const thumb = thumbUrl ? {
   url: thumbUrl.replace('https:', '')
@@ -234,7 +227,6 @@
   title: page.title,
   displaytitle: displayTitle || title,
   normalizedtitle: normalized || title,
-  redirected,
   pageprops,
   image,
   id: page.pageid,
diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index 6110b35..645e927 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -124,7 +124,6 @@
 lastmodifier: input.meta.lastmodifier,
 displaytitle: input.meta.displaytitle,
 normalizedtitle: input.meta.normalizedtitle,
-redirected: input.meta.redirected,
 wikibase_item: input.meta.pageprops && 
input.meta.pageprops.wikibase_item,
 disambiguation,
 description: input.meta.description,
diff --git a/test/features/mobile-sections/pagecontent.js 
b/test/features/mobile-sections/pagecontent.js
index 35d5ec0..01f9c07 100644
--- a/test/features/mobile-sections/pagecontent.js
+++ b/test/features/mobile-sections/pagecontent.js
@@ -129,61 +129,6 @@
 });
 });
 
-it('Page with HTML entity in redirected page title should load', () => {
-const title = `User:BSitzmann_%28WMF%29%2FMCS%2FTest%2FA%26B_redirect`;
-const uri = localUri(title, 'test.wikipedia.org');
-return preq.get({ uri })
-.then((res) => {
-const lead = res.body.lead;
-const redirectTitle = 'User:BSitzmann (WMF)/MCS/Test/A 
redirect';
-assert.equal(res.status, 200);
-assert.equal(lead.normalizedtitle, redirectTitle);
-assert.equal(lead.displaytitle, 'User:BSitzmann 
(WMF)/MCS/Test/A');
-assert.equal(lead.redirected, 'User:BSitzmann 
(WMF)/MCS/Test/A');
-});
-});
-
-it('Page with % in redirected page title should load [beta cluster]', () 
=> {
-const title = `User:Pchelolo%2fRedirect_Test`;
-const uri = localUri(title, 'en.wikipedia.beta.wmflabs.org');
-return preq.get({ uri })
-.then((res) => {
-assert.equal(res.status, 200);
-assert.equal(res.body.lead.normalizedtitle, 
'User:Pchelolo/Redirect Test');
-assert.equal(res.body.lead.displaytitle, 
'User:Pchelolo/Redirect Target %');
-assert.equal(res.body.lead.redirected, 'User:Pchelolo/Redirect 
Target %');
-});
-});
-
-it('Page with % in redirected page title should load 2', () => {
-const title = `User:BSitzmann_%28WMF%29%2FMCS%2FTest%2Fredirect_test2`;
-const normalizedTitle = 'User:BSitzmann (WMF)/MCS/Test/redirect test2';
-const displayTitle = 'User:BSitzmann (WMF)/MCS/Test/redirect test2 
target %';
-const uri = localUri(title, 'test.wikipedia.org');
-return preq.get({ uri })
-.then((res) => {
-assert.equal(res.status, 200);
-assert.equal(res.body.lead.normalizedtitle, normalizedTitle);
-

[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Revert "Bring back anchorencode and locutus dependency"

2017-08-04 Thread BearND (Code Review)
BearND has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370234 )

Change subject: Revert "Bring back anchorencode and locutus dependency"
..

Revert "Bring back anchorencode and locutus dependency"

This reverts commit e3b9910

Bug: T172548
Change-Id: Ifd2b8cec2376dda0c4fe77746548f8f0934ad318
---
D lib/anchorencode.js
M package.json
D test/lib/anchorencode/anchorencode-test.js
3 files changed, 0 insertions(+), 65 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/34/370234/1

diff --git a/lib/anchorencode.js b/lib/anchorencode.js
deleted file mode 100644
index bfe2c53..000
--- a/lib/anchorencode.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-const urlencode = require('locutus/php/url/urlencode');
-
-/**
- * Encodes an input string so that it can be used as an HTML anchor id
- * (e.g. for a section in a page: ).
- * See 
https://www.mediawiki.org/wiki/Manual:PAGENAMEE_encoding#Encodings_compared
- * https://www.mediawiki.org/wiki/Special:Code/MediaWiki/16279
- * core/include/parser/CoreParserFunctions.php
- * https://phabricator.wikimedia.org/T9059
- * https://gerrit.wikimedia.org/r/#/c/226032/
- * @param {!string} input the input string (usually the heading text of a 
section heading)
- * @return {!string} the sanitized version of the input string so it can be 
used as an anchor.
- */
-function anchorencode(input) {
-const id = input.replace(/\s+/g, '_');
-return urlencode(id)
-.replace(/%3A/g, ':')
-.replace(/%/g, '.');
-}
-
-module.exports = anchorencode;
diff --git a/package.json b/package.json
index 6dbcb37..ace1ab6 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,6 @@
 "express": "^4.14.0",
 "js-yaml": "^3.7.0",
 "mediawiki-title": "^0.6.3",
-"locutus": "^2.0.5",
 "preq": "^0.5.1",
 "service-runner": "^2.2.5",
 "swagger-router": "^0.5.5",
diff --git a/test/lib/anchorencode/anchorencode-test.js 
b/test/lib/anchorencode/anchorencode-test.js
deleted file mode 100644
index 9c23c1c..000
--- a/test/lib/anchorencode/anchorencode-test.js
+++ /dev/null
@@ -1,41 +0,0 @@
-'use strict';
-
-const assert = require('../../utils/assert.js');
-const anchorencode = require('../../../lib/anchorencode');
-
-describe('lib:anchorencode', function() {
-
-this.timeout(2); // eslint-disable-line no-invalid-this
-
-it('anchorencode(empty) should return an empty string', () => {
-assert.deepEqual(anchorencode(''), '');
-});
-
-it('anchorencode("a") should return a', () => {
-assert.deepEqual(anchorencode('a'), 'a');
-});
-
-it('anchorencode("Z") should return Z', () => {
-assert.deepEqual(anchorencode('Z'), 'Z');
-});
-
-it('anchorencode("  Z  ") should return Z', () => {
-assert.deepEqual(anchorencode('  Z  '), 'Z');
-});
-
-it('anchorencode("a b c") should return a_b_c', () => {
-assert.deepEqual(anchorencode('a b c'), 'a_b_c');
-});
-
-it('anchorencode("a  b  c") should return a_b_c', () => {
-assert.deepEqual(anchorencode('a  b  c'), 'a_b_c');
-});
-
-it('anchorencode("!@#$%^&*()") should return 
21.40.23.24.25.5E.26.2A.28.29', () => {
-assert.deepEqual(anchorencode('!@#$%^&*()'), 
'21.40.23.24.25.5E.26.2A.28.29');
-});
-
-it('anchorencode(":") should not be converted', () => {
-assert.deepEqual(anchorencode(':'), ':');
-});
-});

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd2b8cec2376dda0c4fe77746548f8f0934ad318
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND 

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Enforce "short" type definitions on @param in comments

2017-08-04 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370232 )

Change subject: Enforce "short" type definitions on @param in comments
..

Enforce "short" type definitions on @param in comments

Bug: T145162
Change-Id: Idbbb8e1c09a6af9732897b6d7495a3f5e2f49cb7
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
M MediaWiki/Tests/files/Commenting/commenting_function.php.expect
M MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
M MediaWiki/Tests/files/generic_namespace_pass.php
4 files changed, 44 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/32/370232/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index 9fdc490..e228825 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -411,6 +411,36 @@
$phpcsFile->addError( $error, $param['tag'], 
'ExtraParamComment' );
}
// end if
+   // Check the short type of boolean and integer
+   if ( $param['type'] === 'boolean' ) {
+   $fix = $phpcsFile->addFixableError(
+   'Short type of "bool" should be used 
for @param tag',
+   $param['tag'],
+   'NotShortBoolParam'
+   );
+   if ( $fix === true ) {
+   $content  = 'bool';
+   $content .= str_repeat( ' ', 
$param['type_space'] );
+   $content .= $param['var'];
+   $content .= str_repeat( ' ', 
$param['var_space'] );
+   $content .= $param['comment'];
+   $phpcsFile->fixer->replaceToken( ( 
$param['tag'] + 2 ), $content );
+   }
+   } elseif ( $param['type'] === 'integer' ) {
+   $fix = $phpcsFile->addFixableError(
+   'Short type of "int" should be used for 
@param tag',
+   $param['tag'],
+   'NotShortIntParam'
+   );
+   if ( $fix === true ) {
+   $content  = 'int';
+   $content .= str_repeat( ' ', 
$param['type_space'] );
+   $content .= $param['var'];
+   $content .= str_repeat( ' ', 
$param['var_space'] );
+   $content .= $param['comment'];
+   $phpcsFile->fixer->replaceToken( ( 
$param['tag'] + 2 ), $content );
+   }
+   }
if ( $param['comment'] === '' ) {
continue;
}
diff --git a/MediaWiki/Tests/files/Commenting/commenting_function.php.expect 
b/MediaWiki/Tests/files/Commenting/commenting_function.php.expect
index fe8b805..46f702c 100644
--- a/MediaWiki/Tests/files/Commenting/commenting_function.php.expect
+++ b/MediaWiki/Tests/files/Commenting/commenting_function.php.expect
@@ -8,6 +8,10 @@
 |   | (MediaWiki.Commenting.FunctionComment.SpacingAfterParamName)
  23 | ERROR | [x] Expected 1 spaces after parameter name; 3 found
 |   | (MediaWiki.Commenting.FunctionComment.SpacingAfterParamName)
+ 31 | ERROR | [x] Short type of "bool" should be used for @param tag
+|   | (MediaWiki.Commenting.FunctionComment.NotShortBoolParam)
+ 32 | ERROR | [x] Short type of "int" should be used for @param tag
+|   | (MediaWiki.Commenting.FunctionComment.NotShortIntParam)
  33 | ERROR | [x] Short type of "bool" should be used for @return tag
 |   | (MediaWiki.Commenting.FunctionComment.NotShortBoolReturn)
  40 | ERROR | [x] Short type of "int" should be used for @return tag
@@ -16,9 +20,13 @@
 |   | (MediaWiki.Commenting.FunctionComment.MissingReturn)
  59 | ERROR | [ ] Missing parameter comment
 |   | (MediaWiki.Commenting.FunctionComment.MissingParamComment)
+ 59 | ERROR | [x] Short type of "bool" should be used for @param tag
+|   | (MediaWiki.Commenting.FunctionComment.NotShortBoolParam)
  60 | ERROR | [ ] Missing parameter comment
 |   | (MediaWiki.Commenting.FunctionComment.MissingParamComment)
+ 60 | ERROR | [x] Short type of "int" should be used for @param tag
+|   | 

[MediaWiki-commits] [Gerrit] mediawiki...LanguageTool[master]: Remove composer.json

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370106 )

Change subject: Remove composer.json
..


Remove composer.json

The repository does not have any php files to lint

Change-Id: Ia9520bb431a3f87ee86ca2636509b6096dd815b5
---
M .gitignore
D composer.json
D phpcs.xml
3 files changed, 0 insertions(+), 23 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index 6495577..e7e3181 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,4 @@
 *.kate-swp
 .*.swp
 .idea
-composer.lock
-vendor/
 node_modules/
diff --git a/composer.json b/composer.json
deleted file mode 100644
index 97fe872..000
--- a/composer.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-   "require-dev": {
-   "jakub-onderka/php-parallel-lint": "0.9.2",
-   "mediawiki/mediawiki-codesniffer": "0.5.1",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
-   },
-   "scripts": {
-   "test": [
-   "parallel-lint . --exclude vendor",
-   "phpcs -p"
-   ]
-   }
-}
diff --git a/phpcs.xml b/phpcs.xml
deleted file mode 100644
index d81a292..000
--- a/phpcs.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-   
-   .
-   
-   
-   vendor
-

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9520bb431a3f87ee86ca2636509b6096dd815b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LanguageTool
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Fix Undefined offset in FunctionCommentSniff

2017-08-04 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370231 )

Change subject: Fix Undefined offset in FunctionCommentSniff
..

Fix Undefined offset in FunctionCommentSniff

On "@return boolean" without comment the undefined offset was raised.

Bug: T171776
Change-Id: Id83b96e5e39b9de6265dbe6dc2fef5ed0c35a3e4
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
M MediaWiki/Tests/files/Commenting/commenting_function.php
M MediaWiki/Tests/files/Commenting/commenting_function.php.expect
M MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
4 files changed, 27 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/31/370231/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index 443da15..9fdc490 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -216,7 +216,7 @@
);
if ( $fix === true ) {
$phpcsFile->fixer->replaceToken(
-   $retType, 'bool ' . $exploded[1]
+   $retType, 'bool' . ( isset( 
$exploded[1] ) ? ' ' . $exploded[1] : '' )
);
}
} elseif ( $first === 'integer' ) {
@@ -227,7 +227,7 @@
);
if ( $fix === true ) {
$phpcsFile->fixer->replaceToken(
-   $retType, 'int ' . $exploded[1]
+   $retType, 'int' . ( isset( 
$exploded[1] ) ? ' ' . $exploded[1] : '' )
);
}
}
diff --git a/MediaWiki/Tests/files/Commenting/commenting_function.php 
b/MediaWiki/Tests/files/Commenting/commenting_function.php
index 3036faf..0967fa2 100644
--- a/MediaWiki/Tests/files/Commenting/commenting_function.php
+++ b/MediaWiki/Tests/files/Commenting/commenting_function.php
@@ -54,6 +54,15 @@
 
return $a();
}
+
+   /**
+* @param boolean $aBool
+* @param integer $anInt
+* @return boolean
+*/
+   public function testLongTypesNoComment( $aBool, $anInt ) {
+   return $aBool;
+   }
 }
 
 class TestPassedExamples {
diff --git a/MediaWiki/Tests/files/Commenting/commenting_function.php.expect 
b/MediaWiki/Tests/files/Commenting/commenting_function.php.expect
index a05b7c3..fe8b805 100644
--- a/MediaWiki/Tests/files/Commenting/commenting_function.php.expect
+++ b/MediaWiki/Tests/files/Commenting/commenting_function.php.expect
@@ -14,5 +14,11 @@
 |   | (MediaWiki.Commenting.FunctionComment.NotShortIntReturn)
  49 | ERROR | [ ] Missing @return tag in function comment
 |   | (MediaWiki.Commenting.FunctionComment.MissingReturn)
+ 59 | ERROR | [ ] Missing parameter comment
+|   | (MediaWiki.Commenting.FunctionComment.MissingParamComment)
+ 60 | ERROR | [ ] Missing parameter comment
+|   | (MediaWiki.Commenting.FunctionComment.MissingParamComment)
+ 61 | ERROR | [x] Short type of "bool" should be used for @return tag
+|   | (MediaWiki.Commenting.FunctionComment.NotShortBoolReturn)
 
-PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
diff --git a/MediaWiki/Tests/files/Commenting/commenting_function.php.fixed 
b/MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
index f414562..ebc9665 100644
--- a/MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
+++ b/MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
@@ -54,6 +54,15 @@
 
return $a();
}
+
+   /**
+* @param boolean $aBool
+* @param integer $anInt
+* @return bool
+*/
+   public function testLongTypesNoComment( $aBool, $anInt ) {
+   return $aBool;
+   }
 }
 
 class TestPassedExamples {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id83b96e5e39b9de6265dbe6dc2fef5ed0c35a3e4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.12]: RCFilters: Show "from" link when live update is not available

2017-08-04 Thread Catrope (Code Review)
Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370230 )

Change subject: RCFilters: Show "from" link when live update is not available
..

RCFilters: Show "from" link when live update is not available

Also introduce a place for feature flags.

Change-Id: Id118b85c727a865745283ee8fabda7050f317ce1
(cherry picked from commit f19764395192218455851eb5a26700ecac9b6ad6)
---
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
4 files changed, 10 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/370230/1

diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
index 9d2c331..5bd4641 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
@@ -479,13 +479,10 @@
 * @private
 */
mw.rcfilters.Controller.prototype._shouldCheckForNewChanges = function 
() {
-   var liveUpdateFeatureFlag = mw.config.get( 
'wgStructuredChangeFiltersEnableLiveUpdate' ) ||
-   new mw.Uri().query.liveupdate;
-
return !document.hidden &&
!this.changesListModel.getNewChangesExist() &&
!this.updatingChangesList &&
-   liveUpdateFeatureFlag;
+   mw.rcfilters.featureFlags.liveUpdate;
};
 
/**
diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.js 
b/resources/src/mediawiki.rcfilters/mw.rcfilters.js
index c62d6f2..7bdc2a2 100644
--- a/resources/src/mediawiki.rcfilters/mw.rcfilters.js
+++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.js
@@ -44,6 +44,9 @@
 
return result;
}
+   },
+   featureFlags: {
+   liveUpdate: mw.config.get( 
'wgStructuredChangeFiltersEnableLiveUpdate' ) || new mw.Uri().query.liveupdate
}
};
 }( mediaWiki ) );
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
index 44d4459..8f8ca38 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
@@ -91,11 +91,7 @@
.append( this.savedLinksListWidget.$element )
);
 
-   if (
-   mw.config.get( 
'wgStructuredChangeFiltersEnableLiveUpdate' ) ||
-   // Allow users to enable live update with ?liveupdate=1
-   new mw.Uri().query.liveupdate
-   ) {
+   if ( mw.rcfilters.featureFlags.liveUpdate ) {
$bottom.append( this.liveUpdateButton.$element );
}
 
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
index 44f6da7..8276fdc 100644
--- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
+++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js
@@ -151,9 +151,11 @@
this.$element.find( 'br' ).detach();
}
 
-   this.$element.find(
-   'legend, .rclistfrom, .rcnotefrom, 
.rcoptions-listfromreset'
-   ).detach();
+   if ( mw.rcfilters.featureFlags.liveUpdate ) {
+   this.$element.find(
+   'legend, .rclistfrom, .rcnotefrom, 
.rcoptions-listfromreset'
+   ).detach();
+   }
 
if ( this.$element.text().trim() === '' ) {
this.$element.detach();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id118b85c727a865745283ee8fabda7050f317ce1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.30.0-wmf.12
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Sbisson 

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Fix phpunit test on windows

2017-08-04 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370229 )

Change subject: Fix phpunit test on windows
..

Fix phpunit test on windows

The lines are not empty or dash only on windows, because the phpcs
output contains also \r

Change-Id: Ib0677d6aad430f4c2af090912dca4aab719d5fd5
---
M MediaWiki/Tests/MediaWikiStandardTest.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/29/370229/1

diff --git a/MediaWiki/Tests/MediaWikiStandardTest.php 
b/MediaWiki/Tests/MediaWikiStandardTest.php
index aff79b4..2ceb11e 100644
--- a/MediaWiki/Tests/MediaWikiStandardTest.php
+++ b/MediaWiki/Tests/MediaWikiStandardTest.php
@@ -128,11 +128,16 @@
 */
private function prepareOutput( $outputStr ) {
if ( $outputStr ) {
+   // Do a "\r\n" -> "\n" and "\r" -> "\n" transformation 
for windows machine
+   $outputStr = str_replace( [ "\r\n", "\r" ], "\n", 
$outputStr );
+
// Remove colors
$outputStr = preg_replace( '`\033\[[0-9;]+m`', '', 
$outputStr );
$outputLines = explode( "\n", $outputStr );
+
// Remove lines that are empty or all dashes:
$outputLines = preg_grep( '/^-*$/', $outputLines, 
PREG_GREP_INVERT );
+
// Remove lines that start with 'Time:', 'FOUND', or 
'FILE:':
$outputLines = preg_grep( '/^(Time:|FOUND|FILE:) .*$/', 
$outputLines, PREG_GREP_INVERT );
$outputStr = implode( "\n", $outputLines );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib0677d6aad430f4c2af090912dca4aab719d5fd5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Use exec for final java command in shell scripts

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370172 )

Change subject: Use exec for final java command in shell scripts
..


Use exec for final java command in shell scripts

This replaces the shell process with the Java daemon process instead of
unnecessarily leaving around a process that never does anything again.

Change-Id: I107118d57aafd4a49b17dc7eaa441aa96b8159c8
---
M dist/src/script/runBlazegraph.sh
M dist/src/script/runUpdate.sh
2 files changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Jonas Kress (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve



diff --git a/dist/src/script/runBlazegraph.sh b/dist/src/script/runBlazegraph.sh
index 6cd7419..4be9c04 100755
--- a/dist/src/script/runBlazegraph.sh
+++ b/dist/src/script/runBlazegraph.sh
@@ -53,7 +53,8 @@
 USER_AGENT="Wikidata Query Service; https://query.wikidata.org/;;
 
 echo "Running Blazegraph from `pwd` on :$PORT/$CONTEXT"
-java -server -XX:+UseG1GC ${MEMORY} ${DEBUG} ${GC_LOGS} \
+exec java \
+ -server -XX:+UseG1GC ${MEMORY} ${DEBUG} ${GC_LOGS} \
  -Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=${CONFIG_FILE} \
  -Dorg.eclipse.jetty.server.Request.maxFormContentSize=2 \
  -Dcom.bigdata.rdf.sparql.ast.QueryHints.analytic=true \
diff --git a/dist/src/script/runUpdate.sh b/dist/src/script/runUpdate.sh
index f26e43a..e56a96f 100755
--- a/dist/src/script/runUpdate.sh
+++ b/dist/src/script/runUpdate.sh
@@ -67,4 +67,4 @@
 SPARQL_URL=$HOST/$CONTEXT/namespace/$NAMESPACE/sparql
 AGENT=-javaagent:lib/jolokia-jvm-1.3.1-agent.jar=port=8778,host=localhost
 echo "Updating via $SPARQL_URL"
-java -cp $CP $MEMORY $GC_LOGS $LOG $TIMEOUT_ARG $AGENT ${UPDATER_OPTS} $MAIN 
$ARGS --sparqlUrl $SPARQL_URL "$@"
+exec java -cp $CP $MEMORY $GC_LOGS $LOG $TIMEOUT_ARG $AGENT ${UPDATER_OPTS} 
$MAIN $ARGS --sparqlUrl $SPARQL_URL "$@"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I107118d57aafd4a49b17dc7eaa441aa96b8159c8
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Smalyshev 
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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Cleanup initialization to use exception instead of null checks.

2017-08-04 Thread Gehel (Code Review)
Gehel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370228 )

Change subject: Cleanup initialization to use exception instead of null checks.
..

Cleanup initialization to use exception instead of null checks.

This removes a bit of logic, and replace it with 2 exception handlers, which
will log and rethrow any problem during initilization or at runtime.

Change-Id: I647a27792e6238ce592fc36afb44ba09e7e81471
---
M tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
1 file changed, 48 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/28/370228/1

diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
index 9973412..3dbd41c 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
@@ -44,34 +44,56 @@
  * @throws Exception on error
  */
 public static void main(String[] args) throws Exception {
-UpdateOptions options = handleOptions(UpdateOptions.class, args);
-WikibaseRepository wikibaseRepository = 
buildWikibaseRepository(options);
-if (wikibaseRepository == null) {
-return;
+RdfRepository rdfRepository = null;
+Updater updater;
+
+try {
+UpdateOptions options = handleOptions(UpdateOptions.class, args);
+WikibaseRepository wikibaseRepository = 
buildWikibaseRepository(options);
+URI sparqlUri = sparqlUri(options);
+WikibaseUris uris = new WikibaseUris(options.wikibaseHost());
+rdfRepository = new RdfRepository(sparqlUri, uris);
+updater = createUpdater(options, wikibaseRepository, uris, 
rdfRepository);
+} catch (Exception e) {
+log.error("Error during initialization.", e);
+if (rdfRepository != null) {
+rdfRepository.close();
+}
+throw e;
 }
+try (RdfRepository r = rdfRepository) {
+updater.run();
+} catch (Exception e) {
+log.error("Error during updater run.", e);
+throw e;
+}
+}
+
+private static Updater createUpdater(
+UpdateOptions options,
+WikibaseRepository wikibaseRepository,
+WikibaseUris uris,
+RdfRepository rdfRepository) {
+Change.Source changeSource = 
buildChangeSource(options, rdfRepository,
+wikibaseRepository);
+int threads = options.threadCount();
+ThreadFactoryBuilder threadFactory = new 
ThreadFactoryBuilder().setDaemon(true).setNameFormat("update %s");
+ExecutorService executor = new ThreadPoolExecutor(threads, threads, 0, 
TimeUnit.SECONDS,
+new LinkedBlockingQueue<>(), threadFactory.build());
+
+Munger munger = mungerFromOptions(options);
+return new Updater<>(changeSource, wikibaseRepository, rdfRepository, 
munger, executor,
+options.pollDelay(), uris, options.verify());
+}
+
+private static URI sparqlUri(UpdateOptions options) {
 URI sparqlUri;
 try {
 sparqlUri = new URI(options.sparqlUrl());
 } catch (URISyntaxException e) {
-log.error("Invalid url:  " + options.sparqlUrl(), e);
-return;
+throw new IllegalArgumentException("Invalid url:  " + 
options.sparqlUrl(), e);
 }
-WikibaseUris uris = new WikibaseUris(options.wikibaseHost());
-try (RdfRepository rdfRepository = new RdfRepository(sparqlUri, uris)) 
{
-Change.Source changeSource = 
buildChangeSource(options, rdfRepository,
-wikibaseRepository);
-if (changeSource == null) {
-return;
-}
-int threads = options.threadCount();
-ThreadFactoryBuilder threadFactory = new 
ThreadFactoryBuilder().setDaemon(true).setNameFormat("update %s");
-ExecutorService executor = new ThreadPoolExecutor(threads, 
threads, 0, TimeUnit.SECONDS,
-new LinkedBlockingQueue(), 
threadFactory.build());
-
-Munger munger = mungerFromOptions(options);
-new Updater<>(changeSource, wikibaseRepository, rdfRepository, 
munger, executor,
-options.pollDelay(), uris, options.verify()).run();
-}
+return sparqlUri;
 }
 
 /**
@@ -101,8 +123,7 @@
 end = Long.parseLong(ids[1]);
 break;
 default:
-log.error("Invalid format for --idrange.  Need 
-.");
-return null;
+throw new IllegalArgumentException("Invalid format for 
--idrange.  Need -.");
 }
 return IdRangeChangeSource.forItems(start, end, 
options.batchSize());
  

[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Fix projection for label service.

2017-08-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370099 )

Change subject: Fix projection for label service.
..


Fix projection for label service.

Also do some refactoring for label service optimizers.

Bug: T171194
Change-Id: I5453c926bd6172afba9fc0a9f6722e4bec3c54b5
---
M 
blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/WikibaseOptimizers.java
M 
blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/EmptyLabelServiceOptimizer.java
M 
blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/LabelServiceExtractOptimizer.java
M 
blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/LabelServicePlacementOptimizer.java
A 
blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/LabelServiceUtils.java
M 
blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/label/LabelServiceUnitTest.java
6 files changed, 115 insertions(+), 48 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Jonas Kress (WMDE): Looks good to me, but someone else must approve
  Lucas Werkmeister (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Gehel: Looks good to me, but someone else must approve



diff --git 
a/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/WikibaseOptimizers.java
 
b/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/WikibaseOptimizers.java
index c066a84..e6e1027 100644
--- 
a/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/WikibaseOptimizers.java
+++ 
b/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/WikibaseOptimizers.java
@@ -4,7 +4,10 @@
 import org.wikidata.query.rdf.blazegraph.label.LabelServiceExtractOptimizer;
 import org.wikidata.query.rdf.blazegraph.label.LabelServicePlacementOptimizer;
 
+import com.bigdata.rdf.sparql.ast.optimizers.ASTJoinGroupOrderOptimizer;
+import com.bigdata.rdf.sparql.ast.optimizers.ASTQueryHintOptimizer;
 import com.bigdata.rdf.sparql.ast.optimizers.DefaultOptimizerList;
+import com.bigdata.rdf.sparql.ast.optimizers.IASTOptimizer;
 
 /**
  * Optimizer list for Wikibase.
@@ -13,8 +16,41 @@
 private static final long serialVersionUID = 2364845438265527328L;
 
 public WikibaseOptimizers() {
-add(0, new LabelServiceExtractOptimizer());
+addAfter(ASTQueryHintOptimizer.class, new 
LabelServicePlacementOptimizer());
+// Needs to be after wildcard projection resolution,
+// see https://phabricator.wikimedia.org/T171194
+// And before ASTJoinGroupOrderOptimizer because of BLZG-2097
+addBefore(ASTJoinGroupOrderOptimizer.class, new 
LabelServiceExtractOptimizer());
 add(new EmptyLabelServiceOptimizer());
-add(new LabelServicePlacementOptimizer());
+}
+
+/**
+ * Add optimizer after optimizer of specified class.
+ * @param type
+ * @param opt
+ */
+private void addAfter(Class type, final IASTOptimizer opt) {
+for (int i = 0; i < size(); i++) {
+if (type.isInstance(get(i))) {
+add(i + 1, opt);
+return;
+}
+}
+throw new IllegalArgumentException("Cannot find placement for " + 
opt.getClass().toString());
+}
+
+/**
+ * Add optimizer before optimizer of specified class.
+ * @param type
+ * @param opt
+ */
+private void addBefore(Class type, final IASTOptimizer opt) {
+for (int i = 0; i < size(); i++) {
+if (type.isInstance(get(i))) {
+add(i, opt);
+return;
+}
+}
+throw new IllegalArgumentException("Cannot find placement for " + 
opt.getClass().toString());
 }
 }
diff --git 
a/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/EmptyLabelServiceOptimizer.java
 
b/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/EmptyLabelServiceOptimizer.java
index c4dff12..f795c2b 100644
--- 
a/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/EmptyLabelServiceOptimizer.java
+++ 
b/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/label/EmptyLabelServiceOptimizer.java
@@ -9,7 +9,6 @@
 import org.openrdf.model.vocabulary.SKOS;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.wikidata.query.rdf.common.uri.Ontology;
 import org.wikidata.query.rdf.common.uri.SchemaDotOrg;
 
 import com.bigdata.bop.BOp;
@@ -17,7 +16,6 @@
 import com.bigdata.bop.IConstant;
 import com.bigdata.bop.IVariable;
 import com.bigdata.rdf.internal.IV;
-import com.bigdata.rdf.model.BigdataValue;
 import com.bigdata.rdf.sparql.ast.AssignmentNode;
 import com.bigdata.rdf.sparql.ast.ConstantNode;
 import com.bigdata.rdf.sparql.ast.JoinGroupNode;
@@ -52,14 +50,7 @@
 if (root.getQueryType() == QueryType.ASK) {
 return;
 }
-for (ServiceNode service : op.getServiceNodes()) {
-BigdataValue serviceRef 

  1   2   3   >