[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: T142998: Fix crasher in normalization code

2016-08-18 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review.

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

Change subject: T142998: Fix crasher in normalization code
..

T142998: Fix crasher in normalization code

Consider DOM: x
where n2 and n3 are HTML syntax nodes.

n2 won't get deleted but they are both candidates for merging.
Since n2 has no children, the swap code would crash on it.

Change-Id: Id2193efd45d60355518d0c3efb5a171f512928ce
---
M lib/html2wt/normalizeDOM.js
1 file changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/lib/html2wt/normalizeDOM.js b/lib/html2wt/normalizeDOM.js
index 3c145cd..d14f942 100644
--- a/lib/html2wt/normalizeDOM.js
+++ b/lib/html2wt/normalizeDOM.js
@@ -132,7 +132,9 @@
b.appendChild(a);
 
// Mark a's subtree, a, and b as all having moved
-   this.addDiffMarks(a.firstChild, 'moved', true);
+   if (a.firstChild !== null) {
+   this.addDiffMarks(a.firstChild, 'moved', true);
+   }
this.addDiffMarks(a, 'moved', true);
this.addDiffMarks(b, 'moved', true);
this.addDiffMarks(a, 'children-changed', true);

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: OutputPage: Make ResourceLoader position exemption more generic

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: OutputPage: Make ResourceLoader position exemption more generic
..


OutputPage: Make ResourceLoader position exemption more generic

Follows-up 80e5b160e which moved queue formatting out of OutputPage into a
a separate ResourceLoaderClientHtml class.

The special handling for 'user' and 'user.styles' modules, and the exempt
module groups was kept in OutputPage. However the handling for it was
hardcoded for the modules in that group by default. It did not account for
modules with a group of 'user' loaded by an extension (e.g. GlobalCssJs).
GlobalCssJs modules were wrongly loaded in the regular style queue
(still in a separate request group, but not in the right cascading order
below the DynamicSyles marker).

This commit generalises the handling previously put in buildExemptModules
and moves it to getRlClient() so that it may apply to all style modules.

This commit should be a no-op besides the moving of any 
for non-core modules in group 'site' or 'user' now being one line lower
in the  HTML (after the DynamicStyles marker).

Bug: T143357
Change-Id: I1d6ea10b42293acfc535578172ad7ab2369f6299
---
M includes/OutputPage.php
1 file changed, 75 insertions(+), 73 deletions(-)

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



diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 374e7af..eb3040c 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -164,6 +164,9 @@
private $rlUserModuleState;
 
/** @var array */
+   private $rlExemptStyleModules;
+
+   /** @var array */
protected $mJsConfigVars = [];
 
/** @var array */
@@ -2660,30 +2663,64 @@
public function getRlClient() {
if ( !$this->rlClient ) {
$context = $this->getRlClientContext();
-   $userModule = $this->getResourceLoader()->getModule( 
'user' );
-   // Manually handled by getBottomScripts()
-   $userState = $userModule->isKnownEmpty( $context ) && 
!$this->isUserModulePreview()
-   ? 'ready'
-   : 'loading';
-   $this->rlUserModuleState = $userState;
-
+   $rl = $this->getResourceLoader();
$this->addModules( [
'user.options',
'user.tokens',
] );
+   $this->addModuleStyles( [
+   'site.styles',
+   'noscript',
+   'user.styles',
+   'user.cssprefs',
+   ] );
+
+   // Prepare exempt modules for buildExemptModules()
+   $exemptGroups = [ 'site' => [], 'noscript' => [], 
'private' => [], 'user' => [] ];
+   $exemptStates = [];
+   $moduleStyles = array_filter( $this->getModuleStyles( 
/*filter*/ true ),
+   function ( $name ) use ( $rl, $context, 
&$exemptGroups, &$exemptStates ) {
+   $module = $rl->getModule( $name );
+   if ( $module ) {
+   $group = $module->getGroup();
+   if ( $name === 'user.styles' && 
$this->isUserCssPreview() ) {
+   $exemptStates[$name] = 
'ready';
+   // Special case in 
buildExemptModules()
+   return false;
+   }
+   if ( $name === 'site.styles' ) {
+   // HACK: Technically, 
'site.styles' isn't in a separate request group.
+   // But, in order to 
ensure its styles are in the right position,
+   // pretend it's in a 
group called 'site'.
+   $group = 'site';
+   }
+   if ( isset( 
$exemptGroups[$group] ) ) {
+   $exemptStates[$name] = 
'ready';
+   if ( 
!$module->isKnownEmpty( $context ) ) {
+   // E.g. Don't 
output empty 
+   
$exemptGroups[$group][] = $name;
+  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] Finish renaming DatabaseBase => Database

2016-08-18 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: [WIP] Finish renaming DatabaseBase => Database
..

[WIP] Finish renaming DatabaseBase => Database

Change-Id: I6e19dc174e1b8f31593a0b6856212c4d4da9a830
---
M includes/GlobalFunctions.php
M includes/MergeHistory.php
M includes/WatchedItemQueryService.php
M includes/WatchedItemStore.php
M includes/api/ApiBase.php
M includes/api/ApiPageSet.php
M includes/api/ApiQuery.php
M includes/api/ApiQueryAllImages.php
M includes/api/ApiQueryBase.php
M includes/cache/BacklinkCache.php
M includes/cache/LinkBatch.php
M includes/changes/ChangesFeed.php
M includes/changetags/ChangeTags.php
M includes/dao/DBAccessBase.php
M includes/db/CloneDatabase.php
M includes/db/DBConnRef.php
M includes/db/Database.php
M includes/db/DatabaseError.php
M includes/db/DatabaseMssql.php
M includes/db/DatabaseMysqlBase.php
M includes/db/DatabaseOracle.php
M includes/db/DatabasePostgres.php
M includes/db/DatabaseSqlite.php
M includes/db/DatabaseUtility.php
M includes/db/IDatabase.php
M includes/db/loadbalancer/LBFactorySingle.php
M includes/db/loadbalancer/LoadBalancer.php
M includes/filebackend/lockmanager/DBLockManager.php
M includes/filerepo/ForeignDBRepo.php
M includes/filerepo/LocalRepo.php
M includes/filerepo/file/LocalFile.php
M includes/installer/DatabaseInstaller.php
M includes/installer/DatabaseUpdater.php
M includes/installer/MssqlInstaller.php
M includes/installer/MysqlInstaller.php
M includes/installer/OracleInstaller.php
M includes/installer/PostgresInstaller.php
M includes/installer/SqliteInstaller.php
M includes/objectcache/SqlBagOStuff.php
M includes/page/WikiPage.php
M includes/profiler/TransactionProfiler.php
M includes/user/BotPassword.php
M includes/user/User.php
M tests/phpunit/includes/db/DatabaseTestHelper.php
M tests/phpunit/includes/installer/DatabaseUpdaterTest.php
45 files changed, 188 insertions(+), 193 deletions(-)


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

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 0d66908..3e3926a 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -3143,7 +3143,7 @@
  * @todo Replace calls to wfGetDB with calls to LoadBalancer::getConnection()
  *   on an injected instance of LoadBalancer.
  *
- * @return DatabaseBase
+ * @return Database
  */
 function wfGetDB( $db, $groups = [], $wiki = false ) {
return wfGetLB( $wiki )->getConnection( $db, $groups, $wiki );
diff --git a/includes/MergeHistory.php b/includes/MergeHistory.php
index 441fe9e..5b01a74 100644
--- a/includes/MergeHistory.php
+++ b/includes/MergeHistory.php
@@ -42,7 +42,7 @@
/** @var Title Page to which history will be merged */
protected $dest;
 
-   /** @var DatabaseBase Database that we are using */
+   /** @var Database Database that we are using */
protected $dbw;
 
/** @var MWTimestamp Maximum timestamp that we can use (oldest 
timestamp of dest) */
diff --git a/includes/WatchedItemQueryService.php 
b/includes/WatchedItemQueryService.php
index 3dcd30f..0ee6642 100644
--- a/includes/WatchedItemQueryService.php
+++ b/includes/WatchedItemQueryService.php
@@ -55,7 +55,7 @@
}
 
/**
-* @return DatabaseBase
+* @return Database
 * @throws MWException
 */
private function getConnection() {
@@ -63,10 +63,10 @@
}
 
/**
-* @param DatabaseBase $connection
+* @param Database $connection
 * @throws MWException
 */
-   private function reuseConnection( DatabaseBase $connection ) {
+   private function reuseConnection( Database $connection ) {
$this->loadBalancer->reuseConnection( $connection );
}
 
@@ -337,7 +337,7 @@
}
 
private function getWatchedItemsWithRCInfoQueryConds(
-   DatabaseBase $db,
+   Database $db,
User $user,
array $options
) {
@@ -445,7 +445,7 @@
return $conds;
}
 
-   private function getStartEndConds( DatabaseBase $db, array $options ) {
+   private function getStartEndConds( Database $db, array $options ) {
if ( !isset( $options['start'] ) && ! isset( $options['end'] ) 
) {
return [];
}
@@ -464,7 +464,7 @@
return $conds;
}
 
-   private function getUserRelatedConds( DatabaseBase $db, User $user, 
array $options ) {
+   private function getUserRelatedConds( Database $db, User $user, array 
$options ) {
if ( !array_key_exists( 'onlyByUser', $options ) && 
!array_key_exists( 'notByUser', $options ) ) {
return [];
}
@@ -491,7 +491,7 @@
return $conds;
}
 
-   private function 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Clarify some WANObjectCache docs

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Clarify some WANObjectCache docs
..


Clarify some WANObjectCache docs

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

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



diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 552c661..c40c819 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -33,6 +33,7 @@
  * This class is intended for caching data from primary stores.
  * If the get() method does not return a value, then the caller
  * should query the new value and backfill the cache using set().
+ * The preferred way to do this logic is through getWithSetCallback().
  * When querying the store on cache miss, the closest DB replica
  * should be used. Try to avoid heavyweight DB master or quorum reads.
  * When the source data changes, a purge method should be called.
@@ -47,8 +48,9 @@
  *   - a) Configure the 'purge' EventRelayer to point to a valid PubSub 
endpoint
  *that has subscribed listeners on the cache servers applying the 
cache updates.
  *   - b) Ignore the 'purge' EventRelayer configuration (default is 
NullEventRelayer)
- *and set up mcrouter as the underlying cache backend. Using 
OperationSelectorRoute,
- *configure 'set' and 'delete' operations to go to all DCs via 
AllAsyncRoute and
+ *and set up mcrouter as the underlying cache backend, using one of 
the memcached
+ *BagOStuff classes as 'cache'. Use OperationSelectorRoute in the 
mcrouter settings
+ *to configure 'set' and 'delete' operations to go to all DCs via 
AllAsyncRoute and
  *configure other operations to go to the local DC via PoolRoute (for 
reference,
  *see https://github.com/facebook/mcrouter/wiki/List-of-Route-Handles).
  *
@@ -56,9 +58,9 @@
  * in all datacenters this way, though the local one should likely be near 
immediate.
  *
  * This means that callers in all datacenters may see older values for however 
many
- * milliseconds the the purge took to reach that datacenter. As with any 
cache, this
+ * milliseconds that the purge took to reach that datacenter. As with any 
cache, this
  * should not be relied on for cases where reads are used to determine writes 
to source
- * (e.g. non-cache) data stores.
+ * (e.g. non-cache) data stores, except when reading immutable data.
  *
  * All values are wrapped in metadata arrays. Keys use a "WANCache:" prefix
  * to avoid collisions with keys that are not wrapped as metadata arrays. The

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I819a630ebba4122a757f04fbf702122069af4fb1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Clarify some WANObjectCache docs

2016-08-18 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Clarify some WANObjectCache docs
..

Clarify some WANObjectCache docs

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/12/305612/1

diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 552c661..c40c819 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -33,6 +33,7 @@
  * This class is intended for caching data from primary stores.
  * If the get() method does not return a value, then the caller
  * should query the new value and backfill the cache using set().
+ * The preferred way to do this logic is through getWithSetCallback().
  * When querying the store on cache miss, the closest DB replica
  * should be used. Try to avoid heavyweight DB master or quorum reads.
  * When the source data changes, a purge method should be called.
@@ -47,8 +48,9 @@
  *   - a) Configure the 'purge' EventRelayer to point to a valid PubSub 
endpoint
  *that has subscribed listeners on the cache servers applying the 
cache updates.
  *   - b) Ignore the 'purge' EventRelayer configuration (default is 
NullEventRelayer)
- *and set up mcrouter as the underlying cache backend. Using 
OperationSelectorRoute,
- *configure 'set' and 'delete' operations to go to all DCs via 
AllAsyncRoute and
+ *and set up mcrouter as the underlying cache backend, using one of 
the memcached
+ *BagOStuff classes as 'cache'. Use OperationSelectorRoute in the 
mcrouter settings
+ *to configure 'set' and 'delete' operations to go to all DCs via 
AllAsyncRoute and
  *configure other operations to go to the local DC via PoolRoute (for 
reference,
  *see https://github.com/facebook/mcrouter/wiki/List-of-Route-Handles).
  *
@@ -56,9 +58,9 @@
  * in all datacenters this way, though the local one should likely be near 
immediate.
  *
  * This means that callers in all datacenters may see older values for however 
many
- * milliseconds the the purge took to reach that datacenter. As with any 
cache, this
+ * milliseconds that the purge took to reach that datacenter. As with any 
cache, this
  * should not be relied on for cases where reads are used to determine writes 
to source
- * (e.g. non-cache) data stores.
+ * (e.g. non-cache) data stores, except when reading immutable data.
  *
  * All values are wrapped in metadata arrays. Keys use a "WANCache:" prefix
  * to avoid collisions with keys that are not wrapped as metadata arrays. The

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ores: Add memory report to uwsgi

2016-08-18 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review.

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

Change subject: ores: Add memory report to uwsgi
..

ores: Add memory report to uwsgi

Bug: T143081
Change-Id: I31fa386b171ad7b6db1e897f0c4e62fabf73310e
---
M modules/ores/manifests/web.pp
1 file changed, 10 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/11/305611/1

diff --git a/modules/ores/manifests/web.pp b/modules/ores/manifests/web.pp
index 729603c..8a35af3 100644
--- a/modules/ores/manifests/web.pp
+++ b/modules/ores/manifests/web.pp
@@ -25,15 +25,16 @@
 healthcheck_url => '/',
 deployment  => $deployment,
 config  => {
-'wsgi-file'  => "${ores::base::config_path}/ores_wsgi.py",
-chdir=> $ores::base::config_path,
-plugins  => 'python3,stats_pusher_statsd',
-venv => $ores::base::venv_path,
-logformat=> '[pid: %(pid)] %(addr) (%(user)) {%(vars) vars in 
%(pktsize) bytes} [%(ctime)] %(method) %(uri) => generated %(rsize) bytes in 
%(msecs) msecs (%(proto) %(status)) %(headers) headers in %(hsize) bytes 
(%(switches) switches on core %(core)) user agent "%(uagent)"',
-processes=> $processes,
-add-header   => 'Access-Control-Allow-Origin: *',
-max-requests => 200,
-stats-push   => 
"statsd:${graphite_server}:8125,ores.${::hostname}.uwsgi",
+'wsgi-file'   => "${ores::base::config_path}/ores_wsgi.py",
+chdir => $ores::base::config_path,
+plugins   => 'python3,stats_pusher_statsd',
+venv  => $ores::base::venv_path,
+logformat => '[pid: %(pid)] %(addr) (%(user)) {%(vars) vars in 
%(pktsize) bytes} [%(ctime)] %(method) %(uri) => generated %(rsize) bytes in 
%(msecs) msecs (%(proto) %(status)) %(headers) headers in %(hsize) bytes 
(%(switches) switches on core %(core)) user agent "%(uagent)"',
+processes => $processes,
+add-header=> 'Access-Control-Allow-Origin: *',
+max-requests  => 200,
+stats-push=> 
"statsd:${graphite_server}:8125,ores.${::hostname}.uwsgi",
+memory-report => true,
 }
 }
 

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

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

___
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 mcrouter support to WANObjectCache

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: objectcache: add mcrouter support to WANObjectCache
..


objectcache: add mcrouter support to WANObjectCache

* Update documentation about relay methods.
* Change interim key set() to add() to avoid broadcasting it.
* Remove the behavior of doing purges synchronously in the
  local DC first before relay. In both the event relayer and
  mcrouter case, they will be asynchronous. It was hardly
  even possible to use such behavior since loads come from
  slave DBs, which do not see changes right after COMMIT.

Bug: T97562
Change-Id: I7759c82ae6e1b72fc227882a99c9a712a46374f6
---
M includes/libs/objectcache/EmptyBagOStuff.php
M includes/libs/objectcache/WANObjectCache.php
M tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
3 files changed, 117 insertions(+), 66 deletions(-)

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



diff --git a/includes/libs/objectcache/EmptyBagOStuff.php 
b/includes/libs/objectcache/EmptyBagOStuff.php
index 408212a..3f66c06 100644
--- a/includes/libs/objectcache/EmptyBagOStuff.php
+++ b/includes/libs/objectcache/EmptyBagOStuff.php
@@ -31,6 +31,10 @@
return false;
}
 
+   public function add( $key, $value, $exp = 0 ) {
+   return true;
+   }
+
public function set( $key, $value, $exp = 0, $flags = 0 ) {
return true;
}
diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 4fd40e2..e3d50c6 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -43,16 +43,22 @@
  *
  * The simplest purge method is delete().
  *
- * Instances of this class must be configured to point to a valid
- * PubSub endpoint, and there must be listeners on the cache servers
- * that subscribe to the endpoint and update the caches.
+ * There are two supported ways to handle broadcasted operations:
+ *   - a) Configure the 'purge' EventRelayer to point to a valid PubSub 
endpoint
+ *that has subscribed listeners on the cache servers applying the 
cache updates.
+ *   - b) Ignore the 'purge' EventRelayer configuration (default is 
NullEventRelayer)
+ *and set up mcrouter as the underlying cache backend. Using 
OperationSelectorRoute,
+ *configure 'set' and 'delete' operations to go to all DCs via 
AllAsyncRoute and
+ *configure other operations to go to the local DC via PoolRoute (for 
reference,
+ *see https://github.com/facebook/mcrouter/wiki/List-of-Route-Handles).
  *
- * Broadcasted operations like delete() and touchCheckKey() are done
- * synchronously in the local datacenter, but are relayed asynchronously.
- * This means that callers in other datacenters will see older values
- * for however many milliseconds the datacenters are apart. As with
- * any cache, this should not be relied on for cases where reads are
- * used to determine writes to source (e.g. non-cache) data stores.
+ * Broadcasted operations like delete() and touchCheckKey() are done 
asynchronously
+ * in all datacenters this way, though the local one should likely be near 
immediate.
+ *
+ * This means that callers in all datacenters may see older values for however 
many
+ * milliseconds the the purge took to reach that datacenter. As with any 
cache, this
+ * should not be relied on for cases where reads are used to determine writes 
to source
+ * (e.g. non-cache) data stores.
  *
  * All values are wrapped in metadata arrays. Keys use a "WANCache:" prefix
  * to avoid collisions with keys that are not wrapped as metadata arrays. The
@@ -60,6 +66,7 @@
  *   - a) "WANCache:v" : used for regular value keys
  *   - b) "WANCache:i" : used for temporarily storing values of tombstoned keys
  *   - c) "WANCache:t" : used for storing timestamp "check" keys
+ *   - d) "WANCache:m" : used for temporary mutex keys to avoid cache stampedes
  *
  * @ingroup Cache
  * @since 1.26
@@ -129,6 +136,7 @@
const VALUE_KEY_PREFIX = 'WANCache:v:';
const INTERIM_KEY_PREFIX = 'WANCache:i:';
const TIME_KEY_PREFIX = 'WANCache:t:';
+   const MUTEX_KEY_PREFIX = 'WANCache:m:';
 
const PURGE_VAL_PREFIX = 'PURGED:';
 
@@ -456,8 +464,8 @@
 *
 * When using potentially long-running ACID transactions, a good 
pattern is
 * to use a pre-commit hook to issue the delete. This means that 
immediately
-* after commit, callers will see the tombstone in cache in the local 
datacenter
-* and in the others upon relay. It also avoids the following race 
condition:
+* after commit, callers will see the tombstone in cache upon purge 
relay.
+* It also avoids the following race condition:
 *   - a) T1 begins, changes a row, and calls delete()
 *   - b) The HOLDOFF_TTL passes, 

[MediaWiki-commits] [Gerrit] analytics/udplog[master]: udp2log: link boost_system too

2016-08-18 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: udp2log: link boost_system too
..

udp2log: link boost_system too

