[MediaWiki-commits] [Gerrit] mediawiki/core[master]: rdbms: Simplify Database::factory()

2018-01-24 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406063 )

Change subject: rdbms: Simplify Database::factory()
..

rdbms: Simplify Database::factory()

Follows-up 0ff2b7a776 (T120333) which removed support for the
deprecated php 'mysql' extension.

It surprised that the 'DatabaseMysql' entry could safely be removed
from $classAliases. This was because the key is not direct input,
but based on $canonicalDBTypes, which maps mysql to mysqli.

Take this further by removing the indirection between type, driver
and class name.

* Map built-in db types directly to their class and driver.
* Change fallback to assign $class directly from $dbType, without
  indirection of a $driver variable.
* Remove unused $classAliases.

Change-Id: I1200b07f66f23624410d848b6f382cb2dafa5c59
---
M includes/libs/rdbms/database/Database.php
1 file changed, 31 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/406063/1

diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index 323c147..1515855 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -336,51 +336,49 @@
 * @since 1.18
 */
final public static function factory( $dbType, $p = [] ) {
-   static $canonicalDBTypes = [
-   'mysql' => [ 'mysqli' ],
-   'postgres' => [],
-   'sqlite' => [],
-   'oracle' => [],
-   'mssql' => [],
-   ];
-   static $classAliases = [
-   'DatabaseMssql' => DatabaseMssql::class,
-   'DatabaseMysqli' => DatabaseMysqli::class,
-   'DatabaseSqlite' => DatabaseSqlite::class,
-   'DatabasePostgres' => DatabasePostgres::class
+   // For database types with built-in support, the below maps 
type to IDatabase
+   // implementations. For types with multipe driver 
implementations (PHP extensions),
+   // an array can be used, keyed by extension name. In case of an 
array, the
+   // optional 'driver' parameter can be used to force a specific 
driver. Otherwise,
+   // we auto-detect the first available driver. For types without 
built-in support,
+   // an class named "Database" us used, eg. DatabaseFoo for 
type 'foo'.
+   static $builtinTypes = [
+   'mssql' => DatabaseMssql::class,
+   'mysql' => [ 'mysqli' => DatabaseMysqli::class ],
+   'sqlite' => DatabaseSqlite::class,
+   'postgres' => DatabasePostgres::class,
];
 
-   $driver = false;
$dbType = strtolower( $dbType );
-   if ( isset( $canonicalDBTypes[$dbType] ) && 
$canonicalDBTypes[$dbType] ) {
-   $possibleDrivers = $canonicalDBTypes[$dbType];
-   if ( !empty( $p['driver'] ) ) {
-   if ( in_array( $p['driver'], $possibleDrivers ) 
) {
-   $driver = $p['driver'];
-   } else {
-   throw new InvalidArgumentException( 
__METHOD__ .
-   " type '$dbType' does not 
support driver '{$p['driver']}'" );
-   }
+   $class = false;
+   if ( isset( $builtinTypes[$dbType] ) ) {
+   $possibleDrivers = $builtinTypes[$dbType];
+   if ( is_string( $possibleDrivers ) ) {
+   $class = $possibleDrivers;
} else {
-   foreach ( $possibleDrivers as $posDriver ) {
-   if ( extension_loaded( $posDriver ) ) {
-   $driver = $posDriver;
-   break;
+   if ( !empty( $p['driver'] ) {
+   if ( !isset( 
$possibleDrivers[$p['driver']] ) ) {
+   throw new 
InvalidArgumentException( __METHOD__ .
+   " type '$dbType' does 
not support driver '{$p['driver']}'" );
+   } else {
+   $class = 
$possibleDrivers[$p['driver']];
+   }
+   } else {
+   foreach ( $possibleDrivers as posDriver 
=> $possibleClass ) {
+   if ( extension_loaded( 
posDriver ) ) {
+ 

[MediaWiki-commits] [Gerrit] CLDRPluralRuleParser[master]: tests: Update phpunit and enable coverage for all classes

2018-01-24 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/406055 )

Change subject: tests: Update phpunit and enable coverage for all classes
..

tests: Update phpunit and enable coverage for all classes

The structure of the Evaluator is that there is a single class
that serves as the main entry point, and everything else is called
internally, so at this point we might as well allow coverage
of all classes from our current tests, which are essentially
integration tests.

This is normally achieved by disabling 'forceCoversAnnotation',
but that is disabled by default and wasn't enabled. The reason
the test coverage report was behaving this way was due to the
presence of one @covers annotation, which I removed.

Also:
* Minor phpunit update.
* Remove redundant variable assignment in test.
* Add 'composer cover' command.
* Add /coverage to gitignore.
* Add visibility to tests.

Change-Id: I9f671dbf5b575799570db307df3fa310fad7976f
---
M .gitignore
M composer.json
M tests/EvaluatorTest.php
3 files changed, 12 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/CLDRPluralRuleParser 
refs/changes/55/406055/1

diff --git a/.gitignore b/.gitignore
index de4a392..a37efea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
+/coverage
 /vendor
 /composer.lock
diff --git a/composer.json b/composer.json
index f71a4b0..db5ce9f 100644
--- a/composer.json
+++ b/composer.json
@@ -24,11 +24,11 @@
}
},
"require": {
-   "php": ">=5.3.3"
+   "php": ">=5.5.9"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9.0.0",
-   "phpunit/phpunit": "^4.7.7.0",
+   "phpunit/phpunit": "^4.8",
"mediawiki/mediawiki-codesniffer": "15.0.0"
},
"scripts": {
@@ -37,6 +37,7 @@
"phpunit $PHPUNIT_ARGS",
"phpcs -p"
],
+   "cover": "phpunit --coverage-html coverage/",
"fix": [
"phpcbf"
]
diff --git a/tests/EvaluatorTest.php b/tests/EvaluatorTest.php
index cc44f37..3243d4d 100644
--- a/tests/EvaluatorTest.php
+++ b/tests/EvaluatorTest.php
@@ -8,28 +8,25 @@
 
 use CLDRPluralRuleParser\Evaluator;
 
-/**
- * @covers \CLDRPluralRuleParser\Evaluator
- */
 class EvaluatorTest extends \PHPUnit_Framework_TestCase {
/**
-* @dataProvider validTestCases
+* @dataProvider provideValidCases
 */
-   function testValidRules( $expected, $rules, $number, $comment ) {
+   public function testValidRules( $expected, $rules, $number, $comment ) {
$result = Evaluator::evaluate( $number, (array)$rules );
$this->assertEquals( $expected, $result, $comment );
}
 
/**
-* @dataProvider invalidTestCases
+* @dataProvider provideInvalidCases
 * @expectedException CLDRPluralRuleParser\Error
 */
-   function testInvalidRules( $rules, $comment ) {
+   public function testInvalidRules( $rules, $comment ) {
Evaluator::evaluate( 1, (array)$rules );
}
 
-   function validTestCases() {
-   $tests = [
+   public static function provideValidCases() {
+   return [
# expected, rule, number, comment
[ 0, 'n is 1', 1, 'integer number and is' ],
[ 0, 'n is 1', "1", 'string integer number and is' ],
@@ -139,17 +136,13 @@
array( 1, 'v = 0 and i % 10 = 2..4 and i % 100 != 
12..14 or f % 10 = 2..4 and f % 100 != 12..14', '10.0', 'bs other' ),
// @codingStandardsIgnoreEnd
];
-
-   return $tests;
}
 
-   function invalidTestCases() {
-   $tests = [
+   public static function provideInvalidCases() {
+   return [
[ 'n mod mod 5 is 1', 'mod mod' ],
[ 'n', 'just n' ],
[ 'n is in 5', 'is in' ],
];
-
-   return $tests;
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f671dbf5b575799570db307df3fa310fad7976f
Gerrit-PatchSet: 1
Gerrit-Project: CLDRPluralRuleParser
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] generator-wikimedia-php-library[master]: Archive repository

2018-01-24 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/405929 )

Change subject: Archive repository
..


Archive repository

Bug: T174416
Change-Id: I0a4a291607da3acf6ba4de7da140c3d8fd4117af
---
D .gitignore
D .jshintrc
D .travis.yml
D LICENSE
D NOTICE
M README.md
D generators/app/index.js
D generators/app/licenses.js
D generators/app/packagist.js
D generators/app/templates/_.editorconfig
D generators/app/templates/_.gitreview
D generators/app/templates/_Doxyfile
D generators/app/templates/_Library.php
D generators/app/templates/_LibraryTest.php
D generators/app/templates/_composer.json
D generators/app/templates/_phpcs.xml
D generators/app/templates/_phpunit.xml.dist
D generators/app/templates/gitattributes
D generators/app/templates/gitignore
D generators/app/templates/licenses/Apache/LICENSE
D generators/app/templates/licenses/Apache/_NOTICE
D generators/app/templates/licenses/Apache/_header
D generators/app/templates/licenses/GPLv2/COPYING
D generators/app/templates/licenses/GPLv2/_header
D generators/app/templates/licenses/MIT/_LICENSE
D generators/app/templates/licenses/MIT/_header
D generators/app/templates/travis.yml
D package.json
D test/test-app.js
29 files changed, 5 insertions(+), 1,316 deletions(-)

Approvals:
  Krinkle: Verified; Looks good to me, approved
  BryanDavis: Looks good to me, approved



diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index c2658d7..000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index e1ea67d..000
--- a/.jshintrc
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-   // Enforcing
-   "bitwise": true,
-   "eqeqeq": true,
-   "freeze": true,
-   "latedef": true,
-   "noarg": true,
-   "nonew": true,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-   "node": true
-}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index dedfc07..000
--- a/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-sudo: false
-language: node_js
-node_js:
-  - 'iojs'
-  - '0.12'
-  - '0.10'
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d645695..000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
-   Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-  "License" shall mean the terms and conditions for use, reproduction,
-  and distribution as defined by Sections 1 through 9 of this document.
-
-  "Licensor" shall mean the copyright owner or entity authorized by
-  the copyright owner that is granting the License.
-
-  "Legal Entity" shall mean the union of the acting entity and all
-  other entities that control, are controlled by, or are under common
-  control with that entity. For the purposes of this definition,
-  "control" means (i) the power, direct or indirect, to cause the
-  direction or management of such entity, whether by contract or
-  otherwise, or (ii) ownership of fifty percent (50%) or more of the
-  outstanding shares, or (iii) beneficial ownership of such entity.
-
-  "You" (or "Your") shall mean an individual or Legal Entity
-  exercising permissions granted by this License.
-
-  "Source" form shall mean the preferred form for making modifications,
-  including but not limited to software source code, documentation
-  source, and configuration files.
-
-  "Object" form shall mean any form resulting from mechanical
-  transformation or translation of a Source form, including but
-  not limited to compiled object code, generated documentation,
-  and conversions to other media types.
-
-  "Work" shall mean the work of authorship, whether in Source or
-  Object form, made available under the License, as indicated by a
-  copyright notice that is included in or attached to the work
-  (an example is provided in the Appendix below).
-
-  "Derivative Works" shall mean any work, whether in Source or Object
-  form, that is based on (or derived from) the Work and for which the
-  editorial revisions, annotations, elaborations, or other modifications
-  represent, as a whole, an original work of authorship. For the purposes
-  of this License, Derivative Works shall not include works that remain
-  separable from, or merely link (or bind by name) to the interfaces of,
-  the Work and Derivative Works thereof.
-
-  "Contribution" shall mean any work of authorship, including
-  the original version of the Work and any modifications or additions
-  to that Work or Derivative Works thereof, that is intentionally
-  submitted to Licensor for inclusion in the Work by the copyright owner
- 

[MediaWiki-commits] [Gerrit] integration/docroot[master]: cover: Convert coverage sub-nav from breadcrumbs to nav-tabs

2018-01-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405995 )

Change subject: cover: Convert coverage sub-nav from breadcrumbs to nav-tabs
..

cover: Convert coverage sub-nav from breadcrumbs to nav-tabs

Breadcrumbs are mainly intended as a way to go from a subpage back
to an ancestor. Not as a way of going to a subpage.

Given the similarity, it looks somewhat confusing to see the breadcrumbs
visually end with 'MediaWiki extensions' when the user isn't actually
on that page.

Nav-tabs seems like a more appropiate fit within the building blocks
that Bootstrap provides.

Change-Id: Ic7b0cf9d76ed79f12074adf07d054e1fd2456746
---
M shared/CoveragePage.php
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/docroot 
refs/changes/95/405995/1

diff --git a/shared/CoveragePage.php b/shared/CoveragePage.php
index 8bb60e5..9418a7e 100644
--- a/shared/CoveragePage.php
+++ b/shared/CoveragePage.php
@@ -50,18 +50,18 @@
if ( $this->pageName === 'Test coverage' ) {
$href = $this->fixNavUrl( '/cover-extensions/' );
$breadcrumbs = <<
-   Coverage home
+
+   Coverage home
MediaWiki extensions
-
+
 HTML;
} else {
$href = $this->fixNavUrl( '/cover/' );
$breadcrumbs = <<
+
Coverage home
-   MediaWiki extensions
-
+   MediaWiki extensions
+
 HTML;
}
$this->addHtmlContent( $breadcrumbs );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7b0cf9d76ed79f12074adf07d054e1fd2456746
Gerrit-PatchSet: 1
Gerrit-Project: integration/docroot
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] integration/docroot[master]: cover: Add sort=cover parameter to coverage report

2018-01-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405996 )

Change subject: cover: Add sort=cover parameter to coverage report
..

cover: Add sort=cover parameter to coverage report

When enabled, the sorting changes from alphabetical by name, to be
ascending by coverage percentage. This helps identify projects with
low code coverage, and as potential area to contribute.

Change-Id: I4ff4bb7191ad8579427cf74fd865fe23b85b234d
---
M shared/CoveragePage.php
1 file changed, 32 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/docroot 
refs/changes/96/405996/1

diff --git a/shared/CoveragePage.php b/shared/CoveragePage.php
index 9418a7e..389c7a6 100644
--- a/shared/CoveragePage.php
+++ b/shared/CoveragePage.php
@@ -47,6 +47,8 @@
$results = glob( $this->coverageDir . '/*/clover.xml' );
$this->embedCSS( file_get_contents( __DIR__ . '/cover.css' ) );
 
+   $sort = isset( $_GET['sort'] ) ? (string)$_GET['sort'] : null;
+
if ( $this->pageName === 'Test coverage' ) {
$href = $this->fixNavUrl( '/cover-extensions/' );
$breadcrumbs = <addHtmlContent( $sortNav );
$this->addHtmlContent( '' );
$html = '';
+   $clovers = [];
foreach ( $results as $clover ) {
-   $info = $this->parseClover( $clover );
+   $clovers[$clover] = $this->parseClover( $clover );
+   }
+   if ( isset( $_GET['sort'] ) && $_GET['sort'] === 'cov' ) {
+   // Order by coverage, ascending
+   uasort( $clovers, function ( $a, $b ) {
+   if ( $a['percent'] === $b['percent'] ) {
+   return 0;
+   }
+   return ( $a['percent'] < $b['percent'] ) ? -1 : 
1;
+   } );
+   }
+   foreach ( $clovers as $clover => $info ) {
$dirName = htmlspecialchars( basename( dirname( $clover 
) ) );
$percent = (string)round( $info['percent'] );
$color = $this->getLevelColor( $info['percent'] );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ff4bb7191ad8579427cf74fd865fe23b85b234d
Gerrit-PatchSet: 1
Gerrit-Project: integration/docroot
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Remove jobs for 'generator-wikimedia-php-library'

2018-01-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405930 )

Change subject: Remove jobs for 'generator-wikimedia-php-library'
..

Remove jobs for 'generator-wikimedia-php-library'

Repo is being archived.

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


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/30/405930/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 3f56ec8..f7daffb 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -7917,10 +7917,6 @@
   - search-mjolnir-tox-docker
   - search-mjolnir-maven
 
-  - name: generator-wikimedia-php-library
-template:
-  - name: npm-docker
-
   - name: oojs/core
 test:
   - oojs-core-jsduck-jessie

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

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

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


[MediaWiki-commits] [Gerrit] generator-wikimedia-php-library[master]: Archive repository

2018-01-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405929 )

Change subject: Archive repository
..

Archive repository

Bug: T174416
Change-Id: I0a4a291607da3acf6ba4de7da140c3d8fd4117af
---
D .gitignore
D .jshintrc
D .travis.yml
D LICENSE
D NOTICE
M README.md
D generators/app/index.js
D generators/app/licenses.js
D generators/app/packagist.js
D generators/app/templates/_.editorconfig
D generators/app/templates/_.gitreview
D generators/app/templates/_Doxyfile
D generators/app/templates/_Library.php
D generators/app/templates/_LibraryTest.php
D generators/app/templates/_composer.json
D generators/app/templates/_phpcs.xml
D generators/app/templates/_phpunit.xml.dist
D generators/app/templates/gitattributes
D generators/app/templates/gitignore
D generators/app/templates/licenses/Apache/LICENSE
D generators/app/templates/licenses/Apache/_NOTICE
D generators/app/templates/licenses/Apache/_header
D generators/app/templates/licenses/GPLv2/COPYING
D generators/app/templates/licenses/GPLv2/_header
D generators/app/templates/licenses/MIT/_LICENSE
D generators/app/templates/licenses/MIT/_header
D generators/app/templates/travis.yml
D package.json
D test/test-app.js
29 files changed, 5 insertions(+), 1,316 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/generator-wikimedia-php-library 
refs/changes/29/405929/1

diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index c2658d7..000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index e1ea67d..000
--- a/.jshintrc
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-   // Enforcing
-   "bitwise": true,
-   "eqeqeq": true,
-   "freeze": true,
-   "latedef": true,
-   "noarg": true,
-   "nonew": true,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-   "node": true
-}
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index dedfc07..000
--- a/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-sudo: false
-language: node_js
-node_js:
-  - 'iojs'
-  - '0.12'
-  - '0.10'
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d645695..000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
-   Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-  "License" shall mean the terms and conditions for use, reproduction,
-  and distribution as defined by Sections 1 through 9 of this document.
-
-  "Licensor" shall mean the copyright owner or entity authorized by
-  the copyright owner that is granting the License.
-
-  "Legal Entity" shall mean the union of the acting entity and all
-  other entities that control, are controlled by, or are under common
-  control with that entity. For the purposes of this definition,
-  "control" means (i) the power, direct or indirect, to cause the
-  direction or management of such entity, whether by contract or
-  otherwise, or (ii) ownership of fifty percent (50%) or more of the
-  outstanding shares, or (iii) beneficial ownership of such entity.
-
-  "You" (or "Your") shall mean an individual or Legal Entity
-  exercising permissions granted by this License.
-
-  "Source" form shall mean the preferred form for making modifications,
-  including but not limited to software source code, documentation
-  source, and configuration files.
-
-  "Object" form shall mean any form resulting from mechanical
-  transformation or translation of a Source form, including but
-  not limited to compiled object code, generated documentation,
-  and conversions to other media types.
-
-  "Work" shall mean the work of authorship, whether in Source or
-  Object form, made available under the License, as indicated by a
-  copyright notice that is included in or attached to the work
-  (an example is provided in the Appendix below).
-
-  "Derivative Works" shall mean any work, whether in Source or Object
-  form, that is based on (or derived from) the Work and for which the
-  editorial revisions, annotations, elaborations, or other modifications
-  represent, as a whole, an original work of authorship. For the purposes
-  of this License, Derivative Works shall not include works that remain
-  separable from, or merely link (or bind by name) to the interfaces of,
-  the Work and Derivative Works thereof.
-
-  "Contribution" shall mean any work of authorship, including
-  the original version of the Work and any modifications or additions
-  to that Work or Derivative Works thereof, that is intentionally
-  submitted to Licensor for inclusion in the Work by the copyright owner
-  or by 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: webperf: Introduce 'templates' in test fixture and use for m...

2018-01-12 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404046 )

Change subject: webperf: Introduce 'templates' in test fixture and use for 
mwload
..

webperf: Introduce 'templates' in test fixture and use for mwload

* Create a 'templates' key in the fixture that the test runner
  ignores.

* Move the existing 'expected_uncached_desktop' list there.

* Abstract another template list for 'expected_uncached_desktop_mwload'
  that is also used by the non-navtiming test.

* Add 'flatten()' utility method given the ref/merge ref/extend syntax
  only works for key-value objects (dict) in YAML, not for sequences (list).

Change-Id: Ib43ab6a2d21c3148a4ce8954cc81166ebc2c0237
---
M modules/webperf/files/navtiming_fixture.yaml
M modules/webperf/files/navtiming_test.py
2 files changed, 160 insertions(+), 156 deletions(-)


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

diff --git a/modules/webperf/files/navtiming_fixture.yaml 
b/modules/webperf/files/navtiming_fixture.yaml
index 494a6eb..8b56c54 100644
--- a/modules/webperf/files/navtiming_fixture.yaml
+++ b/modules/webperf/files/navtiming_fixture.yaml
@@ -14,148 +14,153 @@
 # - webHost: example
 # - wiki: example
 
+templates:
+  - _uncached_desktop_mwload
+- frontend.navtiming.mediaWikiLoadComplete.desktop.authenticated:1270|ms
+- frontend.navtiming.mediaWikiLoadComplete.desktop.overall:1270|ms
+- frontend.navtiming.mediaWikiLoadComplete.overall:1270|ms
+- frontend.navtiming.mediaWikiLoadComplete.by_browser.Firefox.55:1270|ms
+- frontend.navtiming.mediaWikiLoadComplete.by_browser.Firefox.all:1270|ms
+- frontend.navtiming.mediaWikiLoadComplete.by_continent.Europe:1270|ms
+- frontend.navtiming2.mediaWikiLoad.desktop.authenticated:1270|ms
+- frontend.navtiming2.mediaWikiLoad.desktop.overall:1270|ms
+- frontend.navtiming2.mediaWikiLoad.overall:1270|ms
+- frontend.navtiming2.mediaWikiLoad.by_browser.Firefox.55:1270|ms
+- frontend.navtiming2.mediaWikiLoad.by_browser.Firefox.all:1270|ms
+- frontend.navtiming2.mediaWikiLoad.by_continent.Europe:1270|ms
+  - _uncached_desktop
+- frontend.navtiming.loadEventStart.desktop.authenticated:1965|ms
+- frontend.navtiming.loadEventStart.desktop.overall:1965|ms
+- frontend.navtiming.loadEventStart.overall:1965|ms
+- frontend.navtiming.loadEventStart.by_browser.Firefox.55:1965|ms
+- frontend.navtiming.loadEventStart.by_browser.Firefox.all:1965|ms
+- frontend.navtiming.loadEventStart.by_continent.Europe:1965|ms
+- frontend.navtiming.dnsLookup.desktop.authenticated:1|ms
+- frontend.navtiming.dnsLookup.desktop.overall:1|ms
+- frontend.navtiming.dnsLookup.overall:1|ms
+- frontend.navtiming.dnsLookup.by_browser.Firefox.55:1|ms
+- frontend.navtiming.dnsLookup.by_browser.Firefox.all:1|ms
+- frontend.navtiming.dnsLookup.by_continent.Europe:1|ms
+- frontend.navtiming.loadEventEnd.desktop.authenticated:1968|ms
+- frontend.navtiming.loadEventEnd.desktop.overall:1968|ms
+- frontend.navtiming.loadEventEnd.overall:1968|ms
+- frontend.navtiming.loadEventEnd.by_browser.Firefox.55:1968|ms
+- frontend.navtiming.loadEventEnd.by_browser.Firefox.all:1968|ms
+- frontend.navtiming.loadEventEnd.by_continent.Europe:1968|ms
+- frontend.navtiming.waiting.desktop.authenticated:374|ms
+- frontend.navtiming.waiting.desktop.overall:374|ms
+- frontend.navtiming.waiting.overall:374|ms
+- frontend.navtiming.waiting.by_browser.Firefox.55:374|ms
+- frontend.navtiming.waiting.by_browser.Firefox.all:374|ms
+- frontend.navtiming.waiting.by_continent.Europe:374|ms
+- frontend.navtiming.connecting.by_continent.Europe:0|ms
+- frontend.navtiming.fetchStart.desktop.authenticated:1|ms
+- frontend.navtiming.fetchStart.desktop.overall:1|ms
+- frontend.navtiming.fetchStart.overall:1|ms
+- frontend.navtiming.fetchStart.by_browser.Firefox.55:1|ms
+- frontend.navtiming.fetchStart.by_browser.Firefox.all:1|ms
+- frontend.navtiming.fetchStart.by_continent.Europe:1|ms
+- frontend.navtiming.domComplete.desktop.authenticated:1965|ms
+- frontend.navtiming.domComplete.desktop.overall:1965|ms
+- frontend.navtiming.domComplete.overall:1965|ms
+- frontend.navtiming.domComplete.by_browser.Firefox.55:1965|ms
+- frontend.navtiming.domComplete.by_browser.Firefox.all:1965|ms
+- frontend.navtiming.domComplete.by_continent.Europe:1965|ms
+- frontend.navtiming.receiving.desktop.authenticated:35|ms
+- frontend.navtiming.receiving.desktop.overall:35|ms
+- frontend.navtiming.receiving.overall:35|ms
+- frontend.navtiming.receiving.by_browser.Firefox.55:35|ms
+- frontend.navtiming.receiving.by_browser.Firefox.all:35|ms
+- frontend.navtiming.receiving.by_continent.Europe:35|ms
+- frontend.navtiming.responseStart.desktop.authenticated:380|ms
+- 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: webperf: Re-use expected result by reference to simplify fix...

2018-01-12 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404045 )

Change subject: webperf: Re-use expected result by reference to simplify fixture
..

webperf: Re-use expected result by reference to simplify fixture

This makes it easier to review the fixture by knowing the addition
of isOversample=false produced the same output as without that key.

Change-Id: Ic7057f1818f3a25528b0cbd5da953c0e539b6cb4
---
M modules/webperf/files/navtiming_fixture.yaml
1 file changed, 2 insertions(+), 141 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/45/404045/1

diff --git a/modules/webperf/files/navtiming_fixture.yaml 
b/modules/webperf/files/navtiming_fixture.yaml
index 867cc13..494a6eb 100644
--- a/modules/webperf/files/navtiming_fixture.yaml
+++ b/modules/webperf/files/navtiming_fixture.yaml
@@ -16,7 +16,7 @@
 
 Uncached page view from desktop:
  input: {"event": {"action": "history", "connectEnd": 6, "connectStart": 6, 
"dnsLookup": 1, "domComplete": 1965, "domInteractive": 956, "fetchStart": 1, 
"isAnon": false, "isHiDPI": false, "isHttp2": true, "loadEventEnd": 1968, 
"loadEventStart": 1965, "mediaWikiLoadComplete": 1270, "mediaWikiVersion": 
"1.30.0-wmf.19", "namespaceId": 1, "originCountry": "RS", "originRegion": "VO", 
"pageId": 1, "requestStart": 6, "responseEnd": 415, "responseStart": 380, 
"revId": 1, "unload": 4}, "recvFrom": "example", "revision": 1, "schema": 
"NavigationTiming", "seqId": 1, "timestamp": 1, "userAgent": "{\"os_minor\": 
null, \"is_bot\": false, \"os_major\": null, \"device_family\": \"Other\", 
\"os_family\": \"Windows 8.1\", \"browser_minor\": \"0\", \"wmf_app_version\": 
\"-\", \"browser_major\": \"55\", \"browser_family\": \"Firefox\", 
\"is_mediawiki\": false}", "uuid": "example", "webHost": "example", "wiki": 
"example"}
- expect:
+ expect: _uncached_desktop
   - frontend.navtiming.loadEventStart.desktop.authenticated:1965|ms
   - frontend.navtiming.loadEventStart.desktop.overall:1965|ms
   - frontend.navtiming.loadEventStart.overall:1965|ms
@@ -620,146 +620,7 @@
 
 Uncached page view from desktop that includes isOversample=false:
  input: {"event": {"action": "history", "connectEnd": 6, "connectStart": 6, 
"dnsLookup": 1, "domComplete": 1965, "domInteractive": 956, "fetchStart": 1, 
"isAnon": false, "isHiDPI": false, "isHttp2": true, "isOversample": false, 
"loadEventEnd": 1968, "loadEventStart": 1965, "mediaWikiLoadComplete": 1270, 
"mediaWikiVersion": "1.30.0-wmf.19", "namespaceId": 1, "originCountry": "RS", 
"originRegion": "VO", "pageId": 1, "requestStart": 6, "responseEnd": 415, 
"responseStart": 380, "revId": 1, "unload": 4}, "recvFrom": "example", 
"revision": 1, "schema": "NavigationTiming", "seqId": 1, "timestamp": 1, 
"userAgent": "{\"os_minor\": null, \"is_bot\": false, \"os_major\": null, 
\"device_family\": \"Other\", \"os_family\": \"Windows 8.1\", 
\"browser_minor\": \"0\", \"wmf_app_version\": \"-\", \"browser_major\": 
\"55\", \"browser_family\": \"Firefox\", \"is_mediawiki\": false}", "uuid": 
"example", "webHost": "example", "wiki": "example"}
- expect:
-  - frontend.navtiming.loadEventStart.desktop.authenticated:1965|ms
-  - frontend.navtiming.loadEventStart.desktop.overall:1965|ms
-  - frontend.navtiming.loadEventStart.overall:1965|ms
-  - frontend.navtiming.loadEventStart.by_browser.Firefox.55:1965|ms
-  - frontend.navtiming.loadEventStart.by_browser.Firefox.all:1965|ms
-  - frontend.navtiming.loadEventStart.by_continent.Europe:1965|ms
-  - frontend.navtiming.dnsLookup.desktop.authenticated:1|ms
-  - frontend.navtiming.dnsLookup.desktop.overall:1|ms
-  - frontend.navtiming.dnsLookup.overall:1|ms
-  - frontend.navtiming.dnsLookup.by_browser.Firefox.55:1|ms
-  - frontend.navtiming.dnsLookup.by_browser.Firefox.all:1|ms
-  - frontend.navtiming.dnsLookup.by_continent.Europe:1|ms
-  - frontend.navtiming.mediaWikiLoadComplete.desktop.authenticated:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.desktop.overall:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.overall:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.by_browser.Firefox.55:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.by_browser.Firefox.all:1270|ms
-  - frontend.navtiming.mediaWikiLoadComplete.by_continent.Europe:1270|ms
-  - frontend.navtiming.loadEventEnd.desktop.authenticated:1968|ms
-  - frontend.navtiming.loadEventEnd.desktop.overall:1968|ms
-  - frontend.navtiming.loadEventEnd.overall:1968|ms
-  - frontend.navtiming.loadEventEnd.by_browser.Firefox.55:1968|ms
-  - frontend.navtiming.loadEventEnd.by_browser.Firefox.all:1968|ms
-  - frontend.navtiming.loadEventEnd.by_continent.Europe:1968|ms
-  - frontend.navtiming.waiting.desktop.authenticated:374|ms
-  - frontend.navtiming.waiting.desktop.overall:374|ms
-  - frontend.navtiming.waiting.overall:374|ms
-  - frontend.navtiming.waiting.by_browser.Firefox.55:374|ms
-  - 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: config: Increase coverage of EtcdConfig::parseDirectory()

2018-01-12 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403980 )

Change subject: config: Increase coverage of EtcdConfig::parseDirectory()
..

config: Increase coverage of EtcdConfig::parseDirectory()

One of the error cases wasn't covered yet.

Change-Id: I762b37c7448c0f689248a99bad0b206d7cf63d73
---
M tests/phpunit/includes/config/EtcdConfigTest.php
1 file changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/80/403980/1

diff --git a/tests/phpunit/includes/config/EtcdConfigTest.php 
b/tests/phpunit/includes/config/EtcdConfigTest.php
index 7a4d9d9..379eebd 100644
--- a/tests/phpunit/includes/config/EtcdConfigTest.php
+++ b/tests/phpunit/includes/config/EtcdConfigTest.php
@@ -461,6 +461,26 @@
false // retry
],
],
+   '200 OK - Directory with non-array "nodes" key' => [
+   'http' => [
+   'code' => 200,
+   'reason' => 'OK',
+   'headers' => [],
+   'body' => json_encode( [ 'node' => [ 
'nodes' => [
+   [
+   'key' => '/example/a',
+   'dir' => true,
+   'nodes' => 'not an 
array'
+   ],
+   ] ] ] ),
+   'error' => '',
+   ],
+   'expect' => [
+   null,
+   "Unexpected JSON response in dir 'a'; 
'nodes' is not an array.",
+   false // retry
+   ],
+   ],
'200 OK - Correctly encoded garbage response' => [
'http' => [
'code' => 200,

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Initial profiler for Beta Cluster

2018-01-12 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403974 )

Change subject: Initial profiler for Beta Cluster
..

Initial profiler for Beta Cluster

* profiler-labs.php: Like profiler.php, but for labs.

* StartProfiler-labs.php: Like StartProfiler.php, but for labs.
  Beta Cluster app servers will need to be updated to actually
  load this file from /srv/mediawiki/php-master, similar to how
  we do for prod branches already. Right now that logic is missing.

* PhpAutoPrepend-labs.php: To be loaded via auto_prepend_file
  in Beta Cluster. This will help profiling be more complete by
  starting earlier instead of from Setup.php. Currently, the
  relatively late start causes the profiling stack to be unbalanced
  because it will encounter closing of stacks that opened before
  the profiling started.
  We still still need StartProfiler.php, but only for the setting
  of $wgProfiler. And for sanity, we still not rely on state
  left behind by auto_prepend_file, which is why StartProfiler
  will also require_once profiler.php in case it wasn't loaded
  by auto_prepend_file.

Bug: T180183
BUg: T180766
Change-Id: Ie823761e48a557b985397e3d25da4e099c8dcc9e
---
A wmf-config/PhpAutoPrepend-labs.php
A wmf-config/StartProfiler-labs.php
A wmf-config/profiler-labs.php
3 files changed, 79 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/PhpAutoPrepend-labs.php 
b/wmf-config/PhpAutoPrepend-labs.php
new file mode 100644
index 000..392f5a4
--- /dev/null
+++ b/wmf-config/PhpAutoPrepend-labs.php
@@ -0,0 +1,17 @@
+https://secure.php.net/manual/en/ini.core.php#ini.auto-prepend-file
+ */
+
+require_once __DIR__ . '/profiler-labs.php';
diff --git a/wmf-config/StartProfiler-labs.php 
b/wmf-config/StartProfiler-labs.php
new file mode 100644
index 000..c3aea55
--- /dev/null
+++ b/wmf-config/StartProfiler-labs.php
@@ -0,0 +1,18 @@
+https://www.mediawiki.org/wiki/Manual:Profiling
+*/
+   if (
+   ( isset( $_GET['forceprofile'] ) && isset( 
$_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] ) )
+   || PHP_SAPI === 'cli'
+   ) {
+   $wmgProfiler = [
+   'class'  => 'ProfilerXhprof',
+   'flags'  => XHPROF_FLAGS_NO_BUILTINS,
+   'output' => 'text',
+   ];
+
+   }
+}

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Remove unused PhpAutoPrepend.php file for now.

2018-01-12 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403973 )

Change subject: Remove unused PhpAutoPrepend.php file for now.
..

Remove unused PhpAutoPrepend.php file for now.

Follows-up 96de34769, which created this file but isn't being used
by anything yet. To avoid confusion, better to remove for now.

I'll do this for Beta Cluster first.

Bug: T180183
Change-Id: Icddf76486c248495859ba29a10bf9ffe32d0add3
---
D wmf-config/PhpAutoPrepend.php
1 file changed, 0 insertions(+), 17 deletions(-)


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

diff --git a/wmf-config/PhpAutoPrepend.php b/wmf-config/PhpAutoPrepend.php
deleted file mode 100644
index acb19ff..000
--- a/wmf-config/PhpAutoPrepend.php
+++ /dev/null
@@ -1,17 +0,0 @@
-https://secure.php.net/manual/en/ini.core.php#ini.auto-prepend-file
- */
-
-require_once __DIR__ . '/profiler.php';

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: JavaScriptMinifier: Remove support for unused $maxLineLength...

2018-01-11 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403835 )

Change subject: JavaScriptMinifier: Remove support for unused $maxLineLength 
param
..

JavaScriptMinifier: Remove support for unused $maxLineLength param

Follows-up 93b8023946b0e.

The $wgResourceLoaderMinifierMaxLineLength config var was deprecated
in MediaWiki 1.27. The parameter of minify() was not used by other
code, and no new usage has been introduced since then, either.

Remove the feature from JavaScriptMinifier, and add a release note.
The 1.31 release notes already contain a note about the removal
of the configuration variables.

The feature was not covered by unit tests.

Change-Id: I38eb4187e3a8e2d882f317481b43f0bf6ac3bada
---
M RELEASE-NOTES-1.31
M includes/libs/JavaScriptMinifier.php
2 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/35/403835/1

diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31
index 30a174a..e17338d 100644
--- a/RELEASE-NOTES-1.31
+++ b/RELEASE-NOTES-1.31
@@ -163,6 +163,9 @@
 * The $statementsOnOwnLine parameter of JavaScriptMinifier::minify was removed.
   The corresponding configuration variable 
($wgResourceLoaderMinifierStatementsOnOwnLine)
   has been deprecated since 1.27 and was removed as well.
+* The $maxLineLength parameter of JavaScriptMinifier::minify was removed.
+  The corresponding configuration variable 
($wgResourceLoaderMinifierMaxLineLength)
+  has been deprecated since 1.27 and was removed as well.
 * The HtmlFormatter class was removed (deprecated in 1.27). The namespaced
   HtmlFormatter\HtmlFormatter class should be used instead.
 
diff --git a/includes/libs/JavaScriptMinifier.php 
b/includes/libs/JavaScriptMinifier.php
index 3f46453..a1a93d2 100644
--- a/includes/libs/JavaScriptMinifier.php
+++ b/includes/libs/JavaScriptMinifier.php
@@ -63,17 +63,19 @@
const STACK_LIMIT = 1000;
 
/**
+* NOTE: This isn't a strict maximum. Longer lines will be produced when
+*   literals (e.g. quoted strings) longer than this are encountered
+*   or when required to guard against semicolon insertion.
+*/
+   const MAX_LINE_LENGTH = 1000;
+
+   /**
 * Returns minified JavaScript code.
 *
-* NOTE: $maxLineLength isn't a strict maximum. Longer lines will be 
produced when
-*   literals (e.g. quoted strings) longer than $maxLineLength are 
encountered
-*   or when required to guard against semicolon insertion.
-*
 * @param string $s JavaScript code to minify
-* @param int $maxLineLength Maximum length of a single line, or -1 for 
no maximum.
 * @return String Minified code
 */
-   public static function minify( $s, $maxLineLength = 1000 ) {
+   public static function minify( $s ) {
// First we declare a few tables that contain our parsing rules
 
// $opChars : characters, which can be combined without 
whitespace in between them
@@ -571,7 +573,7 @@
$out .= "\n";
$state = self::STATEMENT;
$lineLength = 0;
-   } elseif ( $maxLineLength > 0 && $lineLength + $end - 
$pos > $maxLineLength &&
+   } elseif ( $lineLength + $end - $pos > 
self::MAX_LINE_LENGTH &&
!isset( $semicolon[$state][$type] ) && 
$type !== self::TYPE_INCR_OP ) {
// This line would get too long if we added 
$token, so add a newline first.
// Only do this if it won't trigger semicolon 
insertion and if it won't

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: JavaScriptMinifier: Enable phpcs and fix violations

2018-01-11 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403769 )

Change subject: JavaScriptMinifier: Enable phpcs and fix violations
..

JavaScriptMinifier: Enable phpcs and fix violations

Found 90 violations. 88 fixed by phpxbf. 2 remaining violations
were Generic.Files.LineLength.TooLong (fixed manually).

Change-Id: I760acc5b249fe6f4863652de7b563eaa5f13f05f
---
M includes/libs/JavaScriptMinifier.php
1 file changed, 134 insertions(+), 128 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/69/403769/1

diff --git a/includes/libs/JavaScriptMinifier.php 
b/includes/libs/JavaScriptMinifier.php
index 5e7373e..3f46453 100644
--- a/includes/libs/JavaScriptMinifier.php
+++ b/includes/libs/JavaScriptMinifier.php
@@ -1,5 +1,4 @@
  true,
'"' => true,
'%' => true,
@@ -105,10 +104,10 @@
'|' => true,
'}' => true,
'~' => true
-   );
+   ];
 
// $tokenTypes : maps keywords and operators to their 
corresponding token type
-   $tokenTypes = array(
+   $tokenTypes = [
'!'  => self::TYPE_UN_OP,
'~'  => self::TYPE_UN_OP,
'delete' => self::TYPE_UN_OP,
@@ -180,13 +179,13 @@
'try'=> self::TYPE_DO,
'var'=> self::TYPE_DO,
'function'   => self::TYPE_FUNC
-   );
+   ];
 
// $goto : This is the main table for our state machine. For 
every state/token pair
// the following state is defined. When no rule exists 
for a given pair,
// the state is left unchanged.
-   $goto = array(
-   self::STATEMENT => array(
+   $goto = [
+   self::STATEMENT => [
self::TYPE_UN_OP  => self::EXPRESSION,
self::TYPE_INCR_OP=> self::EXPRESSION,
self::TYPE_ADD_OP => self::EXPRESSION,
@@ -195,29 +194,29 @@
self::TYPE_IF => self::CONDITION,
self::TYPE_FUNC   => self::CONDITION,
self::TYPE_LITERAL=> self::EXPRESSION_OP
-   ),
-   self::CONDITION => array(
+   ],
+   self::CONDITION => [
self::TYPE_PAREN_OPEN => self::PAREN_EXPRESSION
-   ),
-   self::PROPERTY_ASSIGNMENT => array(
+   ],
+   self::PROPERTY_ASSIGNMENT => [
self::TYPE_COLON  => 
self::PROPERTY_EXPRESSION,
self::TYPE_BRACE_OPEN => self::STATEMENT
-   ),
-   self::EXPRESSION => array(
+   ],
+   self::EXPRESSION => [
self::TYPE_SEMICOLON  => self::STATEMENT,
self::TYPE_BRACE_OPEN => 
self::PROPERTY_ASSIGNMENT,
self::TYPE_PAREN_OPEN => self::PAREN_EXPRESSION,
self::TYPE_FUNC   => self::EXPRESSION_FUNC,
self::TYPE_LITERAL=> self::EXPRESSION_OP
-   ),
-   self::EXPRESSION_NO_NL => array(
+   ],
+   self::EXPRESSION_NO_NL => [
self::TYPE_SEMICOLON  => self::STATEMENT,
self::TYPE_BRACE_OPEN => 
self::PROPERTY_ASSIGNMENT,
self::TYPE_PAREN_OPEN => self::PAREN_EXPRESSION,
self::TYPE_FUNC   => self::EXPRESSION_FUNC,
self::TYPE_LITERAL=> self::EXPRESSION_OP
-   ),
-   self::EXPRESSION_OP => array(
+   ],
+   self::EXPRESSION_OP => [
self::TYPE_BIN_OP => self::EXPRESSION,
self::TYPE_ADD_OP => self::EXPRESSION,
self::TYPE_HOOK   => 
self::EXPRESSION_TERNARY,
@@ -225,33 +224,33 @@
self::TYPE_COMMA  => self::EXPRESSION,
self::TYPE_SEMICOLON  => self::STATEMENT,
self::TYPE_PAREN_OPEN => self::PAREN_EXPRESSION
-   ),
-   self::EXPRESSION_FUNC => array(
+   ],
+

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: keys: Simplify and update keys.html styling to match other s...

2018-01-10 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403569 )

Change subject: keys: Simplify and update keys.html styling to match other 
simple pages
..

keys: Simplify and update keys.html styling to match other simple pages

Loosely based on https://noc.wikimedia.org/css/base.css and the
various simple (error) pages we have for 404, 503, docroot/default etc.

Considered loading https://noc.wikimedia.org/css/base.css, but figured
it would be preferable for this page not to load styles cross-domain.

Change-Id: I8cfe38fe7ad266701497f83d66ebca79c2e62f9c
---
M docroot/mediawiki/keys/keys.html
M docroot/mediawiki/static
2 files changed, 27 insertions(+), 119 deletions(-)


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

diff --git a/docroot/mediawiki/keys/keys.html b/docroot/mediawiki/keys/keys.html
index 6005044..82da4c1 100644
--- a/docroot/mediawiki/keys/keys.html
+++ b/docroot/mediawiki/keys/keys.html
@@ -1,120 +1,29 @@
-http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;>
-http://www.w3.org/1999/xhtml; xml:lang="en" lang="en" dir="ltr">
-   
-   
-   Wikimedia public key list
-   /*https://svn.wikimedia.org/skins/custom/images/page-base.png) 0 0 no-repeat;
-   color: black;
-   margin: 0;
-   padding: 0;
-}
-/* scale back up to a sane default */
-#globalWrapper {
-   font-size: 127%;
-   width: 100%;
-   margin: 0;
-   padding: 0;
-}
-#content {
-   margin: 2em 2em 0 2em;
-   padding: 0 1em 1.5em 1em;
-   background: white;
-   color: black;
-   border: 1px solid #aaa;
-   line-height: 1.5em;
-   position: relative;
-   z-index: 2;
-}
-h1, h2, h3, h4, h5, h6 {
-   color: black;
-   background: none;
-   font-weight: normal;
-   margin: 0;
-   padding-top: .5em;
-   padding-bottom: .17em;
-   border-bottom: 1px solid #aaa;
-}
-h1 { 
-   font-size: 188%; 
-   margin-bottom: .6em;
-}
-h2 { 
-   font-size: 150%; 
-   margin-bottom: .6em;
-}
-h3, h4, h5, h6 {
-   border-bottom: none;
-   font-weight: bold;
-   margin-bottom: .3em;
-}
-
-ul {
-   line-height: 1.5em;
-   list-style-type: square;
-   margin: .3em 0 0 1.5em;
-   padding: 0;
-   list-style-image: url(bullet.gif);
-}
-ol {
-   line-height: 1.5em;
-   margin: .3em 0 0 3.2em;
-   padding: 0;
-   list-style-image: none;
-}
-li {
-   margin-bottom: .1em;
-}
-dt {
-   font-weight: bold;
-   margin-bottom: .05em;
-}
-dl {
-   margin-top: .2em;
-   margin-bottom: .5em;
-}
-dd {
-   line-height: 1.5em;
-   margin-left: 2em;
-   margin-bottom: .5em;
-}
-a {
-   text-decoration: none;
-   color: #002bb8;
-   background: none;
-}
-a:visited {
-   color: #5a3696;
-}
-a:active {
-   color: #faa700;
-}
-a:hover {
-   text-decoration: underline;
-}
-
-.visualClear {
-   clear: both;
-}
-
-/*]]>*/
-
+
+
+
+
+Wikimedia public key list
+
+html, body { margin: 0; padding: 0; }
+body { background: #fff; font: 15px/1.6 sans-serif; color: #333; }
+.content { margin: 7% auto 0; padding: 2em 1em 1em; max-width: 640px; 
overflow: hidden; }
+.clear { clear: both; }
+img { float: left; margin: 0 2em 2em 0; }
+a img { border: 0; }
+a { color: #0645AD; text-decoration: none; }
+a:hover { text-decoration: underline; }
+
 
 
-   
-   
-   Wikimedia public key list
-   
-   
-   A plain text bundle is 
also available. You can use the following to
-   automatically import it:
-   
-   gpg --fetch-keys 
"https://www.mediawiki.org/keys/keys.txt;
-   
-   
-   Tim Starling
+
+   https://www.wikimedia.org;>
+   Wikimedia public key list
+   A plain text bundle is also available.
+   You can use the following to automatically import it:
+   gpg --fetch-keys 
"https://www.mediawiki.org/keys/keys.txt;
+   
+   
+Tim Starling
 
 -BEGIN PGP PUBLIC KEY BLOCK-
 Version: GnuPG v1.4.9 (GNU/Linux)
@@ -894,7 +803,6 @@
 =vhcr
 -END PGP PUBLIC KEY BLOCK-
 
-   
-   
-   
+
+
 
diff --git a/docroot/mediawiki/static b/docroot/mediawiki/static
index de3aae3..8e9b74c 12
--- a/docroot/mediawiki/static
+++ b/docroot/mediawiki/static
@@ -1 +1 @@
-/srv/mediawiki/static
\ No newline at end of file
+../../static
\ No newline at end of file

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: [WIP] coal: Consume EventLogging from Kafka instead of ZMQ

2018-01-10 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403560 )

Change subject: [WIP] coal: Consume EventLogging from Kafka instead of ZMQ
..

[WIP] coal: Consume EventLogging from Kafka instead of ZMQ

Bug: T110903
Change-Id: I3d258f84cc4221a51750f79b5ba2dc4db329e570
---
M modules/coal/files/coal
M modules/coal/manifests/init.pp
M modules/coal/templates/initscripts/coal.systemd.erb
3 files changed, 40 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/60/403560/1

diff --git a/modules/coal/files/coal b/modules/coal/files/coal
index 2ec68da..09aef4f 100755
--- a/modules/coal/files/coal
+++ b/modules/coal/files/coal
@@ -25,6 +25,7 @@
 sys.setdefaultencoding('utf-8')
 
 import argparse
+import json
 import collections
 import dateutil.parser
 import errno
@@ -37,7 +38,7 @@
 import time
 
 import whisper
-import zmq
+from kafka import KafkaConsumer
 
 
 WINDOW_SPAN = 60 * 5  # Size of sliding window, in seconds.
@@ -105,10 +106,10 @@
 default=os.getcwd(),
 help='Path for Whisper files. Defaults to working directory.'
 )
-arg_parser.add_argument(
-'endpoint',
-help='EventLogging endpoint URL.'
-)
+ap.add_argument('--brokers', required=True,
+help='Comma-separated list of kafka brokers')
+ap.add_argument('--consumer-group', required=True,
+help='Consumer group to register with Kafka')
 
 def __init__(self):
 self.args = self.arg_parser.parse_args()
@@ -128,7 +129,20 @@
 def run(self):
 self.create_whisper_files()
 
-self.log.info('Connecting to %s.', self.args.endpoint)
+# Based on webperf/navtiming.py
+kafka_bootstrap_servers = tuple(self.args.brokers.split(','))
+kafka_topics = ('eventlogging_NavigationTiming', 
'eventlogging_SaveTiming')
+kafka_consumer_timeout_seconds = 60
+consumer = KafkaConsumer(
+*kafka_topics,
+bootstrap_servers=kafka_bootstrap_servers,
+group_id=self.args.consumer_group,
+auto_offset_reset='latest',
+enable_auto_commit=False,
+consumer_timeout_ms=kafka_consumer_timeout_seconds * 1000
+)
+
+self.log.info('Starting Kafka consumer')
 socket = zmq.Context().socket(zmq.SUB)
 socket.connect(self.args.endpoint)
 socket.subscribe = b''
diff --git a/modules/coal/manifests/init.pp b/modules/coal/manifests/init.pp
index 10aa0c1..17f8b6f 100644
--- a/modules/coal/manifests/init.pp
+++ b/modules/coal/manifests/init.pp
@@ -1,6 +1,16 @@
 # == Class: coal
 #
-# Store a basic set of Navigation Timing metrics in Whisper files.
+# Captures NavigationTiming events from Kafka and writes
+# a subset of metric directly to Whisper files.
+#
+# This complements webperf::navtiming, which uses StatsD and writes
+# to Graphite's default backend via carbon.  StatsD produces derived metrics,
+# like 'p99' and 'sample_rate'. Graphite aggregates Carbon's Whisper files
+# at varying resolutions as data gets older.
+#
+# Coal, on the other hand, simply retains data for 1 year at a constant
+# resolution of 1-minute.
+#
 # See https://meta.wikimedia.org/wiki/Schema:NavigationTiming &
 # http://www.mediawiki.org/wiki/Extension:NavigationTiming
 #
@@ -10,11 +20,14 @@
 #   URI of EventLogging event publisher to subscribe to.
 #   For example, 'tcp://eventlogging.eqiad.wmnet:8600'.
 #
+# [*kafka_brokers*]
+#   String of comma separated Kafka bootstrap brokers.
+#
 class coal( $endpoint ) {
 require_package('python-flask')
 require_package('python-numpy')
 require_package('python-whisper')
-require_package('python-zmq')
+require_package('python-kafka')
 
 group { 'coal':
 ensure => present,
diff --git a/modules/coal/templates/initscripts/coal.systemd.erb 
b/modules/coal/templates/initscripts/coal.systemd.erb
index d53916b..405d83b 100644
--- a/modules/coal/templates/initscripts/coal.systemd.erb
+++ b/modules/coal/templates/initscripts/coal.systemd.erb
@@ -1,11 +1,14 @@
 [Unit]
-Description=Navigation Timing Whisper logger
+Description=Navigation Timing Whisper writer
 
 [Service]
 User=coal
 Group=coal
 Restart=always
-ExecStart=/usr/local/bin/coal --whisper-dir "/var/lib/coal" "<%= @endpoint %>"
+ExecStart=/usr/local/bin/coal \
+--whisper-dir "/var/lib/coal" \
+--brokers <%= @kafka_brokers %> \
+--consumer-group coal
 
 [Install]
 WantedBy=multi-user.target

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

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

___
MediaWiki-commits mailing list

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: JavaScriptMinifier: Improve docs for parsing of string literals

2018-01-09 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403331 )

Change subject: JavaScriptMinifier: Improve docs for parsing of string literals
..

JavaScriptMinifier: Improve docs for parsing of string literals

Also update docs for parsing of regexp literals to match.

Bug: T75556
Change-Id: I86c79b1b1866339d65d1c69e56d457c62544aaac
---
M includes/libs/JavaScriptMinifier.php
1 file changed, 22 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/31/403331/1

diff --git a/includes/libs/JavaScriptMinifier.php 
b/includes/libs/JavaScriptMinifier.php
index e0bbb59..3be20dd 100644
--- a/includes/libs/JavaScriptMinifier.php
+++ b/includes/libs/JavaScriptMinifier.php
@@ -433,27 +433,43 @@
continue;
}
 
-   // Find out which kind of token we're handling. $end 
will point past the end of it.
+   // Find out which kind of token we're handling.
+   // Note: $end must point past the end of the current 
token
+   // so that `substr($s, $pos, $end - $pos)` would be the 
entire token.
+   // In order words, $end will be the offset of the last 
relevant character
+   // in the stream + 1, or simply put: The offset of the 
first character
+   // of any next token in the stream.
$end = $pos + 1;
// Handle string literals
if( $ch === "'" || $ch === '"' ) {
// Search to the end of the string literal, 
skipping over backslash escapes
$search = $ch . '\\';
do{
+   // Speculatively add 2 to the end so 
that if we see a backslash,
+   // the next iteration will start 2 
characters further (one for the
+   // backslash, one for the escaped 
character).
+   // We'll correct this outside the loop.
$end += strcspn( $s, $search, $end ) + 
2;
+   // If the last character in our search 
for a quote or a backlash
+   // matched a backslash and we haven't 
reached the end, keep searching..
} while( $end - 2 < $length && $s[$end - 2] === 
'\\' );
+   // Correction (1): Undo speculative add, keep 
only one (end of string literal)
$end--;
// We have to distinguish between regexp literals and 
division operators
// A division operator is only possible in certain 
states
} elseif( $ch === '/' && !isset( $divStates[$state] ) ) 
{
// Regexp literal
for( ; ; ) {
+   // Search until we find "/" (end of 
regexp), "\" (backslash escapes),
+   // or "[" (start of character classes).
do{
-   // Skip until we find "/" (end 
of regexp), "\" (backslash escapes),
-   // or "[" (start of character 
classes).
+   // Speculatively add 2 to 
ensure next iteration skips
+   // over backslash and escaped 
character.
+   // We'll correct this outside 
the loop.
$end += strcspn( $s, '/[\\', 
$end ) + 2;
// If backslash escape, keep 
searching...
} while( $end - 2 < $length && $s[$end 
- 2] === '\\' );
+   // Correction (1): Undo speculative 
add, keep only one (end of regexp)
$end--;
// If the end, stop here.
if( $end - 1 >= $length || $s[$end - 1] 
=== '/' ) {
@@ -462,11 +478,13 @@
// (Implicit else), we must've found 
the start of a char class,
// skip until we find "]" (end of char 
class), or "\" (backslash escape)
do{
+   // Speculatively add 2 for 
backslash escape.
+   // We'll substract one outside 
the loop.
$end 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: JavaScriptMinifier: Fix "Uninitialized offset" in string and...

2018-01-09 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403332 )

Change subject: JavaScriptMinifier: Fix "Uninitialized offset" in string and 
regexp parsing
..

JavaScriptMinifier: Fix "Uninitialized offset" in string and regexp parsing

When parsing an incomplete string literal or regex literal at the end of a file,
$end would be set to an offset higher than $length, because the code
speculatively increases $end without correcting for this scenario.

This is due to the assumption that the strcspn() search will end because
an end character was seen, instead of simply ending because the string
doesn't have any further characters.

Bug: T75556
Change-Id: I2325c9aff33293c13ff414699c2d47306182aaa6
---
M includes/libs/JavaScriptMinifier.php
M tests/phpunit/includes/libs/JavaScriptMinifierTest.php
2 files changed, 22 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/403332/1

diff --git a/includes/libs/JavaScriptMinifier.php 
b/includes/libs/JavaScriptMinifier.php
index 3be20dd..10a9c76 100644
--- a/includes/libs/JavaScriptMinifier.php
+++ b/includes/libs/JavaScriptMinifier.php
@@ -455,6 +455,12 @@
} while( $end - 2 < $length && $s[$end - 2] === 
'\\' );
// Correction (1): Undo speculative add, keep 
only one (end of string literal)
$end--;
+   if ($end > $length) {
+   // Correction (2): Loop wrongly assumed 
an end quote ended the search,
+   // but search ended because we've 
reached the end. Correct $end.
+   // TODO: This is invalid and should 
throw,
+   $end--;
+   }
// We have to distinguish between regexp literals and 
division operators
// A division operator is only possible in certain 
states
} elseif( $ch === '/' && !isset( $divStates[$state] ) ) 
{
@@ -471,8 +477,14 @@
} while( $end - 2 < $length && $s[$end 
- 2] === '\\' );
// Correction (1): Undo speculative 
add, keep only one (end of regexp)
$end--;
-   // If the end, stop here.
-   if( $end - 1 >= $length || $s[$end - 1] 
=== '/' ) {
+   if( $end > $length ) {
+   // Correction (2): Loop wrongly 
assumed end slash was seen
+   // String ended without end of 
regexp. Correct $end.
+   // TODO: This is invalid and 
should throw,
+   $end--;
+   break;
+   }
+   if ( $s[$end - 1] === '/' ) {
break;
}
// (Implicit else), we must've found 
the start of a char class,
diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php 
b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
index 5061e27..d6a1040 100644
--- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
+++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
@@ -82,6 +82,14 @@
"var a=this\nfor(b=0;c

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


[MediaWiki-commits] [Gerrit] mediawiki...Gadgets[master]: tests: Add @covers tags

2018-01-04 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402145 )

Change subject: tests: Add @covers tags
..

tests: Add @covers tags

Change-Id: Ia3e18e7149292cd23765636111acc846564bf6cc
---
M tests/phpunit/GadgetTest.php
1 file changed, 37 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gadgets 
refs/changes/45/402145/1

diff --git a/tests/phpunit/GadgetTest.php b/tests/phpunit/GadgetTest.php
index e0f5768..87c32bf 100644
--- a/tests/phpunit/GadgetTest.php
+++ b/tests/phpunit/GadgetTest.php
@@ -5,8 +5,13 @@
 /**
  * @group Gadgets
  */
-
 class GadgetsTest extends MediaWikiTestCase {
+
+   public function tearDown() {
+   GadgetRepo::setSingleton();
+   parent::tearDown();
+   }
+
/**
 * @param string $line
 * @return Gadget
@@ -14,7 +19,7 @@
private function create( $line ) {
$repo = new MediaWikiGadgetsDefinitionRepo();
$g = $repo->newFromDefinition( $line, 'misc' );
-   $this->assertInstanceOf( 'Gadget', $g );
+   $this->assertInstanceOf( Gadget::class, $g );
return $g;
}
 
@@ -26,12 +31,21 @@
return $module;
}
 
+   /**
+* @covers MediaWikiGadgetsDefinitionRepo::newFromDefinition
+*/
public function testInvalidLines() {
$repo = new MediaWikiGadgetsDefinitionRepo();
$this->assertFalse( $repo->newFromDefinition( '', 'misc' ) );
$this->assertFalse( $repo->newFromDefinition( '', 
'misc' ) );
}
 
+   /**
+* @covers MediaWikiGadgetsDefinitionRepo::newFromDefinition
+* @covers Gadget::__construct
+* @covers Gadget::getName
+* @covers Gadget::getModuleName
+*/
public function testSimpleCases() {
$g = $this->create( '* foo bar| foo.css|foo.js|foo.bar' );
$this->assertEquals( 'foo_bar', $g->getName() );
@@ -45,6 +59,11 @@
$this->assertTrue( $g->hasModule() );
}
 
+   /**
+* @covers MediaWikiGadgetsDefinitionRepo::newFromDefinition
+* @covers Gadget::supportsResourceLoader
+* @covers Gadget::getLegacyScripts
+*/
public function testRLtag() {
$g = $this->create( '*foo [ResourceLoader]|foo.js|foo.css' );
$this->assertEquals( 'foo', $g->getName() );
@@ -52,6 +71,10 @@
$this->assertEquals( 0, count( $g->getLegacyScripts() ) );
}
 
+   /**
+* @covers MediaWikiGadgetsDefinitionRepo::newFromDefinition
+* @covers Gadget::getDependencies
+*/
public function testDependencies() {
$g = $this->create( '* 
foo[ResourceLoader|dependencies=jquery.ui]|bar.js' );
$this->assertEquals( [ 'MediaWiki:Gadget-bar.js' ], 
$g->getScripts() );
@@ -126,6 +149,9 @@
 
/**
 * @dataProvider provideGetType
+* @covers MediaWikiGadgetsDefinitionRepo::newFromDefinition
+* @covers Gadget::getType
+* @covers GadgetResourceLoaderModule::getType
 */
public function testType( $message, $definition, $gType, $mType ) {
$g = $this->create( $definition );
@@ -133,6 +159,10 @@
$this->assertEquals( $mType, $this->getModule( $g )->getType(), 
"Module: $message" );
}
 
+   /**
+* @covers MediaWikiGadgetsDefinitionRepo::newFromDefinition
+* @covers Gadget::isHidden
+*/
public function testIsHidden() {
$g = $this->create( '* foo[hidden]|bar.js' );
$this->assertTrue( $g->isHidden() );
@@ -144,6 +174,11 @@
$this->assertFalse( $g->isHidden() );
}
 
+
+   /**
+* @covers MediaWikiGadgetsDefinitionRepo::fetchStructuredList
+* @covers GadgetHooks::getPreferences
+*/
public function testPreferences() {
$prefs = [];
$repo = TestingAccessWrapper::newFromObject( new 
MediaWikiGadgetsDefinitionRepo() );
@@ -168,10 +203,5 @@
'Must not show empty sections' );
$this->assertArrayHasKey( '⧼gadget-section-keep-section1⧽', 
$options );
$this->assertArrayHasKey( '⧼gadget-section-keep-section2⧽', 
$options );
-   }
-
-   public function tearDown() {
-   GadgetRepo::setSingleton();
-   parent::tearDown();
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3e18e7149292cd23765636111acc846564bf6cc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gadgets
Gerrit-Branch: master
Gerrit-Owner: Krinkle 


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: phpunit: Remove outdated comment about calling of LinkCache:...

2017-12-27 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400434 )

Change subject: phpunit: Remove outdated comment about calling of 
LinkCache::clear()
..

phpunit: Remove outdated comment about calling of LinkCache::clear()

This is actually being called now, from resetDB() between tests.

Change-Id: I5aa15ce3fd57b6fc90b424fde8691ff33c7ddf45
---
M tests/phpunit/MediaWikiTestCase.php
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/34/400434/1

diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index 4d3c37b..9f2e5f9 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -1008,10 +1008,6 @@
$user = static::getTestSysop()->getUser();
$comment = __METHOD__ . ': Sample page for unit test.';
 
-   // Avoid memory leak...?
-   // LinkCache::singleton()->clear();
-   // Maybe.  But doing this absolutely breaks 
$title->isRedirect() when called during unit tests
-
$page = WikiPage::factory( $title );
$page->doEditContent( ContentHandler::makeContent( $text, 
$title ), $comment, 0, false, $user );
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: maintenance: Add unit test for Benchmarker class

2017-12-27 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400432 )

Change subject: maintenance: Add unit test for Benchmarker class
..

maintenance: Add unit test for Benchmarker class

Change-Id: I3f835fc07741fd42b8adb5b019f72589429cc14f
---
M maintenance/benchmarks/Benchmarker.php
A tests/phpunit/maintenance/BenchmarkerTest.php
2 files changed, 134 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/400432/1

diff --git a/maintenance/benchmarks/Benchmarker.php 
b/maintenance/benchmarks/Benchmarker.php
index 832da4d..ffb8cb3 100644
--- a/maintenance/benchmarks/Benchmarker.php
+++ b/maintenance/benchmarks/Benchmarker.php
@@ -26,7 +26,9 @@
  * @ingroup Benchmark
  */
 
+// @codeCoverageIgnoreStart
 require_once __DIR__ . '/../Maintenance.php';
+// @codeCoverageIgnoreEnd
 
 /**
  * Base class for benchmark scripts.
diff --git a/tests/phpunit/maintenance/BenchmarkerTest.php 
b/tests/phpunit/maintenance/BenchmarkerTest.php
new file mode 100644
index 000..81fd9b1
--- /dev/null
+++ b/tests/phpunit/maintenance/BenchmarkerTest.php
@@ -0,0 +1,132 @@
+getMockBuilder( Benchmarker::class )
+  ->setMethods( [ 'execute', 'output' ] )
+  ->getMock();
+$benchProxy = TestingAccessWrapper::newFromObject( $bench );
+$benchProxy->defaultCount = 3;
+
+$count = 0;
+$bench->bench( [
+  'test' => function () use ( &$count ) {
+  $count++;
+  }
+] );
+
+$this->assertSame( 3, $count );
+  }
+
+  public function testBenchSetup() {
+$bench = $this->getMockBuilder( Benchmarker::class )
+  ->setMethods( [ 'execute', 'output' ] )
+  ->getMock();
+$benchProxy = TestingAccessWrapper::newFromObject( $bench );
+$benchProxy->defaultCount = 2;
+
+$buffer = [];
+$bench->bench( [
+  'test' => [
+'setup' => function () use ( &$buffer ) {
+$buffer[] = 'setup';
+},
+'function' => function () use ( &$buffer ) {
+$buffer[] = 'run';
+}
+  ]
+] );
+
+$this->assertSame( [ 'setup', 'run', 'run' ], $buffer );
+  }
+
+  public function testBenchVerbose() {
+$bench = $this->getMockBuilder( Benchmarker::class )
+  ->setMethods( [ 'execute', 'output', 'hasOption', 'verboseRun' ] )
+  ->getMock();
+$benchProxy = TestingAccessWrapper::newFromObject( $bench );
+$benchProxy->defaultCount = 1;
+
+$bench->expects( $this->exactly( 2 ) )->method( 'hasOption' )
+  ->will( $this->returnValueMap( [
+  [ 'verbose', true ],
+  [ 'count', false ],
+] ) );
+
+$bench->expects( $this->once() )->method( 'verboseRun' )
+  ->with( 0 )
+  ->willReturn( null );
+
+$bench->bench( [
+  'test' => function () {}
+] );
+  }
+
+  public function noop() {}
+
+  public function testBenchName_method() {
+$bench = $this->getMockBuilder( Benchmarker::class )
+  ->setMethods( [ 'execute', 'output', 'addResult' ] )
+  ->getMock();
+$benchProxy = TestingAccessWrapper::newFromObject( $bench );
+$benchProxy->defaultCount = 1;
+
+$bench->expects( $this->once() )->method( 'addResult' )
+  ->with( $this->callback( function ( $res ) {
+return isset( $res['name'] ) && $res['name'] === __CLASS__ . 
'::noop()';
+  } ) );
+
+$bench->bench( [
+  [ 'function' => [ $this, 'noop' ] ]
+] );
+  }
+
+  public function testBenchName_string() {
+$bench = $this->getMockBuilder( Benchmarker::class )
+  ->setMethods( [ 'execute', 'output', 'addResult' ] )
+  ->getMock();
+$benchProxy = TestingAccessWrapper::newFromObject( $bench );
+$benchProxy->defaultCount = 1;
+
+$bench->expects( $this->once() )->method( 'addResult' )
+  ->with( $this->callback( function ( $res ) {
+return 'strtolower(A)';
+  } ) );
+
+$bench->bench( [ [
+  'function' => 'strtolower',
+  'args' => [ 'A' ],
+] ] );
+  }
+
+  /**
+   * @covers Benchmarker::verboseRun
+   */
+  public function testVerboseRun() {
+$bench = $this->getMockBuilder( Benchmarker::class )
+  ->setMethods( [ 'execute', 'output', 'hasOption', 'startBench', 
'addResult' ] )
+  ->getMock();
+$benchProxy = TestingAccessWrapper::newFromObject( $bench );
+$benchProxy->defaultCount = 1;
+
+$bench->expects( $this->exactly( 2 ) )->method( 'hasOption' )
+  ->will( $this->returnValueMap( [
+  [ 'verbose', true ],
+  [ 'count', false ],
+] ) );
+
+$bench->expects( $this->once() )->method( 'output' )
+  ->with( $this->callback( function ( $out ) {
+return preg_match( '/memory.+ peak/', $out ) === 1;
+  } ) );
+
+$bench->bench( [
+  'test' => function () {}
+] );
+  }
+}

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

Gerrit-MessageType: newchange

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: JavaScriptMinifier: Improve docs around parsing of regexp li...

2017-12-22 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399861 )

Change subject: JavaScriptMinifier: Improve docs around parsing of regexp 
literals
..

JavaScriptMinifier: Improve docs around parsing of regexp literals

Bug: T75556
Change-Id: Ifcb6bc21418dfc2e1d3e44dbd2497a0f5f691bf3
---
M includes/libs/JavaScriptMinifier.php
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/61/399861/1

diff --git a/includes/libs/JavaScriptMinifier.php 
b/includes/libs/JavaScriptMinifier.php
index a3bca10..eacaf4f 100644
--- a/includes/libs/JavaScriptMinifier.php
+++ b/includes/libs/JavaScriptMinifier.php
@@ -450,18 +450,24 @@
// We have to distinguish between regexp literals and 
division operators
// A division operator is only possible in certain 
states
} elseif( $ch === '/' && !isset( $divStates[$state] ) ) 
{
-   // Regexp literal, search to the end, skipping 
over backslash escapes and
-   // character classes
+   // Regexp literal
for( ; ; ) {
do{
+   // Skip until we find "/" (end 
of regexp), "\" (backslash escapes),
+   // or "[" (start of character 
classes).
$end += strcspn( $s, '/[\\', 
$end ) + 2;
+   // If backslash escape, keep 
searching...
} while( $end - 2 < $length && $s[$end 
- 2] === '\\' );
$end--;
+   // If the end, stop here.
if( $end - 1 >= $length || $s[$end - 1] 
=== '/' ) {
break;
}
+   // (Implicit else), we must've found 
the start of a char class,
+   // skip until we find "]" (end of char 
class), or "\" (backslash escape)
do{
$end += strcspn( $s, ']\\', 
$end ) + 2;
+   // If backslash escape, keep 
searching...
} while( $end - 2 < $length && $s[$end 
- 2] === '\\' );
$end--;
};

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: JavaScriptMinifier: Remove support for unused $statementsOnO...