Otherwise you start getting errors like:
undefined reference to `boost::system::generic_category()'

Change-Id: I426c83ebe5d97f297256a09a7588e9d6139625d9
---
M Makefile
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/udplog 
refs/changes/10/305610/1

diff --git a/Makefile b/Makefile
index 002a3e8..0383a54 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@
g++ $(CFLAGS) $(SLOWPIPE_OBJS) -lrt -o slowpipe
 
 udp2log/udp2log: $(UDP2LOG_OBJS)
-   g++ $(CFLAGS) -o udp2log/udp2log $(UDP2LOG_OBJS) 
-lboost_program_options -lrt
+   g++ $(CFLAGS) -o udp2log/udp2log $(UDP2LOG_OBJS) -lboost_system 
-lboost_program_options -lrt
 
 install:
install log2udp $(DESTDIR)/usr/bin/log2udp

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I426c83ebe5d97f297256a09a7588e9d6139625d9
Gerrit-PatchSet: 1
Gerrit-Project: analytics/udplog
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: OutputPage: Make ResourceLoader position exemption more generic

2016-08-18 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: OutputPage: Make ResourceLoader position exemption more generic
..

OutputPage: Make ResourceLoader position exemption more generic

Follows-up 80e5b160e which moved queue formatting out of OutputPage into a
a separate ResourceLoaderClientHtml class.

The special handling for 'user' and 'user.styles' modules, and the exempt
module groups was kept in OutputPage. However the handling for it was
hardcoded for the modules in that group by default. It did not account for
modules with a group of 'user' loaded by an extension (e.g. GlobalCssJs).
GlobalCssJs modules were wrongly loaded in the regular style queue
(still in a separate request group, but not in the right cascading order
below the DynamicSyles marker).

This commit generalises the handling previously put in buildExemptModules
and moves it to getRlClient() so that it may apply to all style modules.

This commit should be a no-op besides the moving of any 
for non-core modules in group 'site' or 'user' now being one line lower
in the  HTML (after the DynamicStyles marker).

Bug: T143357
Change-Id: I1d6ea10b42293acfc535578172ad7ab2369f6299
---
M includes/OutputPage.php
1 file changed, 75 insertions(+), 73 deletions(-)


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

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 374e7af..eb3040c 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -164,6 +164,9 @@
private $rlUserModuleState;
 
/** @var array */
+   private $rlExemptStyleModules;
+
+   /** @var array */
protected $mJsConfigVars = [];
 
/** @var array */
@@ -2660,30 +2663,64 @@
public function getRlClient() {
if ( !$this->rlClient ) {
$context = $this->getRlClientContext();
-   $userModule = $this->getResourceLoader()->getModule( 
'user' );
-   // Manually handled by getBottomScripts()
-   $userState = $userModule->isKnownEmpty( $context ) && 
!$this->isUserModulePreview()
-   ? 'ready'
-   : 'loading';
-   $this->rlUserModuleState = $userState;
-
+   $rl = $this->getResourceLoader();
$this->addModules( [
'user.options',
'user.tokens',
] );
+   $this->addModuleStyles( [
+   'site.styles',
+   'noscript',
+   'user.styles',
+   'user.cssprefs',
+   ] );
+
+   // Prepare exempt modules for buildExemptModules()
+   $exemptGroups = [ 'site' => [], 'noscript' => [], 
'private' => [], 'user' => [] ];
+   $exemptStates = [];
+   $moduleStyles = array_filter( $this->getModuleStyles( 
/*filter*/ true ),
+   function ( $name ) use ( $rl, $context, 
&$exemptGroups, &$exemptStates ) {
+   $module = $rl->getModule( $name );
+   if ( $module ) {
+   $group = $module->getGroup();
+   if ( $name === 'user.styles' && 
$this->isUserCssPreview() ) {
+   $exemptStates[$name] = 
'ready';
+   // Special case in 
buildExemptModules()
+   return false;
+   }
+   if ( $name === 'site.styles' ) {
+   // HACK: Technically, 
'site.styles' isn't in a separate request group.
+   // But, in order to 
ensure its styles are in the right position,
+   // pretend it's in a 
group called 'site'.
+   $group = 'site';
+   }
+   if ( isset( 
$exemptGroups[$group] ) ) {
+   $exemptStates[$name] = 
'ready';
+   if ( 
!$module->isKnownEmpty( $context ) ) {
+   // E.g. Don't 
output empty 
+   
$exemptGroups[$group][] = $name;
+   

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Revert "Temporarily make NS_PROJECT_TALK wikitext again on B...

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Temporarily make NS_PROJECT_TALK wikitext again on Beta 
cawiki"
..


Revert "Temporarily make NS_PROJECT_TALK wikitext again on Beta cawiki"

Test is complete.

This reverts commit 9da37e47a1c805b5134c39e2482456a956847018.

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

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



diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 46fae9a..129efd2 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -374,9 +374,6 @@
'enwiki' => true,
'en_rtlwiki' => true,
],
-   'wmgFlowNamespaces' => [
-   'cawiki' => [],
-   ],
# No separate Flow DB or cluster (yet) for labs.
'-wmgFlowDefaultWikiDb' => [
'default' => false,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2a0d2360fb8b0e157bff51ae68c61c97e717c98d
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Mattflaschen 
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 "Temporarily make NS_PROJECT_TALK wikitext again on B...

2016-08-18 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Revert "Temporarily make NS_PROJECT_TALK wikitext again on Beta 
cawiki"
..

Revert "Temporarily make NS_PROJECT_TALK wikitext again on Beta cawiki"

Test is complete.

This reverts commit 9da37e47a1c805b5134c39e2482456a956847018.

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


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

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 46fae9a..129efd2 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -374,9 +374,6 @@
'enwiki' => true,
'en_rtlwiki' => true,
],
-   'wmgFlowNamespaces' => [
-   'cawiki' => [],
-   ],
# No separate Flow DB or cluster (yet) for labs.
'-wmgFlowDefaultWikiDb' => [
'default' => false,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Check for warnings for assembled file after a chunked upload

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Check for warnings for assembled file after a chunked upload
..


Check for warnings for assembled file after a chunked upload

Bug: T130564
Change-Id: Iebc84f030c45c634dc29b02cbd720f33abf50f2b
---
M includes/api/ApiUpload.php
M includes/jobqueue/jobs/AssembleUploadChunksJob.php
2 files changed, 17 insertions(+), 1 deletion(-)

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



diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index 227278c..ac817ba 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -274,6 +274,12 @@
$this->dieStatusWithCode( $status, 
'stashfailed' );
}
 
+   // We can only get warnings like 'duplicate' 
after concatenating the chunks
+   $warnings = $this->getApiWarnings();
+   if ( $warnings ) {
+   $result['warnings'] = $warnings;
+   }
+
// The fully concatenated file has a new 
filekey. So remove
// the old filekey and fetch the new one.
UploadBase::setSessionStatus( $this->getUser(), 
$filekey, false );
@@ -431,6 +437,12 @@
if ( isset( $progress['status']->value['verification'] 
) ) {
$this->checkVerification( 
$progress['status']->value['verification'] );
}
+   if ( isset( $progress['status']->value['warnings'] ) ) {
+   $warnings = $this->transformWarnings( 
$progress['status']->value['warnings'] );
+   if ( $warnings ) {
+   $progress['warnings'] = $warnings;
+   }
+   }
unset( $progress['status'] ); // remove Status object
$this->getResult()->addValue( null, 
$this->getModuleName(), $progress );
 
diff --git a/includes/jobqueue/jobs/AssembleUploadChunksJob.php 
b/includes/jobqueue/jobs/AssembleUploadChunksJob.php
index f3fcadf..060cabb 100644
--- a/includes/jobqueue/jobs/AssembleUploadChunksJob.php
+++ b/includes/jobqueue/jobs/AssembleUploadChunksJob.php
@@ -73,6 +73,10 @@
return false;
}
 
+   // We can only get warnings like 'duplicate' after 
concatenating the chunks
+   $status = Status::newGood();
+   $status->value = [ 'warnings' => 
$upload->checkWarnings() ];
+
// We have a new filekey for the fully concatenated file
$newFileKey = $upload->getStashFile()->getFileKey();
 
@@ -95,7 +99,7 @@
'stage' => 'assembling',
'filekey' => $newFileKey,
'imageinfo' => $imageInfo,
-   'status' => Status::newGood()
+   'status' => $status
]
);
} catch ( Exception $e ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iebc84f030c45c634dc29b02cbd720f33abf50f2b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: MarkTraceur 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: WIP: Fifth parameter is header suffix, not archive pattern

2016-08-18 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: WIP: Fifth parameter is header suffix, not archive pattern
..

WIP: Fifth parameter is header suffix, not archive pattern

Change-Id: I8b92d29064d90d9dbab23da1024e8e2d16205ab6
---
M maintenance/convertNamespaceFromWikitext.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/maintenance/convertNamespaceFromWikitext.php 
b/maintenance/convertNamespaceFromWikitext.php
index 977ac41..064cd5f 100644
--- a/maintenance/convertNamespaceFromWikitext.php
+++ b/maintenance/convertNamespaceFromWikitext.php
@@ -24,8 +24,8 @@
't'
);
$this->addOption(
-   'archive-pattern',
-   'Naming pattern for archive pages; %s for page title, 
%d for sequence number',
+   'header-suffix',
+   'Wikitext to add to the end of the header',
false, // not required
true, // takes argument
'a'
@@ -78,7 +78,7 @@
new Flow\Import\SourceStore\Null(),
$logger,
$noConvertTemplates,
-   $this->getOption( 'archive-pattern', null )
+   $this->getOption( 'header-suffix', null )
)
);
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: API: Insist authn parameters be in the POST body

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: API: Insist authn parameters be in the POST body
..


API: Insist authn parameters be in the POST body

Passwords should always be submitted in the POST body, not in the query
string. Thus, a warning will now be returned if the password for
action=login or any sensitive authentication request parameters for
AuthManager actions are found in the query string.

These warnings should be upgraded to errors in 1.29.

Change-Id: Ifb2c684bb28c9acc004be2b0c2fef839eb7624aa
---
M RELEASE-NOTES-1.28
M includes/api/ApiAuthManagerHelper.php
M includes/api/ApiBase.php
M includes/api/ApiLogin.php
M includes/api/ApiMain.php
5 files changed, 66 insertions(+), 14 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index f6c3530..eac4e2c 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -61,6 +61,13 @@
 * The following response properties from action=login, deprecated in 1.27, are
   now removed: lgtoken, cookieprefix, sessionid. Clients should handle cookies
   to properly manage session state.
+* Submitting the lgtoken and lgpassword parameters in the query string to
+  action=login is now deprecated and outputs a warning. They should be 
submitted
+  in the POST body instead.
+* Submitting sensitive authentication request parameters to action=clientlogin,
+  action=createaccount, action=linkaccount, and action=changeauthenticationdata
+  in the query string is now deprecated and outputs a warning. They should be
+  submitted in the POST body instead.
 
 === Action API internal changes in 1.28 ===
 * Added a new hook, 'ApiMakeParserOptions', to allow extensions to better
diff --git a/includes/api/ApiAuthManagerHelper.php 
b/includes/api/ApiAuthManagerHelper.php
index d330862..a4f54ee 100644
--- a/includes/api/ApiAuthManagerHelper.php
+++ b/includes/api/ApiAuthManagerHelper.php
@@ -157,8 +157,13 @@
 
// Collect the fields for all the requests
$fields = [];
+   $sensitive = [];
foreach ( $reqs as $req ) {
-   $fields += (array)$req->getFieldInfo();
+   $info = (array)$req->getFieldInfo();
+   $fields += $info;
+   $sensitive += array_filter( $info, function ( $opts ) {
+   return !empty( $opts['sensitive'] );
+   } );
}
 
// Extract the request data for the fields and mark those 
request
@@ -166,6 +171,16 @@
$data = array_intersect_key( 
$this->module->getRequest()->getValues(), $fields );
$this->module->getMain()->markParamsUsed( array_keys( $data ) );
 
+   if ( $sensitive ) {
+   try {
+   $this->module->requirePostedParameters( 
array_keys( $sensitive ), 'noprefix' );
+   } catch ( UsageException $ex ) {
+   // Make this a warning for now, upgrade to an 
error in 1.29.
+   $this->module->setWarning( $ex->getMessage() );
+   $this->module->logFeatureUsage( 
$this->module->getModuleName() . '-params-in-query-string' );
+   }
+   }
+
return AuthenticationRequest::loadRequestsFromSubmission( 
$reqs, $data );
}
 
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index 4a1a520..fcb748c 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -777,6 +777,39 @@
}
 
/**
+* Die if any of the specified parameters were found in the query part 
of
+* the URL rather than the post body.
+* @since 1.28
+* @param string[] $params Parameters to check
+* @param string $prefix Set to 'noprefix' to skip calling 
$this->encodeParamName()
+*/
+   public function requirePostedParameters( $params, $prefix = 'prefix' ) {
+   // Skip if $wgDebugAPI is set or we're in internal mode
+   if ( $this->getConfig()->get( 'DebugAPI' ) || 
$this->getMain()->isInternalMode() ) {
+   return;
+   }
+
+   $queryValues = $this->getRequest()->getQueryValues();
+   $badParams = [];
+   foreach ( $params as $param ) {
+   if ( $prefix !== 'noprefix' ) {
+   $param = $this->encodeParamName( $param );
+   }
+   if ( array_key_exists( $param, $queryValues ) ) {
+   $badParams[] = $param;
+   }
+   }
+
+   if ( $badParams ) {
+   $this->dieUsage(
+   'The following 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Appropriatly check KafkaHandler requireAck argument

2016-08-18 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Appropriatly check KafkaHandler requireAck argument
..

Appropriatly check KafkaHandler requireAck argument

This requireAck argument was supposed to allow enabling turning
on or off the requirement to get ackowledgment of log messages
being written to kafka. Due to a minor mistake though, it was
always enabled regardless of the configuration. Fix that.

Change-Id: I08cb9839a5a93bc586904a1a66ec6c9b05a97707
---
M includes/debug/logger/monolog/KafkaHandler.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/06/305606/1

diff --git a/includes/debug/logger/monolog/KafkaHandler.php 
b/includes/debug/logger/monolog/KafkaHandler.php
index 432a9e1..a15560d 100644
--- a/includes/debug/logger/monolog/KafkaHandler.php
+++ b/includes/debug/logger/monolog/KafkaHandler.php
@@ -120,7 +120,7 @@
$options['logExceptions'] = LoggerFactory::getInstance( 
$options['logExceptions'] );
}
 
-   if ( isset( $options['requireAck'] ) ) {
+   if ( isset( $options['requireAck'] ) && $options['requireAck'] 
) {
$produce->setRequireAck( $options['requireAck'] );
}
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Move logic for creating entities on the fly into EntitySavin...

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Move logic for creating entities on the fly into 
EntitySavingHelper.
..


Move logic for creating entities on the fly into EntitySavingHelper.

This moves several functions from ModifyEntity to EntitySavingHelper.

Bug: T140760
Change-Id: Ie9463149c88484de6799c939b0db2b85a54374b0
---
M repo/includes/Api/ApiHelperFactory.php
M repo/includes/Api/CreateClaim.php
M repo/includes/Api/EditEntity.php
M repo/includes/Api/EntityLoadingHelper.php
M repo/includes/Api/EntitySavingHelper.php
M repo/includes/Api/ModifyEntity.php
M repo/includes/Api/RemoveClaims.php
M repo/includes/Api/RemoveQualifiers.php
M repo/includes/Api/RemoveReferences.php
M repo/includes/Api/SetClaim.php
M repo/includes/Api/SetClaimValue.php
M repo/includes/Api/SetQualifier.php
M repo/includes/Api/SetReference.php
M repo/includes/WikibaseRepo.php
M repo/tests/phpunit/includes/Api/CreateClaimTest.php
M repo/tests/phpunit/includes/Api/EditEntityTest.php
M repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
M repo/tests/phpunit/includes/Api/EntitySavingHelperTest.php
M repo/tests/phpunit/includes/Api/SetClaimTest.php
19 files changed, 680 insertions(+), 341 deletions(-)

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



diff --git a/repo/includes/Api/ApiHelperFactory.php 
b/repo/includes/Api/ApiHelperFactory.php
index f70bd8f..f4ef893 100644
--- a/repo/includes/Api/ApiHelperFactory.php
+++ b/repo/includes/Api/ApiHelperFactory.php
@@ -10,7 +10,9 @@
 use Wikibase\DataModel\SerializerFactory;
 use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup;
 use Wikibase\EditEntityFactory;
+use Wikibase\EntityFactory;
 use Wikibase\Lib\Store\EntityRevisionLookup;
+use Wikibase\Lib\Store\EntityStore;
 use Wikibase\Lib\Store\EntityTitleLookup;
 use Wikibase\Lib\Store\SiteLinkLookup;
 use Wikibase\Repo\Localizer\ExceptionLocalizer;
@@ -73,10 +75,36 @@
private $idParser;
 
/**
-* @var SiteLinkLookup
+* @var SiteLinkLookup|null
 */
private $siteLinkLookup;
 
+   /**
+* @var EntityFactory|null
+*/
+   private $entityFactory;
+
+   /**
+* @var EntityStore|null
+*/
+   private $entityStore;
+
+   /**
+* ApiHelperFactory constructor.
+*
+* @param EntityTitleLookup $titleLookup
+* @param ExceptionLocalizer $exceptionLocalizer
+* @param PropertyDataTypeLookup $dataTypeLookup
+* @param SiteStore $siteStore
+* @param SummaryFormatter $summaryFormatter
+* @param EntityRevisionLookup $entityRevisionLookup
+* @param EditEntityFactory $editEntityFactory
+* @param Serializer $entitySerializer
+* @param EntityIdParser $idParser
+* @param SiteLinkLookup|null $siteLinkLookup
+* @param EntityFactory|null $entityFactory
+* @param EntityStore|null $entityStore
+*/
public function __construct(
EntityTitleLookup $titleLookup,
ExceptionLocalizer $exceptionLocalizer,
@@ -87,7 +115,9 @@
EditEntityFactory $editEntityFactory,
Serializer $entitySerializer,
EntityIdParser $idParser,
-   SiteLinkLookup $siteLinkLookup = null
+   SiteLinkLookup $siteLinkLookup = null,
+   EntityFactory $entityFactory = null,
+   EntityStore $entityStore = null
) {
$this->titleLookup = $titleLookup;
$this->exceptionLocalizer = $exceptionLocalizer;
@@ -99,6 +129,8 @@
$this->entitySerializer = $entitySerializer;
$this->idParser = $idParser;
$this->siteLinkLookup = $siteLinkLookup;
+   $this->entityFactory = $entityFactory;
+   $this->entityStore = $entityStore;
}
 
/**
@@ -172,6 +204,14 @@
$helper->setSiteLinkLookup( $this->siteLinkLookup );
}
 
+   if ( $this->entityFactory ) {
+   $helper->setEntityFactory( $this->entityFactory );
+   }
+
+   if ( $this->entityStore ) {
+   $helper->setEntityStore( $this->entityStore );
+   }
+
return $helper;
}
 
diff --git a/repo/includes/Api/CreateClaim.php 
b/repo/includes/Api/CreateClaim.php
index a30745d..7ff392f 100644
--- a/repo/includes/Api/CreateClaim.php
+++ b/repo/includes/Api/CreateClaim.php
@@ -104,7 +104,7 @@
 
$statement = 
$entity->getStatements()->getFirstStatementWithGuid( 
$changeOp->getStatementGuid() );
 
-   $status = $this->entitySavingHelper->attemptSaveEntity( 
$entity, $summary, EDIT_UPDATE );
+   $status = $this->entitySavingHelper->attemptSaveEntity( 
$entity, $summary );

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Temporarily make NS_PROJECT_TALK wikitext again on Beta cawiki

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Temporarily make NS_PROJECT_TALK wikitext again on Beta cawiki
..


Temporarily make NS_PROJECT_TALK wikitext again on Beta cawiki

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

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



diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 129efd2..46fae9a 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -374,6 +374,9 @@
'enwiki' => true,
'en_rtlwiki' => true,
],
+   'wmgFlowNamespaces' => [
+   'cawiki' => [],
+   ],
# No separate Flow DB or cluster (yet) for labs.
'-wmgFlowDefaultWikiDb' => [
'default' => false,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ea6c873984c1d87c456aea1af4b64829b0f041a
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: MediaWiki theme: Make ToggleSwitchWidget's disabled state fo...

2016-08-18 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: MediaWiki theme: Make ToggleSwitchWidget's disabled state 
follow enabled
..

MediaWiki theme: Make ToggleSwitchWidget's disabled state follow enabled

After changes introduced in I25e387e33da672455a09252632d174d1dc067405
ToggleSwitchWidget's grip is still not following the same visual logic
in disabled state. This patch introduces outlined circle - supported
by `box-shadow` because of increasing contrast to `background-color` -
when widget is disabled.
Also cleaning up and unifying the different disabled variables. And
exchanging minor occurence of fixed value with variable.

Change-Id: I6f8b45303474a9ffce5f2acd1fc5db38ef211f29
---
M src/themes/mediawiki/common.less
M src/themes/mediawiki/elements.less
M src/themes/mediawiki/widgets.less
3 files changed, 20 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/05/305605/1

diff --git a/src/themes/mediawiki/common.less b/src/themes/mediawiki/common.less
index 04c5eae..f64468f 100644
--- a/src/themes/mediawiki/common.less
+++ b/src/themes/mediawiki/common.less
@@ -29,9 +29,9 @@
 
 // Disabled Widgets
 @background-color-disabled: #f3f3f3;
-@background-color-filled-disabled: #ddd;
+@background-color-disabled-filled: #ddd;
 @color-disabled: #ccc;
-@color-disabled-framed: #fff;
+@color-disabled-filled: #fff;
 @opacity-disabled: 0.2;
 
 // Invalid Widget (validation error feedback)
@@ -49,6 +49,7 @@
 
 @border-default: @border-width-default solid @border-color-default;
 @border-disabled: @border-width-default solid @border-color-disabled;
+@border-disabled-filled: @border-width-default solid 
@border-color-disabled-filled;
 @border-dialog: @border-width-default solid @border-color-dialog;
 @border-menu: @border-dialog;
 
@@ -56,7 +57,7 @@
 @border-color-default-hover: #aaa;
 @border-color-default-focus: @color-progressive-focus;
 @border-color-disabled: #ddd;
-@border-color-disabled-framed: @color-disabled-framed;
+@border-color-disabled-filled: @color-disabled-filled;
 @border-color-progressive-active: #859dcc; // equivalents `fade( 
@color-progressive-active, 50% )`
 @border-color-destructive-active: #b77c79; // equivalents `fade( 
@color-destructive-active, 50% )`
 @border-color-focus-inset: @color-default-light;
@@ -71,6 +72,7 @@
 @box-shadow-menu: @box-shadow-dialog;
 @box-shadow-focus-default: inset 0 0 0 1px @color-progressive;
 @box-shadow-focus-inset: inset 0 0 0 1px @color-progressive, inset 0 0 0 2px 
@color-default-light;
+@box-shadow-disabled-filled: inset 0 0 0 1px @color-disabled-filled;
 
 @line-height-default: 1.4;
 
diff --git a/src/themes/mediawiki/elements.less 
b/src/themes/mediawiki/elements.less
index 7bba06c..7de6231 100644
--- a/src/themes/mediawiki/elements.less
+++ b/src/themes/mediawiki/elements.less
@@ -147,14 +147,14 @@
 
&.oo-ui-widget-disabled {
& > .oo-ui-buttonElement-button {
-   background-color: 
@background-color-filled-disabled;
-   color: @color-disabled-framed;
+   background-color: 
@background-color-disabled-filled;
+   color: @color-disabled-filled;
border: @border-disabled;
}
 
& + .oo-ui-widget-disabled {
& > .oo-ui-buttonElement-button {
-   border-left-color: 
@border-color-disabled-framed;
+   border-left-color: 
@border-color-disabled-filled;
}
}
}
diff --git a/src/themes/mediawiki/widgets.less 
b/src/themes/mediawiki/widgets.less
index e5e074c..f31185f 100644
--- a/src/themes/mediawiki/widgets.less
+++ b/src/themes/mediawiki/widgets.less
@@ -403,7 +403,7 @@
}
 
&:disabled + span {
-   background-color: @background-color-filled-disabled;
+   background-color: @background-color-disabled-filled;
border-color: @border-color-disabled;
}
 
@@ -540,7 +540,7 @@
}
 
&:disabled + span {
-   background-color: @background-color-filled-disabled;
+   background-color: @background-color-disabled-filled;
border-color: @border-color-disabled;
}
 
@@ -1110,7 +1110,7 @@
.oo-ui-popupWidget-anchor:after {
bottom: -@anchor-size - 1px;
left: -@anchor-size + 1px;
-   border-bottom-color: @border-color-disabled-framed;
+   border-bottom-color: @border-color-disabled-filled;

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Temporarily make NS_PROJECT_TALK wikitext again on Beta cawiki

2016-08-18 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Temporarily make NS_PROJECT_TALK wikitext again on Beta cawiki
..

Temporarily make NS_PROJECT_TALK wikitext again on Beta cawiki

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


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

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 129efd2..46fae9a 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -374,6 +374,9 @@
'enwiki' => true,
'en_rtlwiki' => true,
],
+   'wmgFlowNamespaces' => [
+   'cawiki' => [],
+   ],
# No separate Flow DB or cluster (yet) for labs.
'-wmgFlowDefaultWikiDb' => [
'default' => false,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: UploadBase: Stop mLocalFile doubling as stashed file

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: UploadBase: Stop mLocalFile doubling as stashed file
..


UploadBase: Stop mLocalFile doubling as stashed file

"I've a great idea", they said. "You know what would be cool? If I
made this boring getter, getLocalFile(), return something completely
different after the file was stashed. This will be a nice surprise for
someone in the future to discover", they added gleefully.

I am pretty sure everything still works, but I never could get async
upload publishing to work locally, so I'd appreciate some testing.

Change-Id: I11dcf2ed89e4f1dd8ddf081af521da005efdbf39
---
M includes/api/ApiUpload.php
M includes/jobqueue/jobs/AssembleUploadChunksJob.php
M includes/upload/UploadBase.php
M includes/upload/UploadFromChunks.php
4 files changed, 28 insertions(+), 23 deletions(-)

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



diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index fc2fd59..227278c 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -278,7 +278,7 @@
// the old filekey and fetch the new one.
UploadBase::setSessionStatus( $this->getUser(), 
$filekey, false );
$this->mUpload->stash->removeFile( $filekey );
-   $filekey = 
$this->mUpload->getLocalFile()->getFileKey();
+   $filekey = 
$this->mUpload->getStashFile()->getFileKey();
 
$result['result'] = 'Success';
}
@@ -735,7 +735,7 @@
$this->mParams['text'] = $this->mParams['comment'];
}
 
-   /** @var $file File */
+   /** @var $file LocalFile */
$file = $this->mUpload->getLocalFile();
 
// For preferences mode, we want to watch if 'watchdefault' is 
set,
diff --git a/includes/jobqueue/jobs/AssembleUploadChunksJob.php 
b/includes/jobqueue/jobs/AssembleUploadChunksJob.php
index 1e804c4..f3fcadf 100644
--- a/includes/jobqueue/jobs/AssembleUploadChunksJob.php
+++ b/includes/jobqueue/jobs/AssembleUploadChunksJob.php
@@ -74,7 +74,7 @@
}
 
// We have a new filekey for the fully concatenated file
-   $newFileKey = $upload->getLocalFile()->getFileKey();
+   $newFileKey = $upload->getStashFile()->getFileKey();
 
// Remove the old stash file row and first chunk file
$upload->stash->removeFileNoAuth( 
$this->params['filekey'] );
diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php
index ae16f70..e2f7763 100644
--- a/includes/upload/UploadBase.php
+++ b/includes/upload/UploadBase.php
@@ -44,7 +44,7 @@
protected $mDesiredDestName, $mDestName, $mRemoveTempFile, $mSourceType;
protected $mTitle = false, $mTitleError = 0;
protected $mFilteredName, $mFinalExtension;
-   protected $mLocalFile, $mFileSize, $mFileProps;
+   protected $mLocalFile, $mStashFile, $mFileSize, $mFileProps;
protected $mBlackListedExtensions;
protected $mJavaDetected, $mSVGNSError;
 
@@ -912,7 +912,7 @@
/**
 * Return the local file and initializes if necessary.
 *
-* @return LocalFile|UploadStashFile|null
+* @return LocalFile|null
 */
public function getLocalFile() {
if ( is_null( $this->mLocalFile ) ) {
@@ -921,6 +921,13 @@
}
 
return $this->mLocalFile;
+   }
+
+   /**
+* @return UploadStashFile|null
+*/
+   public function getStashFile() {
+   return $this->mStashFile;
}
 
/**
@@ -997,7 +1004,7 @@
protected function doStashFile( User $user = null ) {
$stash = 
RepoGroup::singleton()->getLocalRepo()->getUploadStash( $user );
$file = $stash->stashFile( $this->mTempPath, 
$this->getSourceType() );
-   $this->mLocalFile = $file;
+   $this->mStashFile = $file;
 
return $file;
}
@@ -1975,18 +1982,16 @@
 * @return array Image info
 */
public function getImageInfo( $result ) {
-   $file = $this->getLocalFile();
-   /** @todo This cries out for refactoring.
-*  We really want to say $file->getAllInfo(); here.
-* Perhaps "info" methods should be moved into files, and the 
API should
-* just wrap them in queries.
-*/
-   if ( $file instanceof UploadStashFile ) {
+   $localFile = $this->getLocalFile();
+   $stashFile = $this->getStashFile();
+   // Calling a different API module depending on 

[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Make server-side logging always check whether schema is enabled

2016-08-18 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Make server-side logging always check whether schema is enabled
..

Make server-side logging always check whether schema is enabled

We have a convention to put a logger helper function in
MWEchoEventLogging, so also enforce that:
* Rename to actuallyLogTheEvent to logEvent and centralize the
  'enabled' check there.
* Make that protected, so new schemas also use a helper function
  for consistency.

Bug: T143092
Change-Id: I8085fc5898f3420172355c5a2df04aac6add9acd
---
M includes/EventLogging.php
1 file changed, 14 insertions(+), 19 deletions(-)


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

diff --git a/includes/EventLogging.php b/includes/EventLogging.php
index e527440..cd7bce1 100644
--- a/includes/EventLogging.php
+++ b/includes/EventLogging.php
@@ -7,13 +7,22 @@
 
/**
 * This is the only function that interacts with EventLogging
+*
+* Logs if logging is enabled for the given $schema.
+*
 * @param string $schema
 * @param array $data
 */
-   public static function actuallyLogTheEvent( $schema, array $data ) {
+   protected static function logEvent( $schema, array $data ) {
global $wgEchoConfig;
 
-   EventLogging::logEvent( $schema, 
$wgEchoConfig['eventlogging'][$schema]['revision'], $data );
+   $schemaConfig = $wgEchoConfig['eventlogging'][$schema];
+   if ( !$schemaConfig['enabled'] ) {
+   // If logging for this schema is disabled, it's a no-op.
+   return;
+   }
+
+   EventLogging::logEvent( $schema, $schemaConfig['revision'], 
$data );
}
 
/**
@@ -24,10 +33,6 @@
 */
public static function logSchemaEcho( User $user, EchoEvent $event, 
$deliveryMethod ) {
global $wgEchoConfig, $wgEchoNotifications;
-   if ( !$wgEchoConfig['eventlogging']['Echo']['enabled'] ) {
-   // Only attempt event logging if Echo schema is enabled
-   return;
-   }
 
// Notifications under system category should have -1 as sender 
id
if ( $event->getCategory() === 'system' ) {
@@ -72,7 +77,7 @@
$data['revisionId'] = $rev->getId();
}
 
-   self::actuallyLogTheEvent( 'Echo', $data );
+   self::logEvent( 'Echo', $data );
}
 
/**
@@ -83,18 +88,13 @@
public static function logSchemaEchoMail( User $user, 
$emailDeliveryMode = 'single' ) {
global $wgEchoConfig;
 
-   if ( !$wgEchoConfig['eventlogging']['EchoMail']['enabled'] ) {
-   // Only attempt event logging if EchoMail schema is 
enabled
-   return;
-   }
-
$data = array(
'version' => $wgEchoConfig['version'],
'recipientUserId' => $user->getId(),
'emailDeliveryMode' => $emailDeliveryMode
);
 
-   self::actuallyLogTheEvent( 'EchoMail', $data );
+   self::logEvent( 'EchoMail', $data );
}
 
/**
@@ -102,12 +102,7 @@
 * @param string $skinName
 */
public static function logEchoInteraction( User $user, $skinName ) {
-   global $wgEchoConfig;
-   if ( 
!$wgEchoConfig['eventlogging']['EchoInteraction']['enabled'] ) {
-   return;
-   }
-
-   self::actuallyLogTheEvent(
+   self::logEvent(
'EchoInteraction',
array(
'context' => 'archive',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8085fc5898f3420172355c5a2df04aac6add9acd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Mobile action menu should stick to bottom of screen

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Mobile action menu should stick to bottom of screen
..


Mobile action menu should stick to bottom of screen

Just like we do in the mobile popup, the menu should be accessible
in mobile clicks/taps by being "stuck" at the bottom of the screen.

Bug: T142013
Change-Id: I730216e717c2a02ad98bbcc28f66b13c1cbe29ed
---
M Resources.php
A modules/styles/mw.echo.ui.overlay.minerva.less
2 files changed, 29 insertions(+), 0 deletions(-)

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



diff --git a/Resources.php b/Resources.php
index d2b0fa9..ff147b9 100644
--- a/Resources.php
+++ b/Resources.php
@@ -101,6 +101,9 @@
'vector' => array(
'styles/mw.echo.ui.overlay.vector.less',
),
+   'minerva' => array(
+   'styles/mw.echo.ui.overlay.minerva.less',
+   ),
),
'dependencies' => array(
'ext.echo.logger',
diff --git a/modules/styles/mw.echo.ui.overlay.minerva.less 
b/modules/styles/mw.echo.ui.overlay.minerva.less
new file mode 100644
index 000..9007ab6
--- /dev/null
+++ b/modules/styles/mw.echo.ui.overlay.minerva.less
@@ -0,0 +1,26 @@
+/* In mobile, overlay is positioned at the bottom */
+.mw-echo-ui-overlay {
+   position: fixed;
+   bottom: 0;
+   right: 0;
+   left: 0;
+   top: auto;
+
+   .mw-echo-ui-actionMenuPopupWidget-menu {
+   padding: 0.5em;
+   font-size: 1.5em;
+   box-shadow: none;
+   border: 1px solid #666;
+   // Override the positioning of the menu
+   // so it is "stuck" on the bottom of the
+   // notification overlay panel
+   position: static !important;
+   bottom: 0 !important;
+   left: 0 !important;
+   width: 100% !important;
+   max-width: none !important;
+   height: auto !important;
+   top: auto !important;
+   }
+}
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I730216e717c2a02ad98bbcc28f66b13c1cbe29ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: phabricator: only run dumps on active server

2016-08-18 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: phabricator: only run dumps on active server
..


phabricator: only run dumps on active server

Disable dumps, cron and rsync, on the inactive phabricator
server until further notice, to avoid cronspam.

Change-Id: Id13adf92cab1934664a9e134e12d6b134ca52fdc
---
M modules/role/manifests/phabricator/main.pp
1 file changed, 16 insertions(+), 13 deletions(-)

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



diff --git a/modules/role/manifests/phabricator/main.pp 
b/modules/role/manifests/phabricator/main.pp
index 0cfa45c..44d699a 100644
--- a/modules/role/manifests/phabricator/main.pp
+++ b/modules/role/manifests/phabricator/main.pp
@@ -26,6 +26,18 @@
 $phab_root_dir = '/srv/phab'
 $deploy_target = 'phabricator/deployment'
 
+# logmail and dumps are only enabled on the active server set in Hiera
+$phabricator_active_server = hiera('phabricator_active_server')
+if $::hostname == $phabricator_active_server {
+$logmail_ensure = 'present'
+$dump_rsync_ensure = 'present'
+$dump_enabled = true
+} else {
+$logmail_ensure = 'absent'
+$dump_rsync_ensure ='absent'
+$dump_enabled = false
+}
+
 # lint:ignore:arrow_alignment
 class { '::phabricator':
 deploy_target=> $deploy_target,
@@ -90,12 +102,12 @@
 phabtools_cert  => $role::phabricator::config::phabtools_cert,
 phabtools_user  => $role::phabricator::config::phabtools_user,
 gerritbot_token => $role::phabricator::config::gerritbot_token,
-dump=> true,
+dump=> $dump_enabled,
 require => Package[$deploy_target]
 }
 
 cron { 'phab_dump':
-ensure  => present,
+ensure  => $dump_rsync_ensure,
 command => 'rsync -zpt --bwlimit=4 -4 
/srv/dumps/phabricator_public.dump dataset1001.wikimedia.org::other_misc/ 
>/dev/null 2>&1',
 user=> 'root',
 minute  => '10',
@@ -186,17 +198,8 @@
 
 # community metrics mail (T81784, T1003)
 # disabled due to maintenance: T138460, re-enabled T139950
-
-# crons are only enabled on the active server set in Hiera
-$phabricator_active_server = hiera('phabricator_active_server')
-if $::hostname == $phabricator_active_server {
-$phab_logmail_ensure = 'present'
-} else {
-$phab_logmail_ensure = 'absent'
-}
-
 phabricator::logmail {'communitymetrics':
-ensure   => $phab_logmail_ensure,
+ensure   => $logmail_ensure,
 script_name  => 'community_metrics.sh',
 rcpt_address => 'wikitec...@lists.wikimedia.org',
 sndr_address => 'communitymetr...@wikimedia.org',
@@ -207,7 +210,7 @@
 # project changes mail (T85183)
 # disabled due to maintenance: T138460, re-enabled T139950
 phabricator::logmail {'projectchanges':
-ensure   => $phab_logmail_ensure,
+ensure   => $logmail_ensure,
 script_name  => 'project_changes.sh',
 rcpt_address => [ 'phabricator-repo...@lists.wikimedia.org' ],
 sndr_address => 'aklap...@wikimedia.org',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Make dotdotdot menu not be extremely wide

2016-08-18 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

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

Change subject: Make dotdotdot menu not be extremely wide
..

Make dotdotdot menu not be extremely wide

Work around new styles introduced in oojs-ui in I77cd5212c.

Change-Id: Ifb16b7bb0b01c1eb2551ba4c173042cc759e9b02
---
M Resources.php
A modules/styles/mw.echo.ui.ActionMenuPopupWidget.less
2 files changed, 7 insertions(+), 0 deletions(-)


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

diff --git a/Resources.php b/Resources.php
index d2b0fa9..84254a0 100644
--- a/Resources.php
+++ b/Resources.php
@@ -87,6 +87,7 @@
'styles/mw.echo.ui.NotificationsListWidget.less',
'styles/mw.echo.ui.PlaceholderItemWidget.less',
'styles/mw.echo.ui.SubGroupListWidget.less',
+   'styles/mw.echo.ui.ActionMenuPopupWidget.less',
'styles/mw.echo.ui.MenuItemWidget.less',
'styles/mw.echo.ui.FooterNoticeWidget.less',
'styles/mw.echo.ui.NotificationsWrapper.less',
diff --git a/modules/styles/mw.echo.ui.ActionMenuPopupWidget.less 
b/modules/styles/mw.echo.ui.ActionMenuPopupWidget.less
new file mode 100644
index 000..f1734ae
--- /dev/null
+++ b/modules/styles/mw.echo.ui.ActionMenuPopupWidget.less
@@ -0,0 +1,6 @@
+.mw-echo-ui-actionMenuPopupWidget-menu {
+   &.oo-ui-menuSelectWidget {
+   // Override width: 100%; rule from OOUI
+   width: auto;
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb16b7bb0b01c1eb2551ba4c173042cc759e9b02
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Catrope 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ResourceLoaderImage: Use hashes for versioning instead of ti...

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: ResourceLoaderImage: Use hashes for versioning instead of 
timestamps
..


ResourceLoaderImage: Use hashes for versioning instead of timestamps

Remove use of the deprecated getModifiedTime() method and incorporate
file information in getDefinitionSummary() directly, instead of relying
on the parent class to include getModifiedTime().

Change getDefinitionSummary() to append to the summary instead of
setting arbitrary keys in the array directly to avoid conflicts.
This matches the pattern used elsewhere.

Change ResourceLoaderImage to use file hashes instead of timestamps
to avoid needless cache invalidation. At Wikimedia these modules
tend to roll over every week due to git not storing timestamps.
See also T104950, 9112c9347b, f37cee996.

Change-Id: I5d019bfb991c3b8042d1db14a853ba46cc690315
---
M includes/resourceloader/ResourceLoaderImageModule.php
1 file changed, 11 insertions(+), 11 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  Bartosz Dziewoński: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/resourceloader/ResourceLoaderImageModule.php 
b/includes/resourceloader/ResourceLoaderImageModule.php
index 6cdab1b..43327c9 100644
--- a/includes/resourceloader/ResourceLoaderImageModule.php
+++ b/includes/resourceloader/ResourceLoaderImageModule.php
@@ -393,6 +393,8 @@
public function getDefinitionSummary( ResourceLoaderContext $context ) {
$this->loadFromDefinition();
$summary = parent::getDefinitionSummary( $context );
+
+   $options = [];
foreach ( [
'localBasePath',
'images',
@@ -401,29 +403,27 @@
'selectorWithoutVariant',
'selectorWithVariant',
] as $member ) {
-   $summary[$member] = $this->{$member};
+   $options[$member] = $this->{$member};
};
+
+   $summary[] = [
+   'options' => $options,
+   'fileHashes' => $this->getFileHashes( $context ),
+   ];
return $summary;
}
 
/**
-* Get the last modified timestamp of this module.
-*
-* @param ResourceLoaderContext $context Context in which to calculate
-* the modified time
-* @return int UNIX timestamp
+* Helper method for getDefinitionSummary.
 */
-   public function getModifiedTime( ResourceLoaderContext $context ) {
+   protected function getFileHashes( ResourceLoaderContext $context ) {
$this->loadFromDefinition();
$files = [];
foreach ( $this->getImages( $context ) as $name => $image ) {
$files[] = $image->getPath( $context );
}
-
$files = array_values( array_unique( $files ) );
-   $filesMtime = max( array_map( [ __CLASS__, 'safeFilemtime' ], 
$files ) );
-
-   return $filesMtime;
+   return array_map( [ __CLASS__, 'safeFileHash' ], $files );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5d019bfb991c3b8042d1db14a853ba46cc690315
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] performance[refs/meta/dashboards/custom]: dashboard: Add "My patches" sections

2016-08-18 Thread Krinkle (Code Review)
Krinkle has submitted this change and it was merged.

Change subject: dashboard: Add "My patches" sections
..


dashboard: Add "My patches" sections

Since we exclude 'self' patches by default (since the purpose is
incoming reviews), it is not always obvious what patches others
are seeing from you. Especially because we exclude patches that
are marked "WIP" or failing certain scores.

Add visibility into what others are seeing from you on this
dashboard through these two sections:

* "My patches for review" (the ones self-excluded from "Pending patches by 
team")
* "My other patches" (the ones not yet ready for review)

Change-Id: I995e15374bc708edfadbcac92a9fbac92649f369
---
M custom
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/custom b/custom
index c3afbd1..1999438 100644
--- a/custom
+++ b/custom
@@ -2,7 +2,11 @@
   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)
-[section "Pending patches"]
+[section "Pending patches by team"]
   query = is:open -owner:self -message:WIP -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
+[section "My patches for review"]
+  query = is:open owner:self -message:WIP -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
+[section "My other patches"]
+  query = is:open owner:self (message:WIP OR label:Verified<=-1 OR 
label:Code-Review<=-1) limit:40
 [section "Recently merged"]
   query = is:merged limit:30

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I995e15374bc708edfadbcac92a9fbac92649f369
Gerrit-PatchSet: 3
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]: dashboard: Add "My pending patches" section

2016-08-18 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: dashboard: Add "My pending patches" section
..

dashboard: Add "My pending patches" section

Since we exclude 'self' patches by default (since the purpose is
incoming reviews), it is not always obvious what patches others
are seeing from you. Especially because we exclude patches that
are marked "WIP" or failing certain scores.

Add visibility into what others are seeing from you on this
dashboard through this section.

Change-Id: I995e15374bc708edfadbcac92a9fbac92649f369
---
M custom
1 file changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/custom b/custom
index c3afbd1..ef748b1 100644
--- a/custom
+++ b/custom
@@ -2,7 +2,9 @@
   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)
-[section "Pending patches"]
+[section "Pending patches by team"]
   query = is:open -owner:self -message:WIP -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
+[section "My pending patches"]
+  query = is:open owner:self -message:WIP -label:Verified<=-1 
-label:Code-Review<=-1 limit:40
 [section "Recently merged"]
   query = is:merged limit:30

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I995e15374bc708edfadbcac92a9fbac92649f369
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...VisualEditor[master]: Defer preferences update and avoid CAS errors in onUserLogge...

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Defer preferences update and avoid CAS errors in 
onUserLoggedIn()
..


Defer preferences update and avoid CAS errors in onUserLoggedIn()

Bug: T143367
Change-Id: I9509f6ef565d9953f9c05b00b02b57098eef9e3a
---
M VisualEditor.hooks.php
1 file changed, 10 insertions(+), 2 deletions(-)

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



diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index ea08c82..e60cdc9 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -1009,9 +1009,17 @@
public static function onUserLoggedIn( $user ) {
$cookie = RequestContext::getMain()->getRequest()->getCookie( 
'VEE', '' );
if ( $cookie === 'visualeditor' || $cookie === 'wikitext' ) {
-   $user->setOption( 'visualeditor-editor', $cookie );
-   $user->saveSettings();
+   DeferredUpdates::addUpdate( new AtomicSectionUpdate(
+   wfGetDB( DB_MASTER ),
+   __METHOD__,
+   function () use ( $user, $cookie ) {
+   $uLatest = 
$user->getInstanceForUpdate();
+   $uLatest->setOption( 
'visualeditor-editor', $cookie );
+   $uLatest->saveSettings();
+   }
+   ) );
}
+
return true;
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9509f6ef565d9953f9c05b00b02b57098eef9e3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: phabricator: only run dumps on active server

2016-08-18 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: phabricator: only run dumps on active server
..

phabricator: only run dumps on active server

Also disable dumps cron and rsync on the inactive phabricator
server until further notice, to avoid cronspam.

Change-Id: Id13adf92cab1934664a9e134e12d6b134ca52fdc
---
M modules/role/manifests/phabricator/main.pp
1 file changed, 14 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/00/305600/1

diff --git a/modules/role/manifests/phabricator/main.pp 
b/modules/role/manifests/phabricator/main.pp
index 0cfa45c..3f429b7 100644
--- a/modules/role/manifests/phabricator/main.pp
+++ b/modules/role/manifests/phabricator/main.pp
@@ -26,6 +26,18 @@
 $phab_root_dir = '/srv/phab'
 $deploy_target = 'phabricator/deployment'
 
+# logmail and dumps are only enabled on the active server set in Hiera
+$phabricator_active_server = hiera('phabricator_active_server')
+if $::hostname == $phabricator_active_server {
+$logmail_ensure = 'present'
+$dump_rsync_ensure = 'present'
+$dump_enabled = 'true'
+} else {
+$logmail_ensure = 'absent'
+$dump_rsync_ensure ='absent'
+$dump_enabled = 'false'
+}
+
 # lint:ignore:arrow_alignment
 class { '::phabricator':
 deploy_target=> $deploy_target,
@@ -90,12 +102,12 @@
 phabtools_cert  => $role::phabricator::config::phabtools_cert,
 phabtools_user  => $role::phabricator::config::phabtools_user,
 gerritbot_token => $role::phabricator::config::gerritbot_token,
-dump=> true,
+dump=> $dump_enabled,
 require => Package[$deploy_target]
 }
 
 cron { 'phab_dump':
-ensure  => present,
+ensure  => $phab_dump_ensure,
 command => 'rsync -zpt --bwlimit=4 -4 
/srv/dumps/phabricator_public.dump dataset1001.wikimedia.org::other_misc/ 
>/dev/null 2>&1',
 user=> 'root',
 minute  => '10',
@@ -186,15 +198,6 @@
 
 # community metrics mail (T81784, T1003)
 # disabled due to maintenance: T138460, re-enabled T139950
-
-# crons are only enabled on the active server set in Hiera
-$phabricator_active_server = hiera('phabricator_active_server')
-if $::hostname == $phabricator_active_server {
-$phab_logmail_ensure = 'present'
-} else {
-$phab_logmail_ensure = 'absent'
-}
-
 phabricator::logmail {'communitymetrics':
 ensure   => $phab_logmail_ensure,
 script_name  => 'community_metrics.sh',

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Set timezone to Europe/Ljubljana on sl. projects

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Set timezone to Europe/Ljubljana on sl. projects
..


Set timezone to Europe/Ljubljana on sl. projects

The Slovene Wikibooks and Wiktionary projects have been notified
of the timezone harmonization for sl projects, without any objection.

This is a follow-up for f14df5de.

Bug: T142701
Change-Id: I560af11c578439c073bdc63377f9cd3a6b2279ee
---
M wmf-config/InitialiseSettings.php
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index e9f924b..78cd699 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -407,9 +407,11 @@
'sewikimedia' => 'Europe/Berlin',
'shwiki' => 'Europe/Berlin',
'slwiki' => 'Europe/Ljubljana',
+   'slwikibooks' => 'Europe/Ljubljana', // T142701
'slwikiquote' => 'Europe/Ljubljana',
'slwikisource' => 'Europe/Ljubljana', // T142701
'slwikiversity' => 'Europe/Ljubljana',
+   'slwiktionary' => 'Europe/Ljubljana', // T142701
'sqwiki' => 'Europe/Berlin',
'sqwikinews' => 'Europe/Berlin',
'srwiki' => 'Europe/Berlin',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I560af11c578439c073bdc63377f9cd3a6b2279ee
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Dereckson 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: mysql: innodb_large_prefix and CREATE DATABASE options

2016-08-18 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: mysql: innodb_large_prefix and CREATE DATABASE options
..

mysql: innodb_large_prefix and CREATE DATABASE options

* Enable innodb_large_prefix support via my.cnf configuration
* Add optional 'options' parameter for mysql::db that can be used to
  provide character set and other default settings.

Both are used by role::striker to configure its database with utf8mb4
encoding while still supporting varchar(255) unique indices. Sadly
neither our version of mysql nor Django have a way to set
"row_format=dynamic" as the default for new table creations, so
automatic table creation in Striker for many tables will still fail. We
will take care of that in production via manually curated DDL files.

Bug: T142545
Change-Id: Ia95c9d7414b7a9486868229fa9e1291ab6abd262
---
A puppet/modules/mysql/files/innodb_large_prefix.cnf
M puppet/modules/mysql/manifests/db.pp
M puppet/modules/mysql/manifests/init.pp
M puppet/modules/role/manifests/striker.pp
4 files changed, 32 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/99/305599/1

diff --git a/puppet/modules/mysql/files/innodb_large_prefix.cnf 
b/puppet/modules/mysql/files/innodb_large_prefix.cnf
new file mode 100644
index 000..0eb40b8
--- /dev/null
+++ b/puppet/modules/mysql/files/innodb_large_prefix.cnf
@@ -0,0 +1,12 @@
+# This file is managed by puppet
+# See puppet/modules/mysql/files/innodb_large_prefix.cnf
+#
+# Enable settings to allow indexing >767 bytes.
+#
+# Tables needing innodb_large_prefix support will need to use
+# row_format= in their create statements in addition to
+# these settings. innodb_default_row_format is not supported until 5.7.9
+[mysqld]
+innodb_file_per_table = 1
+innodb_file_format = BARRACUDA
+innodb_large_prefix = 1
diff --git a/puppet/modules/mysql/manifests/db.pp 
b/puppet/modules/mysql/manifests/db.pp
index 7e44591..81327fe 100644
--- a/puppet/modules/mysql/manifests/db.pp
+++ b/puppet/modules/mysql/manifests/db.pp
@@ -11,6 +11,10 @@
 # [*dbname*]
 #   Database name. Defaults to resource title. Example: 'wikidb'.
 #
+# [*options*]
+#   Additional options to pass to the create command.
+#   Example 'CHARACTER SET utf8mb4 COLLATE utf8mb4_bin'. Default ''.
+#
 # === Examples
 #
 # Creates a 'centralauth' database:
@@ -20,8 +24,9 @@
 #  }
 #
 define mysql::db(
-$ensure = present,
-$dbname = $title,
+$ensure  = present,
+$dbname  = $title,
+$options = '',
 ) {
 if $ensure == 'absent' {
 $command = 'drop'
@@ -31,7 +36,7 @@
 $unless  = 'exists'
 }
 
-mysql::sql { "${command} database ${dbname}":
+mysql::sql { "${command} database ${dbname} ${options}":
 unless => "select ${unless}(select * from information_schema.schemata 
where schema_name = '${dbname}')",
 }
 }
diff --git a/puppet/modules/mysql/manifests/init.pp 
b/puppet/modules/mysql/manifests/init.pp
index f503c34..ed15333 100644
--- a/puppet/modules/mysql/manifests/init.pp
+++ b/puppet/modules/mysql/manifests/init.pp
@@ -50,6 +50,16 @@
 content => template('mysql/my.cnf.erb'),
 }
 
+file { '/etc/mysql/conf.d/innodb_large_prefix.cnf':
+ensure  => 'file',
+owner   => 'root',
+group   => 'root',
+mode=> '0444',
+source  => 'puppet:///modules/mysql/innodb_large_prefix.cnf',
+require => Package['mysql-server'],
+notify  => Service['mysql'],
+}
+
 # Create databases before creating users. User resources sometime
 # depend on databases for GRANTs, but the reverse is never true.
 Mysql::Db <| |> -> Mysql::User <| |>
diff --git a/puppet/modules/role/manifests/striker.pp 
b/puppet/modules/role/manifests/striker.pp
index 96a22f4..4eea8c8 100644
--- a/puppet/modules/role/manifests/striker.pp
+++ b/puppet/modules/role/manifests/striker.pp
@@ -134,7 +134,8 @@
 }
 
 mysql::db { $db_name:
-ensure => present,
+ensure  => present,
+options => 'CHARACTER SET utf8mb4 COLLATE utf8mb4_bin',
 }
 mysql::user { $db_user:
 ensure   => present,

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

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

___
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 AbuseFilter B/C config

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove AbuseFilter B/C config
..


Remove AbuseFilter B/C config

Removes B/C part of I63e93d0f that's not needed anymore once
I790d39c28 is deployed everywhere.

Change-Id: Ib59532ba81884abeda1c314b78acb22b3db17cd1
---
M wmf-config/abusefilter.php
1 file changed, 0 insertions(+), 16 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/abusefilter.php b/wmf-config/abusefilter.php
index 2c90ab1..ff8c694 100644
--- a/wmf-config/abusefilter.php
+++ b/wmf-config/abusefilter.php
@@ -398,19 +398,3 @@
$wgAbuseFilterBlockDuration = 'indefinite';
$wgAbuseFilterAnonBlockDuration = '48 hours';
 }
-
-// For BC until I790d39c28 is deployed everywhere
-if ( isset( $wgAbuseFilterAvailableActions ) ) {
-   $wgAbuseFilterActions += [
-   'flag' => true,
-   'throttle' => true,
-   'warn' => true,
-   'disallow' => true,
-   'blockautopromote' => true,
-   'block' => true,
-   'rangeblock' => false,
-   'degroup' => true,
-   'tag' => true,
-   ];
-   $wgAbuseFilterAvailableActions = array_keys( array_filter( 
$wgAbuseFilterActions ) );
-}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib59532ba81884abeda1c314b78acb22b3db17cd1
Gerrit-PatchSet: 5
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Dereckson 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Simplify definition of table selections

2016-08-18 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Simplify definition of table selections
..

Simplify definition of table selections

Change-Id: I37219cde2fbf3cde9ff3e61833aad53d58ffb97a
---
M tests/ce/ve.ce.Surface.test.js
1 file changed, 25 insertions(+), 66 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/97/305597/1

diff --git a/tests/ce/ve.ce.Surface.test.js b/tests/ce/ve.ce.Surface.test.js
index 428b08a..30156d7 100644
--- a/tests/ce/ve.ce.Surface.test.js
+++ b/tests/ce/ve.ce.Surface.test.js
@@ -60,12 +60,13 @@
}
expectedData( data );
 
-   expectedSelection = expectedRangeOrSelection instanceof ve.Range ?
+   expectedSelection = ve.dm.Selection.static.newFromJSON( 
model.getDocument(), expectedRangeOrSelection instanceof ve.Range ?
{ type: 'linear', range: expectedRangeOrSelection } :
-   expectedRangeOrSelection;
+   expectedRangeOrSelection
+   );
 
assert.equalLinearData( model.getDocument().getFullData(), data, msg + 
': data' );
-   assert.deepEqual( selection.toJSON(), expectedSelection, msg + ': 
selection' );
+   assert.equalHash( selection, expectedSelection, msg + ': selection' );
view.destroy();
 };
 
@@ -167,9 +168,7 @@
type: 'table',
tableRange: new ve.Range( 5, 37 ),
fromCol: 0,
-   fromRow: 0,
-   toCol: 0,
-   toRow: 0
+   fromRow: 0
},
msg: 'Table cell selected but not deleted by 
backspace'
},
@@ -181,9 +180,7 @@
type: 'table',
tableRange: new ve.Range( 5, 37 ),
fromCol: 0,
-   fromRow: 0,
-   toCol: 0,
-   toRow: 0
+   fromRow: 0
},
msg: 'Table cell selected but not deleted by 
delete'
},
@@ -459,9 +456,7 @@
type: 'table',
tableRange: new ve.Range( 0, 171 ),
fromCol: 1,
-   fromRow: 0,
-   toCol: 1,
-   toRow: 0
+   fromRow: 0
},
keys: [ 'ENTER' ],
expectedData: function () {},
@@ -474,9 +469,7 @@
type: 'table',
tableRange: new ve.Range( 0, 171 ),
fromCol: 1,
-   fromRow: 0,
-   toCol: 1,
-   toRow: 0
+   fromRow: 0
},
keys: [ 'ENTER', 'ESCAPE' ],
expectedData: function () {},
@@ -484,9 +477,7 @@
type: 'table',
tableRange: new ve.Range( 0, 171 ),
fromCol: 1,
-   fromRow: 0,
-   toCol: 1,
-   toRow: 0
+   fromRow: 0
},
msg: 'Escape to leave a table cell'
},
@@ -496,9 +487,7 @@
type: 'table',
tableRange: new ve.Range( 0, 171 ),
fromCol: 1,
-   fromRow: 0,
-   toCol: 1,
-   toRow: 0
+   fromRow: 0
},
keys: [ 'ENTER', 'TAB' ],
expectedData: function () {},
@@ -506,9 +495,7 @@
type: 'table',
tableRange: new ve.Range( 0, 171 ),
fromCol: 2,
-   fromRow: 0,
- 

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Cursor off tables with up/down

2016-08-18 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Cursor off tables with up/down
..

Cursor off tables with up/down

Change-Id: Id9c454b220ae485a0058ca022cbc94e03f0f29e8
---
M src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js
M tests/ce/ve.ce.Surface.test.js
2 files changed, 36 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/98/305598/1

diff --git a/src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js 
b/src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js
index 5d8d8a2..2d9086e 100644
--- a/src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js
+++ b/src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js
@@ -93,7 +93,7 @@
  * @param {boolean} wrap Wrap to the next/previous row at edges, insert new 
row at end
  */
 ve.ce.TableArrowKeyDownHandler.static.moveTableSelection = function ( surface, 
rowOffset, colOffset, checkDir, expand, wrap ) {
-   var tableNode, newSelection,
+   var tableNode, newSelection, documentModel,
selection = surface.getModel().getSelection();
if ( colOffset && checkDir ) {
tableNode = surface.documentView.getBranchNodeFromOffset( 
selection.tableRange.start + 1 );
@@ -125,6 +125,13 @@
adjust();
}
 
+   // If moving up/down didn't move we move be at the start/end of the 
table
+   // so move outside
+   if ( rowOffset !== 0 && selection.equals( newSelection ) ) {
+   documentModel = selection.getDocument();
+   newSelection = new ve.dm.LinearSelection( documentModel, 
documentModel.getRelativeRange( selection.tableRange, rowOffset ) );
+   }
+
surface.getModel().setSelection( newSelection );
 
return true;
diff --git a/tests/ce/ve.ce.Surface.test.js b/tests/ce/ve.ce.Surface.test.js
index 30156d7..56cc48a 100644
--- a/tests/ce/ve.ce.Surface.test.js
+++ b/tests/ce/ve.ce.Surface.test.js
@@ -543,6 +543,34 @@
fromRow: 7
},
msg: 'Tab at end of table inserts new row'
+   },
+   {
+   // Create a full surface and return the view, 
as the UI surface is required for the insert action
+   htmlOrDoc: mergedCellsDoc,
+   rangeOrSelection: {
+   type: 'table',
+   tableRange: new ve.Range( 0, 171 ),
+   fromCol: 2,
+   fromRow: 0
+   },
+   keys: [ 'UP' ],
+   expectedData: function () {},
+   expectedRangeOrSelection: new ve.Range( 0 ),
+   msg: 'Up in first row of table moves out of 
table'
+   },
+   {
+   // Create a full surface and return the view, 
as the UI surface is required for the insert action
+   htmlOrDoc: mergedCellsDoc,
+   rangeOrSelection: {
+   type: 'table',
+   tableRange: new ve.Range( 0, 171 ),
+   fromCol: 2,
+   fromRow: 6
+   },
+   keys: [ 'DOWN' ],
+   expectedData: function () {},
+   expectedRangeOrSelection: new ve.Range( 171 ),
+   msg: 'Down in last row of table moves out of 
table'
}
];
 
@@ -2780,20 +2808,8 @@
expectedSelectionOffsets: [ 0, 0 ]
},
{
-   msg: 'Move up at start',
-   key: 'UP',
-   selectionOffsets: [ 0, 0 ],
-   expectedSelectionOffsets: [ 0, 0 ]
-   },
-   {
msg: 'Move right at end',
key: 'RIGHT',
-   selectionOffsets: [ 5, 6 ],
-   expectedSelectionOffsets: [ 5, 6 ]
-   },
-   {
-   msg: 'Move down at end',
-   key: 'DOWN',
selectionOffsets: [ 5, 6 ],
expectedSelectionOffsets: [ 5, 6 ]
},

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Remove $wgDisableAuthManager

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove $wgDisableAuthManager
..


Remove $wgDisableAuthManager

False is the default, and the switch is removed in I2b2c9693.

Also drop some logging code that does not work with AuthManager.

Change-Id: I5ad73de8e8db5bd1df621cd5b00895aff6975f86
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
M wmf-config/wikitech.php
3 files changed, 9 insertions(+), 90 deletions(-)

Approvals:
  Anomie: Looks good to me, but someone else must approve
  Dpatrick: Looks good to me, but someone else must approve
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index dc8d8a7..e6ff24f 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1508,35 +1508,6 @@
 $wgDismissableSiteNoticeForAnons = true; // T59732
 $wgMajorSiteNoticeID = '2';
 
-// pre-Authmanager code for logging failed login attempts
-$wgHooks['LoginAuthenticateAudit'][] = function( $user, $pass, $retval ) {
-   if ( $user->isAllowed( 'delete' ) && $retval != LoginForm::SUCCESS ) {
-   global $wgRequest;
-   $headers = apache_request_headers();
-
-   switch( $retval ) {
-   case LoginForm::WRONG_PASS:
-   case LoginForm::EMPTY_PASS:
-   $bit = 'Bad login attempt';
-   break;
-   case LoginForm::RESET_PASS:
-   $bit = 'Login with temporary password';
-   break;
-   default:
-   $bit = '???';
-   }
-
-   $logger = LoggerFactory::getInstance( 'badpass' );
-   $logger->info( "$bit for sysop '" .
-   $user->getName() . "' from " . $wgRequest->getIP() .
-   # " - " . serialize( apache_request_headers() )
-   " - " . @$headers['X-Forwarded-For'] .
-   ' - ' . @$headers['User-Agent']
-   );
-   }
-   return true;
-};
-
 // log failed login attempts
 $wgHooks['AuthManagerLoginAuthenticateAudit'][] = function( $response, $user, 
$username ) {
$guessed = false;
@@ -1560,31 +1531,6 @@
}
 };
 
-// Estimate users affected if we increase the minimum
-// password length to 8 for privileged groups, i.e.
-// T104370, T104371, T104372, T104373
-$wgHooks['LoginAuthenticateAudit'][] = function( $user, $pass, $retval ) {
-   global $wmgUseCentralAuth;
-   if ( $retval == LoginForm::SUCCESS
-   && strlen( $pass ) < 8
-   ) {
-   if ( $wmgUseCentralAuth ) {
-   $central = CentralAuthUser::getInstance( $user );
-   if ( $central->exists() && array_intersect(
-   [ 'staff', 'sysadmin', 'steward', 'ombudsman', 
'checkuser' ],
-   array_merge(
-   $central->getLocalGroups(),
-   $central->getGlobalGroups()
-   )
-   ) ) {
-   $logger = LoggerFactory::getInstance( 'badpass' 
);
-   $logger->info( "Login by privileged user 
'{$user->getName()}' with too short password" );
-   }
-   }
-   }
-   return true;
-};
-
 $wgHooks['PrefsEmailAudit'][] = function( $user, $old, $new ) {
if ( $user->isAllowed( 'delete' ) ) {
global $wgRequest;
@@ -1594,25 +1540,6 @@
$logger->info( "Email changed in prefs for sysop '" .
$user->getName() .
"' from '$old' to '$new'" .
-   " - " . $wgRequest->getIP() .
-   # " - " . serialize( apache_request_headers() )
-   " - " . @$headers['X-Forwarded-For'] .
-   ' - ' . @$headers['User-Agent']
-   );
-   }
-   return true;
-};
-
-// pre-AuthManager code to log sysop password changes
-$wgHooks['PrefsPasswordAudit'][] = function( $user, $pass, $status ) {
-   if ( $user->isAllowed( 'delete' ) ) {
-   global $wgRequest;
-   $headers = apache_request_headers();
-
-   $logger = LoggerFactory::getInstance( 'badpass' );
-   $logger->info( "Password change in prefs for sysop '" .
-   $user->getName() .
-   "': $status" .
" - " . $wgRequest->getIP() .
# " - " . serialize( apache_request_headers() )
" - " . @$headers['X-Forwarded-For'] .
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index bbc1611..e9f924b 100644
--- 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Disable wgUseFilePatrol in huwiki

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Disable wgUseFilePatrol in huwiki
..


Disable wgUseFilePatrol in huwiki

Patrolling was disabled in huwiki when FlaggedRevs was introduced
(see T21241) but since then the new wgUseFilePatrol option was
added which defaults to true, so let's disable that as well.

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

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 0a842d6..bbc1611 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -6975,6 +6975,11 @@
'ukwiki' => false, // T35273
 ],
 
+'wgUseFilePatrol' => array(
+   'default' => true,
+   'huwiki' => false, // T21241
+),
+
 # wgNoFollow... @{
 'wgNoFollowLinks' => [
'default' => true,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I84738b0c92d3e31c3e3c24390cbf3026be0c4ed1
Gerrit-PatchSet: 3
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[wmf/1.28.0-wmf.15]: Let abusefilter-modify users see history of hidden filters

2016-08-18 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Let abusefilter-modify users see history of hidden filters
..

Let abusefilter-modify users see history of hidden filters

d0439337 (I9e15326c) made abusefilter-view-private required
even for users with abusefilter-modify that can see and
change private filters.

Bug: T143365
Change-Id: I401effc5f1e429b5ec12c7f48dcc00ada74eafb6
(cherry picked from commit bb277d437ef79f7cc4a1b57718697479bfa89a77)
---
M Views/AbuseFilterViewDiff.php
M Views/AbuseFilterViewHistory.php
2 files changed, 6 insertions(+), 4 deletions(-)


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

diff --git a/Views/AbuseFilterViewDiff.php b/Views/AbuseFilterViewDiff.php
index b0361c0..b43d8a0 100644
--- a/Views/AbuseFilterViewDiff.php
+++ b/Views/AbuseFilterViewDiff.php
@@ -100,7 +100,7 @@
$this->mFilter = $this->mParams[1];
 
if ( AbuseFilter::filterHidden( $this->mFilter )
-   && !$this->getUser()->isAllowed( 
'abusefilter-view-private' )
+   && !$this->getUser()->isAllowedAny( array( 
'abusefilter-modify', 'abusefilter-view-private' ) )
) {
$this->getOutput()->addWikiMsg( 
'abusefilter-history-error-hidden' );
return false;
diff --git a/Views/AbuseFilterViewHistory.php b/Views/AbuseFilterViewHistory.php
index 82e18bf..c000485 100644
--- a/Views/AbuseFilterViewHistory.php
+++ b/Views/AbuseFilterViewHistory.php
@@ -16,9 +16,9 @@
$out->setPageTitle( $this->msg( 
'abusefilter-filter-log' ) );
}
 
-   # Check perms
+   # Check perms. abusefilter-modify is a superset of 
abusefilter-view-private
if ( $filter && AbuseFilter::filterHidden( $filter )
-   && !$this->getUser()->isAllowed( 
'abusefilter-view-private' )
+   && !$this->getUser()->isAllowedAny( array( 
'abusefilter-modify', 'abusefilter-view-private' ) )
) {
$out->addWikiMsg( 'abusefilter-history-error-hidden' );
return;
@@ -234,7 +234,9 @@
$info['conds']['afh_filter'] = $this->mFilter;
}
 
-   if ( !$this->getUser()->isAllowed( 'abusefilter-view-private' ) 
) {
+   if ( !$this->getUser()->isAllowedAny(
+   array( 'abusefilter-modify', 'abusefilter-view-private' 
) )
+   ) {
// Hide data the user can't see.
$info['conds']['af_hidden'] = 0;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I401effc5f1e429b5ec12c7f48dcc00ada74eafb6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: wmf/1.28.0-wmf.15
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Platonides 

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Add detection for calling global functions in target classes.

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add detection for calling global functions in target classes.
..


Add detection for calling global functions in target classes.

- Usage of global functions like wfMessage() should be warned where target 
classes available and providing its context equivalents.
- Usage of global Variable like $wgUser should be warned, instead, calling 
$this->getUser() is better.
- Usage of global Variable like $wgRequest should be warned, instead, calling 
$this->getRequest() is better.

Change-Id: Id5ad984d14eea83ad385b34a718caaef499f5570
---
A MediaWiki/Sniffs/Usage/ExtendClassUsageSniff.php
A MediaWiki/Tests/files/Usage/extend_class_usage.php
A MediaWiki/Tests/files/Usage/extend_class_usage.php.expect
3 files changed, 281 insertions(+), 0 deletions(-)

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



diff --git a/MediaWiki/Sniffs/Usage/ExtendClassUsageSniff.php 
b/MediaWiki/Sniffs/Usage/ExtendClassUsageSniff.php
new file mode 100644
index 000..b49dee1
--- /dev/null
+++ b/MediaWiki/Sniffs/Usage/ExtendClassUsageSniff.php
@@ -0,0 +1,169 @@
+msg() rather than wfMessage() on ContextSource extend.
+ * Should use $this->getUser() rather than $wgUser() on ContextSource extend.
+ * Should use $this->getRequest() rather than $wgRequest on ContextSource 
extend.
+ */
+
+// @codingStandardsIgnoreStart
+class MediaWiki_Sniffs_Usage_ExtendClassUsageSniff implements 
PHP_CodeSniffer_Sniff {
+   // @codingStandardsIgnoreEnd
+
+   private $eligableCls = null;
+
+   private $eligableFunc = null;
+
+   public static $msgMap = [
+   T_FUNCTION => 'function',
+   T_VARIABLE => 'variable'
+   ];
+
+   public static $checkConfig = [
+   // All extended class name.
+   'extendsCls' => [
+   'ContextSource' => true
+   ],
+   // All details of usage need to be check.
+   'checkList' => [
+   // Extended class name.
+   'ContextSource' => [
+   [
+   // The check content.
+   'content' => 'wfMessage',
+   // The content shows on report message.
+   'msg_content' => 'wfMessage()',
+   // The check content code.
+   'code' => T_FUNCTION,
+   // The expected content.
+   'expect_content' => '$this->msg()',
+   // The expected content code.
+   'expect_code' => T_FUNCTION
+   ],
+   [
+   'content' => '$wgUser',
+   'msg_content' => '$wgUser',
+   'code' => T_VARIABLE,
+   'expect_content' => '$this->getUser()',
+   'expect_code' => T_FUNCTION
+   ],
+   [
+   'content' => '$wgRequest',
+   'msg_content' => '$wgRequest',
+   'code' => T_VARIABLE,
+   'expect_content' => 
'$this->getRequest()',
+   'expect_code' => T_FUNCTION
+   ]
+   ]
+   ]
+   ];
+   /**
+* @return array
+*/
+   public function register() {
+   return [
+   T_CLASS,
+   T_EXTENDS,
+   T_FUNCTION,
+   T_VARIABLE,
+   T_STRING
+   ];
+   }
+
+   /**
+* @param PHP_CodeSniffer_File $phpcsFile PHP_CodeSniffer_File object.
+* @param int $stackPtr The current token index.
+* @return void
+*/
+   public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
+   $tokens = $phpcsFile->getTokens();
+   $currToken = $tokens[$stackPtr];
+
+   if ( $currToken['code'] === T_CLASS ) {
+   $extendsPtr = $phpcsFile->findNext( T_EXTENDS, 
$stackPtr );
+   if ( $extendsPtr === false ) {
+   // No extends token found
+   return;
+   }
+   $baseClsPtr = $phpcsFile->findNext( T_STRING, 
$extendsPtr );
+   $extClsContent = $tokens[$baseClsPtr]['content'];
+ 

[MediaWiki-commits] [Gerrit] mediawiki...GeoData[master]: Use setMwGlobals() to preserve global state

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use setMwGlobals() to preserve global state
..


Use setMwGlobals() to preserve global state

Change-Id: Ia82ef7fbfe48202af743bad5692fa79016ce9c75
---
M tests/phpunit/TagTest.php
1 file changed, 6 insertions(+), 13 deletions(-)

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



diff --git a/tests/phpunit/TagTest.php b/tests/phpunit/TagTest.php
index 0a53e19..73fdfe1 100644
--- a/tests/phpunit/TagTest.php
+++ b/tests/phpunit/TagTest.php
@@ -4,24 +4,18 @@
  * @group GeoData
  */
 class TagTest extends MediaWikiTestCase {
-   private $contLang;
 
public function setUp() {
-   $GLOBALS['wgDefaultDim'] = 1000; // reset to default
-   $this->contLang = $GLOBALS['wgContLang'];
parent::setUp();
-   }
-
-   public function tearDown() {
-   $GLOBALS['wgContLang'] = $this->contLang;
-   parent::tearDown();
+   $this->setMwGlobals( 'wgDefaultDim', 1000 ); // reset to default
}
 
private function setWarnings( $level ) {
global $wgGeoDataWarningLevel;
-   foreach ( array_keys( $wgGeoDataWarningLevel ) as $key ) {
-   $wgGeoDataWarningLevel[$key] = $level;
-   }
+
+   $this->setMwGlobals( 'wgGeoDataWarningLevel',
+   array_fill_keys( array_keys( $wgGeoDataWarningLevel ), 
$level )
+   );
}
 
private function assertParse( $input, $expected ) {
@@ -48,8 +42,7 @@
 */
public function testLooseTagParsing( $input, $expected, $langCode = 
false ) {
if ( $langCode ) {
-   global $wgContLang;
-   $wgContLang = Language::factory( $langCode );
+   $this->setContentLang( $langCode );
}
$this->setWarnings( 'none' );
$this->assertParse( $input, $expected );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia82ef7fbfe48202af743bad5692fa79016ce9c75
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Let abusefilter-modify users see history of hidden filters

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Let abusefilter-modify users see history of hidden filters
..


Let abusefilter-modify users see history of hidden filters

d0439337 (I9e15326c) made abusefilter-view-private required
even for users with abusefilter-modify that can see and
change private filters.

Bug: T143365
Change-Id: I401effc5f1e429b5ec12c7f48dcc00ada74eafb6
---
M Views/AbuseFilterViewDiff.php
M Views/AbuseFilterViewHistory.php
2 files changed, 6 insertions(+), 4 deletions(-)

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



diff --git a/Views/AbuseFilterViewDiff.php b/Views/AbuseFilterViewDiff.php
index b0361c0..b43d8a0 100644
--- a/Views/AbuseFilterViewDiff.php
+++ b/Views/AbuseFilterViewDiff.php
@@ -100,7 +100,7 @@
$this->mFilter = $this->mParams[1];
 
if ( AbuseFilter::filterHidden( $this->mFilter )
-   && !$this->getUser()->isAllowed( 
'abusefilter-view-private' )
+   && !$this->getUser()->isAllowedAny( array( 
'abusefilter-modify', 'abusefilter-view-private' ) )
) {
$this->getOutput()->addWikiMsg( 
'abusefilter-history-error-hidden' );
return false;
diff --git a/Views/AbuseFilterViewHistory.php b/Views/AbuseFilterViewHistory.php
index 82e18bf..c000485 100644
--- a/Views/AbuseFilterViewHistory.php
+++ b/Views/AbuseFilterViewHistory.php
@@ -16,9 +16,9 @@
$out->setPageTitle( $this->msg( 
'abusefilter-filter-log' ) );
}
 
-   # Check perms
+   # Check perms. abusefilter-modify is a superset of 
abusefilter-view-private
if ( $filter && AbuseFilter::filterHidden( $filter )
-   && !$this->getUser()->isAllowed( 
'abusefilter-view-private' )
+   && !$this->getUser()->isAllowedAny( array( 
'abusefilter-modify', 'abusefilter-view-private' ) )
) {
$out->addWikiMsg( 'abusefilter-history-error-hidden' );
return;
@@ -234,7 +234,9 @@
$info['conds']['afh_filter'] = $this->mFilter;
}
 
-   if ( !$this->getUser()->isAllowed( 'abusefilter-view-private' ) 
) {
+   if ( !$this->getUser()->isAllowedAny(
+   array( 'abusefilter-modify', 'abusefilter-view-private' 
) )
+   ) {
// Hide data the user can't see.
$info['conds']['af_hidden'] = 0;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I401effc5f1e429b5ec12c7f48dcc00ada74eafb6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Platonides 
Gerrit-Reviewer: Glaisher 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Defer preferences update and avoid CAS errors in onUserLogge...

2016-08-18 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Defer preferences update and avoid CAS errors in 
onUserLoggedIn()
..

Defer preferences update and avoid CAS errors in onUserLoggedIn()

Bug: T143367
Change-Id: I9509f6ef565d9953f9c05b00b02b57098eef9e3a
---
M VisualEditor.hooks.php
1 file changed, 10 insertions(+), 2 deletions(-)


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

diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index ea08c82..e60cdc9 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -1009,9 +1009,17 @@
public static function onUserLoggedIn( $user ) {
$cookie = RequestContext::getMain()->getRequest()->getCookie( 
'VEE', '' );
if ( $cookie === 'visualeditor' || $cookie === 'wikitext' ) {
-   $user->setOption( 'visualeditor-editor', $cookie );
-   $user->saveSettings();
+   DeferredUpdates::addUpdate( new AtomicSectionUpdate(
+   wfGetDB( DB_MASTER ),
+   __METHOD__,
+   function () use ( $user, $cookie ) {
+   $uLatest = 
$user->getInstanceForUpdate();
+   $uLatest->setOption( 
'visualeditor-editor', $cookie );
+   $uLatest->saveSettings();
+   }
+   ) );
}
+
return true;
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9509f6ef565d9953f9c05b00b02b57098eef9e3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Toggle all checkboxes an changing visibilit of 'All layers'

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Toggle all checkboxes an changing visibilit of 'All layers'
..


Toggle all checkboxes an changing visibilit of 'All layers'

Change-Id: Ia660b26aacb24c2bcdfd04412ae58702ac241717
---
M wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
1 file changed, 28 insertions(+), 4 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  Lucas Werkmeister: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js 
b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
index cbdb7a5..89cacbb 100644
--- a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
@@ -68,20 +68,44 @@
} ).fitBounds( markerGroups[ LAYER_DEFAULT_GROUP ].getBounds() 
);
 
this._setTileLayer( map );
+   this._createControls( map, markerGroups );
 
-   //map controls
+   $element.html( container );
+   };
+
+   /**
+* Create map controls
+*
+* @private
+*/
+   SELF.prototype._createControls = function( map, markerGroups ) {
+   //zoom control
map.addControl( L.control.zoomBox( {
modal: false,
className: 'glyphicon glyphicon-zoom-in'
} ) );
map.addControl( new ScrollToTopButton() );
 
+   //layers control
var numberOfLayers = Object.keys( markerGroups ).length;
if ( numberOfLayers > 1 ) {
-   this._getLayerControl( markerGroups ).addTo( map );
-   }
+   var control = this._getLayerControl( markerGroups 
).addTo( map );
 
-   $element.html( container );
+   // update layer control
+   map.on( 'overlayadd overlayremove', function ( event ) {
+   if ( event.layer !== markerGroups[ 
LAYER_DEFAULT_GROUP ] ) {
+   return;
+   }
+   $.each( markerGroups, function( i, layer ) {
+   if ( event.type === 'overlayadd' ) {
+   map.addLayer( layer );
+   } else {
+   map.removeLayer( layer );
+   }
+   } );
+   control._update();
+   } );
+   }
};
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia660b26aacb24c2bcdfd04412ae58702ac241717
Gerrit-PatchSet: 2
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Lucas Werkmeister 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove unused import

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove unused import
..


Remove unused import

Change-Id: Ia8135ddca9789142804b945524236c3bddf80feb
---
M repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php 
b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
index 4e419c8..e855d66 100644
--- a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
+++ b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
@@ -9,7 +9,6 @@
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\ItemId;
-use Wikibase\DataModel\LegacyIdInterpreter;
 use Wikibase\EntityRevision;
 use Wikibase\Lib\Store\BadRevisionException;
 use Wikibase\Lib\Store\EntityRevisionLookup;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8135ddca9789142804b945524236c3bddf80feb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Maintenance: better sort methods, improve coverage, etc.

2016-08-18 Thread Seb35 (Code Review)
Seb35 has submitted this change and it was merged.

Change subject: Maintenance: better sort methods, improve coverage, etc.
..


Maintenance: better sort methods, improve coverage, etc.

* Sort methods in main class with more important methods on top, helpers on down
* Moved scripts/ to bin/
* Minor schema update
* Converted a raw executable Yaml.php to a function
* Reduced cyclomatic complexity of method extractSkinsAndExtensions
* Added more tests mainly for __construct

I ran PHPUnit with code coverage activated:
* 29.41% of functions/methods covered
* 20.30% of lines (30.90% in main file)

Change-Id: Ib7e586531dc19117bb7f98ee00a01b45f71fbc20
---
R bin/mwscript.php
R bin/validate-schema.php
M docs/farms-schema.json
M src/MediaWikiFarm.php
M src/Yaml.php
M src/main.php
M tests/phpunit/MediaWikiFarmMonoversionInstallationTest.php
M tests/phpunit/MediaWikiFarmMultiversionInstallationTest.php
8 files changed, 381 insertions(+), 133 deletions(-)

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



diff --git a/scripts/mwscript.php b/bin/mwscript.php
similarity index 95%
rename from scripts/mwscript.php
rename to bin/mwscript.php
index 43468e7..101311d 100644
--- a/scripts/mwscript.php
+++ b/bin/mwscript.php
@@ -154,7 +154,7 @@
 
 
 # Display parameters
-$mwfVersion = MediaWikiFarm::getInstance()->getVariable( '$VERSION' ) ? 
MediaWikiFarm::getInstance()->getVariable( '$VERSION' ) : 'current';
+$mwfVersion = $wgMediaWikiFarm->getVariable( '$VERSION' ) ? 
$wgMediaWikiFarm->getVariable( '$VERSION' ) : 'current';
 echo <getVariable( '$SUFFIX' )})
@@ -181,4 +181,4 @@
 
 
 # Update version after maintenance/update.php (the only case where another 
version is given before execution)
-MediaWikiFarm::getInstance()->updateVersionAfterMaintenance();
+$wgMediaWikiFarm->updateVersionAfterMaintenance();
diff --git a/scripts/validate-schema.php b/bin/validate-schema.php
similarity index 100%
rename from scripts/validate-schema.php
rename to bin/validate-schema.php
diff --git a/docs/farms-schema.json b/docs/farms-schema.json
index c47e8c7..85529a7 100644
--- a/docs/farms-schema.json
+++ b/docs/farms-schema.json
@@ -64,7 +64,7 @@
"type": "string",
"description": "File 
containing an array where each key is a wikiID and each value is the 
corresponding MediaWiki version similarly to 'versions', but this file contains 
actual versions, before and after the 'maintenance/update.php' script is run."
},
-   "nonexistant": {
+   "HTTP404": {
"type": "string",
"description": "PHP or 
HTML file displayed in case of a nonexistant wiki."
},
diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index ed90165..ce42145 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -164,6 +164,7 @@
}


+   
/* 
 * Entry points in normal operation
 *  */
@@ -253,6 +254,12 @@

return self::$self;
}
+   
+   
+   
+   /*
+* Functions of interest in normal operations
+* -- */

/**
 * Check the existence of the wiki, given variables values and files 
listing existing wikis.
@@ -412,7 +419,7 @@
}

/**
-* Return the file where is loaded the configuration.
+* Return the file where must be loaded the configuration from.
 * 
 * This function is important to avoid the two parts of the extension 
(checking of
 * existence and loading of configuration) are located in the same 
directory in the
@@ -732,6 +739,19 @@
}

/**
+* Computation of secondary variables.
+* 
+* These can reuse previously-computed variables: URL variables 
(lowercase), '$WIKIID', '$SUFFIX', '$VERSION', '$CODE'.
+* 
+* @throws InvalidArgumentException
+* @return void
+*/
+   function setOtherVariables() {
+   
+   $this->setVariable( 'data' );
+   }
+   
+   /**
 * Update the version in the deployment file.
 * 
 * @param string $version The new version, should be the version found 
in the 'expected version' file.
@@ -753,19 +773,6 @@
# Update the deployment file
$deployments[$this->variables['$WIKIID']] = $version;
$this->cacheFile( $deployments, 

[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Maintenance: better sort methods, improve coverage, etc.

2016-08-18 Thread Seb35 (Code Review)
Seb35 has uploaded a new change for review.

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

Change subject: Maintenance: better sort methods, improve coverage, etc.
..

Maintenance: better sort methods, improve coverage, etc.

* Sort methods in main class with more important methods on top, helpers on down
* Moved scripts/ to bin/
* Minor schema update
* Converted a raw executable Yaml.php to a function
* Reduced cyclomatic complexity of method extractSkinsAndExtensions
* Added more tests mainly for __construct

I ran PHPUnit with code coverage activated:
* 29.41% of functions/methods covered
* 20.30% of lines (30.90% in main file)

Change-Id: Ib7e586531dc19117bb7f98ee00a01b45f71fbc20
---
R bin/mwscript.php
R bin/validate-schema.php
M docs/farms-schema.json
M src/MediaWikiFarm.php
M src/Yaml.php
M src/main.php
M tests/phpunit/MediaWikiFarmMonoversionInstallationTest.php
M tests/phpunit/MediaWikiFarmMultiversionInstallationTest.php
8 files changed, 381 insertions(+), 133 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm 
refs/changes/94/305594/1

diff --git a/scripts/mwscript.php b/bin/mwscript.php
similarity index 95%
rename from scripts/mwscript.php
rename to bin/mwscript.php
index 43468e7..101311d 100644
--- a/scripts/mwscript.php
+++ b/bin/mwscript.php
@@ -154,7 +154,7 @@
 
 
 # Display parameters
-$mwfVersion = MediaWikiFarm::getInstance()->getVariable( '$VERSION' ) ? 
MediaWikiFarm::getInstance()->getVariable( '$VERSION' ) : 'current';
+$mwfVersion = $wgMediaWikiFarm->getVariable( '$VERSION' ) ? 
$wgMediaWikiFarm->getVariable( '$VERSION' ) : 'current';
 echo <getVariable( '$SUFFIX' )})
@@ -181,4 +181,4 @@
 
 
 # Update version after maintenance/update.php (the only case where another 
version is given before execution)
-MediaWikiFarm::getInstance()->updateVersionAfterMaintenance();
+$wgMediaWikiFarm->updateVersionAfterMaintenance();
diff --git a/scripts/validate-schema.php b/bin/validate-schema.php
similarity index 100%
rename from scripts/validate-schema.php
rename to bin/validate-schema.php
diff --git a/docs/farms-schema.json b/docs/farms-schema.json
index c47e8c7..85529a7 100644
--- a/docs/farms-schema.json
+++ b/docs/farms-schema.json
@@ -64,7 +64,7 @@
"type": "string",
"description": "File 
containing an array where each key is a wikiID and each value is the 
corresponding MediaWiki version similarly to 'versions', but this file contains 
actual versions, before and after the 'maintenance/update.php' script is run."
},
-   "nonexistant": {
+   "HTTP404": {
"type": "string",
"description": "PHP or 
HTML file displayed in case of a nonexistant wiki."
},
diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index ed90165..ce42145 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -164,6 +164,7 @@
}


+   
/* 
 * Entry points in normal operation
 *  */
@@ -253,6 +254,12 @@

return self::$self;
}
+   
+   
+   
+   /*
+* Functions of interest in normal operations
+* -- */

/**
 * Check the existence of the wiki, given variables values and files 
listing existing wikis.
@@ -412,7 +419,7 @@
}

/**
-* Return the file where is loaded the configuration.
+* Return the file where must be loaded the configuration from.
 * 
 * This function is important to avoid the two parts of the extension 
(checking of
 * existence and loading of configuration) are located in the same 
directory in the
@@ -732,6 +739,19 @@
}

/**
+* Computation of secondary variables.
+* 
+* These can reuse previously-computed variables: URL variables 
(lowercase), '$WIKIID', '$SUFFIX', '$VERSION', '$CODE'.
+* 
+* @throws InvalidArgumentException
+* @return void
+*/
+   function setOtherVariables() {
+   
+   $this->setVariable( 'data' );
+   }
+   
+   /**
 * Update the version in the deployment file.
 * 
 * @param string $version The new version, should be the version found 
in the 'expected version' file.
@@ -753,19 +773,6 @@
# Update the deployment file
$deployments[$this->variables['$WIKIID']] = 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Add page action tab layout

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add page action tab layout
..


Add page action tab layout

Does nothing for now.  Will add listener/actions in the next patch.

Bug: T135295
Change-Id: I9636990607fd1d69a021cb1f3faf71787731c6e1
---
M app/src/main/java/org/wikipedia/page/PageFragment.java
A app/src/main/res/drawable/ic_bookmark_border_white_24dp.xml
A app/src/main/res/drawable/ic_find_in_page.xml
A app/src/main/res/drawable/ic_share_white_24dp.xml
A app/src/main/res/drawable/ic_translate_white_24dp.xml
M app/src/main/res/layout/fragment_page.xml
6 files changed, 86 insertions(+), 2 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/page/PageFragment.java 
b/app/src/main/java/org/wikipedia/page/PageFragment.java
index cb2510a..7cb4512 100755
--- a/app/src/main/java/org/wikipedia/page/PageFragment.java
+++ b/app/src/main/java/org/wikipedia/page/PageFragment.java
@@ -9,6 +9,7 @@
 import android.support.annotation.Nullable;
 import android.support.design.widget.BottomSheetDialog;
 import android.support.design.widget.BottomSheetDialogFragment;
+import android.support.design.widget.TabLayout;
 import android.support.v4.app.Fragment;
 import android.support.v4.view.MenuItemCompat;
 import android.support.v4.widget.SwipeRefreshLayout;
@@ -153,6 +154,7 @@
 private SwipeRefreshLayoutWithScroll refreshView;
 private WikiErrorView errorView;
 private WikiDrawerLayout tocDrawer;
+private TabLayout tabLayout;
 
 private CommunicationBridge bridge;
 private LinkHandler linkHandler;
@@ -168,6 +170,25 @@
 @Override
 public void onRefresh() {
 refreshPage();
+}
+};
+
+@NonNull
+private final TabLayout.OnTabSelectedListener pageActionTabListener
+= new TabLayout.OnTabSelectedListener() {
+@Override
+public void onTabSelected(TabLayout.Tab tab) {
+
+}
+
+@Override
+public void onTabUnselected(TabLayout.Tab tab) {
+
+}
+
+@Override
+public void onTabReselected(TabLayout.Tab tab) {
+
 }
 };
 
@@ -229,6 +250,9 @@
 refreshView.setScrollableChild(webView);
 refreshView.setOnRefreshListener(pageRefreshListener);
 
+tabLayout = (TabLayout) 
rootView.findViewById(R.id.page_actions_tab_layout);
+tabLayout.addOnTabSelectedListener(pageActionTabListener);
+
 errorView = (WikiErrorView)rootView.findViewById(R.id.page_error);
 
 return rootView;
diff --git a/app/src/main/res/drawable/ic_bookmark_border_white_24dp.xml 
b/app/src/main/res/drawable/ic_bookmark_border_white_24dp.xml
new file mode 100644
index 000..65c427d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_bookmark_border_white_24dp.xml
@@ -0,0 +1,9 @@
+http://schemas.android.com/apk/res/android;
+android:width="24dp"
+android:height="24dp"
+android:viewportWidth="24.0"
+android:viewportHeight="24.0">
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_find_in_page.xml 
b/app/src/main/res/drawable/ic_find_in_page.xml
new file mode 100644
index 000..77acb13
--- /dev/null
+++ b/app/src/main/res/drawable/ic_find_in_page.xml
@@ -0,0 +1,5 @@
+http://schemas.android.com/apk/res/android;>
+
+
diff --git a/app/src/main/res/drawable/ic_share_white_24dp.xml 
b/app/src/main/res/drawable/ic_share_white_24dp.xml
new file mode 100644
index 000..49a9c9b
--- /dev/null
+++ b/app/src/main/res/drawable/ic_share_white_24dp.xml
@@ -0,0 +1,5 @@
+http://schemas.android.com/apk/res/android;>
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_translate_white_24dp.xml 
b/app/src/main/res/drawable/ic_translate_white_24dp.xml
new file mode 100644
index 000..11d53b6
--- /dev/null
+++ b/app/src/main/res/drawable/ic_translate_white_24dp.xml
@@ -0,0 +1,5 @@
+http://schemas.android.com/apk/res/android;>
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_page.xml 
b/app/src/main/res/layout/fragment_page.xml
index 6685db8..bc5a420 100644
--- a/app/src/main/res/layout/fragment_page.xml
+++ b/app/src/main/res/layout/fragment_page.xml
@@ -33,6 +33,7 @@
 android:layout_width="match_parent"
 android:layout_height="wrap_content" />
 
+
 
 
+
 
 
 
+
 
 
 
+
+
+
+
+
+
+
+
+
 
 
 
 
+
 
+android:background="?attr/toc_background_color">
+
 https://gerrit.wikimedia.org/r/305493
To unsubscribe, visit 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Issue 301 redirects for Special:Search/searchterm

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Issue 301 redirects for Special:Search/searchterm
..


Issue 301 redirects for Special:Search/searchterm

Including the search term, which is PII, in the page title allows for
leaking this information through page view dumps. Instead of happily
handling these issue a 301 redirect to tell clients they should not
be issueing these requests, and should instead use the search query
parameter. Dumps at wikimedia remove 30[123] response codes from the
dump output so this will also stop leaking the PII.

Change-Id: Icce7cc4585e90742a8dd3513e7c9f7276e479cd7
---
M includes/specials/SpecialSearch.php
A tests/phpunit/specials/SpecialSearchTest.php
2 files changed, 42 insertions(+), 9 deletions(-)

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



diff --git a/includes/specials/SpecialSearch.php 
b/includes/specials/SpecialSearch.php
index 9690d45..26b86f9 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -100,6 +100,25 @@
 * @param string $par
 */
public function execute( $par ) {
+   $request = $this->getRequest();
+
+   // Fetch the search term
+   $search = str_replace( "\n", " ", $request->getText( 'search' ) 
);
+
+   // Historically search terms have been accepted not only in the 
search query
+   // parameter, but also as part of the primary url. This can 
have PII implications
+   // in releasing page view data. As such issue a 301 redirect to 
the correct
+   // URL.
+   if ( strlen( $par ) && !strlen( $search ) ) {
+   $query = $request->getValues();
+   unset( $query['title'] );
+   // Strip underscores from title parameter; most of the 
time we'll want
+   // text form here. But don't strip underscores from 
actual text params!
+   $query['search'] = str_replace( '_', ' ', $par );
+   $this->getOutput()->redirect( 
$this->getPageTitle()->getFullURL( $query ), 301 );
+   return;
+   }
+
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
@@ -109,15 +128,6 @@
'mediawiki.ui.input', 
'mediawiki.widgets.SearchInputWidget.styles',
] );
$this->addHelpLink( 'Help:Searching' );
-
-   // Strip underscores from title parameter; most of the time 
we'll want
-   // text form here. But don't strip underscores from actual text 
params!
-   $titleParam = str_replace( '_', ' ', $par );
-
-   $request = $this->getRequest();
-
-   // Fetch the search term
-   $search = str_replace( "\n", " ", $request->getText( 'search', 
$titleParam ) );
 
$this->load();
if ( !is_null( $request->getVal( 'nsRemember' ) ) ) {
diff --git a/tests/phpunit/specials/SpecialSearchTest.php 
b/tests/phpunit/specials/SpecialSearchTest.php
new file mode 100644
index 000..20e88f5
--- /dev/null
+++ b/tests/phpunit/specials/SpecialSearchTest.php
@@ -0,0 +1,23 @@
+getOutput()->getRedirect();
+   // some older versions of hhvm have a bug that doesn't parse 
relative
+   // urls with a port, so help it out a little bit.
+   // https://github.com/facebook/hhvm/issues/7136
+   $url = wfExpandUrl( $url, PROTO_CURRENT );
+
+   $parts = parse_url( $url );
+   $this->assertEquals( '/w/index.php', $parts['path'] );
+   parse_str( $parts['query'], $query );
+   $this->assertEquals( 'Special:Search', $query['title'] );
+   $this->assertEquals( 'foo bar', $query['search'] );
+   }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icce7cc4585e90742a8dd3513e7c9f7276e479cd7
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: [WIP] Skeletal tests for both stages of the PayPal listener

2016-08-18 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: [WIP] Skeletal tests for both stages of the PayPal listener
..

[WIP] Skeletal tests for both stages of the PayPal listener

Bug: T141654
Change-Id: If96f0f2beeffd1c7cc2b2f911b4d6657aec9c6ea
---
A PaymentProviders/PayPal/Tests/Data/config_test.yaml
A PaymentProviders/PayPal/Tests/PayPalTestConfiguration.php
A PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
A PaymentProviders/PayPal/Tests/phpunit/ProcessIncomingMessageJobTest.php
4 files changed, 147 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/93/305593/1

diff --git a/PaymentProviders/PayPal/Tests/Data/config_test.yaml 
b/PaymentProviders/PayPal/Tests/Data/config_test.yaml
new file mode 100644
index 000..e19e943
--- /dev/null
+++ b/PaymentProviders/PayPal/Tests/Data/config_test.yaml
@@ -0,0 +1,26 @@
+paypal:
+data-store:
+pending:
+class: SmashPig\Tests\MockDataStore
+inst-args: []
+
+antifraud-stomp:
+class: SmashPig\Tests\MockDataStore
+inst-args: []
+
+recurring:
+class: SmashPig\Tests\MockDataStore
+inst-args: []
+
+refund:
+class: SmashPig\Tests\MockDataStore
+inst-args: []
+
+verified:
+class: SmashPig\Tests\MockDataStore
+inst-args: []
+
+pending-db:
+class: PDO
+inst-args:
+- 'sqlite::memory:'
diff --git a/PaymentProviders/PayPal/Tests/PayPalTestConfiguration.php 
b/PaymentProviders/PayPal/Tests/PayPalTestConfiguration.php
new file mode 100644
index 000..f9325e2
--- /dev/null
+++ b/PaymentProviders/PayPal/Tests/PayPalTestConfiguration.php
@@ -0,0 +1,14 @@
+config = PayPalTestConfiguration::get( true );
+   Context::initWithLogger( $this->config );
+   }
+
+   public function testCaptureIncoming() {
+   $jobQueue = $this->config->object( 'data-store/job-requests', 
true );
+
+   $payload = json_decode(
+   file_get_contents( __DIR__ . '/../Data/web_accept.json' 
)
+   true
+   );
+
+   $listener = new Listener();
+   $listener->execute( $request, $response,
+   array( 'smashpig', 'listener', 'paypal' )
+   );
+
+   // FIXME: This is all make-believe.
+   $jobQueueMessage = $jobQueue->queueGetObject( null, '' );
+   $this->assertNotNull( $jobQueueMessage,
+   'Job was inserted');
+   $actualPayload = $jobQueueMessage->getPayload();
+   $this->assertEquals( $payload, $actualPayload,
+   'Queued job contains accurate payload' );
+   }
+}
diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/ProcessIncomingMessageJobTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/ProcessIncomingMessageJobTest.php
new file mode 100644
index 000..054a7f0
--- /dev/null
+++ b/PaymentProviders/PayPal/Tests/phpunit/ProcessIncomingMessageJobTest.php
@@ -0,0 +1,58 @@
+config = PayPalTestConfiguration::get( true );
+   Context::initWithLogger( $this->config );
+   }
+
+   public function createJob( $payload ) {
+   $jobMessage = new RawIncomingMessage();
+   $jobMessage->setPayload( $payload );
+   return $jobMessage;
+   }
+
+   public function testSuccessfulValidation() {
+   $completedQueue = $this->config->object( 
'data-store/completed', true );
+
+   $payload = json_decode(
+   file_get_contents( __DIR__ . '/../Data/web_accept.json' 
),
+   true
+   );
+   $jobMessage = $this->createJob( $payload );
+   $job = ProcessIncomingMessageJob::factory( $jobMessage );
+   $this->assertTrue( $job->execute() );
+
+   $completedMessage = $completed->queueGetObject( null, '' );
+   $this->assertNotNull( $completedMessage,
+   'Successful charge was sent to the completed queue.' );
+
+   // TODO: populate expected fields
+   $expectedDonation = array( 'FOO.' );
+   $this->assertEquals( $expectedDonation, $completedMessage,
+   'Completed donation matches expected content' );
+
+   // TODO: Check that validation was called.
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If96f0f2beeffd1c7cc2b2f911b4d6657aec9c6ea
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Awight 

[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Synchronize JsonSchema with mediawiki/core

2016-08-18 Thread Seb35 (Code Review)
Seb35 has submitted this change and it was merged.

Change subject: Synchronize JsonSchema with mediawiki/core
..


Synchronize JsonSchema with mediawiki/core

See: Ie37e2ebc48684783abf8d99d2f775ee6a5988da7

Bug: T141281
Change-Id: Ib9dab5b8606b579c9ecf591965c607490759fc6f
---
M composer.json
M scripts/validate-schema.php
2 files changed, 3 insertions(+), 11 deletions(-)

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



diff --git a/composer.json b/composer.json
index 7326a3a..8feeb8e 100644
--- a/composer.json
+++ b/composer.json
@@ -15,7 +15,7 @@
"symfony/yaml": "^2.0 || ^3.0"
},
"require-dev": {
-   "justinrainbow/json-schema": "*",
+   "justinrainbow/json-schema": "~3.0",
"phpdocumentor/phpdocumentor": "*",
"jakub-onderka/php-parallel-lint": "*",
"phpmd/phpmd": "*",
diff --git a/scripts/validate-schema.php b/scripts/validate-schema.php
index bf41119..8832e14 100644
--- a/scripts/validate-schema.php
+++ b/scripts/validate-schema.php
@@ -36,18 +36,10 @@
$data = json_decode( $dataJSON );
}

-   // Initialise objects
-   $resolver = new JsonSchema\Uri\UriResolver();
-   $retriever = new JsonSchema\Uri\UriRetriever();
-   
-   // If you use $ref or if you are unsure, resolve those references here
-   // This modifies the $schema object
-   $refResolver = new JsonSchema\RefResolver( $retriever, $resolver );
-   $schema = $refResolver->resolve( 'file://' . realpath( 
'docs/farms-schema.json' ) );
-   
// Validate
$validator = new JsonSchema\Validator();
-   $validator->check( $data, $schema );
+   $validator->check( $data, (object) array( '$ref' =>
+   'file://' . realpath( 'docs/farms-schema.json' ) ) );

if( $validator->isValid() ) {
echo "The supplied JSON validates against the schema.\n";

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9dab5b8606b579c9ecf591965c607490759fc6f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MediaWikiFarm
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Seb35 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add `.mw-ui-icon-small` to icon classes

2016-08-18 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: Add `.mw-ui-icon-small` to icon classes
..

Add `.mw-ui-icon-small` to icon classes

Adding small icon class `.mw-ui-icon-small`.

Change-Id: Ia140779d488dddf9014087e8d48852c8c53977e3
---
M resources/src/mediawiki.ui/components/icons.less
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/305592/1

diff --git a/resources/src/mediawiki.ui/components/icons.less 
b/resources/src/mediawiki.ui/components/icons.less
index b4edc50..61408ec 100644
--- a/resources/src/mediawiki.ui/components/icons.less
+++ b/resources/src/mediawiki.ui/components/icons.less
@@ -81,3 +81,7 @@
}
}
 }
+
+.mw-ui-icon-small:before {
+   background-size: 66.67% auto; // 66.67% of 24px equals 16px
+}

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: phabricator: don't run phd on inactive server yet

2016-08-18 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: phabricator: don't run phd on inactive server yet
..


phabricator: don't run phd on inactive server yet

Phabricator is not aware yet that it is running in a cluster
environment, and as 20after4 explained to me, if phd is running
on the inactive server it will currently start mirroring
repos which results in deleting refs from github which then
get recreated by phd on iridium.

So to avoid that puppet has to stay disabled on phab2001 and so that
we can apply other changes, we are disabling the phd service on the
inactive server using the same Hiera setting that we used to
disable Icinga SMSing us and cronspam being created.

When cluster config is activated this will be changed again and phd
will run on both machines and the second one can help do jobs from the
job queue and take load off the main one.

Bug:T137928
Change-Id: I09c6557753547db23843dcaa697899feb78fb26a
---
M modules/phabricator/manifests/init.pp
1 file changed, 9 insertions(+), 1 deletion(-)

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



diff --git a/modules/phabricator/manifests/init.pp 
b/modules/phabricator/manifests/init.pp
index ee472fd..19987a4 100644
--- a/modules/phabricator/manifests/init.pp
+++ b/modules/phabricator/manifests/init.pp
@@ -245,6 +245,14 @@
 }
 }
 
+# phd service is only running on active server set in Hiera
+# will be changed after cluster setup is finished
+$phabricator_active_server = hiera('phabricator_active_server')
+if $::hostname == $phabricator_active_server {
+$phd_service_ensure = 'running'
+} else {
+$phd_service_ensure = 'stopped'
+}
 # This needs to become Upstart systemd managed
 # https://secure.phabricator.com/book/phabricator/article/managing_daemons/
 # Meanwhile upstream has a bug to make an LSB friendly wrapper
@@ -252,7 +260,7 @@
 # see examples of real-word unit files in comments of:
 # https://secure.phabricator.com/T4181
 service { 'phd':
-ensure => running,
+ensure => $phd_service_ensure,
 start  => '/usr/sbin/service phd start --force',
 status => '/usr/bin/pgrep -f phd-daemon',
 hasrestart => true,

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

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

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Eliminate floating TOC button

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Eliminate floating TOC button
..


Eliminate floating TOC button

This will be replaced by the TOC page action tab.

TODO: Update the tooltip once the page action tab menu work is complete.

Bug: T135295
Change-Id: I7b05b1f19087a07cde3e0e8ffb6c61d94fa54967
---
M app/src/main/java/org/wikipedia/page/PageFragment.java
M app/src/main/java/org/wikipedia/page/ToCHandler.java
M app/src/main/res/layout/fragment_page.xml
3 files changed, 6 insertions(+), 99 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/page/PageFragment.java 
b/app/src/main/java/org/wikipedia/page/PageFragment.java
index 804c24e..cb2510a 100755
--- a/app/src/main/java/org/wikipedia/page/PageFragment.java
+++ b/app/src/main/java/org/wikipedia/page/PageFragment.java
@@ -9,10 +9,8 @@
 import android.support.annotation.Nullable;
 import android.support.design.widget.BottomSheetDialog;
 import android.support.design.widget.BottomSheetDialogFragment;
-import android.support.design.widget.FloatingActionButton;
 import android.support.v4.app.Fragment;
 import android.support.v4.view.MenuItemCompat;
-import android.support.v4.view.animation.FastOutSlowInInterpolator;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.app.AppCompatActivity;
@@ -156,8 +154,6 @@
 private WikiErrorView errorView;
 private WikiDrawerLayout tocDrawer;
 
-private FloatingActionButton tocButton;
-
 private CommunicationBridge bridge;
 private LinkHandler linkHandler;
 private EditHandler editHandler;
@@ -172,23 +168,6 @@
 @Override
 public void onRefresh() {
 refreshPage();
-}
-};
-
-@NonNull
-private final View.OnClickListener tocButtonOnClickListener = new 
View.OnClickListener() {
-@Override
-public void onClick(View v) {
-hideSoftKeyboard();
-showToCButton();
-toggleToC(TOC_ACTION_TOGGLE);
-}
-};
-
-@NonNull private final Runnable hideToCButtonRunnable = new Runnable() {
-@Override
-public void run() {
-tocButton.hide();
 }
 };
 
@@ -240,9 +219,6 @@
 
 tocDrawer = (WikiDrawerLayout) 
rootView.findViewById(R.id.page_toc_drawer);
 
tocDrawer.setDragEdgeWidth(getResources().getDimensionPixelSize(R.dimen.drawer_drag_margin));
-
-tocButton = (FloatingActionButton) 
rootView.findViewById(R.id.floating_toc_button);
-tocButton.setOnClickListener(tocButtonOnClickListener);
 
 refreshView = (SwipeRefreshLayoutWithScroll) rootView
 .findViewById(R.id.page_refresh_container);
@@ -370,32 +346,14 @@
 webView.addOnUpOrCancelMotionEventListener(new 
ObservableWebView.OnUpOrCancelMotionEventListener() {
 @Override
 public void onUpOrCancelMotionEvent() {
-// queue the button to be hidden when the user stops scrolling.
-hideToCButton(true);
 // update our session, since it's possible for the user to 
remain on the page for
 // a long time, and we wouldn't want the session to time out.
 app.getSessionFunnel().touchSession();
 }
 });
-webView.setOnFastScrollListener(new 
ObservableWebView.OnFastScrollListener() {
-@Override
-public void onFastScroll() {
-// show the ToC button...
-showToCButton();
-// and immediately queue it to be hidden after a short delay, 
but only if we're
-// not at the top of the page.
-if (webView.getScrollY() > 0) {
-hideToCButton(true);
-}
-}
-});
 webView.addOnScrollChangeListener(new 
ObservableWebView.OnScrollChangeListener() {
 @Override
 public void onScrollChanged(int oldScrollY, int scrollY, boolean 
isHumanScroll) {
-if (scrollY <= 0) {
-// always show the ToC button when we're at the top of the 
page.
-showToCButton();
-}
 if (pageScrollFunnel != null) {
 pageScrollFunnel.onPageScrolled(oldScrollY, scrollY, 
isHumanScroll);
 }
@@ -588,7 +546,6 @@
  boolean pushBackStack, int stagedScrollY, boolean 
pageRefreshed) {
 // disable sliding of the ToC while sections are loading
 tocHandler.setEnabled(false);
-hideToCButton(false);
 
 errorState = false;
 errorView.setVisibility(View.GONE);
@@ -773,7 +730,6 @@
 findInPageActionMode = mode;
 MenuItem menuItem = 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Adjust brower test settings and add tie_breaker support.

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Adjust brower test settings and add tie_breaker support.
..


Adjust brower test settings and add tie_breaker support.

Current settings seem to be too fragile and can cause cindy to
fail unexpectedly.
This patch tries to reduce the chances for this to happen by
lowering the norms impact and adjusting field boosts.

Added the possibility to customize dismax queries by
setting a tie_breaker. Avg field length is extremely
low for opening_text that we would need to either:
- completely disable norms on all fields
- set an insanely high boost so it can win in a dismax
- move it outside the dismax

Tie breaker seems to be a more reasonable approach and
could be usesul for production settings.

Change-Id: I2d12b3103afb2c08d470563c766d09105f6b0905
---
M includes/Query/FullTextSimpleMatchQueryBuilder.php
M profiles/FullTextQueryBuilderProfiles.config.php
M profiles/SimilarityProfiles.php
M tests/browser/features/relevancy_api.feature
4 files changed, 43 insertions(+), 11 deletions(-)

Approvals:
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Query/FullTextSimpleMatchQueryBuilder.php 
b/includes/Query/FullTextSimpleMatchQueryBuilder.php
index 524b680..bee3e9c 100644
--- a/includes/Query/FullTextSimpleMatchQueryBuilder.php
+++ b/includes/Query/FullTextSimpleMatchQueryBuilder.php
@@ -45,6 +45,11 @@
 */
private $defaultMinShouldMatch;
 
+   /**
+* @var array[] dismax query settings
+*/
+   private $dismaxSettings;
+
public function __construct( SearchConfig $config, Escaper $escaper, 
array $feature, array $settings ) {
parent::__construct( $config, $escaper, $feature );
$this->fields = $settings['fields'];
@@ -52,6 +57,7 @@
$this->defaultStemWeight = $settings['default_stem_weight'];
$this->defaultQueryType = $settings['default_query_type'];
$this->defaultMinShouldMatch = 
$settings['default_min_should_match'];
+   $this->dismaxSettings = isset( $settings['dismax_settings'] ) ? 
$settings['dismax_settings'] : array();
}
 
/**
@@ -197,8 +203,17 @@
$query->addShould( $mmatch );
}
}
-   foreach ( $dismaxQueries as $queries ) {
+   foreach ( $dismaxQueries as $name => $queries ) {
$dismax = new \Elastica\Query\DisMax();
+   if ( isset ( $this->dismaxSettings[$name] ) ) {
+   $settings = $this->dismaxSettings[$name];
+   if ( isset ( $settings['tie_breaker'] ) ) {
+   $dismax->setTieBreaker( 
$settings['tie_breaker'] );
+   }
+   if ( isset ( $settings['boost'] ) ) {
+   $dismax->setBoost( $settings['boost'] );
+   }
+   }
foreach( $queries as $q ) {
$dismax->addQuery( $q );
}
diff --git a/profiles/FullTextQueryBuilderProfiles.config.php 
b/profiles/FullTextQueryBuilderProfiles.config.php
index 34f1b0c..fc7d674 100644
--- a/profiles/FullTextQueryBuilderProfiles.config.php
+++ b/profiles/FullTextQueryBuilderProfiles.config.php
@@ -59,10 +59,9 @@
'boost' => 2.1,
'in_dismax' => 'redirects_or_shingles',
),
-   // Very high category weight still unclear why 
such
-   // high boost is needed for 
tests/browser/features/relevancy_api.feature
-   'category' => 3.5,
-   'heading' => 2.3,
+   // category should win over heading/opening
+   'category' => 1.8,
+   'heading' => 1.3,
// Pack text and opening_text in a dismax query
// this is to avoid scoring twice the same words
'text' => array(
@@ -79,7 +78,19 @@
'phrase_rescore_fields' => array(
// Low boost to counter high phrase rescore 
boost
'text' => 0.07,
-   'text.plain' => 0.07,
+   // higher on text.plain for 
tests/browser/features/relevancy_api.feature:106
+   'text.plain' => 0.1,
+   ),
+   'dismax_settings' => 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: phabricator: don't run phd on inactive server yet

2016-08-18 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: phabricator: don't run phd on inactive server yet
..

phabricator: don't run phd on inactive server yet

Phabricator is not aware yet that it is running in a cluster
environment, and as 20after4 explained to me, if phd is running
on the inactive server it will currently start mirroring
repos which results in deleting refs from github which then
get recreated by phd on iridium.

So to avoid that puppet has to stay disabled on phab2001 and so that
we can apply other changes, we are disabling the phd service on the
inactive server using the same Hiera setting that we used to
disable Icinga SMSing us and cronspam being created.

When cluster config is activated this will be changed again and phd
will run on both machines and the second one can help do jobs from the
job queue and take load off the main one.

Bug:T137928
Change-Id: I09c6557753547db23843dcaa697899feb78fb26a
---
M modules/phabricator/manifests/init.pp
1 file changed, 9 insertions(+), 1 deletion(-)


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

diff --git a/modules/phabricator/manifests/init.pp 
b/modules/phabricator/manifests/init.pp
index ee472fd..cf1855e 100644
--- a/modules/phabricator/manifests/init.pp
+++ b/modules/phabricator/manifests/init.pp
@@ -245,6 +245,14 @@
 }
 }
 
+# phd service is only running on active server set in Hiera
+# will be changed after cluster setup is finished
+$phabricator_active_server = hiera('phabricator_active_server')
+if $::hostname == $phabricator_active_server {
+$phd_service_ensure = 'running',
+} else {
+$phd_service_ensure = 'stopped',
+}
 # This needs to become Upstart systemd managed
 # https://secure.phabricator.com/book/phabricator/article/managing_daemons/
 # Meanwhile upstream has a bug to make an LSB friendly wrapper
@@ -252,7 +260,7 @@
 # see examples of real-word unit files in comments of:
 # https://secure.phabricator.com/T4181
 service { 'phd':
-ensure => running,
+ensure => $phd_service_ensure,
 start  => '/usr/sbin/service phd start --force',
 status => '/usr/bin/pgrep -f phd-daemon',
 hasrestart => true,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Send new account and password reset emails post-commit

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Send new account and password reset emails post-commit
..


Send new account and password reset emails post-commit

Change-Id: I8f1bd3e882e20fefa5ce0167202d511aa066cfe2
---
M includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
1 file changed, 9 insertions(+), 2 deletions(-)

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



diff --git a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php 
b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
index 46cbab5..ed94c1a 100644
--- a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
+++ b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
@@ -303,7 +303,11 @@
);
 
if ( $sendMail ) {
-   $this->sendPasswordResetEmail( $req );
+   // Send email after DB commit
+   $dbw->onTransactionIdle( function () use ( $req ) {
+   /** @var TemporaryPasswordAuthenticationRequest 
$req */
+   $this->sendPasswordResetEmail( $req );
+   } );
}
}
 
@@ -370,7 +374,10 @@
$this->providerChangeAuthenticationData( $req );
 
if ( $mailpassword ) {
-   $this->sendNewAccountEmail( $user, $creator, 
$req->password );
+   // Send email after DB commit
+   wfGetDB( DB_MASTER )->onTransactionIdle( function () 
use ( $user, $creator, $req ) {
+   $this->sendNewAccountEmail( $user, $creator, 
$req->password );
+   } );
}
 
return $mailpassword ? 'byemail' : null;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f1bd3e882e20fefa5ce0167202d511aa066cfe2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: CSyntaxHighlight: Using new extension.json

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: CSyntaxHighlight: Using new extension.json
..


CSyntaxHighlight: Using new extension.json

Change-Id: Ie45ed13a170e8a3784432095a53df8fbc4825519
---
M CSyntaxHighlight/CSyntaxHighlight.class.php
M CSyntaxHighlight/CSyntaxHighlight.setup.php
A CSyntaxHighlight/extension.json
3 files changed, 26 insertions(+), 29 deletions(-)

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



diff --git a/CSyntaxHighlight/CSyntaxHighlight.class.php 
b/CSyntaxHighlight/CSyntaxHighlight.class.php
index cc2221e..c9d2195 100644
--- a/CSyntaxHighlight/CSyntaxHighlight.class.php
+++ b/CSyntaxHighlight/CSyntaxHighlight.class.php
@@ -77,30 +77,6 @@
);
 
/**
-* Contructor of the CSyntaxHighlight class
-*/
-   public function __construct() {
-   wfProfileIn( 'BS::'.__METHOD__ );
-   // Base settings
-   $this->mExtensionFile = __FILE__;
-   $this->mExtensionType = EXTTYPE::OTHER;
-   $this->mInfo = array(
-   EXTINFO::NAME=> 'CSyntaxHighlight',
-   EXTINFO::DESCRIPTION => 'bs-csyntaxhighlight-desc',
-   EXTINFO::AUTHOR  => 'Robert Vogel',
-   EXTINFO::VERSION => 'default',
-   EXTINFO::STATUS  => 'default',
-   EXTINFO::PACKAGE => 'default',
-   EXTINFO::URL => 
'https://help.bluespice.com/index.php/CSyntaxHighlight',
-   EXTINFO::DEPS=> array(
-   
'bluespice' => '2.22.0'
-   
)
-   );
-   $this->mExtensionKey = 'MW::CSyntaxHighlight';
-   wfProfileOut( 'BS::'.__METHOD__ );
-   }
-
-   /**
 * Initialization of CSyntaxHighlight extension
 */
public function  initExt() {
diff --git a/CSyntaxHighlight/CSyntaxHighlight.setup.php 
b/CSyntaxHighlight/CSyntaxHighlight.setup.php
index 117a7ce..f1ba5fa 100644
--- a/CSyntaxHighlight/CSyntaxHighlight.setup.php
+++ b/CSyntaxHighlight/CSyntaxHighlight.setup.php
@@ -1,7 +1,3 @@
 https://help.bluespice.com/index.php/CSyntaxHighlight;,
+"author": [
+"Robert Vogel"
+],
+"descriptionmsg": "bs-csyntaxhighlight-desc",
+"type": "bluespice",
+"bsgExtensions": {
+"CSyntaxHighlight": {
+"className": "CSyntaxHighlight",
+"extPath": "/BlueSpiceExtensions/CSyntaxHighlight"
+}
+},
+"MessagesDirs": {
+"CSyntaxHighlight": [
+"i18n"
+]
+},
+"AutoloadClasses": {
+"CSyntaxHighlight": "CSyntaxHighlight.class.php"
+},
+"manifest_version": 1
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie45ed13a170e8a3784432095a53df8fbc4825519
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Gerharddiller85 
Gerrit-Reviewer: Dvogel hallowelt 
Gerrit-Reviewer: Ljonka 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: Pwirth 
Gerrit-Reviewer: Robert Vogel 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...RelatedArticles[master]: Allow skins a mechanism to decide on placement of related pages

2016-08-18 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Allow skins a mechanism to decide on placement of related pages
..

Allow skins a mechanism to decide on placement of related pages

If an element with id #related-articles is present append there

Bug: T141002
Change-Id: Iac11948f8f5fdaad45d51b905bb7494a84775710
---
M resources/ext.relatedArticles.readMore/index.js
1 file changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/resources/ext.relatedArticles.readMore/index.js 
b/resources/ext.relatedArticles.readMore/index.js
index ac1c912..d86a71d 100644
--- a/resources/ext.relatedArticles.readMore/index.js
+++ b/resources/ext.relatedArticles.readMore/index.js
@@ -48,7 +48,12 @@
.append( $( '' ).text( mw.msg( 
'relatedarticles-read-more-heading' ) ) )
.append( cards.$el );
 
-   $readMore.insertAfter( '#content' );
+   // If a skin has specifically marked where related 
articles should go respect that.
+   if ( $( '#related-articles' ).length ) {
+   $( '#related-articles' ).replaceWith( $readMore 
);
+   } else {
+   $readMore.insertAfter( '#content' );
+   }
 
// the ReadMore code is ready
mw.track( 'ext.relatedArticles.logReady', { $readMore: 
$readMore } );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac11948f8f5fdaad45d51b905bb7494a84775710
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RelatedArticles
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: tools: sge colletor set SGE_ROOT

2016-08-18 Thread Rush (Code Review)
Rush has submitted this change and it was merged.

Change subject: tools: sge colletor set SGE_ROOT
..


tools: sge colletor set SGE_ROOT

Add env context for qstat similar to qconf

Bug: T140999
Change-Id: If243a00f509ad19627fe83520e9861527cbd4f4a
---
M modules/toollabs/files/monitoring/sge.py
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/modules/toollabs/files/monitoring/sge.py 
b/modules/toollabs/files/monitoring/sge.py
index ba3079b..2e08579 100644
--- a/modules/toollabs/files/monitoring/sge.py
+++ b/modules/toollabs/files/monitoring/sge.py
@@ -38,7 +38,9 @@
 :note: shell=true is to honor askerisk via subprocess
 """
 job_query = "/usr/bin/qstat -q %s -u '*'" % (queue,)
-return subprocess.check_output([job_query], shell=True)
+return subprocess.check_output([job_query],
+   env={"SGE_ROOT": 
'/data/project/.system/gridengine/'},
+   shell=True)
 
 def get_queues(self):
 """ retrieve list of queues

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If243a00f509ad19627fe83520e9861527cbd4f4a
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Rush 
Gerrit-Reviewer: Coren 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Merlijn van Deen 
Gerrit-Reviewer: Rush 
Gerrit-Reviewer: Yuvipanda 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: deployment-prep: Move udp2log to deployment-fluorine02

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: deployment-prep: Move udp2log to deployment-fluorine02
..


deployment-prep: Move udp2log to deployment-fluorine02

Change-Id: I70b2842ca91a2e7c4b1484a5a448832934226d0e
---
M wmf-config/LabsServices.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/wmf-config/LabsServices.php b/wmf-config/LabsServices.php
index 1da6253..3f55d8f 100644
--- a/wmf-config/LabsServices.php
+++ b/wmf-config/LabsServices.php
@@ -12,7 +12,7 @@
 $wmfAllServices = [];
 
 $wmfAllServices['eqiad'] = [
-   'udp2log' => 'deployment-fluorine.eqiad.wmflabs:8420',
+   'udp2log' => 'deployment-fluorine02.eqiad.wmflabs:8420',
'statsd' => 'labmon1001.eqiad.wmnet',
'search' => [
// These MUST match the installed SSL certs

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I70b2842ca91a2e7c4b1484a5a448832934226d0e
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: deployment-prep: Move udp2log to deployment-fluorine02

2016-08-18 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: deployment-prep: Move udp2log to deployment-fluorine02
..

deployment-prep: Move udp2log to deployment-fluorine02

Change-Id: I70b2842ca91a2e7c4b1484a5a448832934226d0e
---
M wmf-config/LabsServices.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/wmf-config/LabsServices.php b/wmf-config/LabsServices.php
index 1da6253..3f55d8f 100644
--- a/wmf-config/LabsServices.php
+++ b/wmf-config/LabsServices.php
@@ -12,7 +12,7 @@
 $wmfAllServices = [];
 
 $wmfAllServices['eqiad'] = [
-   'udp2log' => 'deployment-fluorine.eqiad.wmflabs:8420',
+   'udp2log' => 'deployment-fluorine02.eqiad.wmflabs:8420',
'statsd' => 'labmon1001.eqiad.wmnet',
'search' => [
// These MUST match the installed SSL certs

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70b2842ca91a2e7c4b1484a5a448832934226d0e
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: tools: sge colletor

2016-08-18 Thread Rush (Code Review)
Rush has uploaded a new change for review.

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

Change subject: tools: sge colletor
..

tools: sge colletor

Add env context for qstat similar to qconf

Bug: T140999
Change-Id: If243a00f509ad19627fe83520e9861527cbd4f4a
---
A modules/nodepool/files/logrotate
M modules/toollabs/files/monitoring/sge.py
2 files changed, 10 insertions(+), 1 deletion(-)


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

diff --git a/modules/nodepool/files/logrotate b/modules/nodepool/files/logrotate
new file mode 100644
index 000..9cf489a2
--- /dev/null
+++ b/modules/nodepool/files/logrotate
@@ -0,0 +1,7 @@
+/var/log/nodepool {
+daily
+compress
+missingok
+notifempty
+rotate 14
+}
diff --git a/modules/toollabs/files/monitoring/sge.py 
b/modules/toollabs/files/monitoring/sge.py
index ba3079b..2e08579 100644
--- a/modules/toollabs/files/monitoring/sge.py
+++ b/modules/toollabs/files/monitoring/sge.py
@@ -38,7 +38,9 @@
 :note: shell=true is to honor askerisk via subprocess
 """
 job_query = "/usr/bin/qstat -q %s -u '*'" % (queue,)
-return subprocess.check_output([job_query], shell=True)
+return subprocess.check_output([job_query],
+   env={"SGE_ROOT": 
'/data/project/.system/gridengine/'},
+   shell=True)
 
 def get_queues(self):
 """ retrieve list of queues

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: deployment-prep: Move udp2log to deployment-fluorine02

2016-08-18 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: deployment-prep: Move udp2log to deployment-fluorine02
..

deployment-prep: Move udp2log to deployment-fluorine02

Change-Id: I9aeb30e904d574e723918064beb414f98b6cff22
---
M hieradata/labs/deployment-prep/common.yaml
A hieradata/labs/deployment-prep/host/deployment-fluorine02.yaml
M modules/scap/templates/scap.cfg.erb
3 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/87/305587/1

diff --git a/hieradata/labs/deployment-prep/common.yaml 
b/hieradata/labs/deployment-prep/common.yaml
index 93ca450..89720fe 100644
--- a/hieradata/labs/deployment-prep/common.yaml
+++ b/hieradata/labs/deployment-prep/common.yaml
@@ -117,7 +117,7 @@
 restbase::mathoid_uri: 
http://deployment-mathoid.deployment-prep.eqiad.wmflabs:10042
 restbase::aqs_uri: https://wikimedia.org/api/rest_v1/metrics
 restbase::eventlogging_service_uri: 
http://deployment-eventlogging04.deployment-prep.eqiad.wmflabs:8085/v1/events
-"mediawiki::log_aggregator": deployment-fluorine.eqiad.wmflabs:8420
+"mediawiki::log_aggregator": deployment-fluorine02.eqiad.wmflabs:8420
 "mediawiki::forward_syslog": 
deployment-logstash2.deployment-prep.eqiad.wmflabs:10514
 mediawiki_memcached_servers:
 - 10.68.23.25:11211:1  # deployment-memc04
diff --git a/hieradata/labs/deployment-prep/host/deployment-fluorine02.yaml 
b/hieradata/labs/deployment-prep/host/deployment-fluorine02.yaml
new file mode 100644
index 000..8f7c7c6
--- /dev/null
+++ b/hieradata/labs/deployment-prep/host/deployment-fluorine02.yaml
@@ -0,0 +1,3 @@
+role::logging::mediawiki::monitor: false
+role::logging::mediawiki::log_directory: /srv/mw-log
+role::logging::mediawiki::count: 100
diff --git a/modules/scap/templates/scap.cfg.erb 
b/modules/scap/templates/scap.cfg.erb
index c374236..50d6386 100644
--- a/modules/scap/templates/scap.cfg.erb
+++ b/modules/scap/templates/scap.cfg.erb
@@ -92,7 +92,7 @@
 # Wikimedia Foundation beta cluster configuration
 master_rsync: <%= @wmflabs_master %>
 statsd_host: labmon1001.eqiad.wmnet
-udp2log_host: 10.68.16.198
+udp2log_host: deployment-fluorine02.deployment-prep.eqiad.wmflabs
 wmf_realm: labs
 # No pybal in labs, but pretend that there is anyway
 pybal_interface: lo

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9aeb30e904d574e723918064beb414f98b6cff22
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: UserStore: include blocked information and hide blocked users

2016-08-18 Thread Mglaser (Code Review)
Mglaser has uploaded a new change for review.

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

Change subject: UserStore: include blocked information and hide blocked users
..

UserStore: include blocked information and hide blocked users

There is now information about the block status of users. Blocked
users are not shown (per default filter), unless the default filter is
overridden. This can currently only be done in UserManager (per
corresponding commit)

Change-Id: I8d3ec0e6224878ae1b4837e499c874628d0bc35b
---
M includes/api/BSApiUserStore.php
1 file changed, 27 insertions(+), 8 deletions(-)


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

diff --git a/includes/api/BSApiUserStore.php b/includes/api/BSApiUserStore.php
index 0ddd687..4a77aeb 100644
--- a/includes/api/BSApiUserStore.php
+++ b/includes/api/BSApiUserStore.php
@@ -2,16 +2,25 @@
 
 class BSApiUserStore extends BSApiExtJSStoreBase {
 
+   protected $aGroups = array();
+   protected $aBlocks = array();
+
protected function makeData($sQuery = '') {
$dbr = $this->getDB();
 
-   $aGroups = array();
+   $this->aGroups = array();
$groupsRes = $dbr->select( 'user_groups', '*' );
foreach( $groupsRes as $row ) {
-   if( !isset( $aGroups[$row->ug_user] ) ) {
-   $aGroups[$row->ug_user] = array();
+   if( !isset( $this->aGroups[$row->ug_user] ) ) {
+   $this->aGroups[$row->ug_user] = array();
}
-   $aGroups[$row->ug_user][] = $row->ug_group;
+   $this->aGroups[$row->ug_user][] = $row->ug_group;
+   }
+
+   $this->aBlocks = array();
+   $blocksRes = $dbr->select( 'ipblocks', '*' );
+   foreach( $blocksRes as $row ) {
+   $this->aBlocks[$row->ipb_user] = $row->ipb_address;
}
 
//TODO: It would be very cool to have the permissions as a 
filterable
@@ -23,7 +32,7 @@
$aData = array();
$userRes = $dbr->select( 'user', '*' );
foreach( $userRes as $aRow ) {
-   $aResRow = $this->makeResultRow( $aRow, $aGroups );
+   $aResRow = $this->makeResultRow( $aRow );
if( !$aResRow ) {
continue;
}
@@ -36,10 +45,9 @@
/**
 * Builds a single result set
 * @param stdClass $row
-* @param array $aGroups
 * @return array
 */
-   protected function makeResultRow( $row, $aGroups = array() ) {
+   protected function makeResultRow( $row ) {
$oUserPageTitle = Title::makeTitle( NS_USER, $row->user_name );
return array(
'user_id' => (int) $row->user_id,
@@ -47,7 +55,8 @@
'user_real_name' => $row->user_real_name,
'user_registration' => $row->user_registration,
'user_editcount' => (int) $row->user_editcount,
-   'groups' => isset( $aGroups[$row->user_id] ) ? 
$aGroups[$row->user_id] : array(),
+   'groups' => isset( $this->aGroups[$row->user_id] ) ? 
$this->aGroups[$row->user_id] : array(),
+   'enabled' => isset( $this->aBlocks[$row->user_id] ) ? 
false : true,
'page_link' => Linker::link( $oUserPageTitle, 
$row->user_name.' ' ), //The whitespace is to aviod automatic rewrite to 
user_real_name by BSF
 
//legacy fields
@@ -55,4 +64,14 @@
'page_prefixed_text' => 
$oUserPageTitle->getPrefixedText()
);
}
+
+   /**
+* Sets standard filter for users to "only enabled users".
+* @return string
+*/
+   public function getAllowedParams() {
+   $aAllowedParams = parent::getAllowedParams();
+   $aAllowedParams['filter'][ApiBase::PARAM_DFLT] = 
'[{"type":"boolean","value":true,"field":"enabled"}]';
+   return $aAllowedParams;
+   }
 }
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d3ec0e6224878ae1b4837e499c874628d0bc35b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Mglaser 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: UserManager: Use block to enable / disable users

2016-08-18 Thread Mglaser (Code Review)
Mglaser has uploaded a new change for review.

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

Change subject: UserManager: Use block to enable / disable users
..

UserManager: Use block to enable / disable users

Blocked users are treated as disabled. Disabled users are not shown
in UserManager, unless the (hidden) column "Enabled" is shown and
a filter is set. From add/edit dialogue, you can enable/disable
users.

Requires corresponding commit in BlueSpiceFoundation

Change-Id: I01242cc5af5e9fbd0afcae4d2a594557207fef51
---
M UserManager/UserManager.class.php
M UserManager/UserManager.setup.php
M UserManager/i18n/en.json
M UserManager/includes/api/BSApiTasksUserManager.php
M UserManager/resources/BS.UserManager/dialog/User.js
M UserManager/resources/BS.UserManager/panel/Manager.js
6 files changed, 90 insertions(+), 5 deletions(-)


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

diff --git a/UserManager/UserManager.class.php 
b/UserManager/UserManager.class.php
index cb55c67..5b2af32 100644
--- a/UserManager/UserManager.class.php
+++ b/UserManager/UserManager.class.php
@@ -122,6 +122,7 @@
public static function editUser( User $oUser, $aMetaData = array(), 
$bCreateIfNotExists = false ) {
$oStatus = Status::newGood();
$bNew = false;
+   $oPerformer = RequestContext::getMain()->getUser();
 
if ( $oUser->getId() === 0  ) {
if( !$bCreateIfNotExists ) {
@@ -190,6 +191,41 @@
 
$oUser->saveSettings();
 
+   if( isset( $aMetaData['enabled'] ) ) {
+   if ( $aMetaData['enabled'] === false && 
!$oUser->isBlocked() ) {
+   if ( $oUser->getId() == $oPerformer->getId() ) {
+   return Status::newFatal( 
'bs-usermanager-no-self-block' );
+   }
+   # Create block object.
+   $block = new Block();
+   $block->setTarget( $oUser );
+   $block->setBlocker( $oPerformer );
+   $block->mReason = wfMessage( 
'bs-usermanager-user-disabled' )->text();
+   $block->mExpiry = 'indefinite';
+   $block->prevents( 'createaccount', false );
+   $block->prevents( 'editownusertalk', false );
+   $block->prevents( 'sendemail', true );
+   $block->isHardblock( true );
+   $block->isAutoblocking( false );
+   $reason = [ 'hookaborted' ];
+   if ( !Hooks::run( 'BlockIp', [ &$block, 
&$performer, &$reason ] ) ) {
+   return $reason;
+   }
+
+   # Try to insert block. Is there a conflicting 
block?
+   $bStatus = $block->insert();
+   if ( !$bStatus ) {
+   return Status::newFatal( 
'bs-usermanager-block-error' );
+   }
+   } else if ( $aMetaData['enabled'] === true && 
$oUser->isBlocked() ) {
+   $block = Block::newFromTarget( $oUser );
+   $bStatus = $block->delete();
+   if ( !$bStatus ) {
+   return Status::newFatal( 
'bs-usermanager-unblock-error' );
+   }
+   }
+   }
+
$oUserManager = BsExtensionManager::getExtension( 'UserManager' 
);
Hooks::run(
'BSUserManagerAfterEditUser',
diff --git a/UserManager/UserManager.setup.php 
b/UserManager/UserManager.setup.php
index 0b780a2..0ba317b 100644
--- a/UserManager/UserManager.setup.php
+++ b/UserManager/UserManager.setup.php
@@ -23,7 +23,8 @@
'bs-usermanager-titledeleteuser',
'bs-usermanager-confirmdeleteuser',
'bs-usermanager-groups-more',
-   'bs-usermanager-no-self-desysop'
+   'bs-usermanager-no-self-desysop',
+   'bs-usermanager-headerenabled'
),
'localBasePath' => __DIR__ . '/resources',
'remoteExtPath' => 'BlueSpiceExtensions/UserManager/resources'
diff --git a/UserManager/i18n/en.json b/UserManager/i18n/en.json
index 42c160a..220282a 100644
--- a/UserManager/i18n/en.json
+++ b/UserManager/i18n/en.json
@@ -31,5 +31,10 @@
"bs-usermanager-confirmdeleteuser": "Are you sure, you want to delete 
{{PLURAL:$1|this user|these $1 users}}?",
"bs-usermanager-groups-more": "... more",

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Auto-populate the wiki field when reindexing

2016-08-18 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Auto-populate the wiki field when reindexing
..

Auto-populate the wiki field when reindexing

This field was recently added, but for an existing index will take
quite some time to naturally be populated in 100% of pages by the
normal update process. Instead of waiting and hoping populate it
on demand during an in-place reindex.

Change-Id: I5cdb77b171222601d5e45438ef9d12f52ac42364
---
M includes/Maintenance/Reindexer.php
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/includes/Maintenance/Reindexer.php 
b/includes/Maintenance/Reindexer.php
index c1c..ca08722 100644
--- a/includes/Maintenance/Reindexer.php
+++ b/includes/Maintenance/Reindexer.php
@@ -360,6 +360,12 @@
// out any old fields that we no longer use.
$data = Util::cleanUnusedFields( $result->getSource(), 
$properties );
 
+   // This field was added July, 2016. For the first reindex that 
occurs after it was added it will
+   // not exist in the documents, so add it here.
+   if ( !isset( $data['wiki'] ) ) {
+   $data['wiki'] = wfWikiId();
+   }
+
// Note that while setting the opType to create might improve 
performance slightly it can cause
// trouble if the scroll returns the same id twice.  It can do 
that if the document is updated
// during the scroll process.  I'm unclear on if it will always 
do that, so you still have to

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5cdb77b171222601d5e45438ef9d12f52ac42364
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 

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


[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Let abusefilter-modify users see history of hidden filters

2016-08-18 Thread Platonides (Code Review)
Platonides has uploaded a new change for review.

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

Change subject: Let abusefilter-modify users see history of hidden filters
..

Let abusefilter-modify users see history of hidden filters

d0439337 (I9e15326c) made abusefilter-view-private required
even for users with abusefilter-modify that can see and
change private filters.

Bug: T143365
Change-Id: I401effc5f1e429b5ec12c7f48dcc00ada74eafb6
---
M Views/AbuseFilterViewDiff.php
M Views/AbuseFilterViewHistory.php
2 files changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/Views/AbuseFilterViewDiff.php b/Views/AbuseFilterViewDiff.php
index b0361c0..b43d8a0 100644
--- a/Views/AbuseFilterViewDiff.php
+++ b/Views/AbuseFilterViewDiff.php
@@ -100,7 +100,7 @@
$this->mFilter = $this->mParams[1];
 
if ( AbuseFilter::filterHidden( $this->mFilter )
-   && !$this->getUser()->isAllowed( 
'abusefilter-view-private' )
+   && !$this->getUser()->isAllowedAny( array( 
'abusefilter-modify', 'abusefilter-view-private' ) )
) {
$this->getOutput()->addWikiMsg( 
'abusefilter-history-error-hidden' );
return false;
diff --git a/Views/AbuseFilterViewHistory.php b/Views/AbuseFilterViewHistory.php
index 82e18bf..9f5eba2 100644
--- a/Views/AbuseFilterViewHistory.php
+++ b/Views/AbuseFilterViewHistory.php
@@ -16,9 +16,9 @@
$out->setPageTitle( $this->msg( 
'abusefilter-filter-log' ) );
}
 
-   # Check perms
+   # Check perms. abusefilter-modify is a superset of 
abusefilter-view-private
if ( $filter && AbuseFilter::filterHidden( $filter )
-   && !$this->getUser()->isAllowed( 
'abusefilter-view-private' )
+   && !$this->getUser()->isAllowedAny( array( 
'abusefilter-modify', 'abusefilter-view-private' ) )
) {
$out->addWikiMsg( 'abusefilter-history-error-hidden' );
return;
@@ -234,7 +234,7 @@
$info['conds']['afh_filter'] = $this->mFilter;
}
 
-   if ( !$this->getUser()->isAllowed( 'abusefilter-view-private' ) 
) {
+   if ( !$this->getUser()->isAllowedAny( array( 
'abusefilter-modify', 'abusefilter-view-private' ) ) ) {
// Hide data the user can't see.
$info['conds']['af_hidden'] = 0;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I401effc5f1e429b5ec12c7f48dcc00ada74eafb6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Platonides 

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


[MediaWiki-commits] [Gerrit] mediawiki...ConfirmEdit[master]: Use string for Hooks in extension.json, instead of arrays

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use string for Hooks in extension.json, instead of arrays
..


Use string for Hooks in extension.json, instead of arrays

This is a lot easier to read.

Change-Id: Iab783a120cf600c22143016e6ebaa18ef12e7c70
---
M extension.json
1 file changed, 9 insertions(+), 27 deletions(-)

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



diff --git a/extension.json b/extension.json
index 26f6830..4c6a1fd 100644
--- a/extension.json
+++ b/extension.json
@@ -59,33 +59,15 @@
},
"callback": "ConfirmEditHooks::onRegistration",
"Hooks": {
-   "EditPageBeforeEditButtons": [
-   "ConfirmEditHooks::confirmEditPage"
-   ],
-   "EmailUserForm": [
-   "ConfirmEditHooks::injectEmailUser"
-   ],
-   "EmailUser": [
-   "ConfirmEditHooks::confirmEmailUser"
-   ],
-   "PageContentSaveComplete": [
-   "ConfirmEditHooks::onPageContentSaveComplete"
-   ],
-   "EditPage::showEditForm:fields": [
-   "ConfirmEditHooks::showEditFormFields"
-   ],
-   "EditFilterMergedContent": [
-   "ConfirmEditHooks::confirmEditMerged"
-   ],
-   "APIGetAllowedParams": [
-   "ConfirmEditHooks::APIGetAllowedParams"
-   ],
-   "APIGetParamDescription": [
-   "ConfirmEditHooks::APIGetParamDescription"
-   ],
-   "TitleReadWhitelist": [
-   "ConfirmEditHooks::onTitleReadWhitelist"
-   ]
+   "EditPageBeforeEditButtons": 
"ConfirmEditHooks::confirmEditPage",
+   "EmailUserForm": "ConfirmEditHooks::injectEmailUser",
+   "EmailUser": "ConfirmEditHooks::confirmEmailUser",
+   "PageContentSaveComplete": 
"ConfirmEditHooks::onPageContentSaveComplete",
+   "EditPage::showEditForm:fields": 
"ConfirmEditHooks::showEditFormFields",
+   "EditFilterMergedContent": 
"ConfirmEditHooks::confirmEditMerged",
+   "APIGetAllowedParams": "ConfirmEditHooks::APIGetAllowedParams",
+   "APIGetParamDescription": 
"ConfirmEditHooks::APIGetParamDescription",
+   "TitleReadWhitelist": "ConfirmEditHooks::onTitleReadWhitelist"
},
"config": {
"_prefix": "",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab783a120cf600c22143016e6ebaa18ef12e7c70
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ConfirmEdit[master]: Use TitleReadWhitelist for automatic whitelist

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use TitleReadWhitelist for automatic whitelist
..


Use TitleReadWhitelist for automatic whitelist

Instead of abusing the extension.json callback.

Bug: T142259
Change-Id: I12501ebfa61a4b2f72cec1f94b86a54e56c28719
---
M extension.json
M includes/ConfirmEditHooks.php
2 files changed, 19 insertions(+), 10 deletions(-)

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



diff --git a/extension.json b/extension.json
index 380545c..26f6830 100644
--- a/extension.json
+++ b/extension.json
@@ -82,6 +82,9 @@
],
"APIGetParamDescription": [
"ConfirmEditHooks::APIGetParamDescription"
+   ],
+   "TitleReadWhitelist": [
+   "ConfirmEditHooks::onTitleReadWhitelist"
]
},
"config": {
diff --git a/includes/ConfirmEditHooks.php b/includes/ConfirmEditHooks.php
index e0bf824..ebff507 100644
--- a/includes/ConfirmEditHooks.php
+++ b/includes/ConfirmEditHooks.php
@@ -142,25 +142,31 @@
 * Set up $wgWhitelistRead
 */
public static function confirmEditSetup() {
-   global $wgGroupPermissions, $wgCaptchaTriggers, 
$wgWikimediaJenkinsCI;
+   global $wgCaptchaTriggers, $wgWikimediaJenkinsCI;
 
// There is no need to run (core) tests with enabled 
ConfirmEdit - bug T44145
if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI 
=== true ) {
$wgCaptchaTriggers = array_fill_keys( array_keys( 
$wgCaptchaTriggers ), false );
}
+   }
 
-   if ( !$wgGroupPermissions['*']['read'] && 
$wgCaptchaTriggers['badlogin'] ) {
-   // We need to ensure that the captcha interface is 
accessible
-   // so that unauthenticated users can actually get in 
after a
-   // mistaken password typing.
-   global $wgWhitelistRead;
-   $image = SpecialPage::getTitleFor( 'Captcha', 'image' );
-   $help = SpecialPage::getTitleFor( 'Captcha', 'help' );
-   $wgWhitelistRead[] = $image->getPrefixedText();
-   $wgWhitelistRead[] = $help->getPrefixedText();
+   /**
+* TitleReadWhitelist hook handler.
+*
+* @param Title $title
+* @param User $user
+* @param $whitelisted
+*/
+   public static function onTitleReadWhitelist( Title $title, User $user, 
&$whitelisted ) {
+   $image = SpecialPage::getTitleFor( 'Captcha', 'image' );
+   $help = SpecialPage::getTitleFor( 'Captcha', 'help' );
+   if ( $title->equals( $image ) || $title->equals( $help ) ) {
+   $whitelisted = true;
}
}
+
/**
+*
 * Callback for extension.json of FancyCaptcha to set a default captcha 
directory,
 * which depends on wgUploadDirectory
 */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I12501ebfa61a4b2f72cec1f94b86a54e56c28719
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Clean up EditableTemplatedWidget and implementations

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Clean up EditableTemplatedWidget and implementations
..


Clean up EditableTemplatedWidget and implementations

Change-Id: Ie236a8d066555ab62965490cdbba02643402123b
---
M repo/resources/wikibase.ui.entityViewInit.js
M view/resources/jquery/ui/jquery.ui.EditableTemplatedWidget.js
M view/resources/jquery/wikibase/jquery.wikibase.aliasesview.js
M view/resources/jquery/wikibase/jquery.wikibase.descriptionview.js
M 
view/resources/jquery/wikibase/jquery.wikibase.entitytermsforlanguagelistview.js
M view/resources/jquery/wikibase/jquery.wikibase.entitytermsforlanguageview.js
M view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js
M view/resources/jquery/wikibase/jquery.wikibase.labelview.js
M view/resources/jquery/wikibase/jquery.wikibase.sitelinkgroupview.js
M view/resources/jquery/wikibase/jquery.wikibase.sitelinklistview.js
M view/resources/jquery/wikibase/jquery.wikibase.statementview.RankSelector.js
M view/resources/jquery/wikibase/jquery.wikibase.statementview.js
M view/resources/jquery/wikibase/resources.php
M view/resources/jquery/wikibase/toolbar/controller/resources.php
M view/tests/qunit/jquery/ui/jquery.ui.EditableTemplatedWidget.tests.js
M view/tests/qunit/jquery/wikibase/jquery.wikibase.aliasesview.tests.js
M view/tests/qunit/jquery/wikibase/jquery.wikibase.descriptionview.tests.js
M 
view/tests/qunit/jquery/wikibase/jquery.wikibase.entitytermsforlanguagelistview.tests.js
M 
view/tests/qunit/jquery/wikibase/jquery.wikibase.entitytermsforlanguageview.tests.js
M view/tests/qunit/jquery/wikibase/jquery.wikibase.labelview.tests.js
M view/tests/qunit/jquery/wikibase/jquery.wikibase.sitelinklistview.tests.js
21 files changed, 51 insertions(+), 759 deletions(-)

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



diff --git a/repo/resources/wikibase.ui.entityViewInit.js 
b/repo/resources/wikibase.ui.entityViewInit.js
index 529aff7..c91611e 100644
--- a/repo/resources/wikibase.ui.entityViewInit.js
+++ b/repo/resources/wikibase.ui.entityViewInit.js
@@ -31,8 +31,6 @@
'statementview-referenceview',
'referenceview-snakview'
],
-   edittoolbar: [
-   ],
removetoolbar: [
'referenceview',
'statementview-snakview',
diff --git a/view/resources/jquery/ui/jquery.ui.EditableTemplatedWidget.js 
b/view/resources/jquery/ui/jquery.ui.EditableTemplatedWidget.js
index f8e8adc..c95789e 100644
--- a/view/resources/jquery/ui/jquery.ui.EditableTemplatedWidget.js
+++ b/view/resources/jquery/ui/jquery.ui.EditableTemplatedWidget.js
@@ -1,6 +1,7 @@
 /**
  * @license GPL-2.0+
  * @author H. Snater < mediaw...@snater.com >
+ * @author Adrian Heine 
  */
 ( function( $ ) {
'use strict';
@@ -117,49 +118,14 @@
 * - {Error}
 */
stopEditing: function( dropValue ) {
-   var self = this,
-   deferred = $.Deferred();
-
-   if ( !this.isInEditMode() || !this.isValid() && !dropValue ) {
-   return deferred.resolve().promise();
+   var done = $.Deferred().resolve().promise();
+   if ( !this.isInEditMode() ) {
+   return done;
}
-
this._trigger( 'stopediting', null, [dropValue] );
-
-   this.disable();
-
-   if ( dropValue ) {
-   return this._afterStopEditing( dropValue );
-   } else {
-   this._save()
-   .done( function( savedValue ) {
-   self.options.value = savedValue || self.value();
-   self._afterStopEditing( dropValue )
-   .done( function() {
-   deferred.resolve( dropValue );
-   } )
-   .fail( function( error ) {
-   deferred.reject( error );
-   } );
-   } )
-   .fail( function( error ) {
-   self.setError( error );
-   deferred.reject( error );
-   self.enable();
-   } );
-   }
-
-   return deferred.promise();
+   this._afterStopEditing( dropValue );
+   return done;
},
-
-   /**
-* @return {Object} jQuery.Promise
-* Resolved parameters:
-  

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add information about quantity values to JSON docs

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add information about quantity values to JSON docs
..


Add information about quantity values to JSON docs

Change-Id: I385ebf304dbfe08b2b6d6c77f42d903c44483fec
---
M docs/json.wiki
1 file changed, 21 insertions(+), 0 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/docs/json.wiki b/docs/json.wiki
index 7a8421c..b3fb25f 100644
--- a/docs/json.wiki
+++ b/docs/json.wiki
@@ -366,6 +366,27 @@
 * '''globe''': the URI of a reference globe. This would typically refer to a 
data item on wikidata.org. This is usually just an indication of the celestial 
body (e.g. Q2 = earth), but could be more specific, like WGS 84 or ED50.
 * 'altitude': ''Deprecated and no longer used. Will be dropped in the 
future.''
 
+= quantity =
+
+
+  "datavalue": {
+"value":{
+  "amount":"+10.38",
+  "upperBound":"+10.375",
+  "lowerBound":"+10.385",
+  "unit":"http://www.wikidata.org/entity/Q712226;
+},
+"type":"quantity"
+  }
+
+
+Quantity values are given as a map with the following fields:
+
+* '''amount''': The nominal value of the quantity, as an arbitrary precision 
decimal string. The string always starts with a character indicating the sign 
of the value, either "+" or "-".
+* '''upperBound''': Optionally, the upper bound of the quantity's uncertainty 
interval, using the same notation as the amount field. If not given or null, 
the uncertainty (or precision) of the quantity is not known. If the upperBound 
field is given, the lowerBound field must also be given.
+* '''lowerBound''': Optionally, the lower bound of the quantity's uncertainty 
interval, using the same notation as the amount field. If not given or null, 
the uncertainty (or precision) of the quantity is not known. If the lowerBound 
field is given, the upperBound field must also be given.
+* '''unit''': the URI of a unit (or "1" to indicate a unit-less quantity). 
This would typically refer to a data item on wikidata.org, e.g. 
http://www.wikidata.org/entity/Q712226 for "square kilometer".
+
 = time =
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I385ebf304dbfe08b2b6d6c77f42d903c44483fec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update libs

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update libs
..


Update libs

Change-Id: I97c23b50fff62b72be71fd8e062f1f00d4e64937
---
M vendor
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/vendor b/vendor
index 0b850a2..6de05c5 16
--- a/vendor
+++ b/vendor
@@ -1 +1 @@
-Subproject commit 0b850a29ea3a73287347f177c3f880a5cb308adc
+Subproject commit 6de05c538e1f3075169b393f191c89432fa656c4

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update libs

2016-08-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Update libs
..

Update libs

Change-Id: I97c23b50fff62b72be71fd8e062f1f00d4e64937
---
M vendor
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/82/305582/1

diff --git a/vendor b/vendor
index 0b850a2..6de05c5 16
--- a/vendor
+++ b/vendor
@@ -1 +1 @@
-Subproject commit 0b850a29ea3a73287347f177c3f880a5cb308adc
+Subproject commit 6de05c538e1f3075169b393f191c89432fa656c4

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...vendor[master]: Re-add polyfill-php54

2016-08-18 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged.

Change subject: Re-add polyfill-php54
..


Re-add polyfill-php54

Change-Id: Iddbc34ef0e63408cb58d9a32ca7b2365a5f0723d
---
M composer/LICENSE
M composer/installed.json
A symfony/polyfill-php54/LICENSE
A symfony/polyfill-php54/Php54.php
A symfony/polyfill-php54/README.md
A symfony/polyfill-php54/Resources/stubs/CallbackFilterIterator.php
A symfony/polyfill-php54/Resources/stubs/RecursiveCallbackFilterIterator.php
A symfony/polyfill-php54/Resources/stubs/SessionHandlerInterface.php
A symfony/polyfill-php54/bootstrap.php
A symfony/polyfill-php54/composer.json
10 files changed, 363 insertions(+), 60 deletions(-)

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



diff --git a/composer/LICENSE b/composer/LICENSE
index b0794ff..1a28124 100644
--- a/composer/LICENSE
+++ b/composer/LICENSE
@@ -1,3 +1,4 @@
+
 Copyright (c) 2016 Nils Adermann, Jordi Boggiano
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -17,3 +18,4 @@
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
+
diff --git a/composer/installed.json b/composer/installed.json
index b010bb8..8b7f034 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -813,66 +813,6 @@
 ]
 },
 {
-"name": "symfony/polyfill-php54",
-"version": "v1.2.0",
-"version_normalized": "1.2.0.0",
-"source": {
-"type": "git",
-"url": "https://github.com/symfony/polyfill-php54.git;,
-"reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1"
-},
-"dist": {
-"type": "zip",
-"url": 
"https://api.github.com/repos/symfony/polyfill-php54/zipball/34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1;,
-"reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1",
-"shasum": ""
-},
-"require": {
-"php": ">=5.3.3"
-},
-"time": "2016-05-18 14:26:46",
-"type": "library",
-"extra": {
-"branch-alias": {
-"dev-master": "1.2-dev"
-}
-},
-"installation-source": "dist",
-"autoload": {
-"psr-4": {
-"Symfony\\Polyfill\\Php54\\": ""
-},
-"files": [
-"bootstrap.php"
-],
-"classmap": [
-"Resources/stubs"
-]
-},
-"notification-url": "https://packagist.org/downloads/;,
-"license": [
-"MIT"
-],
-"authors": [
-{
-"name": "Nicolas Grekas",
-"email": "p...@tchwork.com"
-},
-{
-"name": "Symfony Community",
-"homepage": "https://symfony.com/contributors;
-}
-],
-"description": "Symfony polyfill backporting some PHP 5.4+ features to 
lower PHP versions",
-"homepage": "https://symfony.com;,
-"keywords": [
-"compatibility",
-"polyfill",
-"portable",
-"shim"
-]
-},
-{
 "name": "symfony/http-foundation",
 "version": "v2.8.9",
 "version_normalized": "2.8.9.0",
@@ -1270,5 +1210,65 @@
 "donations",
 "payments"
 ]
+},
+{
+"name": "symfony/polyfill-php54",
+"version": "v1.2.0",
+"version_normalized": "1.2.0.0",
+"source": {
+"type": "git",
+"url": "https://github.com/symfony/polyfill-php54.git;,
+"reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/symfony/polyfill-php54/zipball/34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1;,
+"reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1",
+"shasum": ""
+},
+"require": {
+"php": ">=5.3.3"
+},
+"time": "2016-05-18 14:26:46",
+"type": "library",
+"extra": {
+"branch-alias": {
+"dev-master": "1.2-dev"
+}
+},
+"installation-source": "dist",
+"autoload": {
+"psr-4": {
+"Symfony\\Polyfill\\Php54\\": ""
+},
+"files": [
+"bootstrap.php"
+],
+"classmap": [
+"Resources/stubs"
+]
+},
+"notification-url": "https://packagist.org/downloads/;,
+"license": [
+"MIT"
+],
+"authors": [
+{
+"name": "Nicolas Grekas",
+"email": "p...@tchwork.com"
+},
+{
+"name": 

[MediaWiki-commits] [Gerrit] wikimedia...vendor[master]: Re-add polyfill-php54

2016-08-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Re-add polyfill-php54
..

Re-add polyfill-php54

Change-Id: Iddbc34ef0e63408cb58d9a32ca7b2365a5f0723d
---
M composer/LICENSE
M composer/installed.json
A symfony/polyfill-php54/LICENSE
A symfony/polyfill-php54/Php54.php
A symfony/polyfill-php54/README.md
A symfony/polyfill-php54/Resources/stubs/CallbackFilterIterator.php
A symfony/polyfill-php54/Resources/stubs/RecursiveCallbackFilterIterator.php
A symfony/polyfill-php54/Resources/stubs/SessionHandlerInterface.php
A symfony/polyfill-php54/bootstrap.php
A symfony/polyfill-php54/composer.json
10 files changed, 363 insertions(+), 60 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/vendor 
refs/changes/81/305581/1

diff --git a/composer/LICENSE b/composer/LICENSE
index b0794ff..1a28124 100644
--- a/composer/LICENSE
+++ b/composer/LICENSE
@@ -1,3 +1,4 @@
+
 Copyright (c) 2016 Nils Adermann, Jordi Boggiano
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -17,3 +18,4 @@
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
+
diff --git a/composer/installed.json b/composer/installed.json
index b010bb8..8b7f034 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -813,66 +813,6 @@
 ]
 },
 {
-"name": "symfony/polyfill-php54",
-"version": "v1.2.0",
-"version_normalized": "1.2.0.0",
-"source": {
-"type": "git",
-"url": "https://github.com/symfony/polyfill-php54.git;,
-"reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1"
-},
-"dist": {
-"type": "zip",
-"url": 
"https://api.github.com/repos/symfony/polyfill-php54/zipball/34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1;,
-"reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1",
-"shasum": ""
-},
-"require": {
-"php": ">=5.3.3"
-},
-"time": "2016-05-18 14:26:46",
-"type": "library",
-"extra": {
-"branch-alias": {
-"dev-master": "1.2-dev"
-}
-},
-"installation-source": "dist",
-"autoload": {
-"psr-4": {
-"Symfony\\Polyfill\\Php54\\": ""
-},
-"files": [
-"bootstrap.php"
-],
-"classmap": [
-"Resources/stubs"
-]
-},
-"notification-url": "https://packagist.org/downloads/;,
-"license": [
-"MIT"
-],
-"authors": [
-{
-"name": "Nicolas Grekas",
-"email": "p...@tchwork.com"
-},
-{
-"name": "Symfony Community",
-"homepage": "https://symfony.com/contributors;
-}
-],
-"description": "Symfony polyfill backporting some PHP 5.4+ features to 
lower PHP versions",
-"homepage": "https://symfony.com;,
-"keywords": [
-"compatibility",
-"polyfill",
-"portable",
-"shim"
-]
-},
-{
 "name": "symfony/http-foundation",
 "version": "v2.8.9",
 "version_normalized": "2.8.9.0",
@@ -1270,5 +1210,65 @@
 "donations",
 "payments"
 ]
+},
+{
+"name": "symfony/polyfill-php54",
+"version": "v1.2.0",
+"version_normalized": "1.2.0.0",
+"source": {
+"type": "git",
+"url": "https://github.com/symfony/polyfill-php54.git;,
+"reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/symfony/polyfill-php54/zipball/34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1;,
+"reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1",
+"shasum": ""
+},
+"require": {
+"php": ">=5.3.3"
+},
+"time": "2016-05-18 14:26:46",
+"type": "library",
+"extra": {
+"branch-alias": {
+"dev-master": "1.2-dev"
+}
+},
+"installation-source": "dist",
+"autoload": {
+"psr-4": {
+"Symfony\\Polyfill\\Php54\\": ""
+},
+"files": [
+"bootstrap.php"
+],
+"classmap": [
+"Resources/stubs"
+]
+},
+"notification-url": "https://packagist.org/downloads/;,
+"license": [
+"MIT"
+],
+"authors": [
+{
+"name": "Nicolas Grekas",
+

[MediaWiki-commits] [Gerrit] wikidata...gui-deploy[production]: Merging from 435104f156c292e1a0e276f8f41d9368abb14d4d:

2016-08-18 Thread Smalyshev (Code Review)
Smalyshev has submitted this change and it was merged.

Change subject: Merging from 435104f156c292e1a0e276f8f41d9368abb14d4d:
..


Merging from 435104f156c292e1a0e276f8f41d9368abb14d4d:

i18n for menus and short url to result

Bug: T136058
Change-Id: I34c368e64e404bba67d6e5ef873d0f7d1c5ff539
---
A css/images/layers-2x.png
A css/images/layers.png
A css/images/marker-icon-2x.png
A css/images/marker-icon.png
A css/images/marker-shadow.png
M embed.html
M i18n/ast.json
M i18n/bg.json
M i18n/bn.json
M i18n/cs.json
M i18n/en.json
M i18n/es.json
M i18n/eu.json
M i18n/gl.json
M i18n/he.json
M i18n/id.json
M i18n/krl.json
M i18n/lt.json
M i18n/pt.json
M i18n/qqq.json
M index.html
A js/embed.wdqs.min.2bdc0d456ee366be7eb5.js
D js/embed.wdqs.min.f61d16179fc9b9fb.js
D js/wdqs.min.cba3e1e019d4801d2360.js
A js/wdqs.min.d8d350b83c619b549018.js
25 files changed, 21 insertions(+), 21 deletions(-)

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




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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: AuthManager: Allow for flagging fields as "sensitive"

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: AuthManager: Allow for flagging fields as "sensitive"
..


AuthManager: Allow for flagging fields as "sensitive"

This can allow AuthenticationRequests to flag certain fields as
sensitive, so e.g. the API can insist they be in the POST body rather
than in the query string.

Change-Id: I7b12aa4cd8f5a570f0df7213c0f9084b5a4d4de7
---
M includes/api/ApiAuthManagerHelper.php
M includes/auth/AuthenticationRequest.php
M includes/auth/PasswordAuthenticationRequest.php
M tests/phpunit/includes/auth/AuthenticationRequestTest.php
M tests/phpunit/includes/auth/AuthenticationRequestTestCase.php
5 files changed, 24 insertions(+), 0 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/ApiAuthManagerHelper.php 
b/includes/api/ApiAuthManagerHelper.php
index c970f93..d330862 100644
--- a/includes/api/ApiAuthManagerHelper.php
+++ b/includes/api/ApiAuthManagerHelper.php
@@ -326,6 +326,7 @@
$this->formatMessage( $ret, 'label', $field['label'] );
$this->formatMessage( $ret, 'help', $field['help'] );
$ret['optional'] = !empty( $field['optional'] );
+   $ret['sensitive'] = !empty( $field['sensitive'] );
 
$retFields[$name] = $ret;
}
diff --git a/includes/auth/AuthenticationRequest.php 
b/includes/auth/AuthenticationRequest.php
index f6f949e..2474b8b 100644
--- a/includes/auth/AuthenticationRequest.php
+++ b/includes/auth/AuthenticationRequest.php
@@ -102,6 +102,8 @@
 *  - label: (Message) Text suitable for a label in an HTML form
 *  - help: (Message) Text suitable as a description of what the field 
is
 *  - optional: (bool) If set and truthy, the field may be left empty
+*  - sensitive: (bool) If set and truthy, the field is considered 
sensitive. Code using the
+*  request should avoid exposing the value of the field.
 *
 * @return array As above
 */
@@ -315,6 +317,8 @@
$options['optional'] = !empty( 
$options['optional'] );
}
 
+   $options['sensitive'] = !empty( 
$options['sensitive'] );
+
if ( !array_key_exists( $name, $merged ) ) {
$merged[$name] = $options;
} elseif ( $merged[$name]['type'] !== 
$options['type'] ) {
@@ -333,6 +337,7 @@
}
 
$merged[$name]['optional'] = 
$merged[$name]['optional'] && $options['optional'];
+   $merged[$name]['sensitive'] = 
$merged[$name]['sensitive'] || $options['sensitive'];
 
// No way to merge 'value', 'image', 
'help', or 'label', so just use
// the value from the first request.
diff --git a/includes/auth/PasswordAuthenticationRequest.php 
b/includes/auth/PasswordAuthenticationRequest.php
index 187c29a..8550f3e 100644
--- a/includes/auth/PasswordAuthenticationRequest.php
+++ b/includes/auth/PasswordAuthenticationRequest.php
@@ -53,6 +53,7 @@
'type' => 'password',
'label' => wfMessage( $passwordLabel ),
'help' => wfMessage( 
'authmanager-password-help' ),
+   'sensitive' => true,
],
];
 
@@ -68,6 +69,7 @@
'type' => 'password',
'label' => wfMessage( $retypeLabel ),
'help' => wfMessage( 'authmanager-retype-help' 
),
+   'sensitive' => true,
];
}
 
diff --git a/tests/phpunit/includes/auth/AuthenticationRequestTest.php 
b/tests/phpunit/includes/auth/AuthenticationRequestTest.php
index a7df221..7d2ba8d 100644
--- a/tests/phpunit/includes/auth/AuthenticationRequestTest.php
+++ b/tests/phpunit/includes/auth/AuthenticationRequestTest.php
@@ -172,6 +172,7 @@
'type' => 'string',
'label' => $msg,
'help' => $msg,
+   'sensitive' => true,
],
'string3' => [
'type' => 'string',
@@ -206,6 +207,7 @@
$expect = $req1->getFieldInfo();
foreach ( $expect as $name => &$options ) {
$options['optional'] = !empty( $options['optional'] );
+   $options['sensitive'] = !empty( $options['sensitive'] );
}
 

[MediaWiki-commits] [Gerrit] mediawiki...Comments[master]: [SECURITY] Version 4.2.0: remove memcache caching from Comme...

2016-08-18 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: [SECURITY] Version 4.2.0: remove memcache caching from 
CommentsPage::display()
..


[SECURITY] Version 4.2.0: remove memcache caching from CommentsPage::display()

Ever since the January 19, 2015 rewrite (version 4.0) of Comments, there
was an issue where comments would be erroneously attributed to someone
else (https://github.com/Brickimedia/brickimedia/issues/346). Not only was
this annoying and meant that users weren't able to up/downvote others'
comments, it also posed a security risk because the commentadmin user
right wasn't working correctly (i.e. comment admins didn't see the "delete
comment" link even though they were meant to see that).

The entire RequestContext was being serialized into memcache, causing
global $wgUser and $this->getUser() to return different values, the first
one returning the correct one and the latter not. Huge thanks to legoktm
for looking into this and figuring out what's going on in here!

Closes Brickimedia/brickimedia#346

Change-Id: I7f73e4bc59471743b5db364861ac121505ae2dfe
---
M Comments.php
M CommentsPage.php
M extension.json
3 files changed, 5 insertions(+), 23 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/Comments.php b/Comments.php
index c7dbcf8..5d24990 100644
--- a/Comments.php
+++ b/Comments.php
@@ -24,7 +24,7 @@
 $wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'Comments',
-   'version' => '4.1.1',
+   'version' => '4.2.0',
'author' => array( 'David Pean', 'Misza', 'Jack Phoenix', 'Adam 
Carter/UltrasonicNXT' ),
'descriptionmsg' => 'comments-desc',
'url' => 'https://www.mediawiki.org/wiki/Extension:Comments'
diff --git a/CommentsPage.php b/CommentsPage.php
index c2ead66..617c004 100644
--- a/CommentsPage.php
+++ b/CommentsPage.php
@@ -449,29 +449,14 @@
return array_chunk( $comments, $this->limit );
}
 
-
/**
 * Display all the comments for the current page.
-* CSS and JS is loaded in Comment.php
+* CSS and JS is loaded in CommentsHooks.php
 */
function display() {
-   global $wgMemc;
-
$output = '';
 
-   // Try cache
-   $key = wfMemcKey( 'comment', 'pagethreadlist', $this->id );
-   $data = $wgMemc->get( $key );
-
-   if ( !$data ) {
-   wfDebug( "Loading comments for page {$this->id} from 
DB\n" );
-   $commentThreads = $this->getComments();
-   $wgMemc->set( $key, $commentThreads );
-   } else {
-   wfDebug( "Loading comments for page {$this->id} from 
cache\n" );
-   $commentThreads = $data;
-   }
-
+   $commentThreads = $this->getComments();
$commentThreads = $this->sort( $commentThreads );
 
$this->comments = $commentThreads;
@@ -594,13 +579,10 @@
}
 
/**
-* Purge caches (memcached, parser cache and Squid cache)
+* Purge caches (parser cache and Squid cache)
 */
function clearCommentListCache() {
-   global $wgMemc;
wfDebug( "Clearing comments for page {$this->id} from cache\n" 
);
-   $key = wfMemcKey( 'comment', 'pagethreadlist', $this->id );
-   $wgMemc->delete( $key );
 
if ( is_object( $this->title ) ) {
$this->title->invalidateCache();
diff --git a/extension.json b/extension.json
index ed4f7b1..a81ba04 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Comments",
-   "version": "4.1.0",
+   "version": "4.2.0",
"author": [
"David Pean",
"Misza",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f73e4bc59471743b5db364861ac121505ae2dfe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Comments
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: Jack Phoenix 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: FIXME

2016-08-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: FIXME
..

FIXME

Change-Id: I886c453d86219ff54df6fac9b2715612aabc3314
---
M sites/all/modules/queue2civicrm/queue2civicrm.module
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/80/305580/1

diff --git a/sites/all/modules/queue2civicrm/queue2civicrm.module 
b/sites/all/modules/queue2civicrm/queue2civicrm.module
index 67f8337..05c816b 100644
--- a/sites/all/modules/queue2civicrm/queue2civicrm.module
+++ b/sites/all/modules/queue2civicrm/queue2civicrm.module
@@ -258,7 +258,7 @@
 
 $dbEntry = false;
 // If more information is available, find it from the pending database
-// FIXME: replace completion_message_id with a boolean flag
+// FIXME: combine the information in a SmashPig job a la Adyen, not here
 if ( isset( $msg['completion_message_id'] ) ) {
 $dbEntry = queue2civicrm_update_from_pending_db( $msg );
 if ( !$dbEntry ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Comments[master]: [SECURITY] Version 4.2.0: remove memcache caching from Comme...

2016-08-18 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: [SECURITY] Version 4.2.0: remove memcache caching from 
CommentsPage::display()
..

[SECURITY] Version 4.2.0: remove memcache caching from CommentsPage::display()

Ever since the January 19, 2015 rewrite (version 4.0) of Comments, there
was an issue where comments would be erroneously attributed to someone
else (https://github.com/Brickimedia/brickimedia/issues/346). Not only was
this annoying and meant that users weren't able to up/downvote others'
comments, it also posed a security risk because the commentadmin user
right wasn't working correctly (i.e. comment admins didn't see the "delete
comment" link even though they were meant to see that).

The entire RequestContext was being serialized into memcache, causing
global $wgUser and $this->getUser() to return different values, the first
one returning the correct one and the latter not. Huge thanks to legoktm
for looking into this and figuring out what's going on in here!

Closes Brickimedia/brickimedia#346

Change-Id: I7f73e4bc59471743b5db364861ac121505ae2dfe
---
M Comments.php
M CommentsPage.php
M extension.json
3 files changed, 5 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Comments 
refs/changes/79/305579/1

diff --git a/Comments.php b/Comments.php
index c7dbcf8..5d24990 100644
--- a/Comments.php
+++ b/Comments.php
@@ -24,7 +24,7 @@
 $wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'Comments',
-   'version' => '4.1.1',
+   'version' => '4.2.0',
'author' => array( 'David Pean', 'Misza', 'Jack Phoenix', 'Adam 
Carter/UltrasonicNXT' ),
'descriptionmsg' => 'comments-desc',
'url' => 'https://www.mediawiki.org/wiki/Extension:Comments'
diff --git a/CommentsPage.php b/CommentsPage.php
index c2ead66..617c004 100644
--- a/CommentsPage.php
+++ b/CommentsPage.php
@@ -449,29 +449,14 @@
return array_chunk( $comments, $this->limit );
}
 
-
/**
 * Display all the comments for the current page.
-* CSS and JS is loaded in Comment.php
+* CSS and JS is loaded in CommentsHooks.php
 */
function display() {
-   global $wgMemc;
-
$output = '';
 
-   // Try cache
-   $key = wfMemcKey( 'comment', 'pagethreadlist', $this->id );
-   $data = $wgMemc->get( $key );
-
-   if ( !$data ) {
-   wfDebug( "Loading comments for page {$this->id} from 
DB\n" );
-   $commentThreads = $this->getComments();
-   $wgMemc->set( $key, $commentThreads );
-   } else {
-   wfDebug( "Loading comments for page {$this->id} from 
cache\n" );
-   $commentThreads = $data;
-   }
-
+   $commentThreads = $this->getComments();
$commentThreads = $this->sort( $commentThreads );
 
$this->comments = $commentThreads;
@@ -594,13 +579,10 @@
}
 
/**
-* Purge caches (memcached, parser cache and Squid cache)
+* Purge caches (parser cache and Squid cache)
 */
function clearCommentListCache() {
-   global $wgMemc;
wfDebug( "Clearing comments for page {$this->id} from cache\n" 
);
-   $key = wfMemcKey( 'comment', 'pagethreadlist', $this->id );
-   $wgMemc->delete( $key );
 
if ( is_object( $this->title ) ) {
$this->title->invalidateCache();
diff --git a/extension.json b/extension.json
index ed4f7b1..a81ba04 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Comments",
-   "version": "4.1.0",
+   "version": "4.2.0",
"author": [
"David Pean",
"Misza",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f73e4bc59471743b5db364861ac121505ae2dfe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Comments
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 

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


[MediaWiki-commits] [Gerrit] wikidata...gui-deploy[production]: Merging from 435104f156c292e1a0e276f8f41d9368abb14d4d:

2016-08-18 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: Merging from 435104f156c292e1a0e276f8f41d9368abb14d4d:
..

Merging from 435104f156c292e1a0e276f8f41d9368abb14d4d:

i18n for menus and short url to result

Bug: T136058
Change-Id: I34c368e64e404bba67d6e5ef873d0f7d1c5ff539
---
A css/images/layers-2x.png
A css/images/layers.png
A css/images/marker-icon-2x.png
A css/images/marker-icon.png
A css/images/marker-shadow.png
M embed.html
M i18n/ast.json
M i18n/bg.json
M i18n/bn.json
M i18n/cs.json
M i18n/en.json
M i18n/es.json
M i18n/eu.json
M i18n/gl.json
M i18n/he.json
M i18n/id.json
M i18n/krl.json
M i18n/lt.json
M i18n/pt.json
M i18n/qqq.json
M index.html
A js/embed.wdqs.min.2bdc0d456ee366be7eb5.js
D js/embed.wdqs.min.f61d16179fc9b9fb.js
D js/wdqs.min.cba3e1e019d4801d2360.js
A js/wdqs.min.d8d350b83c619b549018.js
25 files changed, 21 insertions(+), 21 deletions(-)


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


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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Type hint array for HTMLFormFieldCloner::getInputHTMLForKey()

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Type hint array for HTMLFormFieldCloner::getInputHTMLForKey()
..


Type hint array for HTMLFormFieldCloner::getInputHTMLForKey()

I was a bit fast with merging I18edfcb62f7b21f2c1990c73944ee6a956fd4901,
because I think, type hinting the type of the parameter would make sense,
too.

Bug: T142912
Change-Id: Id397847c6c078047f3daa84db68ccf3e629ca531
---
M includes/htmlform/fields/HTMLFormFieldCloner.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/htmlform/fields/HTMLFormFieldCloner.php 
b/includes/htmlform/fields/HTMLFormFieldCloner.php
index f39f54b..5d8f491 100644
--- a/includes/htmlform/fields/HTMLFormFieldCloner.php
+++ b/includes/htmlform/fields/HTMLFormFieldCloner.php
@@ -257,7 +257,7 @@
 * @param array $values
 * @return string
 */
-   protected function getInputHTMLForKey( $key, $values ) {
+   protected function getInputHTMLForKey( $key, array $values ) {
$displayFormat = isset( $this->mParams['format'] )
? $this->mParams['format']
: $this->mParent->getDisplayFormat();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id397847c6c078047f3daa84db68ccf3e629ca531
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Dereckson 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Check for duplicates before re-queueing MISSING_PREDECESSOR

2016-08-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Check for duplicates before re-queueing MISSING_PREDECESSOR
..

Check for duplicates before re-queueing MISSING_PREDECESSOR

When we've got a missing pending db entry, don't re-queue the donation
if it's already been added to Civi.

Bug: T122641
Change-Id: Ic3c21cef7245de0e8b48cbc900ba1381549e0064
---
M sites/all/modules/queue2civicrm/queue2civicrm.module
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/77/305577/1

diff --git a/sites/all/modules/queue2civicrm/queue2civicrm.module 
b/sites/all/modules/queue2civicrm/queue2civicrm.module
index c2eec3b..67f8337 100644
--- a/sites/all/modules/queue2civicrm/queue2civicrm.module
+++ b/sites/all/modules/queue2civicrm/queue2civicrm.module
@@ -262,6 +262,16 @@
 if ( isset( $msg['completion_message_id'] ) ) {
 $dbEntry = queue2civicrm_update_from_pending_db( $msg );
 if ( !$dbEntry ) {
+// If the contribution has already been imported, we don't want
+// to re-queue this message, but drop it entirely.
+if ( wmf_civicrm_get_contributions_from_gateway_id(
+$msg['gateway'], $msg['gateway_txn_id']
+) ) {
+throw new WmfException(
+'DUPLICATE_CONTRIBUTION',
+'Contribution already exists. Ignoring message.'
+);
+}
 // If the pending db row is missing, throw an exception that
 // tells dequeue_loop to requeue the incomplete message with a 
delay
 $errorMessage = "Message 
{$msg['gateway']}-{$msg['gateway_txn_id']} " .

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

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

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


[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add JSHint

2016-08-18 Thread Felipe Schenone (Code Review)
Felipe Schenone has submitted this change and it was merged.

Change subject: Add JSHint
..


Add JSHint

- Add .jshintrc file for code quality
- Very minor fixes

Change-Id: I9a93a48487bf94e3bdf4b02bbbdf0446b102a461
---
A .jshintrc
M proveit.js
2 files changed, 24 insertions(+), 2 deletions(-)

Approvals:
  Felipe Schenone: Verified; Looks good to me, approved



diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 000..b9e5076
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,22 @@
+{
+   // Enforcing
+   "bitwise": true,
+   "eqeqeq": true,
+   "esversion": 3,
+   "freeze": true,
+   "futurehostile": true,
+   "latedef": "nofunc",
+   "noarg": true,
+   "nonew": true,
+   "strict": false,
+   "undef": true,
+   "unused": true,
+
+   // Environment
+   "browser": true,
+
+   "globals": {
+   "mediaWiki": false,
+   "jQuery": false
+   }
+}
\ No newline at end of file
diff --git a/proveit.js b/proveit.js
index 9ee4a3c..d8273f5 100755
--- a/proveit.js
+++ b/proveit.js
@@ -351,7 +351,7 @@
'name': 'wpChangeTags',
'value': tag
});
-   $( '#editform' ).append( tagInput );
+   $( '#editform' ).prepend( tagInput );
},
 
/**
@@ -662,7 +662,7 @@
 * @return {object}
 */
this.getRegisteredParams = function () {
-   var formattedNamespaces = mw.config.get( 
'wgFormattedNamespaces' );
+   var formattedNamespaces = mw.config.get( 
'wgFormattedNamespaces' ),
templateNamespace = formattedNamespaces[10];
return proveit.templates[ templateNamespace + ':' + 
this.template ];
};

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9a93a48487bf94e3bdf4b02bbbdf0446b102a461
Gerrit-PatchSet: 2
Gerrit-Project: wikipedia/gadgets/ProveIt
Gerrit-Branch: master
Gerrit-Owner: Felipe Schenone 
Gerrit-Reviewer: Felipe Schenone 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...LinkedWiki[master]: Refactoring/cleaning and give a new configuration system

2016-08-18 Thread Karima Rafes (Code Review)
Karima Rafes has submitted this change and it was merged.

Change subject: Refactoring/cleaning and give a new configuration system
..


Refactoring/cleaning and give a new configuration system

- Refactoring/cleaning  the code
- Upgrade loading / registration of LinkedWiki extension
- Insert tests for selenium IDE (and delete the old tests)
- Add an experimental lua Class

BUG:T142563
BUG:T142572
Change-Id: Icb65c4720019fdc62c34f81e0d33f125011a40f9
---
M LinkedWiki.php
A LinkedWikiConfig.php
M README
M extension.json
A i18n/linkedwikiconfig/en.json
A i18n/linkedwikiconfig/fr.json
M i18n/sparqlquery/en.json
M i18n/sparqlquery/fr.json
A lua/LinkedWiki.lua
A lua/LinkedWiki.lua.php
A old/LinkedWiki_old.lua
M parser/SparqlParser.php
M parser/ToolsParser.php
M parser/WSparqlParser.php
A specialpages/SpecialLinkedWikiConfig.alias.php
A specialpages/SpecialLinkedWikiConfig.i18n.php
A specialpages/SpecialLinkedWikiConfig.php
M specialpages/SpecialSparqlFlintEditor.php
M specialpages/SpecialSparqlQuery.php
A storageMethod/DatabaseExampleMethod.php
A storageMethod/SimpleStorageMethod.php
A storageMethod/StorageInGraphMethod.php
A storageMethod/StorageMethodAbstract.php
A storageMethod/WikidataStorageMethod.php
M tag/LwgraphTag.php
A test/lua/test_core.lua
A test/lua/test_functions.lua
A test/lua/test_instance.lua
C test/selenium_ide/#sparql_T10_Config
C test/selenium_ide/#sparql_T10_Default
R test/selenium_ide/#sparql_T10_Endpoint
C test/selenium_ide/#sparql_T11_Config
C test/selenium_ide/#sparql_T11_Default
R test/selenium_ide/#sparql_T11_Endpoint
C test/selenium_ide/#sparql_T12_Config
C test/selenium_ide/#sparql_T12_Default
R test/selenium_ide/#sparql_T12_Endpoint
C test/selenium_ide/#sparql_T1_Config
R test/selenium_ide/#sparql_T1_Default
R test/selenium_ide/#sparql_T1_Endpoint
C test/selenium_ide/#sparql_T2_Config
C test/selenium_ide/#sparql_T4_Config
C test/selenium_ide/#sparql_T4_Default
C test/selenium_ide/#sparql_T4_Endpoint
C test/selenium_ide/#sparql_T5_Config
C test/selenium_ide/#sparql_T5_Default
R test/selenium_ide/#sparql_T5_Endpoint
C test/selenium_ide/#sparql_T6_Config
C test/selenium_ide/#sparql_T6_Default
R test/selenium_ide/#sparql_T6_Endpoint
C test/selenium_ide/#sparql_T7_Config
C test/selenium_ide/#sparql_T7_Default
R test/selenium_ide/#sparql_T7_Endpoint
C test/selenium_ide/#sparql_T8_Config
C test/selenium_ide/#sparql_T8_Default
R test/selenium_ide/#sparql_T8_Endpoint
C test/selenium_ide/#sparql_T9_Config
R test/selenium_ide/#sparql_T9_Default
R test/selenium_ide/#sparql_T9_Endpoint
A test/selenium_ide/#wsparql_T1_Config
A test/selenium_ide/#wsparql_T1_Default
R test/selenium_ide/#wsparql_T1_Endpoint
A test/selenium_ide/lua_core
A test/selenium_ide/lua_function
A test/selenium_ide/lua_instance
A test/selenium_ide/special_config_T1
M test/selenium_ide/special_sparql_T1
A test/selenium_ide/special_sparql_T2
A test/selenium_ide/special_sparql_T3
M test/selenium_ide/suite_tests
70 files changed, 5,219 insertions(+), 468 deletions(-)

Approvals:
  Karima Rafes: Verified; Looks good to me, approved




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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb65c4720019fdc62c34f81e0d33f125011a40f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LinkedWiki
Gerrit-Branch: master
Gerrit-Owner: Karima Rafes 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: Karima Rafes 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add JSHint

2016-08-18 Thread Felipe Schenone (Code Review)
Felipe Schenone has uploaded a new change for review.

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

Change subject: Add JSHint
..

Add JSHint

- Add .jshintrc file for code quality
- Very minor fixes

Change-Id: I9a93a48487bf94e3bdf4b02bbbdf0446b102a461
---
A .jshintrc
M proveit.js
2 files changed, 24 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt 
refs/changes/76/305576/1

diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 000..b9e5076
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,22 @@
+{
+   // Enforcing
+   "bitwise": true,
+   "eqeqeq": true,
+   "esversion": 3,
+   "freeze": true,
+   "futurehostile": true,
+   "latedef": "nofunc",
+   "noarg": true,
+   "nonew": true,
+   "strict": false,
+   "undef": true,
+   "unused": true,
+
+   // Environment
+   "browser": true,
+
+   "globals": {
+   "mediaWiki": false,
+   "jQuery": false
+   }
+}
\ No newline at end of file
diff --git a/proveit.js b/proveit.js
index 9ee4a3c..d8273f5 100755
--- a/proveit.js
+++ b/proveit.js
@@ -351,7 +351,7 @@
'name': 'wpChangeTags',
'value': tag
});
-   $( '#editform' ).append( tagInput );
+   $( '#editform' ).prepend( tagInput );
},
 
/**
@@ -662,7 +662,7 @@
 * @return {object}
 */
this.getRegisteredParams = function () {
-   var formattedNamespaces = mw.config.get( 
'wgFormattedNamespaces' );
+   var formattedNamespaces = mw.config.get( 
'wgFormattedNamespaces' ),
templateNamespace = formattedNamespaces[10];
return proveit.templates[ templateNamespace + ':' + 
this.template ];
};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a93a48487bf94e3bdf4b02bbbdf0446b102a461
Gerrit-PatchSet: 1
Gerrit-Project: wikipedia/gadgets/ProveIt
Gerrit-Branch: master
Gerrit-Owner: Felipe Schenone 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: [WIP] Implement page props in RDF

2016-08-18 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: [WIP] Implement page props in RDF
..

[WIP] Implement page props in RDF

Change-Id: I95868d6ae75c4ebf98ff414200fcdcc2155488f1
Bug: T129046
---
M repo/config/Wikibase.default.php
M repo/includes/Dumpers/DumpGenerator.php
M repo/includes/Dumpers/RdfDumpGenerator.php
M repo/includes/LinkedData/EntityDataSerializationService.php
M repo/includes/Rdf/RdfBuilder.php
M repo/includes/Rdf/RdfProducer.php
M repo/includes/Rdf/RdfVocabulary.php
M repo/includes/WikibaseRepo.php
M repo/maintenance/dumpRdf.php
M repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php
M repo/tests/phpunit/includes/Rdf/RdfBuilderTest.php
11 files changed, 211 insertions(+), 45 deletions(-)


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

diff --git a/repo/config/Wikibase.default.php b/repo/config/Wikibase.default.php
index df2305b..078c474 100644
--- a/repo/config/Wikibase.default.php
+++ b/repo/config/Wikibase.default.php
@@ -183,4 +183,10 @@
'http://www.wikidata.org/entity/Q3359' => 'triton',
'http://www.wikidata.org/entity/Q339' => 'pluto'
],
+
+// Map between page properties and Wikibase predicates
+   'pagePropertiesRdf' => [
+   'wb-sitelinks' => 'sitelinks',
+   'wb-claims' => 'claims'
+   ]
 ];
diff --git a/repo/includes/Dumpers/DumpGenerator.php 
b/repo/includes/Dumpers/DumpGenerator.php
index 5a1a31d..65f6323 100644
--- a/repo/includes/Dumpers/DumpGenerator.php
+++ b/repo/includes/Dumpers/DumpGenerator.php
@@ -29,7 +29,7 @@
 * @var int The max number of entities to process in a single batch.
 *  Also controls the interval for progress reports.
 */
-   private $batchSize = 100;
+   protected $batchSize = 100;
 
/**
 * @var resource File handle for output
@@ -214,6 +214,14 @@
}
 
/**
+* Do something before dumping a batch of entities
+* @param EntityId[] $entities
+*/
+   protected function preBatchDump( $entities ) {
+   $this->entityPrefetcher->prefetch( $entities );
+   }
+
+   /**
 * Do something before dumping entity
 *
 * @param int $dumpCount
@@ -273,7 +281,8 @@
$toLoad[] = $entityId;
}
}
-   $this->entityPrefetcher->prefetch( $toLoad );
+
+   $this->preBatchDump( $toLoad );
 
foreach ( $toLoad as $entityId ) {
try {
diff --git a/repo/includes/Dumpers/RdfDumpGenerator.php 
b/repo/includes/Dumpers/RdfDumpGenerator.php
index 673db5f..7bab7c3 100644
--- a/repo/includes/Dumpers/RdfDumpGenerator.php
+++ b/repo/includes/Dumpers/RdfDumpGenerator.php
@@ -11,6 +11,7 @@
 use Wikibase\DataModel\Services\Entity\EntityPrefetcher;
 use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup;
 use Wikibase\Lib\Store\EntityRevisionLookup;
+use Wikibase\Lib\Store\EntityTitleLookup;
 use Wikibase\Lib\Store\StorageException;
 use Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup;
 use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException;
@@ -49,14 +50,25 @@
private $timestamp;
 
/**
-* @param resource $out
-* @param EntityRevisionLookup $lookup Must not resolve redirects
-* @param RdfBuilder $rdfBuilder
-* @param EntityPrefetcher $entityPrefetcher
-*
-* @throws InvalidArgumentException
+* @var \PageProps
 */
-   public function __construct( $out, EntityRevisionLookup $lookup, 
RdfBuilder $rdfBuilder, EntityPrefetcher $entityPrefetcher ) {
+   private $pageProps;
+
+   /**
+* @var EntityTitleLookup
+*/
+   private $titleLookup;
+
+   /**
+* @param resource $out
+* @param EntityRevisionLookup $lookup Must not resolve redirects
+* @param RdfBuilder   $rdfBuilder
+* @param EntityPrefetcher $entityPrefetcher
+* @param EntityTitleLookup$titleLookup
+*/
+   public function __construct( $out, EntityRevisionLookup $lookup, 
RdfBuilder $rdfBuilder,
+EntityPrefetcher $entityPrefetcher,
+EntityTitleLookup $titleLookup ) {
parent::__construct( $out, $entityPrefetcher );
if ( $lookup instanceof RedirectResolvingEntityLookup ) {
throw new InvalidArgumentException( '$lookup must not 
resolve redirects!' );
@@ -64,12 +76,17 @@
 
$this->rdfBuilder = $rdfBuilder;
$this->entityRevisionLookup = $lookup;
+   $this->titleLookup = $titleLookup;
}
 
/**
 * Do something before dumping data
 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Send new account and password reset emails post-commit

2016-08-18 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Send new account and password reset emails post-commit
..

Send new account and password reset emails post-commit

Change-Id: I8f1bd3e882e20fefa5ce0167202d511aa066cfe2
---
M includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
1 file changed, 9 insertions(+), 2 deletions(-)


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

diff --git a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php 
b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
index 46cbab5..ed94c1a 100644
--- a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
+++ b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php
@@ -303,7 +303,11 @@
);
 
if ( $sendMail ) {
-   $this->sendPasswordResetEmail( $req );
+   // Send email after DB commit
+   $dbw->onTransactionIdle( function () use ( $req ) {
+   /** @var TemporaryPasswordAuthenticationRequest 
$req */
+   $this->sendPasswordResetEmail( $req );
+   } );
}
}
 
@@ -370,7 +374,10 @@
$this->providerChangeAuthenticationData( $req );
 
if ( $mailpassword ) {
-   $this->sendNewAccountEmail( $user, $creator, 
$req->password );
+   // Send email after DB commit
+   wfGetDB( DB_MASTER )->onTransactionIdle( function () 
use ( $user, $creator, $req ) {
+   $this->sendNewAccountEmail( $user, $creator, 
$req->password );
+   } );
}
 
return $mailpassword ? 'byemail' : null;

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Restrict local upload on ar.wikipedia

2016-08-18 Thread Dereckson (Code Review)
Dereckson has uploaded a new change for review.

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

Change subject: Restrict local upload on ar.wikipedia
..

Restrict local upload on ar.wikipedia

The Arabic Wikipedia community wants to restrict local upload.

Only the following groups will now be allowed to upload files:
  - editor
  - reviewer
  - uploader (a group dedicated to upload)
  - sysop

Upload will point to Commons' upload wizard, set in Arabic.

Bug: T142450
Change-Id: I2dbc88295beb296002a4c4f2a5f91fbe1a3e1401
---
M wmf-config/InitialiseSettings.php
1 file changed, 34 insertions(+), 1 deletion(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 0a842d6..05c8f9a 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -1275,6 +1275,7 @@
 
// Individual wikis
// NOTE: Use relative paths for same-wiki links so the SSL converter 
can tweak them correctly
+   'arwiki' => 
'//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=ar', // T142450
'aswiki' => '/wiki/ৱিকিপিডিয়া:ফাইল_আপল’ড_বিশেষজ্ঞ',
'azbwiki' => 
'//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=azb', // T106305
'bgwiki' => '/wiki/MediaWiki:Uploadtext', // T16836
@@ -7424,8 +7425,40 @@
],
'arwiki' => [
'autoconfirmed' => [ 'patrol' => true ],
-   'editor' => [ 'movefile' => true ], // T131249
+   'editor' => [
+   'movefile' => true, // T131249
+   'upload' => true, // T142450
+   'reupload' => true,
+   'reupload-own' => true,
+   'reupload-shared' => true,
+   ],
'rollbacker' => [ 'rollback' => true ],
+
+   // Uploads are restricted to a uploader group - T142450
+   'user' => [
+   'upload' => false,
+   'reupload' => false,
+   'reupload-own' => false,
+   'reupload-shared' => false,
+   ],
+   'autoconfirmed' => [
+   'upload' => false,
+   'reupload' => false,
+   'reupload-own' => false,
+   'reupload-shared' => false,
+   ],
+   'uploader' => [
+   'upload' => true,
+   'reupload' => true,
+   'reupload-own' => true,
+   'reupload-shared' => true,
+   ],
+   'reviewer' => [
+   'upload' => true,
+   'reupload' => true,
+   'reupload-own' => true,
+   'reupload-shared' => true,
+   ],
],
'+arwikisource' => [
'autopatrolled' => [ 'autopatrol' => true ],

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Add bold names for mentions status notifications

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add bold names for mentions status notifications
..


Add bold names for mentions status notifications

Bug: T140224
Change-Id: If4737a627c884f358bdc619849d6c9a8e6d20009
---
M i18n/en.json
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  Jakob: Checked; Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 658cd3d..c04a2c2 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -149,13 +149,13 @@
"notification-header-mention-agent-talkpage-nosection": "$1 
{{GENDER:$2|mentioned}} {{GENDER:$3|you}} on 
{{GENDER:$2|his|her|their}} talk page.",
"notification-header-mention-article-talkpage": "$1 
{{GENDER:$2|mentioned}} {{GENDER:$3|you}} on the $4 talk page 
in \"$5\".",
"notification-header-mention-article-talkpage-nosection": "$1 
{{GENDER:$2|mentioned}} {{GENDER:$3|you}} on the $4 talk 
page.",
-   "notification-header-mention-failure-user-unknown": "{{GENDER:$2|Your}} 
mention of $3 was not sent because the user was not found.",
-   "notification-header-mention-failure-user-anonymous": 
"{{GENDER:$2|Your}} mention of $3 was not sent because the user is anonymous.",
+   "notification-header-mention-failure-user-unknown": "{{GENDER:$2|Your}} 
mention of $3 was not sent because the user was not found.",
+   "notification-header-mention-failure-user-anonymous": 
"{{GENDER:$2|Your}} mention of $3 was not sent because the 
user is anonymous.",
"notification-header-mention-failure-too-many": "{{GENDER:$2|Your}} 
mentions were not sent because they exceeded the limit of $3.",
"notification-header-mention-failure-bundle": "{{PLURAL:$3|A mention|$3 
mentions}} {{GENDER:$2|you made}} on the $4 talk page 
{{PLURAL:$3|could}} not be sent.",
"notification-compact-header-mention-failure-user-unknown": 
"Username does not exist: $1",
"notification-compact-header-mention-failure-user-anonymous": 
"IPs cannot be mentioned: $1",
-   "notification-header-mention-success": "{{GENDER:$2|Your}} mention of 
$3 was sent.",
+   "notification-header-mention-success": "{{GENDER:$2|Your}} mention of 
$3 was sent.",
"notification-header-mention-success-bundle": "{{PLURAL:$3|A mention|$3 
mentions}} {{GENDER:$2|you made}} on the $4 talk page 
{{PLURAL:$3|were}} sent.",
"notification-compact-header-mention-success": "{{GENDER:$2|You 
mentioned}}: $3",
"notification-header-user-rights-add-only": "{{GENDER:$4|Your}} user 
rights were {{GENDER:$1|changed}}. You have been added to: $2.",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If4737a627c884f358bdc619849d6c9a8e6d20009
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Gabriel Birke 
Gerrit-Reviewer: Jakob 
Gerrit-Reviewer: Kai Nissen (WMDE) 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: Tobias Gritschacher 
Gerrit-Reviewer: WMDE-leszek 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Revert "AuthManager: Commit transaction after auto-creating ...

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert "AuthManager: Commit transaction after auto-creating a 
user"
..


Revert "AuthManager: Commit transaction after auto-creating a user"

* 81be9512a022 should obviate the main desire for this.
  The normal commit step is now relied upon again.
* 820f5d6ce57f and a26fbb67054 enforce DBO_TRX transactions.
* Committing the implicit transaction(s) prematurely is bad
  for web request and cross-DB transactionality. Only code
  that has clear outermost DB context (e.g. jobs/maintenance)
  should be doing things like this as it becomes hard to reason
  about (e.g. how much the request/caller needs atomicity
  or whether there is an outer (start|end)Atomic section).

This reverts commit 83c66caa0831086db7c2033ddda38106584060d0.

Change-Id: I1a5533b239e53f2089f239651c6fdf97e51c9062
---
M includes/auth/AuthManager.php
1 file changed, 1 insertion(+), 5 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php
index 50e370e..b4ce16f 100644
--- a/includes/auth/AuthManager.php
+++ b/includes/auth/AuthManager.php
@@ -1688,12 +1688,8 @@
$logEntry->setParameters( [
'4::userid' => $user->getId(),
] );
-   $logid = $logEntry->insert();
+   $logEntry->insert();
}
-
-   // Commit database changes, so even if something else later 
blows up
-   // the newly-created user doesn't get lost.
-   wfGetLBFactory()->commitMasterChanges( __METHOD__ );
 
$trxProfiler->setSilenced( false );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a5533b239e53f2089f239651c6fdf97e51c9062
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: Zppix 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikidata...gui[master]: i18n for menus and short url to result

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: i18n for menus and short url to result
..


i18n for menus and short url to result

Bug: T136058
Change-Id: I34c368e64e404bba67d6e5ef873d0f7d1c5ff539
---
M i18n/en.json
M i18n/qqq.json
M index.html
M wikibase/queryService/ui/App.js
4 files changed, 48 insertions(+), 11 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 9752dd0..61f8599 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -16,10 +16,22 @@
 "wdqs-app-button-display": "Display",
 "wdqs-app-button-download": "Download",
 "wdqs-app-button-link": "Link",
+"wdqs-app-help-feedback": "Give Feedback!",
+"wdqs-app-help-manual": "User Manual",
+"wdqs-app-help-examples": "Example Queries",
+"wdqs-app-help-datamodel": "RDF Data Model",
+"wdqs-app-help-prefixes": "List of prefixes",
 "wdqs-app-footer-help": "Press [CTRL-SPACE] to activate auto 
completion.",
 "wdqs-app-footer-updated-before": "Data updated",
 "wdqs-app-footer-updated-after": "ago",
+"wdqs-app-result-shorturl": "Short URL to result",
+"wdqs-app-result-shorturl-title": "Short URL to this result",
+"wdqs-app-result-embed": "Embed result",
+"wdqs-app-result-endpoint": "SPARQL endpoint",
+"wdqs-app-result-endpoint-title": "Link to the SPARQL endpoint returning 
the result",
+"wdqs-app-shorturl-page-title": "Short URL to this page",
 "wdqs-app-editor-placeholder": "(Input a SPARQL query or choose a query 
example)",
+"wdqs-app-editor-addprefixes": "Add Standard Prefixes",
 "wdqs-dialog-examples-preview-query": "Preview query",
 "wdqs-dialog-examples-preview-result": "Preview result",
 "wdqs-ve-find": "Find",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index f31db8c..bd88ad5 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -18,10 +18,22 @@
"wdqs-app-button-display": "Button display result as table, image, 
...\n{{Identical|Display}}",
"wdqs-app-button-download": "Button download 
result\n{{Identical|Download}}",
"wdqs-app-button-link": "Button get link to query\n{{Identical|Link}}",
+"wdqs-app-help-feedback": "Button message in help dropdown",
+"wdqs-app-help-manual": "Button message in help dropdown",
+"wdqs-app-help-examples": "Button message in help dropdown",
+"wdqs-app-help-datamodel": "Button message in help dropdown",
+"wdqs-app-help-prefixes": "Button message in help dropdown",
"wdqs-app-footer-help": "Help message at the footer of the editor",
"wdqs-app-footer-updated-before": "Label before date string at the 
footer",
"wdqs-app-footer-updated-after": "Label after date string at the 
footer.\n\n''[https://phabricator.wikimedia.org/T143005 Bug 
reported]''\n\n{{Identical|Ago}}",
+   "wdqs-app-result-shorturl": "Link message in the footer link dropdown",
+"wdqs-app-result-shorturl-title": "Title of link message in the footer 
link dropdown",
+"wdqs-app-result-embed": "Link message in the footer link dropdown",
+"wdqs-app-result-endpoint": "Link message in the footer link dropdown",
+"wdqs-app-result-endpoint-title": "Title of link message in the footer 
link dropdown",
+"wdqs-app-shorturl-page-title": "Title of link message on the left side of 
the editor",
"wdqs-app-editor-placeholder": "Placeholder message in editor box",
+"wdqs-app-editor-addprefixes": "Butten message in the prefix menu",
"wdqs-dialog-examples-preview-query": "Label to preview query in 
example dialog",
"wdqs-dialog-examples-preview-result": "Label to preview result in 
example dialog",
"wdqs-ve-find": "Label to find some item\n{{Identical|Find}}",
diff --git a/index.html b/index.html
index 3209857..9a9cebe 100644
--- a/index.html
+++ b/index.html
@@ -57,7 +57,7 @@



-   Add Standard Prefixes
+   



@@ -73,13 +73,13 @@



-   https://www.mediawiki.org/w/index.php?title=Talk:Wikidata_query_service=edit=new;>Give
 Feedback!
+   https://www.mediawiki.org/w/index.php?title=Talk:Wikidata_query_service=edit=new;
 data-i18n="wdqs-app-help-feedback">
   

[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Mobile action menu should stick to bottom of screen

2016-08-18 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

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

Change subject: Mobile action menu should stick to bottom of screen
..

Mobile action menu should stick to bottom of screen

Just like we do in the mobile popup, the menu should be accessible
in mobile clicks/taps by being "stuck" at the bottom of the screen.

Bug: T142013
Change-Id: I730216e717c2a02ad98bbcc28f66b13c1cbe29ed
---
M Resources.php
A modules/styles/mw.echo.ui.overlay.minerva.less
2 files changed, 29 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/72/305572/1

diff --git a/Resources.php b/Resources.php
index d2b0fa9..ff147b9 100644
--- a/Resources.php
+++ b/Resources.php
@@ -101,6 +101,9 @@
'vector' => array(
'styles/mw.echo.ui.overlay.vector.less',
),
+   'minerva' => array(
+   'styles/mw.echo.ui.overlay.minerva.less',
+   ),
),
'dependencies' => array(
'ext.echo.logger',
diff --git a/modules/styles/mw.echo.ui.overlay.minerva.less 
b/modules/styles/mw.echo.ui.overlay.minerva.less
new file mode 100644
index 000..9007ab6
--- /dev/null
+++ b/modules/styles/mw.echo.ui.overlay.minerva.less
@@ -0,0 +1,26 @@
+/* In mobile, overlay is positioned at the bottom */
+.mw-echo-ui-overlay {
+   position: fixed;
+   bottom: 0;
+   right: 0;
+   left: 0;
+   top: auto;
+
+   .mw-echo-ui-actionMenuPopupWidget-menu {
+   padding: 0.5em;
+   font-size: 1.5em;
+   box-shadow: none;
+   border: 1px solid #666;
+   // Override the positioning of the menu
+   // so it is "stuck" on the bottom of the
+   // notification overlay panel
+   position: static !important;
+   bottom: 0 !important;
+   left: 0 !important;
+   width: 100% !important;
+   max-width: none !important;
+   height: auto !important;
+   top: auto !important;
+   }
+}
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I730216e717c2a02ad98bbcc28f66b13c1cbe29ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

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


[MediaWiki-commits] [Gerrit] mediawiki...Contributors[master]: To have an API module to access the contributors data

2016-08-18 Thread Devirk (Code Review)
Devirk has uploaded a new change for review.

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

Change subject: To have an API module to access the contributors data
..

To have an API module to access the contributors data

Bug: T134941
Change-Id: Iba01eee9b88a9d0b37a81996ca6e09b677070dda
---
A api/ApiQueryContributors.php
M extension.json
2 files changed, 59 insertions(+), 1 deletion(-)


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

diff --git a/api/ApiQueryContributors.php b/api/ApiQueryContributors.php
new file mode 100644
index 000..53236eb
--- /dev/null
+++ b/api/ApiQueryContributors.php
@@ -0,0 +1,54 @@
+extractRequestParams();
+   $this->buildDbQuery( $params );
+   $res = $this->select( __METHOD__ );
+
+   // API result
+   $result = $this->getResult();
+
+   foreach ( $res as $row ) {
+
+   $result->addValue( 'query', $this->getModuleName() , 
$row->cn_user_text , $row->cn_revision_count );
+   }
+   }
+   private function buildDbQuery( array $params ) {
+   $this->addTables( array( 'contributors' , 'page' ) );
+   $this->addFields(
+   array(
+   'Username' => 'cn_user_text',
+   'Number of revisions' => 'cn_revision_count',
+   'Date of first edit' => 'cn_first_edit',
+   'Date of last edit' => 'cn_last_edit'
+   )
+   );
+   $this->addJoinConds( array(
+   'page' => array(
+   'LEFT JOIN',
+   array( 'cn_page_id = page_id' )
+   )
+   ) );
+   $this->addWhereFld( 'page_title', $params['title'] );
+   }
+   public function getAllowedParams() {
+   return array(
+   'title' => array(
+   ApiBase::PARAM_TYPE => 'string',
+   ApiBase::PARAM_REQUIRED => true,
+   )
+   );
+   }
+   public function getExamplesMessages() {
+   return array(
+   
'action=query=json=contributors=Main+Page'
+   => 'apihelp-query+contributors-example-1',
+   );
+   }
+}
\ No newline at end of file
diff --git a/extension.json b/extension.json
index bc2b31e..4414bcb 100644
--- a/extension.json
+++ b/extension.json
@@ -13,6 +13,9 @@
"SpecialPages": {
"Contributors": "SpecialContributors"
},
+   "APIListModules": {
+   "contributors": "ApiQueryContributors"
+   },
"MessagesDirs": {
"Contributors": [
"i18n"
@@ -26,7 +29,8 @@
"Contributors": "includes/Contributors.php",
"SpecialContributors": "includes/SpecialContributors.php",
"ContributorsHooks": "includes/ContributorsHooks.php",
-   "ContributorsTablePager":"includes/ContributorsTablePager.php"
+   "ContributorsTablePager":"includes/ContributorsTablePager.php",
+   "ApiQueryContributors":"api/ApiQueryContributors.php"
},
"Hooks": {
"PageContentSaveComplete": [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba01eee9b88a9d0b37a81996ca6e09b677070dda
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Contributors
Gerrit-Branch: master
Gerrit-Owner: Devirk 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Revert "Work around T87871 to avoid double-loading OOjs UI P...

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Work around T87871 to avoid double-loading OOjs UI PHP 
styles"
..


Revert "Work around T87871 to avoid double-loading OOjs UI PHP styles"

We no longer need this workaround after T87871 was fixed.

This reverts commit e65186c443a5887024da50b66fe92bcf267a0752.

Change-Id: Ieba46fb07e1e92d9a6a86cb84d0ecaf208312baa
---
M includes/OutputPage.php
M resources/ResourcesOOUI.php
D resources/src/oojs-ui-styles-skip.js
3 files changed, 3 insertions(+), 20 deletions(-)

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



diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index f5a37d4..374e7af 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -3813,9 +3813,6 @@
'oojs-ui.styles.textures',
'mediawiki.widgets.styles',
] );
-   // Used by 'skipFunction' of the four 'oojs-ui.styles.*' 
modules. Please don't treat this as a
-   // public API or you'll be severely disappointed when T87871 is 
fixed and it disappears.
-   $this->addMeta( 'X-OOUI-PHP', '1' );
}
 
/**
diff --git a/resources/ResourcesOOUI.php b/resources/ResourcesOOUI.php
index b31fe82..c3a287d 100644
--- a/resources/ResourcesOOUI.php
+++ b/resources/ResourcesOOUI.php
@@ -68,6 +68,9 @@
'es5-shim',
'oojs',
'oojs-ui-core.styles',
+   'oojs-ui.styles.icons',
+   'oojs-ui.styles.indicators',
+   'oojs-ui.styles.textures',
'mediawiki.language',
],
'targets' => [ 'desktop', 'mobile' ],
@@ -78,14 +81,6 @@
'styles' => 'resources/src/oojs-ui-local.css', // HACK, see 
inside the file
'skinStyles' => $getSkinSpecific( 'core' ),
'targets' => [ 'desktop', 'mobile' ],
-   // ResourceLoaderImageModule doesn't support 'skipFunction', so 
instead we set this up so that
-   // this module is skipped together with its dependencies. 
Nothing else depends on these modules.
-   'dependencies' => [
-   'oojs-ui.styles.icons',
-   'oojs-ui.styles.indicators',
-   'oojs-ui.styles.textures',
-   ],
-   'skipFunction' => 'resources/src/oojs-ui-styles-skip.js',
];
 
// Additional widgets and layouts module.
diff --git a/resources/src/oojs-ui-styles-skip.js 
b/resources/src/oojs-ui-styles-skip.js
deleted file mode 100644
index 57c905a..000
--- a/resources/src/oojs-ui-styles-skip.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/*!
- * Skip function for OOjs UI PHP style modules.
- *
- * The `` is added to pages by 
OutputPage::enableOOUI().
- *
- * Looking for elements in the DOM might be expensive, but it's probably 
better than double-loading
- * 200 KB of CSS with embedded images because of bug T87871.
- */
-return !!jQuery( 'meta[name="X-OOUI-PHP"]' ).length;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieba46fb07e1e92d9a6a86cb84d0ecaf208312baa
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ResourceLoaderImageModule: Mark as style-only

2016-08-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: ResourceLoaderImageModule: Mark as style-only
..


ResourceLoaderImageModule: Mark as style-only

Follow-up to a464d1d41d69f12fe93146629254f6c785f43d81.

Bug: T87871
Change-Id: Iff307af1cf550c02bea94d596f316b30da259900
---
M includes/resourceloader/ResourceLoaderImageModule.php
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/includes/resourceloader/ResourceLoaderImageModule.php 
b/includes/resourceloader/ResourceLoaderImageModule.php
index 3b3bdf7..6cdab1b 100644
--- a/includes/resourceloader/ResourceLoaderImageModule.php
+++ b/includes/resourceloader/ResourceLoaderImageModule.php
@@ -455,4 +455,11 @@
$this->loadFromDefinition();
return $this->position;
}
+
+   /**
+* @return string
+*/
+   public function getType() {
+   return self::LOAD_STYLES;
+   }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff307af1cf550c02bea94d596f316b30da259900
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove unused import

2016-08-18 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Remove unused import
..

Remove unused import

Change-Id: Ia8135ddca9789142804b945524236c3bddf80feb
---
M repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php 
b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
index 4e419c8..e855d66 100644
--- a/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
+++ b/repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
@@ -9,7 +9,6 @@
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\ItemId;
-use Wikibase\DataModel\LegacyIdInterpreter;
 use Wikibase\EntityRevision;
 use Wikibase\Lib\Store\BadRevisionException;
 use Wikibase\Lib\Store\EntityRevisionLookup;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8135ddca9789142804b945524236c3bddf80feb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Base class for dbs, they can create tables

2016-08-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Base class for dbs, they can create tables
..

Base class for dbs, they can create tables

Move common functionality for DamagedDatabase and PendingDatabase into
base SmashPigDatabase class. Add a createTable() method and use it in
test setup rather than referencing paths. Rearrange sql files to make
it easy to find the driver-specific script.

Also change default database name from pending to smashpig

Could do like the PDO PHP-Queue backend and try creating the table on
insert errors.

Change-Id: I49b15430c3a2bebecaebfd4f0ddb9437ee9a32f1
---
M Core/DataStores/DamagedDatabase.php
M Core/DataStores/PendingDatabase.php
A Core/DataStores/SmashPigDatabase.php
M PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
R Schema/mysql/001_CreatePendingTable.sql
R Schema/mysql/002_CreateDamagedTable.sql
R Schema/sqlite/001_CreatePendingTable.sql
R Schema/sqlite/002_CreateDamagedTable.sql
M SmashPig.yaml
M Tests/DamagedDatabaseTest.php
M Tests/PendingDatabaseTest.php
D Tests/PendingDatabaseTestConfiguration.php
M Tests/QueueConsumerTest.php
A Tests/SmashPigDatabaseTestConfiguration.php
R Tests/data/config_smashpig_db.yaml
15 files changed, 103 insertions(+), 100 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/68/305568/1

diff --git a/Core/DataStores/DamagedDatabase.php 
b/Core/DataStores/DamagedDatabase.php
index 312ffa6..d6069ef 100644
--- a/Core/DataStores/DamagedDatabase.php
+++ b/Core/DataStores/DamagedDatabase.php
@@ -9,32 +9,7 @@
 /**
  * Data store containing messages which were not successfully processed
  */
-class DamagedDatabase {
-
-   /**
-* @var PDO
-* We do the silly singleton thing for convenient testing with in-memory
-* databases that would otherwise not be shared between components.
-*/
-   protected static $db;
-
-   protected function __construct() {
-   if ( !self::$db ) {
-   $config = Context::get()->getConfiguration();
-   self::$db = $config->object( 'data-store/damaged-db' );
-   }
-   }
-
-   /**
-* @return PDO
-*/
-   public function getDatabase() {
-   return self::$db;
-   }
-
-   public static function get() {
-   return new DamagedDatabase();
-   }
+class DamagedDatabase extends SmashPigDatabase {
 
protected function validateMessage( $message ) {
if (
@@ -57,7 +32,10 @@
 * @throws SmashPigException if insert fails
 */
public function storeMessage(
-   $message, $originalQueue, $error = '', $retryDate = null
+   $message,
+   $originalQueue,
+   $error = '',
+   $retryDate = null
) {
$this->validateMessage( $message );
 
@@ -95,6 +73,7 @@
 
$insert = "INSERT INTO damaged ( $fieldList )
VALUES ( $paramList );";
+
$prepared = self::$db->prepare( $insert );
 
foreach ( $dbRecord as $field => $value ) {
@@ -117,14 +96,17 @@
 * @return array|null Records with retry_date prior to now
 */
public function fetchRetryMessages( $limit ) {
-   $prepared = self::$db->prepare( '
+   $prepared = self::$db->prepare(
+   '
SELECT * FROM damaged
WHERE retry_date < :now
ORDER BY retry_date ASC
LIMIT ' . $limit
);
$prepared->bindValue(
-   ':now', UtcDate::getUtcDatabaseString(), PDO::PARAM_STR
+   ':now',
+   UtcDate::getUtcDatabaseString(),
+   PDO::PARAM_STR
);
$prepared->execute();
$rows = $prepared->fetchAll( PDO::FETCH_ASSOC );
@@ -140,7 +122,8 @@
 * @param array $message
 */
public function deleteMessage( $message ) {
-   $prepared = self::$db->prepare( '
+   $prepared = self::$db->prepare(
+   '
DELETE FROM damaged
WHERE id = :id'
);
@@ -182,4 +165,12 @@
$message['original_queue'] = $row['original_queue'];
return $message;
}
+
+   protected function getConfigKey() {
+   return 'data-store/damaged-db';
+   }
+
+   protected function getTableScriptFile() {
+   return '002_CreateDamagedTable.sql';
+   }
 }
diff --git a/Core/DataStores/PendingDatabase.php 
b/Core/DataStores/PendingDatabase.php
index 598499b..cc8b313 100644
--- a/Core/DataStores/PendingDatabase.php
+++ 

[MediaWiki-commits] [Gerrit] mediawiki...LinkedWiki[master]: Refactoring/cleaning and give a new configuration system

2016-08-18 Thread Karima Rafes (Code Review)
Karima Rafes has uploaded a new change for review.

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

Change subject: Refactoring/cleaning and give a new configuration system
..

Refactoring/cleaning and give a new configuration system

- Refactoring/cleaning  the code
- Upgrade loading / registration of LinkedWiki extension
- Insert tests for selenium IDE (and delete the old tests)
- Add an experimental lua Class

BUG:T142563
BUG:T142572
Change-Id: Icb65c4720019fdc62c34f81e0d33f125011a40f9
---
M LinkedWiki.php
A LinkedWikiConfig.php
M README
M extension.json
A i18n/linkedwikiconfig/en.json
A i18n/linkedwikiconfig/fr.json
M i18n/sparqlquery/en.json
M i18n/sparqlquery/fr.json
A lua/LinkedWiki.lua
A lua/LinkedWiki.lua.php
A old/LinkedWiki_old.lua
M parser/SparqlParser.php
M parser/ToolsParser.php
M parser/WSparqlParser.php
A specialpages/SpecialLinkedWikiConfig.alias.php
A specialpages/SpecialLinkedWikiConfig.i18n.php
A specialpages/SpecialLinkedWikiConfig.php
M specialpages/SpecialSparqlFlintEditor.php
M specialpages/SpecialSparqlQuery.php
A storageMethod/DatabaseExampleMethod.php
A storageMethod/SimpleStorageMethod.php
A storageMethod/StorageInGraphMethod.php
A storageMethod/StorageMethodAbstract.php
A storageMethod/WikidataStorageMethod.php
M tag/LwgraphTag.php
A test/lua/test_core.lua
A test/lua/test_functions.lua
A test/lua/test_instance.lua
C test/selenium_ide/#sparql_T10_Config
C test/selenium_ide/#sparql_T10_Default
R test/selenium_ide/#sparql_T10_Endpoint
C test/selenium_ide/#sparql_T11_Config
C test/selenium_ide/#sparql_T11_Default
R test/selenium_ide/#sparql_T11_Endpoint
C test/selenium_ide/#sparql_T12_Config
C test/selenium_ide/#sparql_T12_Default
R test/selenium_ide/#sparql_T12_Endpoint
C test/selenium_ide/#sparql_T1_Config
R test/selenium_ide/#sparql_T1_Default
R test/selenium_ide/#sparql_T1_Endpoint
C test/selenium_ide/#sparql_T2_Config
C test/selenium_ide/#sparql_T4_Config
C test/selenium_ide/#sparql_T4_Default
C test/selenium_ide/#sparql_T4_Endpoint
C test/selenium_ide/#sparql_T5_Config
C test/selenium_ide/#sparql_T5_Default
R test/selenium_ide/#sparql_T5_Endpoint
C test/selenium_ide/#sparql_T6_Config
C test/selenium_ide/#sparql_T6_Default
R test/selenium_ide/#sparql_T6_Endpoint
C test/selenium_ide/#sparql_T7_Config
C test/selenium_ide/#sparql_T7_Default
R test/selenium_ide/#sparql_T7_Endpoint
C test/selenium_ide/#sparql_T8_Config
C test/selenium_ide/#sparql_T8_Default
R test/selenium_ide/#sparql_T8_Endpoint
C test/selenium_ide/#sparql_T9_Config
R test/selenium_ide/#sparql_T9_Default
R test/selenium_ide/#sparql_T9_Endpoint
A test/selenium_ide/#wsparql_T1_Config
A test/selenium_ide/#wsparql_T1_Default
R test/selenium_ide/#wsparql_T1_Endpoint
A test/selenium_ide/lua_core
A test/selenium_ide/lua_function
A test/selenium_ide/lua_instance
A test/selenium_ide/special_config_T1
M test/selenium_ide/special_sparql_T1
A test/selenium_ide/special_sparql_T2
A test/selenium_ide/special_sparql_T3
M test/selenium_ide/suite_tests
70 files changed, 5,219 insertions(+), 468 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LinkedWiki 
refs/changes/67/305567/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb65c4720019fdc62c34f81e0d33f125011a40f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LinkedWiki
Gerrit-Branch: master
Gerrit-Owner: Karima Rafes 

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Simplify table move tests

2016-08-18 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Simplify table move tests
..

Simplify table move tests

Change-Id: I9a139a090253e7f7b6b79836b8f4fd8dbd3d3b0b
---
M tests/ce/ve.ce.Surface.test.js
1 file changed, 22 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/65/305565/1

diff --git a/tests/ce/ve.ce.Surface.test.js b/tests/ce/ve.ce.Surface.test.js
index c76ef6f..3f68b3a 100644
--- a/tests/ce/ve.ce.Surface.test.js
+++ b/tests/ce/ve.ce.Surface.test.js
@@ -2695,7 +2695,7 @@
 } );
 
 QUnit.test( 'special key down: table arrow keys', function ( assert ) {
-   var i, offsets, selection, table, view, model,
+   var i, offsets, expectedSelectionOffsets, selection, table, view, model,
fn = function () {},
tables = {
mergedCells: {
@@ -2719,93 +2719,93 @@
msg: 'Simple move right',
key: 'RIGHT',
selectionOffsets: [ 0, 0 ],
-   expectedSelectionOffsets: [ 1, 0, 1, 0 ]
+   expectedSelectionOffsets: [ 1, 0 ]
},
{
msg: 'Simple move right with tab',
key: 'TAB',
selectionOffsets: [ 0, 0 ],
-   expectedSelectionOffsets: [ 1, 0, 1, 0 ]
+   expectedSelectionOffsets: [ 1, 0 ]
},
{
msg: 'Move right with tab at end wraps to next 
line',
key: 'TAB',
selectionOffsets: [ 5, 0 ],
-   expectedSelectionOffsets: [ 0, 1, 0, 1 ]
+   expectedSelectionOffsets: [ 0, 1 ]
},
{
msg: 'Simple move end',
key: 'END',
selectionOffsets: [ 0, 0 ],
-   expectedSelectionOffsets: [ 5, 0, 5, 0 ]
+   expectedSelectionOffsets: [ 5, 0 ]
},
{
msg: 'Simple move down',
key: 'DOWN',
selectionOffsets: [ 0, 0 ],
-   expectedSelectionOffsets: [ 0, 1, 0, 1 ]
+   expectedSelectionOffsets: [ 0, 1 ]
},
{
msg: 'Simple move page down',
key: 'PAGEDOWN',
selectionOffsets: [ 0, 0 ],
-   expectedSelectionOffsets: [ 0, 6, 0, 6 ]
+   expectedSelectionOffsets: [ 0, 6 ]
},
{
msg: 'Simple move left',
key: 'LEFT',
selectionOffsets: [ 5, 6 ],
-   expectedSelectionOffsets: [ 4, 6, 4, 6 ]
+   expectedSelectionOffsets: [ 4, 6 ]
},
{
msg: 'Simple move left with shift+tab',
key: 'TAB',
shiftKey: true,
selectionOffsets: [ 5, 6 ],
-   expectedSelectionOffsets: [ 4, 6, 4, 6 ]
+   expectedSelectionOffsets: [ 4, 6 ]
},
{
msg: 'Move left with shift+tab at start wraps 
to previous line',
key: 'TAB',
shiftKey: true,
selectionOffsets: [ 0, 1 ],
-   expectedSelectionOffsets: [ 5, 0, 5, 0 ]
+   expectedSelectionOffsets: [ 5, 0 ]
},
{
msg: 'Simple move home',
key: 'HOME',
selectionOffsets: [ 5, 6 ],
-   expectedSelectionOffsets: [ 0, 6, 0, 6 ]
+   expectedSelectionOffsets: [ 0, 6 ]
},
{
msg: 'Simple move page up',
key: 'PAGEUP',
selectionOffsets: [ 5, 6 ],
-   expectedSelectionOffsets: [ 5, 0, 5, 

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Add a new row when tabbing off the end of a table

2016-08-18 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Add a new row when tabbing off the end of a table
..

Add a new row when tabbing off the end of a table

Bug: T119546
Change-Id: I4955977a7287adb71ad9c2763a8d904bb0d14d10
---
M src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js
1 file changed, 22 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/66/305566/1

diff --git a/src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js 
b/src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js
index afb420c..5d8d8a2 100644
--- a/src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js
+++ b/src/ce/keydownhandlers/ve.ce.TableArrowKeyDownHandler.js
@@ -90,7 +90,7 @@
  * @param {number} colOffset how many columns to move
  * @param {boolean} checkDir whether to translate offsets according to ltr 
settings
  * @param {boolean} expand whether to expand the selection or replace it
- * @param {boolean} wrap Wrap to the next/previous row at edges
+ * @param {boolean} wrap Wrap to the next/previous row at edges, insert new 
row at end
  */
 ve.ce.TableArrowKeyDownHandler.static.moveTableSelection = function ( surface, 
rowOffset, colOffset, checkDir, expand, wrap ) {
var tableNode, newSelection,
@@ -104,13 +104,27 @@
if ( !expand && !selection.isSingleCell() ) {
selection = selection.collapseToFrom();
}
-   newSelection = selection.newFromAdjustment(
-   expand ? 0 : colOffset,
-   expand ? 0 : rowOffset,
-   colOffset,
-   rowOffset,
-   wrap
-   );
+
+   function adjust() {
+   newSelection = selection.newFromAdjustment(
+   expand ? 0 : colOffset,
+   expand ? 0 : rowOffset,
+   colOffset,
+   rowOffset,
+   wrap
+   );
+   }
+
+   adjust();
+
+   // If wrapping forwards didn't move, we must be at the end of the table,
+   // so insert a new row and try again
+   if ( wrap && colOffset > 0 && selection.equals( newSelection ) ) {
+   surface.getSurface().execute( 'table', 'insert', 'row', 'after' 
);
+   selection = surface.getModel().getSelection();
+   adjust();
+   }
+
surface.getModel().setSelection( newSelection );
 
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4955977a7287adb71ad9c2763a8d904bb0d14d10
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

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


  1   2   3   4   >