2017-12-22 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399855 )

Change subject: JavaScriptMinifier: Remove support for unused 
$statementsOnOwnLine flag
..

JavaScriptMinifier: Remove support for unused $statementsOnOwnLine flag

The $wgResourceLoaderMinifierStatementsOnOwnLine config var was deprecated
in MediaWiki 1.27. The parameter of minify() was not used by other code, and
no new usage has been introduced since then, either.

Remove the feature from JavaScriptMinifier, and add a release note for that.
The same 1.31 release notes also contain a note already about the removal
of the configuration variable.

The feature was not covered by unit tests.

The following private variables have been removed, that are no longer used
due to this change: $newlineBefore, $newlineAfter, $newlineAdded.

Change-Id: I2cbf271156c1954abb982531d0125b4b9573b12c
---
M RELEASE-NOTES-1.31
M includes/libs/JavaScriptMinifier.php
2 files changed, 4 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/399855/1

diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31
index 67026f4..cd7d6c7 100644
--- a/RELEASE-NOTES-1.31
+++ b/RELEASE-NOTES-1.31
@@ -149,6 +149,8 @@
   * WatchedItem::IGNORE_USER_RIGHTS
   * WatchedItem::CHECK_USER_RIGHTS
   * WatchedItem::DEPRECATED_USAGE_TIMESTAMP
+* Support for the '$statementsOnOwnLine' parameter to 
JavaScriptMinifier::minify()
+  has been removed (deprecated in 1.27).
 
 == Compatibility ==
 MediaWiki 1.31 requires PHP 5.5.9 or later. There is experimental support for
diff --git a/includes/libs/JavaScriptMinifier.php 
b/includes/libs/JavaScriptMinifier.php
index 141a515..a3bca10 100644
--- a/includes/libs/JavaScriptMinifier.php
+++ b/includes/libs/JavaScriptMinifier.php
@@ -74,11 +74,11 @@
 *   or when required to guard against semicolon insertion.
 *
 * @param string $s JavaScript code to minify
-* @param bool $statementsOnOwnLine Whether to put each statement on 
its own line
+* @param bool $unused Deprecated (Used to be: Enable to put each 
statement on its own line)
 * @param int $maxLineLength Maximum length of a single line, or -1 for 
no maximum.
 * @return String Minified code
 */
-   public static function minify( $s, $statementsOnOwnLine = false, 
$maxLineLength = 1000 ) {
+   public static function minify( $s, $unused = false, $maxLineLength = 
1000 ) {
// First we declare a few tables that contain our parsing rules
 
// $opChars : characters, which can be combined without 
whitespace in between them
@@ -387,23 +387,6 @@
)
);
 
-   // Rules for when newlines should be inserted if
-   // $statementsOnOwnLine is enabled.
-   // $newlineBefore is checked before switching state,
-   // $newlineAfter is checked after
-   $newlineBefore = array(
-   self::STATEMENT => array(
-   self::TYPE_BRACE_CLOSE => true,
-   ),
-   );
-   $newlineAfter = array(
-   self::STATEMENT => array(
-   self::TYPE_BRACE_OPEN => true,
-   self::TYPE_PAREN_CLOSE => true,
-   self::TYPE_SEMICOLON => true,
-   ),
-   );
-
// $divStates : Contains all states that can be followed by a 
division operator
$divStates = array(
self::EXPRESSION_OP  => true,
@@ -580,15 +563,6 @@
$pos = $end;
$newlineFound = false;
 
-   // Output a newline after the token if required
-   // This is checked before AND after switching state
-   $newlineAdded = false;
-   if ( $statementsOnOwnLine && !$newlineAdded && isset( 
$newlineBefore[$state][$type] ) ) {
-   $out .= "\n";
-   $lineLength = 0;
-   $newlineAdded = true;
-   }
-
// Now that we have output our token, transition into 
the new state.
if( isset( $push[$state][$type] ) && count( $stack ) < 
self::STACK_LIMIT ) {
$stack[] = $push[$state][$type];
@@ -597,12 +571,6 @@
$state = array_pop( $stack );
} elseif( isset( $goto[$state][$type] ) ) {
$state = $goto[$state][$type];
-   }
-
-   // Check for newline insertion again
-   if ( $statementsOnOwnLine && !$newlineAdded && isset( 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Improve JavaScriptMinifier code coverage

2017-12-22 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399853 )

Change subject: resourceloader: Improve JavaScriptMinifier code coverage
..

resourceloader: Improve JavaScriptMinifier code coverage

Change-Id: I234b996cfec8ef48ce3dc48aabbdf88bc9439c15
---
M tests/phpunit/includes/libs/JavaScriptMinifierTest.php
1 file changed, 17 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/53/399853/1

diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php 
b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
index ca12f6c..12b2c04 100644
--- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
+++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
@@ -59,6 +59,20 @@
[ "0xFF.\nx;", "0xFF.x;" ],
[ "5.3.\nx;", "5.3.x;" ],
 
+   // Cover failure case for incomplete hex literal
+   [ "0x;", false, false ],
+
+   // Cover failure case for number with no digits after E
+   [ "1.4E", false, false ],
+
+   // Cover failure case for number with several E
+   [ "1.4EE2", false, false ],
+   [ "1.4EE", false, false ],
+
+   // Cover failure case for number with several E 
(nonconsecutive)
+   // FIXME: This is invalid, but currently tolerated
+   [ "1.4E2E3", "1.4E2 E3", false ],
+
// Semicolon insertion between an expression having an 
inline
// comment after it, and a statement on the next line 
(T29046).
[
@@ -138,6 +152,7 @@
[ "var a = 5.;", "var a=5.;" ],
[ "5.0.toString();", "5.0.toString();" ],
[ "5..toString();", "5..toString();" ],
+   // Cover failure case for too many decimal points
[ "5...toString();", false ],
[ "5.\n.toString();", '5..toString();' ],
 
@@ -153,8 +168,9 @@
/**
 * @dataProvider provideCases
 * @covers JavaScriptMinifier::minify
+* @covers JavaScriptMinifier::parseError
 */
-   public function testJavaScriptMinifierOutput( $code, $expectedOutput, 
$expectedValid = true ) {
+   public function testMinifyOutput( $code, $expectedOutput, 
$expectedValid = true ) {
$minified = JavaScriptMinifier::minify( $code );
 
// JSMin+'s parser will throw an exception if output is not 
valid JS.

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: build: Remove phplint --ignore-fails hack for symlink support

2017-12-14 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398408 )

Change subject: build: Remove phplint --ignore-fails hack for symlink support
..

build: Remove phplint --ignore-fails hack for symlink support

Follows-up 91689085c. Should not be needed anymore according
to T171510.

Change-Id: If1f54d17a0ee876ead4e1ae901114ffe021cf4f5
---
M composer.json
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/composer.json b/composer.json
index 330e526..4d776f6 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
"phpunit/phpunit": "4.8.36"
},
"scripts": {
-   "lint": "parallel-lint --exclude multiversion/vendor 
--ignore-fails .",
+   "lint": "parallel-lint --exclude multiversion/vendor .",
"phpcs": "phpcs -p -s",
"fix": "phpcbf",
"test": [

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.loader: Fix logError() not to print exceptions twice

2017-12-14 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398319 )

Change subject: mediawiki.loader: Fix logError() not to print exceptions twice
..

mediawiki.loader: Fix logError() not to print exceptions twice

Current behaviour results in:

Chrome 65 (initial)
> â–¶ [WARN] Error: foo Error: foo
>  at bar
>  at main

Chrome 65 (expanded)
> â–¼ [WARN] Error: foo Error: foo
>at bar
>at main
>  at logError
>  at main

Safari 11 (initial)
> â–¶ [WARN] Error: foo, Error: foo

Safari 11 (expanded)
> â–¼ [WARN] Error: foo is undefined
> * Error: foo is undefined
> at bar
> at main

Firefox 57
> [WARN] Error: foo | Error: foo
>   | Stacktrace:
>   |   bar
>   |   main

I don't recall why I did it this way, but it seems redundant.
This commit effectively removes the first "Error: foo"

Change-Id: Idc5dee34ce2b5068e3a2d8800e2b5f6b879525d1
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/398319/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 393ab4a..6a218e3 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -2755,7 +2755,7 @@
// If we have an exception object, log it to the 
warning channel to trigger
// proper stacktraces in browsers that support it.
if ( e && console.warn ) {
-   console.warn( String( e ), e );
+   console.warn( e );
}
}
/* eslint-enable no-console */

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.loader: Avoid jQuery for simple creation and selec...

2017-12-13 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398109 )

Change subject: mediawiki.loader: Avoid jQuery for simple creation and selection
..

mediawiki.loader: Avoid jQuery for simple creation and selection

Use document.createElement and document.head instead.

Change-Id: Ia0f981da34f9f8dbc328e46a44511b2573b4e1b8
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/398109/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 592fc9e..393ab4a 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -879,8 +879,10 @@
// Cache
marker = document.querySelector( 
'meta[name="ResourceLoaderDynamicStyles"]' );
if ( !marker ) {
-   mw.log( 'Create  dynamically' );
-   marker = $( '' ).attr( 
'name', 'ResourceLoaderDynamicStyles' ).appendTo( 'head' )[ 0 ];
+   mw.log( 'Created 
ResourceLoaderDynamicStyles marker dynamically' );
+   marker = 
document.createElement( 'meta' );
+   marker.name = 
'ResourceLoaderDynamicStyles';
+   document.head.appendChild( 
marker );
}
}
return marker;
@@ -2059,7 +2061,7 @@
l = 
document.createElement( 'link' );
l.rel = 
'stylesheet';
l.href = 
modules;
-   $( 'head' 
).append( l );
+   
document.head.appendChild( l );
return;
}
if ( type === 
'text/javascript' || type === undefined ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Use document.head instead of getElementsByTa...

2017-12-13 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398108 )

Change subject: resourceloader: Use document.head instead of 
getElementsByTagName
..

resourceloader: Use document.head instead of getElementsByTagName

Supported in all Grade A browsers. Also already being used
by jquery.js (without fallback), which we depend on.

Browser support (per MDN):
- Desktop: Chrome 4+, FF 4+, Edge, IE 9+, Opera 11+, Safari 5+
- Mobile: Android, Edge, FF Mobile 4+, IE Mobile 9+, Opera Mobile,
  Mobile Safari

(Those without numbers, have support since their initial release)

Change-Id: I2e9820de8463518a14a0d679d1f339c3a2f9dc66
---
M resources/src/mediawiki.legacy/wikibits.js
M resources/src/mediawiki/mediawiki.js
M resources/src/startup.js
3 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/08/398108/1

diff --git a/resources/src/mediawiki.legacy/wikibits.js 
b/resources/src/mediawiki.legacy/wikibits.js
index f5bdfd8..27d049e 100644
--- a/resources/src/mediawiki.legacy/wikibits.js
+++ b/resources/src/mediawiki.legacy/wikibits.js
@@ -49,7 +49,7 @@
loadedScripts[ url ] = true;
s = document.createElement( 'script' );
s.setAttribute( 'src', url );
-   document.getElementsByTagName( 'head' )[ 0 ].appendChild( s );
+   document.head.appendChild( s );
return s;
}
 
@@ -72,7 +72,7 @@
if ( media ) {
l.media = media;
}
-   document.getElementsByTagName( 'head' )[ 0 ].appendChild( l );
+   document.head.appendChild( l );
return l;
}
 
diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index a661ae5..592fc9e 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -902,7 +902,7 @@
if ( nextNode && nextNode.parentNode ) {
nextNode.parentNode.insertBefore( s, 
nextNode );
} else {
-   document.getElementsByTagName( 'head' 
)[ 0 ].appendChild( s );
+   document.head.appendChild( s );
}
 
return s;
diff --git a/resources/src/startup.js b/resources/src/startup.js
index b0c1578..8e8463d 100644
--- a/resources/src/startup.js
+++ b/resources/src/startup.js
@@ -162,5 +162,5 @@
// Callback
startUp();
};
-   document.getElementsByTagName( 'head' )[ 0 ].appendChild( script );
+   document.head.appendChild( script );
 }() );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] ImagePage: Create metadata table collapse button in PHP

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

Change subject: [WIP] ImagePage: Create metadata table collapse button in PHP
..

[WIP] ImagePage: Create metadata table collapse button in PHP

Currently broken because makeMetadataTable() is treated as wikitext
and  is not valid in wikitext.

Change-Id: I05c06bdd4428f0d71a3c154c28237ba0bd57cda7
---
M includes/page/ImagePage.php
M resources/src/mediawiki.action/mediawiki.action.view.filepage.css
M resources/src/mediawiki.action/mediawiki.action.view.metadata.css
M resources/src/mediawiki.action/mediawiki.action.view.metadata.js
4 files changed, 51 insertions(+), 28 deletions(-)


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

diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php
index 1dcdc65..46400c4 100644
--- a/includes/page/ImagePage.php
+++ b/includes/page/ImagePage.php
@@ -267,6 +267,20 @@
);
}
}
+   // Create button for metadata.js
+   $r .= Html::rawElement( 'tr',
+   [ 'class' => 'mw-metadata-show-hide-extended' ],
+   Html::rawElement( 'td',
+   [ 'colspan' => '2' ],
+   Html::element( 'a',
+   [
+   'role' => 'button',
+   'tabindex' => '0'
+   ],
+   $this->getContext()->msg( 
'metadata-expand' )
+   )
+   )
+   );
$r .= "\n\n";
return $r;
}
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.filepage.css 
b/resources/src/mediawiki.action/mediawiki.action.view.filepage.css
index b643d76..a49db48 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.filepage.css
+++ b/resources/src/mediawiki.action/mediawiki.action.view.filepage.css
@@ -113,7 +113,15 @@
 }
 
 .client-js .mw_metadata.collapsed .mw-metadata-collapsible,
+.client-nojs .mw-metadata-show-hide-extended,
 /* Keep tr.collapsible for back-compat with cached HTML */
 .client-js .mw_metadata.collapsed tr.collapsable {
display: none;
 }
+
+
+@media print {
+   .mw-metadata-show-hide-extended {
+   display: none;
+   }
+}
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.metadata.css 
b/resources/src/mediawiki.action/mediawiki.action.view.metadata.css
index f21b111..c93ff4b2 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.metadata.css
+++ b/resources/src/mediawiki.action/mediawiki.action.view.metadata.css
@@ -13,7 +13,7 @@
 }
 
 @media print {
-   .mw_metadata .mw-metadata-show-hide-extended {
+   .mw-metadata-show-hide-extended {
display: none;
}
 }
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.metadata.js 
b/resources/src/mediawiki.action/mediawiki.action.view.metadata.js
index ac927ae..4b0ab40 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.metadata.js
+++ b/resources/src/mediawiki.action/mediawiki.action.view.metadata.js
@@ -14,38 +14,39 @@
return;
}
$tables.each( function () {
-   var $link,
+   var $link = $table.find( 
'.mw-metadata-show-hide-extended a' ),
expandText = mw.msg( 'metadata-expand' ),
collapseText = mw.msg( 'metadata-collapse' ),
$table = $( this );
 
-   $link = $( '' )
-   .text( expandText )
-   .attr( {
-   role: 'button',
-   tabindex: 0
-   } )
-   .on( 'click keypress', function ( e ) {
-   if (
-   e.type === 'click' ||
-   e.type === 'keypress' 
&& e.which === 13
-   ) {
-   if ( $table.hasClass( 
'collapsed' ) ) {
-   // From 
collapsed to expanded. Button will now collapse.
-   $( this ).text( 
collapseText );
-   } else {
-   // From 
expanded to collapsed. Button will now expand.
-

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ImagePage: Clean up metadata.js collapsing

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

Change subject: ImagePage: Clean up metadata.js collapsing
..

ImagePage: Clean up metadata.js collapsing

In preparation for trying out a CSS-only approach for the initial
collapse that doesn't cause the expanded view to flash first.

Bug: T182047
Change-Id: I42941ccb05d5525599a0209f0f33db9fe836580b
---
M includes/page/ImagePage.php
M resources/src/mediawiki.action/mediawiki.action.view.metadata.css
M resources/src/mediawiki.action/mediawiki.action.view.metadata.js
3 files changed, 41 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/57/395157/1

diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php
index 67f9e09..c774eb5 100644
--- a/includes/page/ImagePage.php
+++ b/includes/page/ImagePage.php
@@ -257,7 +257,7 @@
$class = str_replace( ' ', '_', $v['id'] );
if ( $type == 'collapsed' ) {
// Handled by 
mediawiki.action.view.metadata module.
-   $class .= ' collapsable';
+   $class .= ' mw-metadata-collapsible';
}
$r .= Html::rawElement( 'tr',
[ 'class' => $class ],
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.metadata.css 
b/resources/src/mediawiki.action/mediawiki.action.view.metadata.css
index b07965e..35b0623 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.metadata.css
+++ b/resources/src/mediawiki.action/mediawiki.action.view.metadata.css
@@ -1,7 +1,9 @@
 /*!
  * Hide collapsable rows in a collapsed table.
  */
-table.collapsed tr.collapsable {
+
+ .mw_metadata.collapsed .mw-metadata-collapsible,
+ .mw_metadata.collapsed tr.collapsable {
display: none;
 }
 
@@ -9,14 +11,14 @@
  * Exclude user interface elements from selection.
  */
 .mw-metadata-show-hide-extended {
-   -moz-user-select: none;
-webkit-user-select: none;
+   -moz-user-select: none;
-ms-user-select: none;
user-select: none;
 }
 
 @media print {
-   tr.mw-metadata-show-hide-extended {
+   .mw_metadata .mw-metadata-show-hide-extended {
display: none;
}
 }
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.metadata.js 
b/resources/src/mediawiki.action/mediawiki.action.view.metadata.js
index 0d000c9..bae248b 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.metadata.js
+++ b/resources/src/mediawiki.action/mediawiki.action.view.metadata.js
@@ -8,42 +8,45 @@
  */
 ( function ( mw, $ ) {
$( function () {
-   var $row, $col, $link,
-   showText = mw.msg( 'metadata-expand' ),
-   hideText = mw.msg( 'metadata-collapse' ),
-   $table = $( '#mw_metadata' ),
-   $tbody = $table.find( 'tbody' );
-
-   if ( !$tbody.find( '.collapsable' ).length ) {
+   var $tables = $( '.mw_metadata' );
+   if ( !$tables.find( '.mw-metadata-collapsible, .collapsable' 
).length ) {
+   // No collapsible rows present on this page
return;
}
+   $tables.each( function () {
+   var $row, $col, $link,
+   expandText = mw.msg( 'metadata-expand' ),
+   collapseText = mw.msg( 'metadata-collapse' ),
+   $table = $( this );
 
-   $row = $( '' );
-   $col = $( '' );
+   $link = $( '' )
+   .text( expandText )
+   .attr( {
+   role: 'button',
+   tabindex: 0
+   } )
+   .on( 'click keypress', function ( e ) {
+   if (
+   e.type === 'click' ||
+   e.type === 'keypress' 
&& e.which === 13
+   ) {
+   if ( $table.hasClass( 
'collapsed' ) ) {
+   // From 
collapsed to expanded. Button will now collapse.
+   $( this ).text( 
collapseText );
+   } else {
+   // From 
expanded to collapsed. Button will now expand.
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ImagePage: Make metadata table's initial collapse CSS-only

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

Change subject: ImagePage: Make metadata table's initial collapse CSS-only
..

ImagePage: Make metadata table's initial collapse CSS-only

Make the initial collapse of the metadata table not depend on
JavaScript. This eliminates the FOUC, and will also reduce JS
footprint once compat can be removed.

* Move the 'display: none;' styles from metadata.css to
  filepage.css so that they are part of the base styles for
  file pages (metadata.css is only for supporting metadata.js,
  which is loaded dynamically).

* Apply "collapsed" class from the PHP side immediately,
  instead of calling "addClass" in JavaScript.

* Restrict hide-styles to only apply under .client-js to make
  sure the rows remain visible in no-js mode.

* Declare dependency between metadata.js and filepage.css.
  This is just for documentation purposes, as they are both
  already separately loaded on all file pages.

Change-Id: If22bf7acb47b59151dc3b0843a62507c100e548b
---
M includes/page/ImagePage.php
M resources/Resources.php
M resources/src/mediawiki.action/mediawiki.action.view.filepage.css
M resources/src/mediawiki.action/mediawiki.action.view.metadata.css
M resources/src/mediawiki.action/mediawiki.action.view.metadata.js
5 files changed, 15 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/58/395158/1

diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php
index c774eb5..1dcdc65 100644
--- a/includes/page/ImagePage.php
+++ b/includes/page/ImagePage.php
@@ -251,12 +251,13 @@
protected function makeMetadataTable( $metadata ) {
$r = "";
$r .= $this->getContext()->msg( 'metadata-help' )->plain();
-   $r .= "\n";
+   // Intial state is collapsed
+   // see filepage.css and mediawiki.action.view.metadata module.
+   $r .= "\n";
foreach ( $metadata as $type => $stuff ) {
foreach ( $stuff as $v ) {
$class = str_replace( ' ', '_', $v['id'] );
if ( $type == 'collapsed' ) {
-   // Handled by 
mediawiki.action.view.metadata module.
$class .= ' mw-metadata-collapsible';
}
$r .= Html::rawElement( 'tr',
diff --git a/resources/Resources.php b/resources/Resources.php
index 0e6939b..7d89f1c 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1498,6 +1498,7 @@
'metadata-expand',
'metadata-collapse',
],
+   'dependencies' => 'mediawiki.action.view.filepage',
],
'mediawiki.action.view.categoryPage.styles' => [
'styles' => 
'resources/src/mediawiki.action/mediawiki.action.view.categoryPage.less',
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.filepage.css 
b/resources/src/mediawiki.action/mediawiki.action.view.filepage.css
index d466216..b643d76 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.filepage.css
+++ b/resources/src/mediawiki.action/mediawiki.action.view.filepage.css
@@ -111,3 +111,9 @@
padding-left: 5px;
margin: 0;
 }
+
+.client-js .mw_metadata.collapsed .mw-metadata-collapsible,
+/* Keep tr.collapsible for back-compat with cached HTML */
+.client-js .mw_metadata.collapsed tr.collapsable {
+   display: none;
+}
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.metadata.css 
b/resources/src/mediawiki.action/mediawiki.action.view.metadata.css
index 35b0623..f21b111 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.metadata.css
+++ b/resources/src/mediawiki.action/mediawiki.action.view.metadata.css
@@ -1,11 +1,6 @@
 /*!
- * Hide collapsable rows in a collapsed table.
+ * Styles for metadata.js.
  */
-
- .mw_metadata.collapsed .mw-metadata-collapsible,
- .mw_metadata.collapsed tr.collapsable {
-   display: none;
-}
 
 /*
  * Exclude user interface elements from selection.
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.metadata.js 
b/resources/src/mediawiki.action/mediawiki.action.view.metadata.js
index bae248b..ac927ae 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.metadata.js
+++ b/resources/src/mediawiki.action/mediawiki.action.view.metadata.js
@@ -14,7 +14,7 @@
return;
}
$tables.each( function () {
-   var $row, $col, $link,
+   var $link,
expandText = mw.msg( 'metadata-expand' ),
collapseText = mw.msg( 'metadata-collapse' ),
$table = $( this );
@@ -48,7 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Re-apply "Revert "Set wgCommentTableSchemaMigrationStage = M...

2017-12-04 Thread Krinkle (Code Review)
Hello Urbanecm, Legoktm, jenkins-bot, Anomie, Zoranzoki21,

I'd like you to do a code review.  Please visit

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

to review the following change.


Change subject: Re-apply "Revert "Set wgCommentTableSchemaMigrationStage = 
MIGRATION_WRITE_BOTH on test wikis""
..

Re-apply "Revert "Set wgCommentTableSchemaMigrationStage = MIGRATION_WRITE_BOTH 
on test wikis""

This reverts commit cf4620dfc8c773d06fd81a411ffa04891b743409.

This re-applies I939b27c759c0ecd50b4ebd5c0358de9fb61f8b.

Change-Id: Id9d5c6c28b5598d0b12228c863561bd489a5b96b
---
M wmf-config/InitialiseSettings.php
1 file changed, 0 insertions(+), 3 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 4309626..83b85cb 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19764,9 +19764,6 @@
 
 'wgCommentTableSchemaMigrationStage' => [
'default' => MIGRATION_OLD,
-   'testwiki' => MIGRATION_WRITE_BOTH,
-   'test2wiki' => MIGRATION_WRITE_BOTH,
-   'testwikidatawiki' => MIGRATION_WRITE_BOTH,
 ],
 
 ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9d5c6c28b5598d0b12228c863561bd489a5b96b
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Urbanecm 
Gerrit-Reviewer: Zoranzoki21 
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]: Revert "Revert "Set wgCommentTableSchemaMigrationStage = MIG...

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

Change subject: Revert "Revert "Set wgCommentTableSchemaMigrationStage = 
MIGRATION_WRITE_BOTH on test wikis""
..


Revert "Revert "Set wgCommentTableSchemaMigrationStage = MIGRATION_WRITE_BOTH 
on test wikis""

Wasn't deployed.

This reverts commit fb074eaf56ee2523bb14cdf7090da6e34b053a51.

Change-Id: I71e9b0123b115d1496aeb21fdbf0b16373eecf24
---
M wmf-config/InitialiseSettings.php
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 83b85cb..4309626 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19764,6 +19764,9 @@
 
 'wgCommentTableSchemaMigrationStage' => [
'default' => MIGRATION_OLD,
+   'testwiki' => MIGRATION_WRITE_BOTH,
+   'test2wiki' => MIGRATION_WRITE_BOTH,
+   'testwikidatawiki' => MIGRATION_WRITE_BOTH,
 ],
 
 ];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I71e9b0123b115d1496aeb21fdbf0b16373eecf24
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Urbanecm 
Gerrit-Reviewer: Zoranzoki21 
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]: Revert "Revert "Set wgCommentTableSchemaMigrationStage = MIG...

2017-12-04 Thread Krinkle (Code Review)
Hello Urbanecm, Legoktm, jenkins-bot, Anomie, Zoranzoki21,

I'd like you to do a code review.  Please visit

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

to review the following change.


Change subject: Revert "Revert "Set wgCommentTableSchemaMigrationStage = 
MIGRATION_WRITE_BOTH on test wikis""
..

Revert "Revert "Set wgCommentTableSchemaMigrationStage = MIGRATION_WRITE_BOTH 
on test wikis""

Wasn't deployed.

This reverts commit fb074eaf56ee2523bb14cdf7090da6e34b053a51.

Change-Id: I71e9b0123b115d1496aeb21fdbf0b16373eecf24
---
M wmf-config/InitialiseSettings.php
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 83b85cb..4309626 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19764,6 +19764,9 @@
 
 'wgCommentTableSchemaMigrationStage' => [
'default' => MIGRATION_OLD,
+   'testwiki' => MIGRATION_WRITE_BOTH,
+   'test2wiki' => MIGRATION_WRITE_BOTH,
+   'testwikidatawiki' => MIGRATION_WRITE_BOTH,
 ],
 
 ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71e9b0123b115d1496aeb21fdbf0b16373eecf24
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Urbanecm 
Gerrit-Reviewer: Zoranzoki21 
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]: multiversion: Update docs for 'wfShellWikiCmd' hook

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

Change subject: multiversion: Update docs for 'wfShellWikiCmd' hook
..

multiversion: Update docs for 'wfShellWikiCmd' hook

This hook was already renamed from 'wfShellMaintenanceCmd' to
'wfShellWikiCmd' shortly after its creation in 2012.

Follows-up 770c9d8c2eda.

Update the code comments to ease future debugging.

Change-Id: Ia06ccce381a71178ddb8f2f3f1a6cfafa4e98f27
---
M multiversion/MWMultiVersion.php
M wmf-config/CommonSettings.php
2 files changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/multiversion/MWMultiVersion.php b/multiversion/MWMultiVersion.php
index 2b59447..395ef86 100644
--- a/multiversion/MWMultiVersion.php
+++ b/multiversion/MWMultiVersion.php
@@ -266,7 +266,8 @@
}
 
/**
-* Handler for the wfShellMaintenanceCmd hook.
+* Handler for the wfShellWikiCmd hook.
+*
 * This converts shell commands like "php $IP/maintenance/foo.php" into
 * commands that use the "MWScript.php" wrapper, for example:
 * "php /srv/mediawiki-staging/multiversion/MWScript.php 
maintenance/foo.php"
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index b529ac4..d806b58 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -258,7 +258,7 @@
 
 ini_set( 'memory_limit', $wmgMemoryLimit );
 
-# Rewrite commands given to wfShellWikiCmd() to use Het-Deploy
+# Change calls to wfShellWikiCmd() to use MWScript.php wrapper
 $wgHooks['wfShellWikiCmd'][] = 'MWMultiVersion::onWfShellMaintenanceCmd';
 
 setlocale( LC_ALL, 'en_US.UTF-8' );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove various redundant '@license' tags in file headers

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

Change subject: Remove various redundant '@license' tags in file headers
..

Remove various redundant '@license' tags in file headers

Redundant given this is the project-wide license already,
especially in file headers that already include the GPL license
header.

Based on feedback from Ie0cea0ef5027c7e5.

Change-Id: I7067abb7abee1f0c238cb2536e16192e946d8daa
---
M includes/changes/ChangesListBooleanFilter.php
M includes/changes/ChangesListFilter.php
M includes/changes/ChangesListFilterGroup.php
M includes/changes/ChangesListStringOptionsFilterGroup.php
M includes/libs/rdbms/connectionmanager/ConnectionManager.php
M includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
M includes/linkeddata/PageDataRequestHandler.php
M includes/linker/LinkRenderer.php
M includes/linker/LinkRendererFactory.php
M includes/linker/LinkTarget.php
M includes/specials/SpecialPageData.php
M includes/specials/formfields/Licenses.php
M includes/title/ForeignTitleFactory.php
M includes/title/ImportTitleFactory.php
M includes/title/MediaWikiTitleCodec.php
M includes/title/NaiveForeignTitleFactory.php
M includes/title/NaiveImportTitleFactory.php
M includes/title/NamespaceAwareForeignTitleFactory.php
M includes/title/NamespaceImportTitleFactory.php
M includes/title/SubpageImportTitleFactory.php
M includes/title/TitleFormatter.php
M includes/title/TitleParser.php
M includes/title/TitleValue.php
M tests/phpunit/includes/libs/http/HttpAcceptNegotiatorTest.php
M tests/phpunit/includes/libs/http/HttpAcceptParserTest.php
M tests/phpunit/includes/libs/rdbms/connectionmanager/ConnectionManagerTest.php
M 
tests/phpunit/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManagerTest.php
M tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php
M tests/phpunit/includes/specials/SpecialPageDataTest.php
M tests/phpunit/includes/title/NaiveImportTitleFactoryTest.php
M tests/phpunit/languages/LanguageCodeTest.php
31 files changed, 31 insertions(+), 47 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/74/395074/1

diff --git a/includes/changes/ChangesListBooleanFilter.php 
b/includes/changes/ChangesListBooleanFilter.php
index 2a7ba88..f37ed2d 100644
--- a/includes/changes/ChangesListBooleanFilter.php
+++ b/includes/changes/ChangesListBooleanFilter.php
@@ -18,14 +18,13 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @license GPL 2+
  * @author Matthew Flaschen
  */
 
 use Wikimedia\Rdbms\IDatabase;
 
 /**
- * An individual filter in a boolean group
+ * Represents a hide-based boolean filter (used on ChangesListSpecialPage and 
descendants)
  *
  * @since 1.29
  */
diff --git a/includes/changes/ChangesListFilter.php 
b/includes/changes/ChangesListFilter.php
index 2546f2b..17a94c5 100644
--- a/includes/changes/ChangesListFilter.php
+++ b/includes/changes/ChangesListFilter.php
@@ -18,7 +18,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @license GPL 2+
  * @author Matthew Flaschen
  */
 
diff --git a/includes/changes/ChangesListFilterGroup.php 
b/includes/changes/ChangesListFilterGroup.php
index 48c6e84..facc41b 100644
--- a/includes/changes/ChangesListFilterGroup.php
+++ b/includes/changes/ChangesListFilterGroup.php
@@ -18,7 +18,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @license GPL 2+
  * @author Matthew Flaschen
  */
 
diff --git a/includes/changes/ChangesListStringOptionsFilterGroup.php 
b/includes/changes/ChangesListStringOptionsFilterGroup.php
index 775fd76..d801d59 100644
--- a/includes/changes/ChangesListStringOptionsFilterGroup.php
+++ b/includes/changes/ChangesListStringOptionsFilterGroup.php
@@ -18,7 +18,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @license GPL 2+
  * @author Matthew Flaschen
  */
 
diff --git a/includes/libs/rdbms/connectionmanager/ConnectionManager.php 
b/includes/libs/rdbms/connectionmanager/ConnectionManager.php
index 212ff31..4099188 100644
--- a/includes/libs/rdbms/connectionmanager/ConnectionManager.php
+++ b/includes/libs/rdbms/connectionmanager/ConnectionManager.php
@@ -10,8 +10,6 @@
  * This manages access to master and replica databases.
  *
  * @since 1.29
- *
- * @license GPL-2.0+
  * @author Addshore
  */
 class ConnectionManager {
diff --git 
a/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php 
b/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
index 30b1fb4..3ca6b38 100644
--- 
a/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
+++ 
b/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php
@@ -20,7 +20,6 @@
  *
  * @since 1.29
  *
- * @license GPL-2.0+
  * @author Daniel Kinzler
  * @author Addshore
  */
diff --git a/includes/linkeddata/PageDataRequestHandler.php 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [DNM] Fun with PHP - https://3v4l.org/Gv3QB

2017-12-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394732 )

Change subject: [DNM] Fun with PHP - https://3v4l.org/Gv3QB
..

[DNM] Fun with PHP - https://3v4l.org/Gv3QB

Change-Id: I40bae7c35c8225c8473955d8cffda462602aa48d
---
M tests/common/TestSetup.php
M tests/phpunit/includes/jobqueue/JobTest.php
M tests/phpunit/phpunit.php
3 files changed, 2 insertions(+), 338 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/394732/1

diff --git a/tests/common/TestSetup.php b/tests/common/TestSetup.php
index 3733e60..098a63f54 100644
--- a/tests/common/TestSetup.php
+++ b/tests/common/TestSetup.php
@@ -1,113 +1,10 @@
  [ 'class' => 'JobQueueMemory', 'order' => 
'fifo' ],
-   ];
-
-   $wgUseDatabaseMessages = false; # Set for future resets
-
-   // Assume UTC for testing purposes
-   $wgLocaltimezone = 'UTC';
-
-   $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
-
-   // Do not bother updating search tables
-   $wgSearchType = 'SearchEngineDummy';
-
-   // Generic MediaWiki\Session\SessionManager configuration for 
tests
-   // We use CookieSessionProvider because things might be 
expecting
-   // cookies to show up in a FauxRequest somewhere.
-   $wgSessionProviders = [
-   [
-   'class' => 
MediaWiki\Session\CookieSessionProvider::class,
-   'args' => [ [
-   'priority' => 30,
-   'callUserSetCookiesHook' => true,
-   ] ],
-   ],
-   ];
-
-   // Single-iteration PBKDF2 session secret derivation, for speed.
-   $wgSessionPbkdf2Iterations = 1;
-
-   // Generic AuthManager configuration for testing
-   $wgAuthManagerConfig = [
-   'preauth' => [],
-   'primaryauth' => [
-   [
-   'class' => 
MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider::class,
-   'args' => [ [
-   'authoritative' => false,
-   ] ],
-   ],
-   [
-   'class' => 
MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider::class,
-   'args' => [ [
-   'authoritative' => true,
-   ] ],
-   ],
-   ],
-   'secondaryauth' => [],
-   ];
-   $wgAuth = new MediaWiki\Auth\AuthManagerAuthPlugin();
-
-   // T46192 Do not attempt to send a real e-mail
-   Hooks::clear( 'AlternateUserMailer' );
-   Hooks::register(
-   'AlternateUserMailer',
-   function () {
-   return false;
-   }
-   );
-   // xdebug's default of 100 is too low for MediaWiki
-   ini_set( 'xdebug.max_nesting_level', 1000 );
-
// Bug T116683 serialize_precision of 100
// may break testing against floating point values
// treated with PHP's serialize()
ini_set( 'serialize_precision', 17 );
-
-   // TODO: we should call MediaWikiTestCase::prepareServices( new 
GlobalVarConfig() ) here.
-   // But PHPUnit may not be loaded yet, so we have to wait until 
just
-   // before PHPUnit_TextUI_Command::main() is executed.
}
-
 }
diff --git a/tests/phpunit/includes/jobqueue/JobTest.php 
b/tests/phpunit/includes/jobqueue/JobTest.php
index 6723a0b..eccf237 100644
--- a/tests/phpunit/includes/jobqueue/JobTest.php
+++ b/tests/phpunit/includes/jobqueue/JobTest.php
@@ -6,89 +6,9 @@
 class JobTest extends MediaWikiTestCase {
 
/**
-* @dataProvider provideTestToString
-*
-* @param Job $job
-* @param string $expected
-*
 * @covers Job::toString
 */
-   public function testToString( $job, $expected ) {
-   $this->assertEquals( $expected, $job->toString() );
-   }
-
-   public function provideTestToString() {
-   $mockToStringObj = $this->getMockBuilder( 'stdClass' )
-   ->setMethods( [ '__toString' ] )->getMock();
-   $mockToStringObj->expects( $this->any() )
-   ->method( '__toString' )
-   ->will( $this->returnValue( '{STRING_OBJ_VAL}' 

[MediaWiki-commits] [Gerrit] labs...guc[master]: Add tests for App::getDB()

2017-12-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394705 )

Change subject: Add tests for App::getDB()
..

Add tests for App::getDB()

Change-Id: I49bd2762b070d8641d8a7c7faf139a823d2d0421
---
M src/App.php
A tests/AppTest.php
2 files changed, 60 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/guc 
refs/changes/05/394705/1

diff --git a/src/App.php b/src/App.php
index 9fa292b..ec1d471 100644
--- a/src/App.php
+++ b/src/App.php
@@ -24,7 +24,7 @@
  * @param string $host
  * @return PDO
  */
-private function openDB($dbname, $host) {
+protected function openDB($dbname, $host) {
 $this->aTP('Create connection to ' . $host);
 
 try {
diff --git a/tests/AppTest.php b/tests/AppTest.php
new file mode 100644
index 000..d725787
--- /dev/null
+++ b/tests/AppTest.php
@@ -0,0 +1,59 @@
+getMockBuilder(App::class)
+->setMethods(['openDB'])
+->getMock();
+
+$pdo = $this->createMock(PDO::class);
+$pdo->expects($this->once())->method('prepare')
+->with('USE `testwiki_p`;')
+->willReturn($this->createMock(PDOStatement::class));
+
+$app->expects($this->once())->method('openDB')
+->with('testwiki_p', 'eg1.web.db.svc.eqiad.wmflabs')
+->willReturn($pdo);
+
+$this->assertInstanceOf(
+PDO::class,
+$app->getDB('testwiki', 'eg1')
+);
+}
+
+public function testGetDBCached() {
+$app = $this->getMockBuilder(App::class)
+->setMethods(['openDB'])
+->getMock();
+$pdo = $this->createMock(PDO::class);
+
$pdo->method('prepare')->willReturn($this->createMock(PDOStatement::class));
+
+$app->expects($this->exactly(2))->method('openDB')
+->withConsecutive(
+['testwiki_p', 'eg1.web.db.svc.eqiad.wmflabs'],
+['otherwiki_p', 'eg2.web.db.svc.eqiad.wmflabs']
+)
+->willReturn($pdo);
+
+$this->assertInstanceOf(
+PDO::class,
+$app->getDB('testwiki', 'eg1'),
+'First on eg1'
+);
+
+$this->assertInstanceOf(
+PDO::class,
+$app->getDB('otherwiki', 'eg1'),
+'Second on eg1'
+);
+
+$this->assertInstanceOf(
+PDO::class,
+$app->getDB('otherwiki', 'eg2'),
+'First on eg2'
+);
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49bd2762b070d8641d8a7c7faf139a823d2d0421
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: build: Add PHP 7.1 to Travis CI test matrix

2017-12-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394666 )

Change subject: build: Add PHP 7.1 to Travis CI test matrix
..

build: Add PHP 7.1 to Travis CI test matrix

Looks like we've got at least one test failure at the moment
(being fixed in Ibb1a59e373740772). Let's use Travis CI to also
check if there are other failures behind it.

Change-Id: Iec9857ee04b4811e912f2f43aed1e5a9fce0a2c4
---
M .travis.yml
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/394666/1

diff --git a/.travis.yml b/.travis.yml
index cde7193..78a2b7d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,6 +33,8 @@
   php: hhvm-3.18
 - env: dbtype=mysql dbuser=root
   php: 7
+- env: dbtype=mysql dbuser=root
+  php: 7.1
 
 services:
   - mysql

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: objectcache: Fix HashBagOStuffTest test in PHP 7.1

2017-12-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394665 )

Change subject: objectcache: Fix HashBagOStuffTest test in PHP 7.1
..

objectcache: Fix HashBagOStuffTest test in PHP 7.1

> There was 1 error:
>
> 1) HashBagOStuffTest::testEvictionAdd
> A non-numeric value encountered
>
> tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php:106

This warning is new in PHP 7.1, however the behaviour is not new.
This code was already not behaving as it should have. Concatenation
preceeds addition/multiplication. As such, this was producing
(int)-10 each time instead of (str)"key0" through (str)"key10".

Change-Id: Ibb1a59e373740772f02dfec77ee7ebd9d181d852
---
M tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/394665/1

diff --git a/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php 
b/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php
index b2278c3..53d27c0 100644
--- a/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php
+++ b/tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php
@@ -103,7 +103,7 @@
for ( $i = 10; $i < 20; $i++ ) {
$cache->set( "key$i", 1 );
$this->assertEquals( 1, $cache->get( "key$i" ) );
-   $this->assertEquals( false, $cache->get( "key" . $i - 
10 ) );
+   $this->assertEquals( false, $cache->get( "key" . ( $i - 
10 ) ) );
}
}
 

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

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

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


[MediaWiki-commits] [Gerrit] labs...guc[master]: build: Update to PHPUnit 5

2017-12-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394661 )

Change subject: build: Update to PHPUnit 5
..

build: Update to PHPUnit 5

Bug: T181852
Change-Id: I5134c4fe4c3398e5e0463472601e813ed975cded
---
M composer.json
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/guc 
refs/changes/61/394661/1

diff --git a/composer.json b/composer.json
index 574aa02..0f332c3 100644
--- a/composer.json
+++ b/composer.json
@@ -9,14 +9,14 @@
"optimize-autoloader": true
},
"require": {
-   "php": ">=5.4",
+   "php": ">=5.6",
"Krinkle/toollabs-base": "^0.8.1",
"krinkle/intuition": "^0.5.2"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9.2",
-   "squizlabs/php_codesniffer": "^2.7.1",
-   "phpunit/phpunit": "4.8.*"
+   "squizlabs/php_codesniffer": "^2.9.1",
+   "phpunit/phpunit": "^5.7.24"
},
"scripts": {
"test": [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5134c4fe4c3398e5e0463472601e813ed975cded
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Switch tools/guc jobs from php55 to php56

2017-12-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394655 )

Change subject: Switch tools/guc jobs from php55 to php56
..

Switch tools/guc jobs from php55 to php56

Looks like a base image variant exists for php56-jessie, but
the composer job doesn't yet have a variant for it, so creating
that at the same time.

Bug: T181852
Change-Id: Idc05baaf391a8adaa5589002fc2514125132da99
---
M jjb/php.yaml
M zuul/layout.yaml
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/55/394655/1

diff --git a/jjb/php.yaml b/jjb/php.yaml
index f4030c8..055f30c 100644
--- a/jjb/php.yaml
+++ b/jjb/php.yaml
@@ -177,6 +177,8 @@
 phpflavor:
 - php55:
 image: jessie
+- php56:
+image: jessie
 - php70:
 image: jessie
 - hhvm:
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index df51f7a..f71ad36 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -1749,9 +1749,9 @@
 
   - name: labs/tools/guc
 test:
-  - composer-php55-jessie
+  - composer-php56-jessie
 gate-and-submit:
-  - composer-php55-jessie
+  - composer-php56-jessie
 
   - name: labs/tools/Luke081515IRCBot
 test:

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

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

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


[MediaWiki-commits] [Gerrit] labs...guc[master]: Switch to `*.web.db.svc.eqiad.wmflabs`

2017-12-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394651 )

Change subject: Switch to `*.web.db.svc.eqiad.wmflabs`
..

Switch to `*.web.db.svc.eqiad.wmflabs`

Bug: T176686
Change-Id: I2631422949cd8af2cdf56208d576898e28a0eb87
---
M api.php
M src/App.php
2 files changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/guc 
refs/changes/51/394651/1

diff --git a/api.php b/api.php
index 2da5f12..76eb419 100644
--- a/api.php
+++ b/api.php
@@ -54,7 +54,12 @@
 );
 if ($metaRows) {
 foreach ($metaRows as $row) {
-$host = $row['slice'];
+// FIXME: Workaround https://phabricator.wikimedia.org/T176686
+$host = preg_replace(
+'/\.labsdb$/',
+'.web.db.svc.eqiad.wmflabs',
+$row['slice']
+);
 list($shard) = explode('.', $host);
 $res = \LabsDB::query(
 \LabsDB::getConnection($host, 'heartbeat'),
diff --git a/src/App.php b/src/App.php
index 7dd04c2..9fa292b 100644
--- a/src/App.php
+++ b/src/App.php
@@ -55,6 +55,13 @@
 $host = $cluster;
 }
 
+// FIXME: Workaround https://phabricator.wikimedia.org/T176686
+$host = preg_replace(
+'/\.labsdb$/',
+'.web.db.svc.eqiad.wmflabs',
+$host
+);
+
 $dbname = "{$database}_p";
 
 // Reuse existing connection if possible

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2631422949cd8af2cdf56208d576898e28a0eb87
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] labs...guc[master]: Fix-up typo from 9f2c515

2017-12-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394645 )

Change subject: Fix-up typo from 9f2c515
..

Fix-up typo from 9f2c515

Change-Id: I6a14d52bee225a80b4f6afc3b1947baba09771de
---
M src/App.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/guc 
refs/changes/45/394645/1

diff --git a/src/App.php b/src/App.php
index 1cfdeec..7dd04c2 100644
--- a/src/App.php
+++ b/src/App.php
@@ -58,12 +58,12 @@
 $dbname = "{$database}_p";
 
 // Reuse existing connection if possible
-if (!isset($this->clusters[$cluster])) {
-$this->clusters[$cluster] = $this->openDB($dbname, $cluster);
+if (!isset($this->clusters[$host])) {
+$this->clusters[$host] = $this->openDB($dbname, $host);
 }
-$pdo = $this->clusters[$cluster];
+$pdo = $this->clusters[$host];
 
-// Select the right database on this cluster server
+// Select the right database on this host
 $m = $pdo->prepare('USE `' . $dbname . '`;');
 $m->execute();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a14d52bee225a80b4f6afc3b1947baba09771de
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] labs...guc[master]: Improve re-use of connections between getDB()/openDB()

2017-12-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394644 )

Change subject: Improve re-use of connections between getDB()/openDB()
..

Improve re-use of connections between getDB()/openDB()

Current debug output:

> +0s: Create connection to s1
> +0.11s: Query all wikis for matching revisions
> +0s: Create connection to s3.labsdb
> +0.05s: Create connection to s2.labsdb
> +0.06s: Create connection to s1.labsdb

's1' and 's1.labsdb' did not result in re-use because the
normalisation happened inside openDB, but caching in getDB
on the non-canonical value.

Change-Id: Iecda557e8dfd45b4a76b7e32213ce024a28fc06a
---
M src/App.php
1 file changed, 20 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/guc 
refs/changes/44/394644/1

diff --git a/src/App.php b/src/App.php
index 48acec9..1cfdeec 100644
--- a/src/App.php
+++ b/src/App.php
@@ -20,54 +20,51 @@
 /**
  * Open a connection to the database.
  *
- * @param string $database
- * @param int|string $cluster
+ * @param string $dbname
+ * @param string $host
  * @return PDO
  */
-private function openDB($database = 'wikidatawiki', $cluster = null) {
-$dbname = "{$database}_p";
-
-if (is_string($cluster)) {
-if (strpos($cluster, '.') === false) {
-// Default suffix
-$host = "{$cluster}.labsdb";
-} else {
-$host = $cluster;
-}
-} else {
-$host = "{$database}.labsdb";
-}
-
-$this->aTP('Create connection to ' . $cluster);
+private function openDB($dbname, $host) {
+$this->aTP('Create connection to ' . $host);
 
 try {
-// Establish connection
+// Establish a connection
 $pdo = new PDO('mysql:host='.$host.';dbname='.$dbname.';', 
Settings::getSetting('user'), Settings::getSetting('password'));
 } catch (PDOException $e) {
-throw new Exception('Database error: Unable to connect to '.  
$dbname);
+throw new Exception('Database error: Unable to connect to '.  
$host);
 }
+
 return $pdo;
 }
 
 /**
- * Gibt die Verbindung zu einem Wiki zurück (cache)
+ * Get a connection to a database (cached)
  *
  * @param string $database
  * @param string $cluster
  * @return PDO
  */
 public function getDB($database = 'meta', $cluster = 's1') {
-if (!$cluster) {
+if (!is_string($cluster)) {
 throw new Exception('Invalid DB cluster specification');
 }
+if (strpos($cluster, '.') === false) {
+// Default suffix
+$host = "{$cluster}.labsdb";
+} else {
+$host = $cluster;
+}
+
+$dbname = "{$database}_p";
+
 // Reuse existing connection if possible
 if (!isset($this->clusters[$cluster])) {
-$this->clusters[$cluster] = $this->openDB($database, $cluster);
+$this->clusters[$cluster] = $this->openDB($dbname, $cluster);
 }
 $pdo = $this->clusters[$cluster];
 
 // Select the right database on this cluster server
-$m = $pdo->prepare('USE `'.$database.'_p`;');
+$m = $pdo->prepare('USE `' . $dbname . '`;');
 $m->execute();
 
 return $pdo;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iecda557e8dfd45b4a76b7e32213ce024a28fc06a
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Update "Other patches" to hide if already reviewed by MW or ...

2017-11-30 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394511 )

Change subject: Update "Other patches" to hide if already reviewed by MW or WMF 
groups
..

Update "Other patches" to hide if already reviewed by MW or WMF groups

Because they're also authorised to review in mediawiki/core.

This means we still don't hide patches if they've already been
reviewed by guest accounts or accounts with rights elsewhere,
but also don't show all patches unless one of us has reviewed them.

Also update limits a bit.

Change-Id: Ib49ffecabbed7ba31aa25cefddc6de3437146528
---
M custom
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance refs/changes/11/394511/1

diff --git a/custom b/custom
index 1e167f6..4e767bb 100644
--- a/custom
+++ b/custom
@@ -4,10 +4,10 @@
 [section "Our patches awaiting review"]
   query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "Other patches in subscribed areas"]
-  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 -label:Code-Review<0,group=performance 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
+  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 -label:Code-Review<0,group=performance 
-label:Code-Review<0,group=mediawiki -label:Code-Review<0,group=wmf-deployment 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:15
 [section "My patches awaiting review"]
   query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "My other patches"]
   query = is:open ownerin:performance owner:self (message:WIP OR message:DNM 
OR label:Verified<0 OR label:Code-Review<0) limit:40
 [section "Recently merged"]
-  query = is:merged ownerin:performance limit:30
+  query = is:merged ownerin:performance limit:15

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib49ffecabbed7ba31aa25cefddc6de3437146528
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Update "Other patches" to hide if already reviewed by MW or ...

2017-11-30 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394511 )

Change subject: Update "Other patches" to hide if already reviewed by MW or WMF 
groups
..


Update "Other patches" to hide if already reviewed by MW or WMF groups

Because they're also authorised to review in mediawiki/core.

This means we still don't hide patches if they've already been
reviewed by guest accounts or accounts with rights elsewhere,
but also don't show all patches unless one of us has reviewed them.

Also update limits a bit.

Change-Id: Ib49ffecabbed7ba31aa25cefddc6de3437146528
---
M custom
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/custom b/custom
index 1e167f6..4e767bb 100644
--- a/custom
+++ b/custom
@@ -4,10 +4,10 @@
 [section "Our patches awaiting review"]
   query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "Other patches in subscribed areas"]
-  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 -label:Code-Review<0,group=performance 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
+  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 -label:Code-Review<0,group=performance 
-label:Code-Review<0,group=mediawiki -label:Code-Review<0,group=wmf-deployment 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:15
 [section "My patches awaiting review"]
   query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "My other patches"]
   query = is:open ownerin:performance owner:self (message:WIP OR message:DNM 
OR label:Verified<0 OR label:Code-Review<0) limit:40
 [section "Recently merged"]
-  query = is:merged ownerin:performance limit:30
+  query = is:merged ownerin:performance limit:15

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib49ffecabbed7ba31aa25cefddc6de3437146528
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: objectcache: Add @ingroup to RedisBagOStuff

2017-11-30 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394505 )

Change subject: objectcache: Add @ingroup to RedisBagOStuff
..

objectcache: Add @ingroup to RedisBagOStuff

Was missing from "Cache" group, as well as from the cross-component
"Redis" group.

Change-Id: I52ebc93cf472a4acc383742e0ea5c15c5a6db537
---
M includes/libs/objectcache/RedisBagOStuff.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/394505/1

diff --git a/includes/libs/objectcache/RedisBagOStuff.php 
b/includes/libs/objectcache/RedisBagOStuff.php
index 583ec37..f720010 100644
--- a/includes/libs/objectcache/RedisBagOStuff.php
+++ b/includes/libs/objectcache/RedisBagOStuff.php
@@ -23,7 +23,10 @@
 /**
  * Redis-based caching module for redis server >= 2.6.12
  *
- * @note: avoid use of Redis::MULTI transactions for twemproxy support
+ * @note Avoid use of Redis::MULTI transactions for twemproxy support
+ *
+ * @ingroup Cache
+ * @ingroup Redis
  */
 class RedisBagOStuff extends BagOStuff {
/** @var RedisConnectionPool */

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove @defgroup from DefaultSettings.php

2017-11-30 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394502 )

Change subject: Remove @defgroup from DefaultSettings.php
..

Remove @defgroup from DefaultSettings.php

This renders in Doxygen as a blank page in the "Modules" sidebar,
doesn't seem to serve any purpose.

No mentions of "Globalsettings" or "Global settings" elsewhere
in the repository.

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


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

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 21efb28..c17bf7e 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -39,10 +39,6 @@
  */
 
 /**
- * @defgroup Globalsettings Global settings
- */
-
-/**
  * @cond file_level_code
  * This is not a valid entry point, perform no further processing unless
  * MEDIAWIKI is defined

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Remove deprecated minifier config vars

2017-11-30 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394497 )

Change subject: resourceloader: Remove deprecated minifier config vars
..

resourceloader: Remove deprecated minifier config vars

Unused, their values have been hard-coded since 1.27.
No uses anywhere in Wikimedia Git, besides their definition
in this file.

Change-Id: I6689274d0ad028e2c468560816ab753b345048e9
---
M RELEASE-NOTES-1.31
M includes/DefaultSettings.php
2 files changed, 2 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/394497/1

diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31
index b32e3e7..4b55f4b 100644
--- a/RELEASE-NOTES-1.31
+++ b/RELEASE-NOTES-1.31
@@ -17,6 +17,8 @@
   not have the right to mark things patrolled.
 * Wikis that contain imported revisions or CentralAuth global blocks should run
   maintenance/cleanupUsersWithNoId.php.
+* $wgResourceLoaderMinifierStatementsOnOwnLine and 
$wgResourceLoaderMinifierMaxLineLength
+  were removed (deprecated since 1.27).
 
 === New features in 1.31 ===
 * Wikimedia\Rdbms\IDatabase->select() and similar methods now support
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index cc9622e..21efb28 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3686,23 +3686,6 @@
 $wgResourceLoaderDebug = false;
 
 /**
- * Put each statement on its own line when minifying JavaScript. This makes
- * debugging in non-debug mode a bit easier.
- *
- * @deprecated since 1.27: Always false; no longer configurable.
- */
-$wgResourceLoaderMinifierStatementsOnOwnLine = false;
-
-/**
- * Maximum line length when minifying JavaScript. This is not a hard maximum:
- * the minifier will try not to produce lines longer than this, but may be
- * forced to do so in certain cases.
- *
- * @deprecated since 1.27: Always 1,000; no longer configurable.
- */
-$wgResourceLoaderMinifierMaxLineLength = 1000;
-
-/**
  * Whether to ensure the mediawiki.legacy library is loaded before other 
modules.
  *
  * @deprecated since 1.26: Always declare dependencies.

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...NavigationTiming[master]: Factor out getRandom() and inSample()

2017-11-30 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394441 )

Change subject: Factor out getRandom() and inSample()
..

Factor out getRandom() and inSample()

* Centralise the Math.floor() logic and add tests for it.
* Make getRandom() easier to change.
* Document why we duplicated mw.eventLog.inSample().
* Remove use of needless jQuery isNumeric overhead in favour
  of a stricter type check.

Partially extracted from I0908bad313a8566c.

Change-Id: I5a3170b9dd762801c87f7dd9a72e7596da11ba0d
---
M modules/ext.navigationTiming.js
M tests/ext.navigationTiming.test.js
2 files changed, 51 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NavigationTiming 
refs/changes/41/394441/1

diff --git a/modules/ext.navigationTiming.js b/modules/ext.navigationTiming.js
index 84aa956..ca84954 100644
--- a/modules/ext.navigationTiming.js
+++ b/modules/ext.navigationTiming.js
@@ -13,12 +13,29 @@
visibilityChanged = false,
TYPE_NAVIGATE = 0;
 
-   function inSample() {
-   var factor = mw.config.get( 'wgNavigationTimingSamplingFactor' 
);
-   if ( !$.isNumeric( factor ) || factor < 1 ) {
+   /**
+* Get random number between 0 (inclusive) and 1 (exclusive).
+*
+* @return {number}
+*/
+   function getRandom() {
+   return Math.random();
+   }
+
+   /**
+* Determine result of random sampling.
+*
+* Based on ext.eventLogging.subscriber's mw.eventLog.inSample
+* Duplicated here because we need it without/before dependencies.
+*
+* @param {number} factor One in how many should be included. 
(0=nobody, 1=all, 2=50%)
+* @return {boolean}
+*/
+   function inSample( factor ) {
+   if ( typeof factor !== 'number' || factor < 1 ) {
return false;
}
-   return Math.floor( Math.random() * factor ) === 0;
+   return Math.floor( getRandom() * factor ) === 0;
}
 
function getDevicePixelRatio() {
@@ -251,14 +268,13 @@
}
 
function inAsiaSample() {
-   var factor,
-   // From 
https://dev.maxmind.com/geoip/legacy/codes/country_continent/
-   asianCountries = [ 'AE', 'AF', 'AM', 'AP', 'AZ', 'BD', 
'BH', 'BN',
-   'BT', 'CC', 'CN', 'CX', 'CY', 'GE', 'HK', 'ID', 
'IL', 'IN', 'IO',
-   'IQ', 'IR', 'JO', 'JP', 'KG', 'KH', 'KP', 'KR', 
'KW', 'KZ', 'LA',
-   'LB', 'LK', 'MM', 'MN', 'MO', 'MV', 'MY', 'NP', 
'OM', 'PH', 'PK',
-   'PS', 'QA', 'SA', 'SG', 'SY', 'TH', 'TJ', 'TL', 
'TM', 'TW', 'UZ',
-   'VN', 'YE' ];
+   // From 
https://dev.maxmind.com/geoip/legacy/codes/country_continent/
+   var asianCountries = [ 'AE', 'AF', 'AM', 'AP', 'AZ', 'BD', 
'BH', 'BN',
+   'BT', 'CC', 'CN', 'CX', 'CY', 'GE', 'HK', 'ID', 'IL', 
'IN', 'IO',
+   'IQ', 'IR', 'JO', 'JP', 'KG', 'KH', 'KP', 'KR', 'KW', 
'KZ', 'LA',
+   'LB', 'LK', 'MM', 'MN', 'MO', 'MV', 'MY', 'NP', 'OM', 
'PH', 'PK',
+   'PS', 'QA', 'SA', 'SG', 'SY', 'TH', 'TJ', 'TL', 'TM', 
'TW', 'UZ',
+   'VN', 'YE' ];
 
// Only regular page views, ignore any non-compliant data
if ( !navigation || navigation.type !== TYPE_NAVIGATE || 
!isCompliant() ) {
@@ -277,12 +293,7 @@
 
// Sampled (unlike main sampling factor, this is applied within 
and
// after the above filters).
-   factor = mw.config.get( 
'wgNavigationTimingFirstPaintAsiaSamplingFactor' );
-   if ( !$.isNumeric( factor ) || factor < 1 ) {
-   return false;
-   }
-
-   return Math.floor( Math.random() * factor ) === 0;
+   return inSample( mw.config.get( 
'wgNavigationTimingFirstPaintAsiaSamplingFactor' ) );
}
 
function emitAsiaFirstPaint() {
@@ -358,7 +369,7 @@
// Only load EventLogging when page load is in the sampling
// Use a conditional block instead of early return since module.exports
// must happen unconditionally for unit tests.
-   isInSample = inSample();
+   isInSample = inSample( mw.config.get( 
'wgNavigationTimingSamplingFactor', 0 ) );
if ( isInSample ) {
// Preload EventLogging and schema modules
loadEL = mw.loader.using( [ 'schema.NavigationTiming', 
'schema.SaveTiming' ] );
@@ -385,6 +396,7 @@
 * @private
 */
module.exports = {
+   inSample: inSample,
emitNavTiming: 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: jobs: Remove ClearUserWatchlistJob 'batchSize' option

2017-11-30 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394400 )

Change subject: jobs: Remove ClearUserWatchlistJob 'batchSize' option
..

jobs: Remove ClearUserWatchlistJob 'batchSize' option

Use $wgUpdateRowsPerQuery instead, and use its value at run-time
instead of inside the job parameters. Also helps with deduplication
if batchSize is changed.

Change-Id: Ifef25a3ae5ae2418359a41eba05778613fbb548f
---
M includes/jobqueue/jobs/ClearUserWatchlistJob.php
M tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php
2 files changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/394400/1

diff --git a/includes/jobqueue/jobs/ClearUserWatchlistJob.php 
b/includes/jobqueue/jobs/ClearUserWatchlistJob.php
index 17c4b66..3e8b2ad 100644
--- a/includes/jobqueue/jobs/ClearUserWatchlistJob.php
+++ b/includes/jobqueue/jobs/ClearUserWatchlistJob.php
@@ -28,15 +28,10 @@
/**
 * @param Title|null $title Not used by this job.
 * @param array $params
-*  - batchSize,  Number of watchlist entries to remove at once.
 *  - userId, The ID for the user whose watchlist is being 
cleared.
 *  - maxWatchlistId, The maximum wl_id at the time the job was first 
created,
 */
public function __construct( Title $title = null, array $params ) {
-   if ( !array_key_exists( 'batchSize', $params ) ) {
-   $params['batchSize'] = 1000;
-   }
-
parent::__construct(
'clearUserWatchlist',
SpecialPage::getTitleFor( 'EditWatchlist', 'clear' ),
@@ -47,8 +42,10 @@
}
 
public function run() {
+   global $wgUpdateRowsPerQuery;
$userId = $this->params['userId'];
$maxWatchlistId = $this->params['maxWatchlistId'];
+   $batchSize = $wgUpdateRowsPerQuery;
 
$loadBalancer = 
MediaWikiServices::getInstance()->getDBLoadBalancer();
$dbw = $loadBalancer->getConnection( DB_MASTER );
@@ -86,7 +83,7 @@
__METHOD__,
[
'ORDER BY' => 'wl_id ASC',
-   'LIMIT' => $this->params['batchSize'],
+   'LIMIT' => $batchSize,
]
);
 
@@ -101,7 +98,9 @@
$lbf->commitMasterChanges( __METHOD__ );
unset( $scopedLock );
 
-   if ( count( $watchlistIds ) == $this->params['batchSize'] ) {
+   if ( count( $watchlistIds ) === (int)$batchSize ) {
+   // Until we get less results than the limit, 
recursively push
+   // the same job again.
JobQueueGroup::singleton()->push( new self( 
$this->getTitle(), $this->getParams() ) );
}
 
diff --git a/tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php 
b/tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php
index 385ecb7..b5257a3 100644
--- a/tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php
+++ b/tests/phpunit/includes/jobqueue/jobs/ClearUserWatchlistJobTest.php
@@ -48,12 +48,13 @@
$watchedItemStore->addWatch( $user, new TitleValue( 0, 'C' ) );
$watchedItemStore->addWatch( $user, new TitleValue( 1, 'C' ) );
 
+   $this->setMwGlobals( 'wgUpdateRowsPerQuery', 2 );
+
JobQueueGroup::singleton()->push(
new ClearUserWatchlistJob(
null,
[
'userId' => $user->getId(),
-   'batchSize' => 2,
'maxWatchlistId' => $maxId,
]
)

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_30]: Shell: skip null parameters

2017-11-29 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394184 )

Change subject: Shell: skip null parameters
..

Shell: skip null parameters

Right now they're treated as empty strings, however
this doesn't allow skipping parameters in the middle like
 $params = [
 'foo',
 $x ? '--bar' : null,
 '--baz',
 ];

In some cases this matters, e.g. `ls` works while `ls ''` doesn't.

Also, fix spacing problems the new tests uncovered:
* Extra space when using params()
* Missing space when combining params() and unsafeParams()

Change-Id: Icb29d4c48ae7f92fb5635e3865346c98f47abb01
---
M includes/shell/Command.php
M includes/shell/Shell.php
M tests/phpunit/includes/shell/CommandTest.php
M tests/phpunit/includes/shell/ShellTest.php
4 files changed, 25 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/394184/1

diff --git a/includes/shell/Command.php b/includes/shell/Command.php
index 3663d88..17f3b13 100644
--- a/includes/shell/Command.php
+++ b/includes/shell/Command.php
@@ -96,6 +96,7 @@
 
/**
 * Adds parameters to the command. All parameters are sanitized via 
Shell::escape().
+* Null values are ignored.
 *
 * @param string|string[] $args,...
 * @return $this
@@ -107,13 +108,14 @@
// treat it as a list of arguments
$args = reset( $args );
}
-   $this->command .= ' ' . Shell::escape( $args );
+   $this->command = trim( $this->command . ' ' . Shell::escape( 
$args ) );
 
return $this;
}
 
/**
 * Adds unsafe parameters to the command. These parameters are NOT 
sanitized in any way.
+* Null values are ignored.
 *
 * @param string|string[] $args,...
 * @return $this
@@ -125,7 +127,12 @@
// treat it as a list of arguments
$args = reset( $args );
}
-   $this->command .= implode( ' ', $args );
+   $args = array_filter( $args,
+   function ( $value ) {
+   return $value !== null;
+   }
+   );
+   $this->command = trim( $this->command . ' ' . implode( ' ', 
$args ) );
 
return $this;
}
diff --git a/includes/shell/Shell.php b/includes/shell/Shell.php
index e2909d9..cef9ffa 100644
--- a/includes/shell/Shell.php
+++ b/includes/shell/Shell.php
@@ -90,7 +90,7 @@
 * PHP 5.2.6+ (bug backported to earlier distro releases of PHP).
 *
 * @param string $args,... strings to escape and glue together, or a 
single array of
-* strings parameter
+* strings parameter. Null values are ignored.
 * @return string
 */
public static function escape( /* ... */ ) {
@@ -104,6 +104,9 @@
$first = true;
$retVal = '';
foreach ( $args as $arg ) {
+   if ( $arg === null ) {
+   continue;
+   }
if ( !$first ) {
$retVal .= ' ';
} else {
diff --git a/tests/phpunit/includes/shell/CommandTest.php 
b/tests/phpunit/includes/shell/CommandTest.php
index dc49599..d57b1b1 100644
--- a/tests/phpunit/includes/shell/CommandTest.php
+++ b/tests/phpunit/includes/shell/CommandTest.php
@@ -1,6 +1,7 @@
 assertRegExp( '/^.+no-such-file.*$/m', 
$result->getStdout() );
}
 
+   /**
+* Test that null values are skipped by params() and unsafeParams()
+*/
+   public function testNullsAreSkipped() {
+   $command = TestingAccessWrapper::newFromObject( new Command );
+   $command->params( 'echo', 'a', null, 'b' );
+   $command->unsafeParams( 'c', null, 'd' );
+   $this->assertEquals( "'echo' 'a' 'b' c d", $command->command );
+   }
+
public function testT69870() {
$commandLine = wfIsWindows()
// 333 = 331 + CRLF
diff --git a/tests/phpunit/includes/shell/ShellTest.php 
b/tests/phpunit/includes/shell/ShellTest.php
index 1e91074..7c96c3c 100644
--- a/tests/phpunit/includes/shell/ShellTest.php
+++ b/tests/phpunit/includes/shell/ShellTest.php
@@ -25,6 +25,7 @@
'simple' => [ [ 'true' ], "'true'" ],
'with args' => [ [ 'convert', '-font', 'font name' ], 
"'convert' '-font' 'font name'" ],
'array' => [ [ [ 'convert', '-font', 'font name' ] ], 
"'convert' '-font' 'font name'" ],
+   'skip nulls' => [ [ 'ls', null ], "'ls'" ],
];
}
 }

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

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] WebStart: Remove use of realpath() for $IP

2017-11-27 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393713 )

Change subject: [WIP] WebStart: Remove use of realpath() for $IP
..

[WIP] WebStart: Remove use of realpath() for $IP

When installing MediaWiki in a sub directory of document root,
and including it from an /index.php file in the document root,
MediaWiki succesfully includes WebStart from index.php, but
WebStart.php fails to include Setup.php.

Example:
* /var/www/mediawiki - MediaWiki installation
* /var/www/index.php - Containing:

```
 Fatal error:  require_once(): Failed opening required 
> '/var/www/includes/Setup.php' (include_path='.:/usr/local/lib/php') in 
> /var/www/mediawiki/includes/WebStart.php on line 97
> Stack trace:
>   1. {main}() /var/www/index.php:0
>   2. require() /var/www/index.php:3
>   3. require() /var/www/mediawiki/index.php:40

Change-Id: Icd8cfa580ce1c22bc3bf177570a9f4a940d2427c
---
M includes/WebStart.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/13/393713/1

diff --git a/includes/WebStart.php b/includes/WebStart.php
index e4d93f9..ab499af 100644
--- a/includes/WebStart.php
+++ b/includes/WebStart.php
@@ -56,7 +56,7 @@
 # if we don't have permissions on parent directories.
 $IP = getenv( 'MW_INSTALL_PATH' );
 if ( $IP === false ) {
-   $IP = realpath( '.' ) ?: dirname( __DIR__ );
+   $IP = dirname( __DIR__ );
 }
 
 // If no LocalSettings file exists, try to display an error page

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

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

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Exclude CR<0 if from performance group

2017-11-27 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393702 )

Change subject: Exclude CR<0 if from performance group
..

Exclude CR<0 if from performance group

We already exclude CR -2 which is limited to repo maintainers.
For other cases we exclude all CR<0 because they are from ourselves.
Apply the same to this section by using the group= syntax of 'label:'.

This way, patches we -1 are hidden from "Todo review", but patches
-1'ed by other users don't result in such hiding.

Change-Id: I9546a0b8e8f534c86d553d2c5e7fe72552e8f455
---
M custom
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance refs/changes/02/393702/1

diff --git a/custom b/custom
index 600144b..1e167f6 100644
--- a/custom
+++ b/custom
@@ -4,7 +4,7 @@
 [section "Our patches awaiting review"]
   query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "Other patches in subscribed areas"]
-  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
+  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 -label:Code-Review<0,group=performance 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
 [section "My patches awaiting review"]
   query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "My other patches"]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9546a0b8e8f534c86d553d2c5e7fe72552e8f455
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Exclude CR<0 if from performance group

2017-11-27 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393702 )

Change subject: Exclude CR<0 if from performance group
..


Exclude CR<0 if from performance group

We already exclude CR -2 which is limited to repo maintainers.
For other cases we exclude all CR<0 because they are from ourselves.
Apply the same to this section by using the group= syntax of 'label:'.

This way, patches we -1 are hidden from "Todo review", but patches
-1'ed by other users don't result in such hiding.

Change-Id: I9546a0b8e8f534c86d553d2c5e7fe72552e8f455
---
M custom
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/custom b/custom
index 600144b..1e167f6 100644
--- a/custom
+++ b/custom
@@ -4,7 +4,7 @@
 [section "Our patches awaiting review"]
   query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "Other patches in subscribed areas"]
-  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
+  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 -label:Code-Review<0,group=performance 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
 [section "My patches awaiting review"]
   query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "My other patches"]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9546a0b8e8f534c86d553d2c5e7fe72552e8f455
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Also exclude WIP/DNM from "Other" section

2017-11-27 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393701 )

Change subject: Also exclude WIP/DNM from "Other" section
..


Also exclude WIP/DNM from "Other" section

Matches the logic of the other sections.

DNM = Do Not Merge.

Change-Id: I795a533233439a66831859fbc6af9ff484e8d1cb
---
M custom
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/custom b/custom
index 4c16292..600144b 100644
--- a/custom
+++ b/custom
@@ -2,12 +2,12 @@
   title = Performance Team
   description = Custom dashboard for the Performance Team
 [section "Our patches awaiting review"]
-  query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
+  query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "Other patches in subscribed areas"]
-  query = is:open -ownerin:performance -label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
+  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
 [section "My patches awaiting review"]
-  query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
+  query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "My other patches"]
-  query = is:open ownerin:performance owner:self (message:WIP OR message:DNM 
OR label:Verified<=-1 OR label:Code-Review<=-1) limit:40
+  query = is:open ownerin:performance owner:self (message:WIP OR message:DNM 
OR label:Verified<0 OR label:Code-Review<0) limit:40
 [section "Recently merged"]
   query = is:merged ownerin:performance limit:30

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I795a533233439a66831859fbc6af9ff484e8d1cb
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Also exclude WIP/DNM from "Other" section

2017-11-27 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393701 )

Change subject: Also exclude WIP/DNM from "Other" section
..

Also exclude WIP/DNM from "Other" section

Matches the logic of the other sections.

DNM = Do Not Merge.

Change-Id: I795a533233439a66831859fbc6af9ff484e8d1cb
---
M custom
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance refs/changes/01/393701/1

diff --git a/custom b/custom
index 4c16292..600144b 100644
--- a/custom
+++ b/custom
@@ -2,12 +2,12 @@
   title = Performance Team
   description = Custom dashboard for the Performance Team
 [section "Our patches awaiting review"]
-  query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
+  query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "Other patches in subscribed areas"]
-  query = is:open -ownerin:performance -label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
+  query = is:open -ownerin:performance -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
 [section "My patches awaiting review"]
-  query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
+  query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<0 -label:Code-Review<0 limit:40
 [section "My other patches"]
-  query = is:open ownerin:performance owner:self (message:WIP OR message:DNM 
OR label:Verified<=-1 OR label:Code-Review<=-1) limit:40
+  query = is:open ownerin:performance owner:self (message:WIP OR message:DNM 
OR label:Verified<0 OR label:Code-Review<0) limit:40
 [section "Recently merged"]
   query = is:merged ownerin:performance limit:30

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I795a533233439a66831859fbc6af9ff484e8d1cb
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Gerrit: Fix negative cut-off logo on page load

2017-11-27 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393691 )

Change subject: Gerrit: Fix negative cut-off logo on page load
..

Gerrit: Fix negative cut-off logo on page load

Follows-up db9ea750ef. Simplify the CSS a bit and make the logo
absolute positioned.

It was practically already absolutely positioned given all the
arbitrary and negative relative offsets that are highly dependent
on the rest of the interface (which are variable).

Previously the logo was positioned relative to the bottom of the
menu, into the left margin that the menu reserved. It positioned
itself upward by 56px which is 48px (height of menu), plus 4px (
padding-top of menu), plus 4px (padding-bottom of menu).

However, this didn't always work as expected:

* The menu's height isn't actually defined as 48px, which
  is only the default render height given a particular font size
  and number of rows. This can change. Gerrit's interface supports
  such change, but our hack did not.

* The menu's padding isn't actually defined as 4px. Rather 4px
  is the result of various internal table borders of 1px or 2px
  stacking up to produce 4px efffective padding.
  In addition, those borders are not defined in Gerrit and actually
  varies by browser (user agent default styles). Causing the logo
  to render in slightly different positions.

* When a Gerrit page first loads, the gerrit_topmenu element
  is empty and has no height. Its contents are populated later.
  As a result, the first render of a Gerrit page is empty with
  some "Page is loading..." text and a partially cut-off Gerrit
  logo that was 56px off the page toward the top.

These are all fixed, by changing the position of the logo to
be computed from the top-left edge of the page, instead of
relative to the bottom bottom corner of the menu.

The relative position code for that ensures the heigiht being
reserved is replaced with a min-height declaration on topmenu.

Change-Id: I3ca795bb3a3f7c5088fac00bb1b81fdd3139098c
---
M modules/gerrit/files/etc/GerritSite.css
1 file changed, 19 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/91/393691/1

diff --git a/modules/gerrit/files/etc/GerritSite.css 
b/modules/gerrit/files/etc/GerritSite.css
index 906fe64..eeda090 100644
--- a/modules/gerrit/files/etc/GerritSite.css
+++ b/modules/gerrit/files/etc/GerritSite.css
@@ -52,27 +52,30 @@
 }
 
 /**
- * Header
+ * The logo uses position absolute because the HTML generated by Gerrit
+ * creates the header as a sibling *after* the menu instead of before it.
+ * As such, the only reliable way to render to the left of it, is either
+ * with fragile negative offsets, or by using absolute position.
+ *
+ * The logo is taller than gerrit_topmenu. As such, a later CSS rule
+ * ensures gerrit_topmenu has a minimum height that accomodates the
+ * logo as well, to avoid page content from overlapping the logo.
  */
 #gerrit_header {
display: block !important;
-   width: 85px;
-   position: relative;
-   /* 54px puts it exactly against the top of the page */
-   top: -54px;
-   margin-bottom: -54px;
-   height: 68px;
 }
-
 .wm-gerrit-heading {
-   margin: 0.5em 0 0 0.5em;
+   position: absolute;
+   top: 0; left: 0;
+
+   margin: 7px 13px;
padding: 0;
-   font-family: 'PT Sans', sans-serif;
+
+   /* This font and color aren't used since there is an image there,
+* but is kept for consistency when used for display of alt-text
+*/
font-weight: normal;
letter-spacing: -1px;
-   /* This color isn't used since there is an image there,
-* but it kept for consistency when used for display of alt-text
-*/
color: #99;
 
min-height: 60px;
@@ -94,6 +97,9 @@
background: none;
/* Make sure it is above the logo or we can not clck the sub menu items 
*/
z-index: 1;
+   /* Ensure logo is not cut off by page content */
+   /* 74px = 60px height + (2 x 7px) margin */
+   min-height: 74px;
 }
 
 #gerrit_topmenu tbody tr td table {

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

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

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Update "Other patches" to use reviewerin: instead of file:

2017-11-27 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393641 )

Change subject: Update "Other patches" to use reviewerin: instead of file:
..


Update "Other patches" to use reviewerin: instead of file:

We already use ReviewerBot to automatically get added as reviewers
to areas of our interest.

https://www.mediawiki.org/wiki/Git/Reviewers

By using that as filter instead we have two benefits:

1) It automatically includes all our interest.

2) It allows us to easily remove something from the dashboard
   if it is unrelated but happens to touch our area, but removing
   yourself from the CC list. This wasn't previously possible
   with the harcoded file filter.

Change-Id: I9360084470c058761874d1d1f614494388b6171f
---
M custom
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/custom b/custom
index c60e8ce..4c16292 100644
--- a/custom
+++ b/custom
@@ -4,7 +4,7 @@
 [section "Our patches awaiting review"]
   query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
 [section "Other patches in subscribed areas"]
-  query = is:open -ownerin:performance -label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core (file:resourceloader OR file:"startup.js" OR 
file:"mediawiki.js" OR file:rdbms))) limit:20
+  query = is:open -ownerin:performance -label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
 [section "My patches awaiting review"]
   query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
 [section "My other patches"]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9360084470c058761874d1d1f614494388b6171f
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Update "Other patches" to use reviewerin: instead of file:

2017-11-27 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393641 )

Change subject: Update "Other patches" to use reviewerin: instead of file:
..

Update "Other patches" to use reviewerin: instead of file:

We already use ReviewerBot to automatically get added as reviewers
to areas of our interest.

https://www.mediawiki.org/wiki/Git/Reviewers

By using that as filter instead we have two benefits:

1) It automatically includes all our interest.

2) It allows us to easily remove something from the dashboard
   if it is unrelated but happens to touch our area, but removing
   yourself from the CC list. This wasn't previously possible
   with the harcoded file filter.

Change-Id: I9360084470c058761874d1d1f614494388b6171f
---
M custom
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance refs/changes/41/393641/1

diff --git a/custom b/custom
index c60e8ce..4c16292 100644
--- a/custom
+++ b/custom
@@ -4,7 +4,7 @@
 [section "Our patches awaiting review"]
   query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
 [section "Other patches in subscribed areas"]
-  query = is:open -ownerin:performance -label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core (file:resourceloader OR file:"startup.js" OR 
file:"mediawiki.js" OR file:rdbms))) limit:20
+  query = is:open -ownerin:performance -label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core reviewerin:performance)) limit:20
 [section "My patches awaiting review"]
   query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
 [section "My other patches"]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9360084470c058761874d1d1f614494388b6171f
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Add section for patches by others to subscribed areas

2017-11-27 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393638 )

Change subject: Add section for patches by others to subscribed areas
..


Add section for patches by others to subscribed areas

We should keep an eye out for patches submitted (by others) to
areas we maintain so that we can review them.

Right now this includes repos we maintain entirely, as well as
sub-path filters within MediaWiki core that we co-maintain or
are interested in. Not all of these are exclusively maintained by
us (so these are not always a specific request for our review),
but nonetheless may be good to be aware of, even if someone else
ends up reviewing it.

See also:
https://www.mediawiki.org/wiki/Developers/Maintainers
https://www.mediawiki.org/wiki/Development_policy/Code_Stewardship

Change-Id: Ib4342ccd88c38907a43cb46a1c62693a54b6c30a
---
M custom
1 file changed, 8 insertions(+), 7 deletions(-)

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



diff --git a/custom b/custom
index cc549da..c60e8ce 100644
--- a/custom
+++ b/custom
@@ -1,12 +1,13 @@
 [dashboard]
   title = Performance Team
   description = Custom dashboard for the Performance Team
-  foreach = ownerin:performance
-[section "Pending patches by team"]
-  query = is:open -owner:self -message:WIP -message:DNM -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
-[section "My patches for review"]
-  query = is:open owner:self -message:WIP -message:DNM -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
+[section "Our patches awaiting review"]
+  query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
+[section "Other patches in subscribed areas"]
+  query = is:open -ownerin:performance -label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core (file:resourceloader OR file:"startup.js" OR 
file:"mediawiki.js" OR file:rdbms))) limit:20
+[section "My patches awaiting review"]
+  query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
 [section "My other patches"]
-  query = is:open owner:self (message:WIP OR message:DNM OR label:Verified<=-1 
OR label:Code-Review<=-1) limit:40
+  query = is:open ownerin:performance owner:self (message:WIP OR message:DNM 
OR label:Verified<=-1 OR label:Code-Review<=-1) limit:40
 [section "Recently merged"]
-  query = is:merged limit:30
+  query = is:merged ownerin:performance limit:30

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4342ccd88c38907a43cb46a1c62693a54b6c30a
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Add section for patches by others to subscribed areas

2017-11-27 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393638 )

Change subject: Add section for patches by others to subscribed areas
..

Add section for patches by others to subscribed areas

We should keep an eye out for patches submitted (by others) to
areas we maintain so that we can review them.

Right now this includes repos we maintain entirely, as well as
sub-path filters within MediaWiki core that we co-maintain or
are interested in. Not all of these are exclusively maintained by
us (so these are not always a specific request for our review),
but nonetheless may be good to be aware of, even if someone else
ends up reviewing it.

See also:
https://www.mediawiki.org/wiki/Developers/Maintainers
https://www.mediawiki.org/wiki/Development_policy/Code_Stewardship

Change-Id: Ib4342ccd88c38907a43cb46a1c62693a54b6c30a
---
M custom
1 file changed, 8 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance refs/changes/38/393638/1

diff --git a/custom b/custom
index cc549da..c60e8ce 100644
--- a/custom
+++ b/custom
@@ -1,12 +1,13 @@
 [dashboard]
   title = Performance Team
   description = Custom dashboard for the Performance Team
-  foreach = ownerin:performance
-[section "Pending patches by team"]
-  query = is:open -owner:self -message:WIP -message:DNM -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
-[section "My patches for review"]
-  query = is:open owner:self -message:WIP -message:DNM -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
+[section "Our patches awaiting review"]
+  query = is:open ownerin:performance -owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
+[section "Other patches in subscribed areas"]
+  query = is:open -ownerin:performance -label:Verified<0 -label:Code-Review=-2 
(project:mediawiki/extensions/NavigationTiming OR 
project:mediawiki/extensions/PerformanceInspector OR project:performance OR 
project:performance/docroot OR project:performance/WebPageTest OR 
(project:mediawiki/core (file:resourceloader OR file:"startup.js" OR 
file:"mediawiki.js" OR file:rdbms))) limit:20
+[section "My patches awaiting review"]
+  query = is:open ownerin:performance owner:self -message:WIP -message:DNM 
-label:Verified<=-1 -label:Code-Review<=-1 limit:40
 [section "My other patches"]
-  query = is:open owner:self (message:WIP OR message:DNM OR label:Verified<=-1 
OR label:Code-Review<=-1) limit:40
+  query = is:open ownerin:performance owner:self (message:WIP OR message:DNM 
OR label:Verified<=-1 OR label:Code-Review<=-1) limit:40
 [section "Recently merged"]
-  query = is:merged limit:30
+  query = is:merged ownerin:performance limit:30

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4342ccd88c38907a43cb46a1c62693a54b6c30a
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki...EventLogging[master]: RemoteSchema: Use SchemaApiUrl instead of DBname in cache key

2017-11-22 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392986 )

Change subject: RemoteSchema: Use SchemaApiUrl instead of DBname in cache key
..

RemoteSchema: Use SchemaApiUrl instead of DBname in cache key

The RemoteSchema class fetches content from the SchemaApiUrl.
The DBname is not used and it doesn't seem right to use it
in the cache key as such. I suspect this might be a left-over
from a time where it used cross-wiki DB connections (or tried to).

* Update tests to use '::class' syntax for class names.
* Update code to use makeGlobalKey() instead of manually creating
  a key that is both unescaped and unnamescaped (all keys are expected
  to start with a db name or 'global', this one started with 'schema').
* Update key to be less generic ('eventlogging-schema' instead
  of just 'schema').

Change-Id: I43ceaf3a9132bcdf7e3a1028cfc03a676aecc051
---
M includes/RemoteSchema.php
M tests/phpunit/RemoteSchemaTest.php
2 files changed, 28 insertions(+), 15 deletions(-)


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

diff --git a/includes/RemoteSchema.php b/includes/RemoteSchema.php
index 0eeaec9..e3a7cfa 100644
--- a/includes/RemoteSchema.php
+++ b/includes/RemoteSchema.php
@@ -22,13 +22,18 @@
 * @param Http $http (optional) HTTP client.
 */
public function __construct( $title, $revision, $cache = null, $http = 
null ) {
-   global $wgEventLoggingDBname;
+   global $wgEventLoggingSchemaApiUri;
 
$this->title = $title;
$this->revision = $revision;
$this->cache = $cache ?: wfGetCache( CACHE_ANYTHING );
$this->http = $http ?: new Http();
-   $this->key = 
"schema:{$wgEventLoggingDBname}:{$title}:{$revision}";
+   $this->key = $this->cache->makeGlobalKey(
+   'eventlogging-schema',
+   $wgEventLoggingSchemaApiUri,
+   $title,
+   $revision
+   );
}
 
/**
diff --git a/tests/phpunit/RemoteSchemaTest.php 
b/tests/phpunit/RemoteSchemaTest.php
index be9c877..95ef8c7 100644
--- a/tests/phpunit/RemoteSchemaTest.php
+++ b/tests/phpunit/RemoteSchemaTest.php
@@ -14,7 +14,7 @@
  */
 class RemoteSchemaTest extends MediaWikiTestCase {
 
-   /** @var PHPUnit_Framework_MockObject_MockObject */
+   /** @var BagOStuff|PHPUnit_Framework_MockObject_MockObject */
private $cache;
/** @var PHPUnit_Framework_MockObject_MockObject */
private $http;
@@ -24,14 +24,27 @@
public $statusSchema = [ 'status' => [ 'type' => 'string' ] ];
 
function setUp() {
+   global $wgEventLoggingSchemaApiUri;
+
parent::setUp();
 
$this->cache = $this
-   ->getMockBuilder( 'MemcachedPhpBagOStuff' )
+   ->getMockBuilder( MemcachedPhpBagOStuff::class )
->disableOriginalConstructor()
->getMock();
 
-   $this->http = $this->getMock( 'stdClass', [ 'get' ] );
+   $this->cache
+   ->expects( $this->once() )
+   ->method( 'makeGlobalKey' )
+   ->with(
+   'eventlogging-schema',
+   $wgEventLoggingSchemaApiUri,
+   'Test',
+   99
+   )
+   ->willReturn( 'eventlogging-schema:--:99' );
+
+   $this->http = $this->getMock( stdClass::class, [ 'get' ] );
$this->schema = new RemoteSchema( 'Test', 99, $this->cache, 
$this->http );
}
 
@@ -40,13 +53,12 @@
 * This is the most common scenario.
 */
function testSchemaInCache() {
-   global $wgEventLoggingDBname;
 
// If the revision was in memcached...
$this->cache
->expects( $this->once() )
->method( 'get' )
-   ->with( $this->equalTo( 
"schema:{$wgEventLoggingDBname}:Test:99" ) )
+   ->with( $this->equalTo( 'eventlogging-schema:--:99' ) )
->will( $this->returnValue( $this->statusSchema ) );
 
// ...no HTTP call will need to be made
@@ -83,20 +95,18 @@
 * be retrieved via HTTP instead.
 */
function testSchemaNotInCacheDoUpdate() {
-   global $wgEventLoggingDBname;
-
// If the revision was not in memcached...
$this->cache
->expects( $this->once() )
->method( 'get' )
-   ->with( $this->equalTo( 
"schema:{$wgEventLoggingDBname}:Test:99" ) )
+   

[MediaWiki-commits] [Gerrit] mediawiki...EventLogging[master]: Simplify onSetup check for configuration

2017-11-22 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392982 )

Change subject: Simplify onSetup check for configuration
..

Simplify onSetup check for configuration

* No need for isset(), because these are created by default.
  If they were unset somehow, the run-time warning for that should
  not be hidden.

* No need to check DBname. Optional.

* Fix BagOStuff typehint.

Ref T180192.

Change-Id: Idd64e1811fbfb88302769a568369c58e66b5fa03
---
M includes/EventLoggingHooks.php
M includes/RemoteSchema.php
2 files changed, 3 insertions(+), 4 deletions(-)


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

diff --git a/includes/EventLoggingHooks.php b/includes/EventLoggingHooks.php
index b6cd377..3f9bd2e 100644
--- a/includes/EventLoggingHooks.php
+++ b/includes/EventLoggingHooks.php
@@ -19,10 +19,9 @@
public static function onSetup() {
foreach ( [
'wgEventLoggingBaseUri',
-   'wgEventLoggingDBname',
-   'wgEventLoggingSchemaApiUri'
+   'wgEventLoggingSchemaApiUri',
] as $configVar ) {
-   if ( !isset( $GLOBALS[ $configVar ] ) || $GLOBALS[ 
$configVar ] === false ) {
+   if ( $GLOBALS[ $configVar ] === false ) {
wfDebugLog( 'EventLogging', "$configVar has not 
been configured." );
}
}
diff --git a/includes/RemoteSchema.php b/includes/RemoteSchema.php
index 445cee4..0eeaec9 100644
--- a/includes/RemoteSchema.php
+++ b/includes/RemoteSchema.php
@@ -18,7 +18,7 @@
 * Constructor.
 * @param string $title
 * @param int $revision
-* @param ObjectCache $cache (optional) cache client.
+* @param BagOStuff $cache (optional) cache client.
 * @param Http $http (optional) HTTP client.
 */
public function __construct( $title, $revision, $cache = null, $http = 
null ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd64e1811fbfb88302769a568369c58e66b5fa03
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: InstallDocFormatter: Add missing @covers scope

2017-11-22 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392891 )

Change subject: InstallDocFormatter: Add missing @covers scope
..

InstallDocFormatter: Add missing @covers scope

The format() method is a one-line wrapper around execute(), which
is the real method being tested here. Given the class doesn't
contain any other methods, increase the scope to the whole class.

Change-Id: I8b2c7736c6708c0915a9ce15fef0dc85c63621ea
---
M includes/installer/InstallDocFormatter.php
M tests/phpunit/includes/installer/InstallDocFormatterTest.php
2 files changed, 2 insertions(+), 6 deletions(-)


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

diff --git a/includes/installer/InstallDocFormatter.php 
b/includes/installer/InstallDocFormatter.php
index 4163e2f..08cfd86 100644
--- a/includes/installer/InstallDocFormatter.php
+++ b/includes/installer/InstallDocFormatter.php
@@ -21,7 +21,7 @@
  */
 
 class InstallDocFormatter {
-   static function format( $text ) {
+   public static function format( $text ) {
$obj = new self( $text );
 
return $obj->execute();
diff --git a/tests/phpunit/includes/installer/InstallDocFormatterTest.php 
b/tests/phpunit/includes/installer/InstallDocFormatterTest.php
index 36b6d64..9584d4b 100644
--- a/tests/phpunit/includes/installer/InstallDocFormatterTest.php
+++ b/tests/phpunit/includes/installer/InstallDocFormatterTest.php
@@ -1,12 +1,8 @@
 https://gerrit.wikimedia.org/r/392891
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: build: Add 'npm run qunit' command

2017-11-22 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392888 )

Change subject: build: Add 'npm run qunit' command
..

build: Add 'npm run qunit' command

The running of 'grunt qunit' is unconvenient due to it only working
if the user has grunt-cli installed globally, which should not be
needed because it is already installed in the local directory.

It could be worked around by instructing users to use
`./node_modules/.bin/grunt qunit`, but it would be much simpler
to instruct them to use `npm run qunit` instead.

Unlike 'composer', 'npm' does not come by default with a command
like 'composer exec' that one could pass a command directly
without needing to register it. This is fixed in more recent
versions through 'npx -c', but that's a bit too new to require
in the manual, so adding it as a run-script instead.

Change-Id: I2812b13dbed50612b1626a617ba65f92e212f01a
---
M package.json
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/package.json b/package.json
index faca87d..2878eca 100644
--- a/package.json
+++ b/package.json
@@ -2,6 +2,7 @@
   "private": true,
   "scripts": {
 "test": "grunt test",
+"qunit": "grunt qunit",
 "doc": "jsduck",
 "postdoc": "grunt copy:jsduck",
 "selenium": "killall -0 chromedriver 2>/dev/null || chromedriver 
--url-base=/wd/hub --port= & grunt webdriver:test; killall chromedriver"

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Revert "Move styles for Special:UserRights to separate style...

2017-11-21 Thread Krinkle (Code Review)
Hello Bartosz Dziewoński, Fomafix, Reedy, Florianschmidtwelzow, jenkins-bot,

I'd like you to do a code review.  Please visit

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

to review the following change.


Change subject: Revert "Move styles for Special:UserRights to separate style 
module"
..

Revert "Move styles for Special:UserRights to separate style module"

This reverts commit 5f18aae76eecf54665d4301da021afb3d1ae6e13.

Change-Id: I4143e876495bad6530afe290ba686d7f26a43c58
---
M includes/specials/SpecialUserrights.php
M resources/Resources.php
M resources/src/mediawiki.special/mediawiki.special.css
M resources/src/mediawiki.special/mediawiki.special.userrights.css
4 files changed, 15 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/392773/1

diff --git a/includes/specials/SpecialUserrights.php 
b/includes/specials/SpecialUserrights.php
index 4e4394d..0a712ef 100644
--- a/includes/specials/SpecialUserrights.php
+++ b/includes/specials/SpecialUserrights.php
@@ -140,7 +140,7 @@
$this->setHeaders();
$this->outputHeader();
 
-   $out->addModuleStyles( 'mediawiki.special.userrights.styles' );
+   $out->addModuleStyles( 'mediawiki.special' );
$this->addHelpLink( 'Help:Assigning permissions' );
 
$this->switchForm();
diff --git a/resources/Resources.php b/resources/Resources.php
index d9fa8e0..715f339 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -2230,13 +2230,11 @@
],
],
'mediawiki.special.userrights' => [
+   'styles' => 
'resources/src/mediawiki.special/mediawiki.special.userrights.css',
'scripts' => 
'resources/src/mediawiki.special/mediawiki.special.userrights.js',
'dependencies' => [
'mediawiki.notification.convertmessagebox',
],
-   ],
-   'mediawiki.special.userrights.styles' => [
-   'styles' => 
'resources/src/mediawiki.special/mediawiki.special.userrights.css',
],
'mediawiki.special.watchlist' => [
'scripts' => 
'resources/src/mediawiki.special/mediawiki.special.watchlist.js',
diff --git a/resources/src/mediawiki.special/mediawiki.special.css 
b/resources/src/mediawiki.special/mediawiki.special.css
index 5d0ec49..7f3b09a 100644
--- a/resources/src/mediawiki.special/mediawiki.special.css
+++ b/resources/src/mediawiki.special/mediawiki.special.css
@@ -122,3 +122,16 @@
color: #72777d;
font-size: 90%;
 }
+
+/* Special:UserRights */
+.mw-userrights-disabled {
+   color: #72777d;
+}
+.mw-userrights-groups * td,
+.mw-userrights-groups * th {
+   padding-right: 1.5em;
+}
+
+.mw-userrights-groups * th {
+   text-align: left;
+}
diff --git a/resources/src/mediawiki.special/mediawiki.special.userrights.css 
b/resources/src/mediawiki.special/mediawiki.special.userrights.css
index acfdb56..a4b4087 100644
--- a/resources/src/mediawiki.special/mediawiki.special.userrights.css
+++ b/resources/src/mediawiki.special/mediawiki.special.userrights.css
@@ -10,15 +10,3 @@
display: inline-block;
vertical-align: middle;
 }
-
-.mw-userrights-disabled {
-   color: #72777d;
-}
-.mw-userrights-groups * td,
-.mw-userrights-groups * th {
-   padding-right: 1.5em;
-}
-
-.mw-userrights-groups * th {
-   text-align: left;
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4143e876495bad6530afe290ba686d7f26a43c58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Fomafix 
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] operations/mediawiki-config[master]: multiversion: Assume --wiki=aawiki for purgeUrls.php

2017-11-20 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392561 )

Change subject: multiversion: Assume --wiki=aawiki for purgeUrls.php
..

multiversion: Assume --wiki=aawiki for purgeUrls.php

Similar to purgeList.php.

Change-Id: Id2d2edcd67890a4fe66d96413c5e745a44015b35
---
M multiversion/MWScript.php
1 file changed, 4 insertions(+), 3 deletions(-)


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

diff --git a/multiversion/MWScript.php b/multiversion/MWScript.php
index 869c587..47c60eb 100644
--- a/multiversion/MWScript.php
+++ b/multiversion/MWScript.php
@@ -66,11 +66,12 @@
# other maintenance scripts we don't care what wiki DB is used...
$wikiless = [
'maintenance/purgeList.php',
-   'extensions/WikimediaMaintenance/addWiki.php', // 1.19
-   'extensions/WikimediaMaintenance/dumpInterwiki.php', // 1.19
+   'extensions/WikimediaMaintenance/addWiki.php',
+   'extensions/WikimediaMaintenance/dumpInterwiki.php',
'extensions/WikimediaMaintenance/getJobQueueLengths.php',
-   'extensions/WikimediaMaintenance/rebuildInterwiki.php', // 1.19
+   'extensions/WikimediaMaintenance/rebuildInterwiki.php',
'extensions/WikimediaMaintenance/filebackend/setZoneAccess.php',
+   'extensions/WikimediaMaintenance/purgeUrls.php',
'maintenance/mctest.php',
'maintenance/mcc.php',
];

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: noc: Remove more unused styles/images and update Vector

2017-11-20 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392557 )

Change subject: noc: Remove more unused styles/images and update Vector
..

noc: Remove more unused styles/images and update Vector

No visible changes except for the underline going away from
the two H2 headings on the noc/index.html page, which aligns
with regular Vector.

All other changes are visual no-ops.

* Replace PNG images with gradients (match current Vector).
  Fallback to transparent or solid background color as needed.

* Remove unused style rules.

* Remove unused images.

* Remove redundant  element.

* Replace  element with gradient and padding
  directly on body.

* Replace need for  by merging
  its styles with  (and update padding
  to remain the effectively same, given it is relative to
  font-size).

Change-Id: Iae0cdeaf643b921ab58e61bc096fe4711f81f5e9
---
D docroot/noc/css/images/border.png
D docroot/noc/css/images/bullet-icon.png
D docroot/noc/css/images/page-base.png
D docroot/noc/css/images/page-fade.png
M docroot/noc/css/vector.css
M docroot/noc/index.html
6 files changed, 28 insertions(+), 72 deletions(-)


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

diff --git a/docroot/noc/css/images/border.png 
b/docroot/noc/css/images/border.png
deleted file mode 100644
index 54b4792..000
--- a/docroot/noc/css/images/border.png
+++ /dev/null
Binary files differ
diff --git a/docroot/noc/css/images/bullet-icon.png 
b/docroot/noc/css/images/bullet-icon.png
deleted file mode 100644
index cb925a7..000
--- a/docroot/noc/css/images/bullet-icon.png
+++ /dev/null
Binary files differ
diff --git a/docroot/noc/css/images/page-base.png 
b/docroot/noc/css/images/page-base.png
deleted file mode 100644
index 17d02a7..000
--- a/docroot/noc/css/images/page-base.png
+++ /dev/null
Binary files differ
diff --git a/docroot/noc/css/images/page-fade.png 
b/docroot/noc/css/images/page-fade.png
deleted file mode 100644
index 815a048..000
--- a/docroot/noc/css/images/page-fade.png
+++ /dev/null
Binary files differ
diff --git a/docroot/noc/css/vector.css b/docroot/noc/css/vector.css
index ec9a181..94029dd 100644
--- a/docroot/noc/css/vector.css
+++ b/docroot/noc/css/vector.css
@@ -1,37 +1,29 @@
 /* Framework */
 body {
-   background-color: #f3f3f3;
-   background-image: url(images/page-base.png);
+   background-color: #f6f6f6;
+   background-image: -webkit-linear-gradient(top, #ff 2.5em, #f6f6f6 
5em);
+   background-image: -moz-linear-gradient(top, #ff 2.5em, #f6f6f6 5em);
+   background-image: linear-gradient(#ff 2.5em, #f6f6f6 5em);
 
-   /* Vector: No outer padding */
-   padding: 0;
-   /* Vector: Larger base size, bodyContent resets */
+   /* Vector: Layout */
+   padding-top: 2.5em; /* Like Vector div#mw-page-base */
+   padding-right: 0;
+   padding-bottom: 0;
+   padding-left: 10em; /* Like Vector div#content */
+
+   /* Vector: Larger base size #bodyContent resets */
font-size: 100%;
 }
-/* Head */
-#page-base {
-   height: 2.5em;
-   background-color: white;
-   background-image: url(images/page-fade.png);
-   background-position: bottom left;
-   background-repeat: repeat-x;
-}
-#head-base {
-   margin-top: -2.5em;
-   margin-left: 10em;
-   height: 2.5em;
-   background-image: url(images/border.png);
-   background-position: bottom left;
-   background-repeat: repeat-x;
-}
 /* Content */
-#content-container {
-   margin-left: 10em;
-   padding: 1em;
-   background-image: url(images/border.png);
-   background-position: top left;
-   background-repeat: repeat-y;
+#bodyContent {
background-color: white;
+   border: 1px solid #a7d7f9;
+   border-right-width: 0;
+   padding: 1.25em;
+   font-size: 0.8em;
+   position: relative;
+   width: 100%;
+   line-height: 1.5em;
 }
 
 /* Panel */
@@ -90,9 +82,6 @@
margin-left: 10em;
margin-top: 0;
padding: 0.75em;
-   background-image: url(images/border.png);
-   background-position: top left;
-   background-repeat: repeat-x;
 }
 #footer ul {
list-style: none;
@@ -146,23 +135,6 @@
 }
 
 
-/* Content */
-#content-container {
-   line-height: 1.5em;
-}
-#bodyContent {
-   font-size: 0.8em;
-   position: relative;
-   width: 100%;
-   line-height: 1.5em;
-}
-#bodyContent table {
-   font-size: 100%;
-   border: none;
-}
-#bodyContent td, #bodyContent th {
-   border: none;
-}
 /* Inline Elements */
 hr {
height: 1px;
@@ -183,10 +155,6 @@
background: none;
cursor: help;
 }
-q {
-   font-family: Times, "Times New Roman", serif;
-   font-style: italic;
-}
 code {
background-color: #f9f9f9;
 }
@@ -197,17 +165,11 @@
background-color: #f9f9f9;

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: noc: Link to Grafana instead of Ganglia

2017-11-19 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392317 )

Change subject: noc: Link to Grafana instead of Ganglia
..

noc: Link to Grafana instead of Ganglia

Closes https://github.com/wikimedia/operations-mediawiki-config/pull/12.

Change-Id: I43142b672369b1a9a1cc6a3deff92f456b27fa1a
---
M docroot/noc/index.html
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/docroot/noc/index.html b/docroot/noc/index.html
index 17fcef9..039e899 100644
--- a/docroot/noc/index.html
+++ b/docroot/noc/index.html
@@ -25,7 +25,7 @@
   Core DB Replication Layout and Lag
   DB clusters
   Database cluster info
-   https://ganglia.wikimedia.org/;>Ganglia
+   https://grafana.wikimedia.org/;>Grafana
   Server utilization
https://phabricator.wikimedia.org/;>Phabricator
   Bug tracker

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

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

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Try again with using 'ownerin:' instead of hardcoded ...

2017-11-17 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/392112 )

Change subject: Try again with using 'ownerin:' instead of hardcoded list
..


Try again with using 'ownerin:' instead of hardcoded list

Follows-up 6268aed4700edde881, bbb26c4ef4b. Last time we tried
this caused Gerrit to take over 10 seconds to query the dashboard.
Not sure why, but doing a manual query now seems to show that
that bug has been fixed.

Change-Id: I349dac9983ee317d979372f92f3fcfc23d7ee51a
---
M custom
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/custom b/custom
index 961a069..cc549da 100644
--- a/custom
+++ b/custom
@@ -1,7 +1,7 @@
 [dashboard]
   title = Performance Team
   description = Custom dashboard for the Performance Team
-  foreach = (owner:Ori.livneh OR owner:asch...@wikimedia.org OR owner:Gilles 
OR owner:Krinkle OR owner:Phedenskog)
+  foreach = ownerin:performance
 [section "Pending patches by team"]
   query = is:open -owner:self -message:WIP -message:DNM -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
 [section "My patches for review"]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I349dac9983ee317d979372f92f3fcfc23d7ee51a
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: Try again with using 'ownerin:' instead of hardcoded ...

2017-11-17 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392112 )

Change subject: Try again with using 'ownerin:' instead of hardcoded list
..

Try again with using 'ownerin:' instead of hardcoded list

Follows-up 6268aed4700edde881, bbb26c4ef4b. Last time we tried
this caused Gerrit to take over 10 seconds to query the dashboard.
Not sure why, but doing a manual query now seems to show that
that bug has been fixed.

Change-Id: I349dac9983ee317d979372f92f3fcfc23d7ee51a
---
M custom
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance refs/changes/12/392112/1

diff --git a/custom b/custom
index 961a069..cc549da 100644
--- a/custom
+++ b/custom
@@ -1,7 +1,7 @@
 [dashboard]
   title = Performance Team
   description = Custom dashboard for the Performance Team
-  foreach = (owner:Ori.livneh OR owner:asch...@wikimedia.org OR owner:Gilles 
OR owner:Krinkle OR owner:Phedenskog)
+  foreach = ownerin:performance
 [section "Pending patches by team"]
   query = is:open -owner:self -message:WIP -message:DNM -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
 [section "My patches for review"]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I349dac9983ee317d979372f92f3fcfc23d7ee51a
Gerrit-PatchSet: 1
Gerrit-Project: performance
Gerrit-Branch: refs/meta/dashboards/custom
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: mw.MediaWikiPlayerSupport: Fix more .bind() deprecation warn...

2017-11-16 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391991 )

Change subject: mw.MediaWikiPlayerSupport: Fix more .bind() deprecation warnings
..

mw.MediaWikiPlayerSupport: Fix more .bind() deprecation warnings

Bug: T169385
Change-Id: I241d1e3e3f400e812d10507b6b6aee7f9c4a1e7c
---
M resources/mw.MediaWikiPlayerSupport.js
1 file changed, 5 insertions(+), 5 deletions(-)


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

diff --git a/resources/mw.MediaWikiPlayerSupport.js 
b/resources/mw.MediaWikiPlayerSupport.js
index a382d62..f57eece 100644
--- a/resources/mw.MediaWikiPlayerSupport.js
+++ b/resources/mw.MediaWikiPlayerSupport.js
@@ -11,7 +11,7 @@
} );
 
// Add mediaWiki player support to target embedPlayer
-   $( mw ).bind( 'EmbedPlayerNewPlayer', function ( event, embedPlayer ) {
+   $( mw ).on( 'EmbedPlayerNewPlayer', function ( event, embedPlayer ) {
mw.addMediaWikiPlayerSupport( embedPlayer );
} );
 
@@ -250,7 +250,7 @@
} );
 
// Show credits on clip complete:
-   $( embedPlayer ).bind( 'onEndedDone', function ( event, id ) {
+   $( embedPlayer ).on( 'onEndedDone', function ( event, id ) {
var cb;
if ( embedPlayer.id !== id ) {
// possible event trigger error. ( skip )
@@ -268,7 +268,7 @@
cb.showMenuItem( 'credits' );
} );
 
-   $( embedPlayer ).bind( 'showInlineDownloadLink', function () {
+   $( embedPlayer ).on( 'showInlineDownloadLink', function () {
// Add recommend HTML5 player if we have non-native 
playback:
if ( embedPlayer.controlBuilder.checkNativeWarning() ) {
embedPlayer.controlBuilder.addWarningBinding(
@@ -286,7 +286,7 @@
}
} );
 
-   $( embedPlayer ).bind( 'TimedText_BuildCCMenu', function ( 
event, $menu, id ) {
+   $( embedPlayer ).on( 'TimedText_BuildCCMenu', function ( event, 
$menu, id ) {
var thisep,
pageTitle,
addTextPage,
@@ -362,7 +362,7 @@
} );
} );
 
-   $( embedPlayer ).bind( 'getShareIframeSrc', function ( event, 
callback, id ) {
+   $( embedPlayer ).on( 'getShareIframeSrc', function ( event, 
callback, id ) {
var iframeUrl = false;
if ( id !== embedPlayer.id ) {
embedPlayer = $( '#' + id )[ 0 ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I241d1e3e3f400e812d10507b6b6aee7f9c4a1e7c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

___
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: Enable profiler based on same signals as production does

2017-11-16 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391987 )

Change subject: labs: Enable profiler based on same signals as production does
..

labs: Enable profiler based on same signals as production does

Bug: T180766
Change-Id: I8179ed9ed3c7f0bc0ee951d2055514e00467d6d8
---
M wmf-config/CommonSettings-labs.php
1 file changed, 9 insertions(+), 2 deletions(-)


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

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 5296b05..75fbf66 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -18,8 +18,15 @@
 #
 
 if ( $wmfRealm == 'labs' ) {  # safe guard
-// test wiki
-if ( $wgDBname == 'testwiki' ) {
+
+// Profiler (similar to wmf-config/profiler.php for production)
+// 1. Web request for https://test.wikimedia.beta.wmflabs.org/
+// 2. Web request with X-Wikimedia-Debug and ?forceprofile=1
+// 3. Maintenance script with --profiler=text
+if ( $wgDBname == 'testwiki'
+   || PHP_SAPI === 'cli'
+   || ( isset( $_GET['forceprofile'] ) && isset( 
$_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] ) )
+) {
$wgProfiler = [
'class' => 'ProfilerXhprof',
'output' => 'text',

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

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

___
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: Clean up outdated wgProfiler config

2017-11-16 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391982 )

Change subject: labs: Clean up outdated wgProfiler config
..

labs: Clean up outdated wgProfiler config

* Define $wgProfiler cleanly (not augmenting a predefined array).
* Remove `udphost` (no longer recognised by MediaWiki).

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


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

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 5d61866..6db69a8 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -21,15 +21,15 @@
 // test wiki
 if ( $wgDBname == 'testwiki' ) {
$wgDebugToolbar = true;
-   $wgProfiler['class'] = 'ProfilerXhprof';
-   $wgProfiler['output'] = [ 'text' ];
+   $wgProfiler = [
+   'class' => 'ProfilerXhprof'
+   'output' => 'text',
+   ];
 }
 
 if ( file_exists( '/etc/wmflabs-instancename' ) ) {
$wgOverrideHostname = trim( file_get_contents( 
'/etc/wmflabs-instancename' ) );
 }
-
-$wgProfiler['udphost'] = 'labmon1001.eqiad.wmnet';
 
 $wgDebugTimestamps = true;
 

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: wikidatawiki back to wmf.7

2017-11-15 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391755 )

Change subject: wikidatawiki back to wmf.7
..

wikidatawiki back to wmf.7

Follows-up 75a290113.

Pushing local unstaged change from tin.eqiad.wmnet.

Change-Id: I086cea3582360e0f15d80904477482b7cea38680
---
M wikiversions.json
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/wikiversions.json b/wikiversions.json
index 12c325d..e875bc1 100644
--- a/wikiversions.json
+++ b/wikiversions.json
@@ -861,7 +861,7 @@
 "wawiktionary": "php-1.31.0-wmf.8",
 "wbwikimedia": "php-1.31.0-wmf.8",
 "wg_enwiki": "php-1.31.0-wmf.7",
-"wikidatawiki": "php-1.31.0-wmf.8",
+"wikidatawiki": "php-1.31.0-wmf.7",
 "wikimania2005wiki": "php-1.31.0-wmf.8",
 "wikimania2006wiki": "php-1.31.0-wmf.8",
 "wikimania2007wiki": "php-1.31.0-wmf.8",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I086cea3582360e0f15d80904477482b7cea38680
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Chad 

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


[MediaWiki-commits] [Gerrit] mediawiki/extensions[master]: Archive the ActivityMonitor extension

2017-11-15 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/391644 )

Change subject: Archive the ActivityMonitor extension
..


Archive the ActivityMonitor extension

Bug: T180631
Change-Id: I92b097d12203773a423474d475a5c6d0fdb9b501
---
M .gitmodules
D ActivityMonitor
2 files changed, 0 insertions(+), 5 deletions(-)

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



diff --git a/.gitmodules b/.gitmodules
index d729a10..b180df7 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -30,10 +30,6 @@
path = ActiveAbstract
url = https://gerrit.wikimedia.org/r/mediawiki/extensions/ActiveAbstract
branch = .
-[submodule "ActivityMonitor"]
-   path = ActivityMonitor
-   url = 
https://gerrit.wikimedia.org/r/mediawiki/extensions/ActivityMonitor
-   branch = .
 [submodule "AdManager"]
path = AdManager
url = https://gerrit.wikimedia.org/r/mediawiki/extensions/AdManager
diff --git a/ActivityMonitor b/ActivityMonitor
deleted file mode 16
index ba0fcd0..000
--- a/ActivityMonitor
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit ba0fcd014f9477bc4e7c897017e70b31a9f8f156

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I92b097d12203773a423474d475a5c6d0fdb9b501
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Reedy 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: [WIP] Split profile.php from StartProfiler and add PhpAutoPr...

2017-11-13 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391162 )

Change subject: [WIP] Split profile.php from StartProfiler and add 
PhpAutoPrepend
..

[WIP] Split profile.php from StartProfiler and add PhpAutoPrepend

Bug: T180183
Change-Id: I60cce0eb51101d9e3fed7a65890c101ddd39e7d0
---
A wmf-config/PhpAutoPrepend.php
M wmf-config/StartProfiler.php
A wmf-config/profiler.php
3 files changed, 282 insertions(+), 246 deletions(-)


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

diff --git a/wmf-config/PhpAutoPrepend.php b/wmf-config/PhpAutoPrepend.php
new file mode 100644
index 000..d29a893
--- /dev/null
+++ b/wmf-config/PhpAutoPrepend.php
@@ -0,0 +1,20 @@
+https://secure.php.net/manual/en/ini.core.php#ini.auto-prepend-file
+ */
+
+require_once __DIR__ . '/profiler.php';
diff --git a/wmf-config/StartProfiler.php b/wmf-config/StartProfiler.php
index a11cecf..93fbe0c 100644
--- a/wmf-config/StartProfiler.php
+++ b/wmf-config/StartProfiler.php
@@ -12,250 +12,7 @@
 # DefaultSettings.php, and wmf-config CommonSettings or InitialiseSettings.
 # ##
 
-/**
- * File overview:
- *
- * 1. Parse X-Wikimedia-Header
- * 2. One-off profile to stdout (via MediaWiki)
- * 3. One-off profile to /tmp (from localhost)
- * 4. Sampling profiler for production traffic
- * 5. One-off profile to XHGui.
- */
+// profiler.php defines $wmfProfiler
+require_once __DIR__ . '/profiler.php';
 
-/**
- * 1) Parse X-Wikimedia-Header
- *
- * If the X-Wikimedia-Header is present, parse it into an associative array.
- *
- * See https://wikitech.wikimedia.org/wiki/X-Wikimedia-Debug
- */
-$XWD = false;
-if ( isset( $_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] ) ) {
-   parse_str( preg_replace( '/; ?/', '&', 
$_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] ), $XWD );
-}
-
-if ( ini_get( 'hhvm.stats.enable_hot_profiler' ) ) {
-   /**
-* 2) One-off profile to stdout
-*
-* MediaWiki's Profiler class can output raw profile data directly to 
the output
-* of a web response (web), or in stdout (CLI).
-*
-* For web: Set X-Wikimedia-Debug (to bypass cache) and query param 
'forceprofile=1'.
-* For CLI: Set CLI option '--profiler=text'.
-*
-* See https://www.mediawiki.org/wiki/Manual:Profiling
-*/
-   if (
-   ( isset( $_GET['forceprofile'] ) && isset( 
$_SERVER['HTTP_X_WIKIMEDIA_DEBUG'] ) )
-   || PHP_SAPI === 'cli'
-   ) {
-   $wgProfiler = [
-   'class'  => 'ProfilerXhprof',
-   'flags'  => XHPROF_FLAGS_NO_BUILTINS,
-   'output' => 'text',
-   ];
-
-   /**
-* 3) One-off profile to /tmp
-*
-* When making requests to the local server using shell access,
-* setting the 'Force-Local-XHProf: 1' header will write raw profile 
data
-* directly to a local file in /tmp/xhprof/.
-*
-* Note: This is only allowed for requests within the same server.
-*/
-   } elseif (
-   isset( $_SERVER['HTTP_FORCE_LOCAL_XHPROF'] )
-   && isset( $_SERVER['REMOTE_ADDR'] )
-   && $_SERVER['REMOTE_ADDR'] == '127.0.0.1'
-   && is_writable( '/tmp/xhprof' )
-   ) {
-   xhprof_enable();
-   register_shutdown_function( function () {
-   $prof = xhprof_disable();
-   $titleFormat = "%-75s %6s %13s %13s %13s\n";
-   $format = "%-75s %6d %13.3f %13.3f %13.3f%%\n";
-   $out = sprintf( $titleFormat, 'Name', 'Calls', 'Total', 
'Each', '%' );
-   if ( empty( $prof['main()']['wt'] ) ) {
-   return;
-   }
-   $total = $prof['main()']['wt'];
-   uksort( $prof, function ( $a, $b ) use ( $prof ) {
-   if ( $prof[$a]['wt'] < $prof[$b]['wt'] ) {
-   return 1;
-   } elseif ( $prof[$a]['wt'] > $prof[$b]['wt'] ) {
-   return -1;
-   } else {
-   return 0;
-   }
-   } );
-
-   foreach ( $prof as $name => $info ) {
-   $out .= sprintf( $format, $name, $info['ct'], 
$info['wt'] / 1000,
-   $info['wt'] / $info['ct'] / 1000,
-   $info['wt'] / $total * 100 );
-   }
-   file_put_contents( '/tmp/xhprof/' . date( 
'Y-m-d\TH:i:s' ) . '.prof', $out );
-   } );
-   }
-}
-
-/**
- * 4) 

[MediaWiki-commits] [Gerrit] mediawiki...Vector[master]: VectorTemplate: Restore 'id' for siteNotice wrapper

2017-11-13 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391158 )

Change subject: VectorTemplate: Restore 'id' for siteNotice wrapper
..

VectorTemplate: Restore 'id' for siteNotice wrapper

Follows-up bc47b4f.

Change-Id: I4220077679ac6d33650ed82a59696f22f1715485
---
M VectorTemplate.php
1 file changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/VectorTemplate.php b/VectorTemplate.php
index 110d902..5c15503 100644
--- a/VectorTemplate.php
+++ b/VectorTemplate.php
@@ -62,7 +62,10 @@
data['sitenotice'] ) {
echo Html::rawElement( 'div',
-   [ 'class' => 'mw-body-content' ],
+   [
+   'id' => 'siteNotice',
+   'class' => 'mw-body-content',
+   ],
// Raw HTML
$this->get( 'sitenotice' )
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4220077679ac6d33650ed82a59696f22f1715485
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Improve StartProfiler.php file documentation

2017-11-10 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390548 )

Change subject: Improve StartProfiler.php file documentation
..

Improve StartProfiler.php file documentation

In preparation for refactoring.

Bug: T180183
Change-Id: Id27227b23e2e6d70b34f686dcff85b882a88fe45
---
M wmf-config/HHVMRequestInit.php
M wmf-config/StartProfiler.php
2 files changed, 23 insertions(+), 4 deletions(-)


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

diff --git a/wmf-config/HHVMRequestInit.php b/wmf-config/HHVMRequestInit.php
index 1919a72..e70040f 100644
--- a/wmf-config/HHVMRequestInit.php
+++ b/wmf-config/HHVMRequestInit.php
@@ -1,4 +1,6 @@
 https://gerrit.wikimedia.org/r/390548
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] labs...guc[master]: frontend: Restore replag warning

2017-11-10 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390543 )

Change subject: frontend: Restore replag warning
..

frontend: Restore replag warning

It was still trying to insert before `.maincontent form`, which
no longer exists as of 4c5b7cd.

Change-Id: Ic28fc82725f454789258336cb2a7e78e58755371
---
M resources/frontend.js
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/guc 
refs/changes/43/390543/1

diff --git a/resources/frontend.js b/resources/frontend.js
index 377cb45..6c41c29 100644
--- a/resources/frontend.js
+++ b/resources/frontend.js
@@ -49,10 +49,12 @@
 if (!lagged) {
 return;
 }
+var p = document.createElement('p');
+p.innerHTML = lagged.html;
 var node = document.createElement('div');
-node.className = 'error';
-node.innerHTML = lagged.html;
-var target = document.querySelector('.maincontent form');
+node.className = 'container error';
+node.appendChild(p);
+var target = document.querySelector('#searchForm');
 target.parentNode.insertBefore(node, target.nextSibling);
 })
 .catch(function (err) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic28fc82725f454789258336cb2a7e78e58755371
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Add warning and documentation comment to HHVMRequestInit.php

2017-11-10 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390526 )

Change subject: Add warning and documentation comment to HHVMRequestInit.php
..

Add warning and documentation comment to HHVMRequestInit.php

Ref T180183.

Change-Id: Idc5f71eef482d84918fb4daf568fc99aa42bd266
---
M wmf-config/HHVMRequestInit.php
1 file changed, 22 insertions(+), 4 deletions(-)


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

diff --git a/wmf-config/HHVMRequestInit.php b/wmf-config/HHVMRequestInit.php
index 9128263..dfffe28 100644
--- a/wmf-config/HHVMRequestInit.php
+++ b/wmf-config/HHVMRequestInit.php
@@ -1,10 +1,28 @@
 https://gerrit.wikimedia.org/r/390526
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Setup: Include StartProfiler before others

2017-11-09 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390351 )

Change subject: Setup: Include StartProfiler before others
..

Setup: Include StartProfiler before others

Bug: T180183
Change-Id: Ibcf78d094cf4dcf09bc919a5f8168f45ae225ebc
---
M includes/Setup.php
M tests/phpunit/autoload.ide.php
2 files changed, 9 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/390351/1

diff --git a/includes/Setup.php b/includes/Setup.php
index 5d8520b..4c281b1 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -37,17 +37,17 @@
  * Pre-config setup: Before loading LocalSettings.php
  */
 
+// Get profiler configuraton
+$wgProfiler = [];
+if ( file_exists( "$IP/StartProfiler.php" ) ) {
+   require "$IP/StartProfiler.php";
+}
+
 // Start the autoloader, so that extensions can derive classes from core files
 require_once "$IP/includes/AutoLoader.php";
 
 // Load up some global defines
 require_once "$IP/includes/Defines.php";
-
-// Start the profiler
-$wgProfiler = [];
-if ( file_exists( "$IP/StartProfiler.php" ) ) {
-   require "$IP/StartProfiler.php";
-}
 
 // Load default settings
 require_once "$IP/includes/DefaultSettings.php";
diff --git a/tests/phpunit/autoload.ide.php b/tests/phpunit/autoload.ide.php
index f883cf6..6f09d4c 100644
--- a/tests/phpunit/autoload.ide.php
+++ b/tests/phpunit/autoload.ide.php
@@ -38,14 +38,13 @@
 // to $maintenance->mSelf. Keep that here for b/c
 $self = $maintenance->getName();
 global $IP;
-# Start the autoloader, so that extensions can derive classes from core files
-require_once "$IP/includes/AutoLoader.php";
-
-# Start the profiler
+# Get profiler configuraton
 $wgProfiler = [];
 if ( file_exists( "$IP/StartProfiler.php" ) ) {
require "$IP/StartProfiler.php";
 }
+# Start the autoloader, so that extensions can derive classes from core files
+require_once "$IP/includes/AutoLoader.php";
 
 $requireOnceGlobalsScope = function ( $file ) use ( $self ) {
foreach ( array_keys( $GLOBALS ) as $varName ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Merge ProfilerFunctions into GlobalFunctions

2017-11-09 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390350 )

Change subject: Merge ProfilerFunctions into GlobalFunctions
..

Merge ProfilerFunctions into GlobalFunctions

Even if people use these (deprecated) functions in the earliest hooks or in
LocalSettings.php, it will keep working because GlobalFunctions is loaded
between DefaultSettings.php and LocalSettings.php.

The only places affected would be files in core: AutoLoader.php, Defines.php,
and DefaultSettings.php, which don't use these functions.

Change-Id: If4c0e8cbe1ea918283df22d72f792a3806569216
---
M includes/GlobalFunctions.php
M includes/Setup.php
D includes/profiler/ProfilerFunctions.php
M tests/phpunit/autoload.ide.php
4 files changed, 34 insertions(+), 61 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/50/390350/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 1cff881..404d115 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3487,3 +3487,37 @@
 
return $baseArray;
 }
+
+/**
+ * Get system resource usage of current request context.
+ * Invokes the getrusage(2) system call, requesting RUSAGE_SELF if on PHP5
+ * or RUSAGE_THREAD if on HHVM. Returns false if getrusage is not available.
+ *
+ * @since 1.24
+ * @return array|bool Resource usage data or false if no data available.
+ */
+function wfGetRusage() {
+   if ( !function_exists( 'getrusage' ) ) {
+   return false;
+   } elseif ( defined( 'HHVM_VERSION' ) && PHP_OS === 'Linux' ) {
+   return getrusage( 2 /* RUSAGE_THREAD */ );
+   } else {
+   return getrusage( 0 /* RUSAGE_SELF */ );
+   }
+}
+
+/**
+ * Begin profiling of a function
+ * @param string $functionname Name of the function we will profile
+ * @deprecated since 1.25
+ */
+function wfProfileIn( $functionname ) {
+}
+
+/**
+ * Stop profiling of a function
+ * @param string $functionname Name of the function we have profiled
+ * @deprecated since 1.25
+ */
+function wfProfileOut( $functionname = 'missing' ) {
+}
diff --git a/includes/Setup.php b/includes/Setup.php
index e4396ba..5d8520b 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -37,9 +37,6 @@
  * Pre-config setup: Before loading LocalSettings.php
  */
 
-// Grab profiling functions
-require_once "$IP/includes/profiler/ProfilerFunctions.php";
-
 // Start the autoloader, so that extensions can derive classes from core files
 require_once "$IP/includes/AutoLoader.php";
 
diff --git a/includes/profiler/ProfilerFunctions.php 
b/includes/profiler/ProfilerFunctions.php
deleted file mode 100644
index cc71630..000
--- a/includes/profiler/ProfilerFunctions.php
+++ /dev/null
@@ -1,56 +0,0 @@
-http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Profiler
- */
-
-/**
- * Get system resource usage of current request context.
- * Invokes the getrusage(2) system call, requesting RUSAGE_SELF if on PHP5
- * or RUSAGE_THREAD if on HHVM. Returns false if getrusage is not available.
- *
- * @since 1.24
- * @return array|bool Resource usage data or false if no data available.
- */
-function wfGetRusage() {
-   if ( !function_exists( 'getrusage' ) ) {
-   return false;
-   } elseif ( defined( 'HHVM_VERSION' ) && PHP_OS === 'Linux' ) {
-   return getrusage( 2 /* RUSAGE_THREAD */ );
-   } else {
-   return getrusage( 0 /* RUSAGE_SELF */ );
-   }
-}
-
-/**
- * Begin profiling of a function
- * @param string $functionname Name of the function we will profile
- * @deprecated since 1.25
- */
-function wfProfileIn( $functionname ) {
-}
-
-/**
- * Stop profiling of a function
- * @param string $functionname Name of the function we have profiled
- * @deprecated since 1.25
- */
-function wfProfileOut( $functionname = 'missing' ) {
-}
diff --git a/tests/phpunit/autoload.ide.php b/tests/phpunit/autoload.ide.php
index 106ab683..f883cf6 100644
--- a/tests/phpunit/autoload.ide.php
+++ b/tests/phpunit/autoload.ide.php
@@ -40,8 +40,6 @@
 global $IP;
 # Start the autoloader, so that extensions can derive classes from core files
 require_once "$IP/includes/AutoLoader.php";
-# Grab profiling functions
-require_once "$IP/includes/profiler/ProfilerFunctions.php";
 
 # Start the profiler
 $wgProfiler = [];

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Vector[master]: VectorTemplate: Some consistency in mixed PHP/HTML formatting

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

Change subject: VectorTemplate: Some consistency in mixed PHP/HTML formatting
..

VectorTemplate: Some consistency in mixed PHP/HTML formatting

Consistently do the following in this file:
* Open '


-
data['sitenotice'] ) {
?>
@@ -137,7 +136,6 @@


msg( 'navigation-heading' ) ?>
-

renderNavigation( 'PERSONAL' ); ?>

@@ -158,42 +156,42 @@

html( 
'userlangattributes' ) ?>>
getFooterLinks() as $category => 
$links ) {
-   ?>
+   foreach ( $this->getFooterLinks() as $category 
=> $links ) {
+   ?>

-   
-   html( $link ) ?>
-   
+   html( $link ) ?>
+   
+   ?>


getFooterIcons( 'icononly' 
);
if ( count( $footericons ) > 0 ) {
?>

-
$footerIcons ) {
-   ?>
-   
-   getSkin()->makeFooterIcon( $icon );
-   }
-   ?>
-   
+   ?>
+   
getSkin()->makeFooterIcon( $icon );
+   }
?>
+   
+   


-   
+   

printTrail(); ?>
 
@@ -266,9 +264,8 @@
 
id=''>exists() ? 
$msgObj->text() : $msg );
?>
-

-   

@@ -290,7 +287,7 @@
}
 
$this->renderAfterPortlet( $name );
-   ?>
+   ?>


" 
aria-labelledby="p-namespaces-label">
msg( 'namespaces' ) ?>
>
-   data['namespace_urls'] as $key => $item ) {
-   echo 
"\t\t\t\t\t\t\t" . $this->makeListItem( $key, $item, [
+   echo 
$this->makeListItem( $key, $item, [

'vector-wrap' => true,
-   ] ) . "\n";
+   ] );
}
-   ?>
+   ?>


" aria-labelledby="p-variants-label">
getMsg( 
'variants' )->text();
-   foreach ( 
$this->data['variant_urls'] as $item ) {
-   if ( isset( 
$item['class'] ) && stripos( $item['class'], 'selected' ) !== false ) {
-   $variantLabel = 
$item['text'];
-   break;
+   // Replace the label 
with the name of currently chosen variant, if any
+   $variantLabel = 
$this->getMsg( 'variants' )->text();
+   foreach ( 
$this->data['variant_urls'] as $item ) {
+   if ( isset( 
$item['class'] 

[MediaWiki-commits] [Gerrit] mediawiki...Vector[master]: VectorTemplate: Refactor literal HTML by using Html methods ...

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

Change subject: VectorTemplate: Refactor literal HTML by using Html methods 
instead
..

VectorTemplate: Refactor literal HTML by using Html methods instead

To some degree the literal HTML was (maybe) useful and self-documenting
at some point when the template was really simple, but until and unless
we really use an Html template for this, it's probably a lot easier to
maintain, understand and review (incl. from security perspective) if
we consistently use the Html class abstraction.

For now, I'm only focussing on cases where there is mixed literal HTML
with embedded PHP statements. The cases where HTML is created plain without
embedded PHP I'm leaving untouched for now.

Any case where attribute or content comes from PHP, use the Html class
instead to clearly indicate which values are escaped, and which are not.

Change-Id: Ib2d6425994918b0c17ef29c1b5d0f9893f61a889
---
M VectorTemplate.php
1 file changed, 34 insertions(+), 22 deletions(-)


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

diff --git a/VectorTemplate.php b/VectorTemplate.php
index 74aa3b7..247a5a2 100644
--- a/VectorTemplate.php
+++ b/VectorTemplate.php
@@ -61,30 +61,40 @@

data['sitenotice'] ) {
-   ?>
-   html( 'sitenotice' ) ?>
-'mw-body-content' ],
+   // Raw HTML
+   $this->get( 'sitenotice' )
+   );
}
-   ?>
-   getIndicators();
}
// Loose comparison with '!=' is intentional, to catch 
null and false too, but not '0'
if ( $this->data['title'] != '' ) {
+   echo Html::rawElement( 'h1',
+   [
+   'id' => 'firstHeading',
+   'class' => 'firstHeading',
+   'lang' => $this->get( 
'pageLanguage' ),
+   ],
+   // Raw HTML
+   $this->get( 'title' )
+   );
+   }
+
+   $this->html( 'prebodyhtml' );
?>
-   html( 'title' )
-   ?>
-   
-   html( 'prebodyhtml' ) ?>

data['isarticle'] ) {
-   ?>
-   msg( 'tagline' ) ?>
-'siteSub',
+   'class' => 'noprint',
+   ],
+   $this->getMsg( 'tagline' 
)->text()
+   );
}
?>
html( 
'userlangattributes' ) ?>>
data['undelete'] ) {
-   ?>
-   html( 'undelete' ) ?>
-'contentSub2' ],
+   // Raw HTML
+   $this->get( 'undelete' )
+   );
}
-   ?>
-   data['newtalk'] ) {
-   ?>
-   html( 'newtalk' ) ?>
-'usermessage' ],
+   // Raw HTML
+   $this->get( 'newtalk' )
+   );
}
?>


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2d6425994918b0c17ef29c1b5d0f9893f61a889
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: webperf: Refactor tests to directly associate expected data ...

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

Change subject: webperf: Refactor tests to directly associate expected data 
with cases
..

webperf: Refactor tests to directly associate expected data with cases

Previously we had a file with all input and a file with all output,
which is pretty hard to review and basically only helps catch errors
when the intent is to change nothing in the output.

Whenever we do make a change in the output, the expected data was
sufficiently mixed up that one basically ends up just recreating
it with the new input with no feasible way to review.

Hopefully this new structure will make it easier to review by
having the input and expected output directly associated with
each another, and in the same file.

Change-Id: Ibb6c11476535e45490a5147294099d1965a3f970
---
D modules/webperf/files/navtiming_expected.txt
M modules/webperf/files/navtiming_fixture.yaml
M modules/webperf/files/navtiming_test.py
3 files changed, 463 insertions(+), 6,775 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/83/390083/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: webperf: Record navtiming discards to Graphite, and add is_s...

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

Change subject: webperf: Record navtiming discards to Graphite, and add is_sane 
test
..

webperf: Record navtiming discards to Graphite, and add is_sane test

* Add a test case that has some of the values exceed 180s,
  to test the is_sane() filter.

  Observerved in navtiming (1):
  - The earlier values in the same event are still reported. (known bug, fixed 
in v2)
  - The ones above the treshold are ignored. (desired behaviour)
  - The ones for by_continent and by_country are not filtered by sanity. 
(previously
unknown bug, but already fixed in v2).
  Observed in navtiming (2):
  - The event is discarded in its entirely,
no partial reports of incomplete data. (desired behaviour)

* Add a new metric that records in Graphite when an event is discarded.
  This is similar to the logic we have already on the client-side where
  we increment the navtiming.logFailure.nonCompliant counter if the values
  were corrupted or not standards-compliant.

Change-Id: I5c4dc247f131ce9eceaef0d60e844aaf4039556b
---
M modules/webperf/files/navtiming.py
M modules/webperf/files/navtiming_expected.txt
M modules/webperf/files/navtiming_fixture.yaml
3 files changed, 44 insertions(+), 114 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/61/390061/1

diff --git a/modules/webperf/files/navtiming.py 
b/modules/webperf/files/navtiming.py
index d055375..dfbe0a4 100755
--- a/modules/webperf/files/navtiming.py
+++ b/modules/webperf/files/navtiming.py
@@ -306,10 +306,24 @@
 
 
 def make_stat(*args):
+"""
+Create a statsd packet for adding a measure to a Timing metric
+"""
 args = list(args)
 value = args.pop()
 name = '.'.join(arg.replace(' ', '_') for arg in args)
 stat = '%s:%s|ms' % (name, value)
+return stat.encode('utf-8')
+
+
+def make_count(*args):
+"""
+Create a statsd packet for incrementing a Counter metric
+"""
+args = list(args)
+value = 1
+name = '.'.join(arg.replace(' ', '_') for arg in args)
+stat = '%s:%s|c' % (name, value)
 return stat.encode('utf-8')
 
 
@@ -453,12 +467,14 @@
 
 # If one of the metrics are wrong, don't send them at all
 for metric, value in metrics_nav2.items():
-isSane = is_sanev2(value)
-if not isSane:
+if not is_sanev2(value):
+isSane = False
 break
 
 # If one of the metrics are over the max then skip it entirely
-if (isSane):
+if not isSane:
+yield make_count('frontend.navtiming_discard', 'isSane')
+else:
 for metric, value in metrics_nav2.items():
 prefix = 'frontend.navtiming2'
 yield make_stat(prefix, metric, site, auth, value)
diff --git a/modules/webperf/files/navtiming_expected.txt 
b/modules/webperf/files/navtiming_expected.txt
index 3ff6424..d1d846c 100644
--- a/modules/webperf/files/navtiming_expected.txt
+++ b/modules/webperf/files/navtiming_expected.txt
@@ -198,9 +198,7 @@
 frontend.navtiming.domComplete.by_browser.Chrome.all:393|ms
 frontend.navtiming.domComplete.by_browser.Chrome_Mobile_iOS.61:964|ms
 frontend.navtiming.domComplete.by_browser.Chrome_Mobile_iOS.all:964|ms
-frontend.navtiming.domComplete.by_browser.Edge.15:10377|ms
 frontend.navtiming.domComplete.by_browser.Edge.15:460|ms
-frontend.navtiming.domComplete.by_browser.Edge.all:10377|ms
 frontend.navtiming.domComplete.by_browser.Edge.all:460|ms
 frontend.navtiming.domComplete.by_browser.Firefox.52:2016|ms
 frontend.navtiming.domComplete.by_browser.Firefox.55:1693|ms
@@ -250,7 +248,6 @@
 frontend.navtiming.domComplete.by_continent.Asia:1372|ms
 frontend.navtiming.domComplete.by_continent.Asia:2831|ms
 frontend.navtiming.domComplete.by_continent.Europe:1036|ms
-frontend.navtiming.domComplete.by_continent.Europe:10377|ms
 frontend.navtiming.domComplete.by_continent.Europe:1037|ms
 frontend.navtiming.domComplete.by_continent.Europe:1037|ms
 frontend.navtiming.domComplete.by_continent.Europe:1037|ms
@@ -272,6 +269,7 @@
 frontend.navtiming.domComplete.by_continent.Europe:1920|ms
 frontend.navtiming.domComplete.by_continent.Europe:2013|ms
 frontend.navtiming.domComplete.by_continent.Europe:2016|ms
+frontend.navtiming.domComplete.by_continent.Europe:203077|ms
 frontend.navtiming.domComplete.by_continent.Europe:2030|ms
 frontend.navtiming.domComplete.by_continent.Europe:2272|ms
 frontend.navtiming.domComplete.by_continent.Europe:2560|ms
@@ -311,7 +309,6 @@
 frontend.navtiming.domComplete.by_country.United_States:104|ms
 frontend.navtiming.domComplete.by_country.United_States:1267|ms
 frontend.navtiming.domComplete.desktop.anonymous:1036|ms
-frontend.navtiming.domComplete.desktop.anonymous:10377|ms
 frontend.navtiming.domComplete.desktop.anonymous:1037|ms
 frontend.navtiming.domComplete.desktop.anonymous:1037|ms
 

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[wmf/1.31.0-wmf.7]: Use the proper cache key method in loadFromCache()

2017-11-07 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389917 )

Change subject: Use the proper cache key method in loadFromCache()
..

Use the proper cache key method in loadFromCache()

Bug: T17
Change-Id: I9199ad964377dd3d079cb2d55f0a2ea88acdad56
---
M includes/CentralAuthUser.php
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/17/389917/1

diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index 6a842b7..019a08a 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -492,7 +492,7 @@
protected function loadFromCache() {
$cache = ObjectCache::getMainWANInstance();
$data = $cache->getWithSetCallback(
-   $this->getCacheKey(),
+   $this->getCacheKey( $cache ),
$cache::TTL_DAY,
function ( $oldValue, &$ttl, array &$setOpts ) {
$dbr = CentralAuthUtils::getCentralSlaveDB();
@@ -569,10 +569,11 @@
 
/**
 * Generate a valid memcached key for caching the object's data.
+* @param WANObjectCache $cache
 * @return string
 */
-   protected function getCacheKey() {
-   return "centralauth-user-" . md5( $this->mName );
+   protected function getCacheKey( WANObjectCache $cache ) {
+   return $cache->makeGlobalKey( 'centralauth-user', md5( 
$this->mName ) );
}
 
/**
@@ -2905,7 +2906,8 @@
"Quick cache invalidation for global user 
{$this->mName}" );
 
CentralAuthUtils::getCentralDB()->onTransactionPreCommitOrIdle( 
function () {
-   ObjectCache::getMainWANInstance()->delete( 
$this->getCacheKey() );
+   $cache = ObjectCache::getMainWANInstance();
+   $cache->delete( $this->getCacheKey( $cache ) );
} );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9199ad964377dd3d079cb2d55f0a2ea88acdad56
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: wmf/1.31.0-wmf.7
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki...EventLogging[master]: hooks: Remove redundant wgMemc check in onSetup

2017-11-07 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389887 )

Change subject: hooks: Remove redundant wgMemc check in onSetup
..

hooks: Remove redundant wgMemc check in onSetup

This is run on all requests and not actually useful because
the EventLogging extension doesn't use the (deprecated) wgMemc
variable anywhere.

The place where it once (long ago) used it (RemoteSchema) no longer
depends on objectcache being configured because it uses CACHE_ANYTHING
which has a CACHE_DB fallback.

Change-Id: I8636adb6bf3c3149719e53c94ebc419c9d1d1030
---
M includes/EventLoggingHooks.php
1 file changed, 0 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging 
refs/changes/87/389887/1

diff --git a/includes/EventLoggingHooks.php b/includes/EventLoggingHooks.php
index c6a8265..384bd43 100644
--- a/includes/EventLoggingHooks.php
+++ b/includes/EventLoggingHooks.php
@@ -17,12 +17,6 @@
 * configuration variable (if any).
 */
public static function onSetup() {
-   global $wgMemc;
-
-   if ( get_class( $wgMemc ) === 'EmptyBagOStuff' ) {
-   wfDebugLog( 'EventLogging', 'No suitable memcached 
driver found.' );
-   }
-
foreach ( [
'wgEventLoggingBaseUri',
'wgEventLoggingDBname',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8636adb6bf3c3149719e53c94ebc419c9d1d1030
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Reduce initFlowExtension cost from Utils::isParsoidConfigured()

2017-11-07 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389886 )

Change subject: Reduce initFlowExtension cost from Utils::isParsoidConfigured()
..

Reduce initFlowExtension cost from Utils::isParsoidConfigured()

Hooks::initFlowExtension() is called on all requests (incl for load.php),
and seems to have a fair bit of overhead in Utils::isParsoidConfigured().

Currently, it creates VirtualRESTServiceClient, MultiHttpClient,
and VirtualRESTService, where most time is spent for the latter in
getVRSObject(). The only line that seems to matter here is
`if !$wgFlowParsoidURL: throw NoParserException`, but I'd rather not put
that in two places so as a first step, at least reduce isParsoidConfigured()
to only calling getVRSObject(), not the getServiceClient wrapper. This also
reduces the number of (likely) unused singletons held during the request.

Also:
* Declare the previously undeclared $serviceClient property.

Change-Id: Icaa0ba9c4b029d3fa6e592004d97e9dd99be2005
---
M includes/Conversion/Utils.php
1 file changed, 16 insertions(+), 2 deletions(-)


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

diff --git a/includes/Conversion/Utils.php b/includes/Conversion/Utils.php
index c3f2ece..0cf46e9 100644
--- a/includes/Conversion/Utils.php
+++ b/includes/Conversion/Utils.php
@@ -20,6 +20,9 @@
 use VirtualRESTServiceClient;
 
 abstract class Utils {
+   protected static $serviceClient;
+   protected static $vrsObject;
+
/**
 * Convert from/to wikitext <=> html or topic-title-wikitext => 
topic-title-html.
 * Only these pairs are supported.  html => wikitext requires Parsoid, 
and
@@ -216,7 +219,7 @@
 */
public static function isParsoidConfigured() {
try {
-   self::getServiceClient();
+   self::getVRSObject();
return true;
} catch ( NoParserException $e ) {
return false;
@@ -246,6 +249,17 @@
}
 
/**
+* @return \VirtualRESTService
+* @throws NoParserException
+*/
+   private static function getVRSObject() {
+   if ( !self::$vrsObject ) {
+   self::$vrsObject = self::makeVRSObject();;
+   }
+   return self::$vrsObject;
+   }
+
+   /**
 * Creates the Virtual REST Service object to be used in Flow's
 * API calls.  The method determines whether to instantiate a
 * ParsoidVirtualRESTService or a RestbaseVirtualRESTService
@@ -258,7 +272,7 @@
 * @return \VirtualRESTService the VirtualRESTService object to use
 * @throws NoParserException When Parsoid/RESTBase is not configured
 */
-   private static function getVRSObject() {
+   private static function makeVRSObject() {
global $wgVirtualRestConfig, $wgFlowParsoidURL, 
$wgFlowParsoidPrefix,
$wgFlowParsoidTimeout, $wgFlowParsoidForwardCookies,
$wgFlowParsoidHTTPProxy;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaa0ba9c4b029d3fa6e592004d97e9dd99be2005
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: grafana: Fix network graphs to not end in a weird drop to 0

2017-11-07 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389798 )

Change subject: grafana: Fix network graphs to not end in a weird drop to 0
..

grafana: Fix network graphs to not end in a weird drop to 0

The last data point for the current minute is often still missing
in Graphite and backfilled as null. The previous settings interpreted
nulls as zero, which is fine for a bar or pie chart, but for a line
graph it's just alarmingly confusing to have it drop to zero at
the end.

Fix by using the default "show null as null" instead, which means
the graph will have the line end slightly earlier, without a drop.

Change-Id: I6104f2de17b8b888e3c8a83c8097a335692996a3
---
M modules/grafana/files/dashboards/server-board
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/modules/grafana/files/dashboards/server-board 
b/modules/grafana/files/dashboards/server-board
index b9af9ce..00d7908 100644
--- a/modules/grafana/files/dashboards/server-board
+++ b/modules/grafana/files/dashboards/server-board
@@ -631,7 +631,7 @@
   "lines": true,
   "linewidth": 1,
   "links": [],
-  "nullPointMode": "null as zero",
+  "nullPointMode": "null",
   "options": false,
   "percentage": false,
   "pointradius": 5,
@@ -695,7 +695,7 @@
   "logBase": 1,
   "max": null,
   "min": null,
-  "show": true
+  "show": false
 }
   ],
   "zerofill": true
@@ -1509,5 +1509,5 @@
   },
   "timezone": "utc",
   "title": "Server Board",
-  "version": 37
+  "version": 39
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...EventLogging[master]: build: Remove outdated references to server/

2017-11-07 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389795 )

Change subject: build: Remove outdated references to server/
..

build: Remove outdated references to server/

The development version of the EventLogging server has not been
maintained in this repository since sometime in 2015.

All code related to the EventLogging server is now in
wikimedia/eventlogging.git. The MediaWiki extension in this
repository is purely an EventLogging client in JS, and PHP.

Also remove the Travis CI config as it has been failing for years
and is redundant with the Jenkins jobs already running from Gerrit.

Change-Id: I2a6eb3dfa1b7aa8e707a35718e16103709fe7579
---
M .gitignore
D .gitmodules
M .jshintignore
M .phpcs.xml
D .travis.yml
M README
M includes/ResourceLoaderSchemaModule.php
D server
D tox.ini
9 files changed, 12 insertions(+), 65 deletions(-)


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

diff --git a/.gitignore b/.gitignore
index 1b5201d..7a94899 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,20 +1,7 @@
-*.egg
-*.egg-info
-*.kate-swp
-*.pyo
-*.pyc
 *~
 .*.swp
-.pylintrc
-.tox
-__pycache__
-server/build
-server/dist
-server/env
-server/.coverage
-tests/suite.php
-.deploy
-node_modules/
-docs/
-composer.lock
-vendor
+/tests/suite.php
+/node_modules/
+/docs/
+/composer.lock
+/vendor
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 648bd61..000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "server"]
-   path = server
-   url = https://gerrit.wikimedia.org/r/eventlogging
diff --git a/.jshintignore b/.jshintignore
index c0a11b8..49152c8 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -1,4 +1,4 @@
-server/.tox
-modules/out
-node_modules
-docs
+/docs
+/modules/out
+/node_modules
+/vendor
diff --git a/.phpcs.xml b/.phpcs.xml
index b212fa2..d473d2b 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -11,5 +11,4 @@
.


-   ^server/*
 
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 6f335fa..000
--- a/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-# Test configuration for Travis CI. See .
-language: python
-python:
-- "2.7"
-- "3.4"
-install:
-- pip install -q pyzmq --install-option="--zmq=bundled"
-- pip install -q server/
-script:
-- cd server
-- python setup.py test
-notifications:
-irc: "irc.freenode.org#wikimedia-analytics"
-on_success: change
-on_failure: change
diff --git a/README b/README
index 1d489c2..a1b74ce 100644
--- a/README
+++ b/README
@@ -1,2 +1,2 @@
-For information on how to install and use this extension, please see:  

+For information on how to install and use this extension, please see:
   
diff --git a/includes/ResourceLoaderSchemaModule.php 
b/includes/ResourceLoaderSchemaModule.php
index 2372fdb..24cd8f1 100644
--- a/includes/ResourceLoaderSchemaModule.php
+++ b/includes/ResourceLoaderSchemaModule.php
@@ -44,9 +44,8 @@
}
 
if ( !is_int( $args['revision'] ) ) {
-   // Events will not validate on the Python server if 
this is defined
-   // wrong.  Enforce it here as well, so it can be more 
easily caught
-   // during local development.
+   // Events will not validate on the EventLogging server 
if this is defined
+   // wrong. Enforce it here as well, so it can be easily 
caught during development.
throw new Exception( "Revision for schema 
\"{$args['schema']}\" must be given as an integer" );
}
 
diff --git a/server b/server
deleted file mode 16
index 68fbd10..000
--- a/server
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 68fbd10a92a38d3a0d79280e6c0ed9619f337505
diff --git a/tox.ini b/tox.ini
deleted file mode 100644
index 41e9684..000
--- a/tox.ini
+++ /dev/null
@@ -1,19 +0,0 @@
-# tox wrapper for /server/tox.ini
-
-[tox]
-setupdir={toxinidir}/server
-skipsdist = true
-
-[testenv]
-commands = tox -c {toxinidir}/server/tox.ini -e {envname}
-changedir={toxinidir}/server
-deps = tox
-
-# Redefine envs from /server/tox.ini
-# Python 3.x is not supported due to dependencies
-
-[testenv:py27]
-
-[testenv:flake8]
-
-[testenv:flake8-bin]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a6eb3dfa1b7aa8e707a35718e16103709fe7579
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

___
MediaWiki-commits mailing list

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: upload: Simplify UploadStashTest by using getNewTempFile()

2017-11-06 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389664 )

Change subject: upload: Simplify UploadStashTest by using getNewTempFile()
..

upload: Simplify UploadStashTest by using getNewTempFile()

The parent class has a built-in list that tracks these files and
deletes them in a teardown.

I was unable to reproduce a case where $path + '.' is created by
MediaWiki. As far as I can tell, no current code exists in core
that would do this. If it does exist, we can keep the tearDown()
override with just that second case, but I'm removing it for now,
given it doesn't appear to be used.

Change-Id: I5847b7b266f1393d983aeb4b115bc0ae000e3547
---
M tests/phpunit/includes/upload/UploadStashTest.php
1 file changed, 1 insertion(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/389664/1

diff --git a/tests/phpunit/includes/upload/UploadStashTest.php 
b/tests/phpunit/includes/upload/UploadStashTest.php
index d754ba5..f46ad20 100644
--- a/tests/phpunit/includes/upload/UploadStashTest.php
+++ b/tests/phpunit/includes/upload/UploadStashTest.php
@@ -19,7 +19,7 @@
protected function setUp() {
parent::setUp();
 
-   $this->tmpFile = wfTempDir() . '/' . uniqid();
+   $this->tmpFile = $this->getNewTempFile();
file_put_contents( $this->tmpFile, "\x00" );
 
self::$users = [
@@ -36,18 +36,6 @@
[]
)
];
-   }
-
-   protected function tearDown() {
-   if ( file_exists( $this->tmpFile . "." ) ) {
-   unlink( $this->tmpFile . "." );
-   }
-
-   if ( file_exists( $this->tmpFile ) ) {
-   unlink( $this->tmpFile );
-   }
-
-   parent::tearDown();
}
 
/**

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaEvents[master]: Add modules/ sub directories to match module registration

2017-11-03 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/388573 )

Change subject: Add modules/ sub directories to match module registration
..

Add modules/ sub directories to match module registration

* One for 'all' (ext.wikimediaEvents)
* One for 'loggedin' (ext.wikimediaEvents.loggedin)

Remove:
* Unused humanSearchRelevance code (follows-up 80f389f62, T175047).
* Old and unused schemas:
  - TimingData (stopped years ago)
  - DeprecatedUsage (stopped years ago)
  - ModuleLoadFailure (stopped years ago)
  - HumanSearchRelevance (follows-up 80f389f62)

Change-Id: Ibbf32ad46ca7f2c6906ee2b5cbe29bbd8d5e4e69
---
M extension.json
R modules/all/ext.wikimediaEvents.events.js
R modules/all/ext.wikimediaEvents.geoFeatures.js
R modules/all/ext.wikimediaEvents.kartographer.js
R modules/all/ext.wikimediaEvents.print.js
R modules/all/ext.wikimediaEvents.readingDepth.js
R modules/all/ext.wikimediaEvents.recentChangesClicks.js
R modules/all/ext.wikimediaEvents.searchSatisfaction.js
R modules/all/ext.wikimediaEvents.statsd.js
D modules/ext.wikimediaEvents.humanSearchRelevance.css
D modules/ext.wikimediaEvents.humanSearchRelevance.js
R modules/loggedin/ext.wikimediaEvents.deprecate.js
12 files changed, 9 insertions(+), 194 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/73/388573/1

diff --git a/extension.json b/extension.json
index 1558b72..9f6d515 100644
--- a/extension.json
+++ b/extension.json
@@ -72,16 +72,6 @@
]
},
"ResourceModules": {
-   "schema.TimingData": {
-   "class": "ResourceLoaderSchemaModule",
-   "schema": "TimingData",
-   "revision": 7254808
-   },
-   "schema.DeprecatedUsage": {
-   "class": "ResourceLoaderSchemaModule",
-   "schema": "DeprecatedUsage",
-   "revision": 7906187
-   },
"schema.Print": {
"class": "ResourceLoaderSchemaModule",
"schema": "Print",
@@ -91,11 +81,6 @@
"class": "ResourceLoaderSchemaModule",
"schema": "ReadingDepth",
"revision": 16325045
-   },
-   "schema.ModuleLoadFailure": {
-   "class": "ResourceLoaderSchemaModule",
-   "schema": "ModuleLoadFailure",
-   "revision": 12407847
},
"schema.Edit": {
"class": "ResourceLoaderSchemaModule",
@@ -157,24 +142,19 @@
"schema": "RecentChangesTopLinks",
"revision": 16732249
},
-   "schema.HumanSearchRelevance": {
-   "class": "ResourceLoaderSchemaModule",
-   "schema": "HumanSearchRelevance",
-   "revision": 17073843
-   },
"ext.wikimediaEvents": {
"scripts": [
-   "ext.wikimediaEvents.events.js",
-   "ext.wikimediaEvents.statsd.js",
-   "ext.wikimediaEvents.kartographer.js",
-   "ext.wikimediaEvents.print.js",
-   "ext.wikimediaEvents.readingDepth.js",
-   "ext.wikimediaEvents.geoFeatures.js",
-   "ext.wikimediaEvents.recentChangesClicks.js"
+   "all/ext.wikimediaEvents.events.js",
+   "all/ext.wikimediaEvents.statsd.js",
+   "all/ext.wikimediaEvents.kartographer.js",
+   "all/ext.wikimediaEvents.print.js",
+   "all/ext.wikimediaEvents.readingDepth.js",
+   "all/ext.wikimediaEvents.geoFeatures.js",
+   "all/ext.wikimediaEvents.recentChangesClicks.js"
],
"skinScripts": {
"default": [
-   
"ext.wikimediaEvents.searchSatisfaction.js"
+   
"all/ext.wikimediaEvents.searchSatisfaction.js"
],
"minerva": []
},
@@ -192,7 +172,7 @@
},
"ext.wikimediaEvents.loggedin": {
"scripts": [
-   "ext.wikimediaEvents.deprecate.js"
+   "loggedin/ext.wikimediaEvents.deprecate.js"
],
"targets": [
"desktop",
@@ -201,21 +181,6 @@
 

[MediaWiki-commits] [Gerrit] mediawiki...WikimediaEvents[master]: geoFeatures: Use local var instead of document data for state

2017-11-03 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/388571 )

Change subject: geoFeatures: Use local var instead of document data for state
..

geoFeatures: Use local var instead of document data for state

* Avoid storing application state in the DOM. This can have significant
  performance overhead.

* In addition, it has an increased likelihood of name clashes with other
  extensions, gadgets, or user scripts. Not to mention unrelated code calling
  methods like $document.removeData(). It was essentially a global variable.

It seems this code is unconditionally setting data `isPrimary.WIWOSM = true`
on all pages on all wikis for all users. This should probably become conditional
to geo-related pages and/or turned into a local constant given it doesn't
seem to change. Kept as-is for now.

Change-Id: Ia91135d1f79d0f759916a1c33f7942ce3cbb2575
---
M modules/ext.wikimediaEvents.geoFeatures.js
1 file changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/modules/ext.wikimediaEvents.geoFeatures.js 
b/modules/ext.wikimediaEvents.geoFeatures.js
index 9abda4a..8aa9d3d 100644
--- a/modules/ext.wikimediaEvents.geoFeatures.js
+++ b/modules/ext.wikimediaEvents.geoFeatures.js
@@ -9,7 +9,7 @@
// Which iframes are being tracked
tracked = {},
$geoHackLinks,
-   $document = $( document ),
+   isPrimary = {},
wmaSelector = 'iframe[src^=\'//wma.wmflabs.org/iframe.html\']',
wiwosmSelector = 'iframe#openstreetmap';
 
@@ -112,7 +112,7 @@
&& $( document.activeElement ).is( 
selector )
) {
tracked[ selector ] = true;
-   doTrack( feature, 'interaction', 
!!$document.data( 'isPrimary-' + feature ) );
+   doTrack( feature, 'interaction', 
!!isPrimary[ feature ] );
}
}, 0 );
} );
@@ -183,7 +183,7 @@
isTitle = isTitleCoordinate( 
$this ),
$container = $( wmaSelector 
).parent();
 
-   $document.data( 
'isPrimary-WikiMiniAtlas', isTitle );
+   isPrimary.WikiMiniAtlas = isTitle;
if ( $container.is( ':visible' ) ) {
doTrack( 'WikiMiniAtlas', 
'open', isTitle );
$container.one( 'hide', 
function () {
@@ -195,7 +195,7 @@
}
 
// Track WIWOSM usage
-   $document.data( 'isPrimary-WIWOSM', true );
+   isPrimary.WIWOSM = true;
trackIframe( wiwosmSelector, 'WIWOSM' );
trackButton( '.osm-icon-coordinates',
function () {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia91135d1f79d0f759916a1c33f7942ce3cbb2575
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: grafana: Update server-board JSON to schemaVersion 14 (no-op)

2017-11-02 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387980 )

Change subject: grafana: Update server-board JSON to schemaVersion 14 (no-op)
..

grafana: Update server-board JSON to schemaVersion 14 (no-op)

Generated by "View JSON" at


Which is the current version. I'm doing this as a separate commit
before submitting my actual change as Git commit.

Change-Id: I0d0d86ea2032ed29d06187811d1f8dc75a8e2553
---
M modules/grafana/files/dashboards/server-board
1 file changed, 234 insertions(+), 183 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/80/387980/1

diff --git a/modules/grafana/files/dashboards/server-board 
b/modules/grafana/files/dashboards/server-board
index 2d5bcee..0bd79ba 100644
--- a/modules/grafana/files/dashboards/server-board
+++ b/modules/grafana/files/dashboards/server-board
@@ -1,51 +1,18 @@
 {
-  "__inputs": [
-{
-  "name": "DS_GRAPHITE",
-  "label": "graphite",
-  "description": "",
-  "type": "datasource",
-  "pluginId": "graphite",
-  "pluginName": "Graphite"
-}
-  ],
-  "__requires": [
-{
-  "type": "panel",
-  "id": "graph",
-  "name": "Graph",
-  "version": ""
-},
-{
-  "type": "grafana",
-  "id": "grafana",
-  "name": "Grafana",
-  "version": "3.1.1"
-},
-{
-  "type": "datasource",
-  "id": "graphite",
-  "name": "Graphite",
-  "version": "1.0.0"
-}
-  ],
-  "id": null,
-  "title": "Server Board",
-  "tags": [
-"operations",
-"source:puppet.git",
-"readonly",
-"featured"
-  ],
-  "style": "light",
-  "timezone": "utc",
+  "annotations": {
+"enable": false,
+"list": []
+  },
   "editable": true,
+  "gnetId": null,
+  "graphTooltip": 1,
   "hideControls": true,
-  "sharedCrosshair": true,
+  "id": null,
+  "links": [],
+  "refresh": "1m",
   "rows": [
 {
   "collapse": false,
-  "editable": true,
   "height": "300px",
   "panels": [
 {
@@ -60,15 +27,13 @@
 "enable": false
   },
   "bars": false,
+  "dashLength": 10,
+  "dashes": false,
   "datasource": "graphite",
   "fill": 10,
   "grid": {
 "max": null,
-"min": null,
-"threshold1": null,
-"threshold1Color": "rgba(216, 200, 27, 0.27)",
-"threshold2": null,
-"threshold2Color": "rgba(234, 112, 112, 0.22)"
+"min": null
   },
   "height": "",
   "id": 7,
@@ -102,6 +67,7 @@
   "linewidth": 1
 }
   ],
+  "spaceLength": 10,
   "span": 4,
   "spyable": true,
   "stack": true,
@@ -132,6 +98,7 @@
   "target": "aliasByMetric(servers.$server.cpu.total.idle)"
 }
   ],
+  "thresholds": [],
   "timeFrom": null,
   "timeShift": null,
   "timezone": "browser",
@@ -145,7 +112,11 @@
   },
   "type": "graph",
   "xaxis": {
-"show": true
+"buckets": null,
+"mode": "time",
+"name": null,
+"show": true,
+"values": []
   },
   "yaxes": [
 {
@@ -176,15 +147,13 @@
 "enable": false
   },
   "bars": false,
+  "dashLength": 10,
+  "dashes": false,
   "datasource": "graphite",
   "fill": 0,
   "grid": {
 "max": null,
-"min": null,
-"threshold1": null,
-"threshold1Color": "rgba(216, 200, 27, 0.27)",
-"threshold2": null,
-"threshold2Color": "rgba(234, 112, 112, 0.22)"
+"min": null
   },
   "height": "",
   "id": 12,
@@ -212,6 +181,7 @@
   "resolution": 100,
   "scale": 1,
   "seriesOverrides": [],
+  "spaceLength": 10,
   "span": 4,
   "spyable": true,
   "stack": false,
@@ -223,6 +193,7 @@
   "target": 
"aliasByMetric(aliasSub(servers.$server.loadavg.{01,05,15}, '0?(\\d+)', '\\1 
minute'))"
 }
   ],
+  "thresholds": [],
   "timeFrom": null,
   "timeShift": null,
   "timezone": "browser",
@@ -236,7 +207,11 @@
   },
   "type": "graph",
   "xaxis": {
-"show": true
+"buckets": null,
+"mode": "time",
+"name": null,
+"show": true,
+"values": []
   },
   "yaxes": [
 {
@@ -267,15 +242,13 @@
 "enable": false
   },
   "bars": false,
+  "dashLength": 10,
+  "dashes": false,
   "datasource": "graphite",
   "fill": 0,
  

[MediaWiki-commits] [Gerrit] operations/puppet[production]: grafana: Reduce "network" dropdown to valid options for curr...

2017-11-02 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387981 )

Change subject: grafana: Reduce "network" dropdown to valid options for current 
server
..

grafana: Reduce "network" dropdown to valid options for current server

* Instead of listing all possible values from all known servers,
  list only the values relevant to the current server.

* Also: Enable sort and set sort to natural (sort 0 -> sort 3).

* Also: Given the values now vary, enable dynamic refresh based
  on current query, instead of fetching once on initial page load
  (refresh 1 -> refresh 2).

Change-Id: I8395beab2154abc171bd45ba9e899af296012e9e
---
M modules/grafana/files/dashboards/server-board
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/81/387981/1

diff --git a/modules/grafana/files/dashboards/server-board 
b/modules/grafana/files/dashboards/server-board
index 0bd79ba..b9af9ce 100644
--- a/modules/grafana/files/dashboards/server-board
+++ b/modules/grafana/files/dashboards/server-board
@@ -7,7 +7,7 @@
   "gnetId": null,
   "graphTooltip": 1,
   "hideControls": true,
-  "id": null,
+  "id": 87,
   "links": [],
   "refresh": "1m",
   "rows": [
@@ -1458,11 +1458,11 @@
 "multi": false,
 "name": "network",
 "options": [],
-"query": "servers.*.network.*",
-"refresh": 1,
+"query": "servers.$server.network.*",
+"refresh": 2,
 "refresh_on_load": false,
-"regex": "",
-"sort": 0,
+"regex": "/^(?!connections).*/",
+"sort": 3,
 "tagValuesQuery": "",
 "tags": [],
 "tagsQuery": "",
@@ -1509,5 +1509,5 @@
   },
   "timezone": "utc",
   "title": "Server Board",
-  "version": 0
+  "version": 37
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_29]: Fix case of SpecialRecentChanges class

2017-11-01 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387973 )

Change subject: Fix case of SpecialRecentChanges class
..

Fix case of SpecialRecentChanges class

Test fails with $wgAutoloadAttemptLowercase = false

Change-Id: Ib8cd202d36d35a36e7513f81cea4a7f8346661bc
---
M tests/phpunit/includes/specials/SpecialRecentchangesTest.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/387973/2

diff --git a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php 
b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php
index e9c7d4b..73edd28 100644
--- a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php
+++ b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php
@@ -15,7 +15,7 @@
 
# setup the CLSP object
$this->changesListSpecialPage = 
TestingAccessWrapper::newFromObject(
-   new SpecialRecentchanges
+   new SpecialRecentChanges
);
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8cd202d36d35a36e7513f81cea4a7f8346661bc
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_29
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 

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


  1   2   3   4   5   6   7   8   9   10   >