[MediaWiki-commits] [Gerrit] mediawiki...WaitConditionLoop[master]: Add .gitattributes

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

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

Change subject: Add .gitattributes
..

Add .gitattributes

Change-Id: I2a8bc7859af4dfc96898c1cd95238f16cbc73bda
---
A .gitattributes
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/libs/WaitConditionLoop 
refs/changes/45/313645/1

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000..b6fe658
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,10 @@
+.editorconfig export-ignore
+.gitattributes export-ignore
+.gitignore export-ignore
+.gitreview export-ignore
+.travis.yml export-ignore
+Doxyfile export-ignore
+composer.json export-ignore
+phpcs.xml export-ignore
+phpunit.xml.dist export-ignore
+tests/ export-ignore

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a8bc7859af4dfc96898c1cd95238f16cbc73bda
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/libs/WaitConditionLoop
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Better fix for empty change set

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

Change subject: Better fix for empty change set
..


Better fix for empty change set

Change-Id: I3b6d7dabe10949538407714b6f50aec171f6b178
---
M tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
M tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java
2 files changed, 8 insertions(+), 6 deletions(-)

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



diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
index 285069b..611dc55 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
@@ -379,12 +379,8 @@
 for (Future task : tasks) {
 task.get();
 }
-log.debug("Preparing update data took {} ms", 
System.currentTimeMillis() - start);
-if (trueChanges.isEmpty()) {
-log.debug("Got no changes, we're done");
-} else {
-rdfRepository.syncFromChanges(trueChanges, verify);
-}
+log.debug("Preparing update data took {} ms, have {} changes", 
System.currentTimeMillis() - start, trueChanges.size());
+rdfRepository.syncFromChanges(trueChanges, verify);
 updateMeter.mark(trueChanges.size());
 }
 
diff --git 
a/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java
index 27b652d..f7c0f34 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java
@@ -361,6 +361,12 @@
 valueList.addAll(change.getCleanupList());
 }
 
+if (entityIds.isEmpty()) {
+// If we've got no IDs, this means all change retrieval failed
+log.debug("Got no valid changes, we're done");
+return 0;
+}
+
 b.bindUris("entityList", entityIds, uris.entity());
 b.bindStatements("insertStatements", insertStatements);
 b.bindValues("entityStatements", entityStatements);

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

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

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Better fix for empty change set

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

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

Change subject: Better fix for empty change set
..

Better fix for empty change set

Change-Id: I3b6d7dabe10949538407714b6f50aec171f6b178
---
M tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
M tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java
2 files changed, 8 insertions(+), 6 deletions(-)


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

diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
index 285069b..611dc55 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
@@ -379,12 +379,8 @@
 for (Future task : tasks) {
 task.get();
 }
-log.debug("Preparing update data took {} ms", 
System.currentTimeMillis() - start);
-if (trueChanges.isEmpty()) {
-log.debug("Got no changes, we're done");
-} else {
-rdfRepository.syncFromChanges(trueChanges, verify);
-}
+log.debug("Preparing update data took {} ms, have {} changes", 
System.currentTimeMillis() - start, trueChanges.size());
+rdfRepository.syncFromChanges(trueChanges, verify);
 updateMeter.mark(trueChanges.size());
 }
 
diff --git 
a/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java
index 27b652d..f7c0f34 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/rdf/RdfRepository.java
@@ -361,6 +361,12 @@
 valueList.addAll(change.getCleanupList());
 }
 
+if (entityIds.isEmpty()) {
+// If we've got no IDs, this means all change retrieval failed
+log.debug("Got no valid changes, we're done");
+return 0;
+}
+
 b.bindUris("entityList", entityIds, uris.entity());
 b.bindStatements("insertStatements", insertStatements);
 b.bindValues("entityStatements", entityStatements);

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

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

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Skip SPARQL if there's no update items

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

Change subject: Skip SPARQL if there's no update items
..


Skip SPARQL if there's no update items

Change-Id: I191b1d9a7ecbaa362dcb24d16450ac63ac244649
---
M tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
index 7029314..285069b 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
@@ -380,7 +380,11 @@
 task.get();
 }
 log.debug("Preparing update data took {} ms", 
System.currentTimeMillis() - start);
-rdfRepository.syncFromChanges(trueChanges, verify);
+if (trueChanges.isEmpty()) {
+log.debug("Got no changes, we're done");
+} else {
+rdfRepository.syncFromChanges(trueChanges, verify);
+}
 updateMeter.mark(trueChanges.size());
 }
 

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

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

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


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

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

Change subject: Update GUI
..


Update GUI

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

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



diff --git a/gui b/gui
index 5208990..027cd04 16
--- a/gui
+++ b/gui
@@ -1 +1 @@
-Subproject commit 5208990365f0d3a2a1a1f679b2fc31d120889146
+Subproject commit 027cd04ca15a1b35e1f55dab93aa4e455200df58

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

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

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


[MediaWiki-commits] [Gerrit] wikidata...gui-deploy[production]: Merging from 027cd04ca15a1b35e1f55dab93aa4e455200df58:

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

Change subject: Merging from 027cd04ca15a1b35e1f55dab93aa4e455200df58:
..


Merging from 027cd04ca15a1b35e1f55dab93aa4e455200df58:

Localisation updates from https://translatewiki.net.

Change-Id: Ia1a1cd146ee1ca68edd9f488c2a46686cba67d53
---
M embed.html
M i18n/bn.json
M i18n/cyrl.json
M i18n/en.json
M i18n/es.json
M i18n/fi.json
M i18n/fr.json
M i18n/hr.json
M i18n/it.json
M i18n/lb.json
M i18n/nah.json
M i18n/qqq.json
M i18n/sd.json
M i18n/ur.json
M i18n/vi.json
M index.html
A js/embed.wdqs.min.5ab547c60f1f883305a9.js
D js/embed.wdqs.min.90435e31df510e2f3272.js
D js/wdqs.min.1376b54abf4f53f3b2b6.js
A js/wdqs.min.abcdb077194816365695.js
20 files changed, 21 insertions(+), 21 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1a1cd146ee1ca68edd9f488c2a46686cba67d53
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] wikidata...gui-deploy[production]: Merging from 027cd04ca15a1b35e1f55dab93aa4e455200df58:

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

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

Change subject: Merging from 027cd04ca15a1b35e1f55dab93aa4e455200df58:
..

Merging from 027cd04ca15a1b35e1f55dab93aa4e455200df58:

Localisation updates from https://translatewiki.net.

Change-Id: Ia1a1cd146ee1ca68edd9f488c2a46686cba67d53
---
M embed.html
M i18n/bn.json
M i18n/cyrl.json
M i18n/en.json
M i18n/es.json
M i18n/fi.json
M i18n/fr.json
M i18n/hr.json
M i18n/it.json
M i18n/lb.json
M i18n/nah.json
M i18n/qqq.json
M i18n/sd.json
M i18n/ur.json
M i18n/vi.json
M index.html
A js/embed.wdqs.min.5ab547c60f1f883305a9.js
D js/embed.wdqs.min.90435e31df510e2f3272.js
D js/wdqs.min.1376b54abf4f53f3b2b6.js
A js/wdqs.min.abcdb077194816365695.js
20 files changed, 21 insertions(+), 21 deletions(-)


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


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

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

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Skip SPARQL if there's no update items

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

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

Change subject: Skip SPARQL if there's no update items
..

Skip SPARQL if there's no update items

Change-Id: I191b1d9a7ecbaa362dcb24d16450ac63ac244649
---
M tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java 
b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
index 7029314..285069b 100644
--- a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
+++ b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java
@@ -380,7 +380,11 @@
 task.get();
 }
 log.debug("Preparing update data took {} ms", 
System.currentTimeMillis() - start);
-rdfRepository.syncFromChanges(trueChanges, verify);
+if (trueChanges.isEmpty()) {
+log.debug("Got no changes, we're done");
+} else {
+rdfRepository.syncFromChanges(trueChanges, verify);
+}
 updateMeter.mark(trueChanges.size());
 }
 

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

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

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


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

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

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

Change subject: Update GUI
..

Update GUI

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


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

diff --git a/gui b/gui
index 5208990..027cd04 16
--- a/gui
+++ b/gui
@@ -1 +1 @@
-Subproject commit 5208990365f0d3a2a1a1f679b2fc31d120889146
+Subproject commit 027cd04ca15a1b35e1f55dab93aa4e455200df58

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

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

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: ButtonGroupWidget: Change `cursor` on `:active` to align to ...

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

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

Change subject: ButtonGroupWidget: Change `cursor` on `:active` to align to 
ButtonSelect
..

ButtonGroupWidget: Change `cursor` on `:active` to align to ButtonSelect

Bringing `cursor` behaviour in alignment with ButtonSelect/OptionWidget
as introduced in https://phabricator.wikimedia.org/rGOJU80dfd527b2b1

Change-Id: Idc2ef8d98312b7182b903215986596f13a696411
---
M src/styles/widgets/ButtonGroupWidget.less
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/40/313640/1

diff --git a/src/styles/widgets/ButtonGroupWidget.less 
b/src/styles/widgets/ButtonGroupWidget.less
index eee220d..f1f3982 100644
--- a/src/styles/widgets/ButtonGroupWidget.less
+++ b/src/styles/widgets/ButtonGroupWidget.less
@@ -1,5 +1,9 @@
 @import '../common';
 
 .oo-ui-buttonGroupWidget {
+   .oo-ui-buttonElement-active .oo-ui-buttonElement-button {
+   cursor: default;
+   }
+
.theme-oo-ui-buttonGroupWidget();
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc2ef8d98312b7182b903215986596f13a696411
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
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] mediawiki...Flow[master]: Exception fix to Converter

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

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

Change subject: Exception fix to Converter
..

Exception fix to Converter

* Don't output error for normal 'end of list' cases.

Change-Id: I803458b2383a0ac7f091a0a8d3417ff444a3be4c
---
M includes/Import/LiquidThreadsApi/Source.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/Import/LiquidThreadsApi/Source.php 
b/includes/Import/LiquidThreadsApi/Source.php
index 53d2d5a..c4e70c5 100644
--- a/includes/Import/LiquidThreadsApi/Source.php
+++ b/includes/Import/LiquidThreadsApi/Source.php
@@ -316,12 +316,12 @@
$data = $this->apiCall( $conditions );
 
if ( ! isset( $data['query'] ) ) {
-   $this->logger->error( __METHOD__ . ': Failed API call 
against ' . $this->getKey() . ' with conditions : ' . json_encode( $conditions 
) );
if ( $this->isNotFoundError( $data ) ) {
$message = "Did not find pages: " . 
json_encode( $conditions );
$this->logger->debug( __METHOD__ . ": $message" 
);
throw new ApiNotFoundException( $message );
} else {
+   $this->logger->error( __METHOD__ . ': Failed 
API call against ' . $this->getKey() . ' with conditions : ' . json_encode( 
$conditions ) );
throw new ImportException( "Null response from 
API module: " . json_encode( $data ) );
}
} elseif ( !$expectContinue && isset( $data['continue'] ) ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I803458b2383a0ac7f091a0a8d3417ff444a3be4c
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]: Fix SectionProfileCallback type error

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

Change subject: Fix SectionProfileCallback type error
..


Fix SectionProfileCallback type error

Avoids "Argument 1 passed to Profiler::scopedProfileOut() must
be an instance of ScopedCallback, SectionProfileCallback given"

Change-Id: I92713de71df9722d8a5d7e5cd04460aff71cf096
---
M includes/profiler/Profiler.php
M includes/profiler/SectionProfiler.php
2 files changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php
index 297dcb2..db9c95b 100644
--- a/includes/profiler/Profiler.php
+++ b/includes/profiler/Profiler.php
@@ -162,9 +162,9 @@
abstract public function scopedProfileIn( $section );
 
/**
-* @param ScopedCallback $section
+* @param SectionProfileCallback $section
 */
-   public function scopedProfileOut( ScopedCallback &$section = null ) {
+   public function scopedProfileOut( SectionProfileCallback &$section = 
null ) {
$section = null;
}
 
diff --git a/includes/profiler/SectionProfiler.php 
b/includes/profiler/SectionProfiler.php
index bbe139b..7e3c398 100644
--- a/includes/profiler/SectionProfiler.php
+++ b/includes/profiler/SectionProfiler.php
@@ -58,7 +58,7 @@
 
/**
 * @param string $section
-* @return ScopedCallback
+* @return SectionProfileCallback
 */
public function scopedProfileIn( $section ) {
$this->profileInInternal( $section );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I92713de71df9722d8a5d7e5cd04460aff71cf096
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: BryanDavis 
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]: Avoid 'message' in log context in AuthManager

2016-09-30 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Avoid 'message' in log context in AuthManager
..

Avoid 'message' in log context in AuthManager

Logstash merges the log context into the main metadata (where
'message' is the log message) and ends up overwriting the message.

Bug: T145133
Change-Id: I27f221b0f1f7203e93d1b92119dc584ba8526f5b
---
M includes/auth/AuthManager.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/313638/1

diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php
index 51efe56..8cbbb0a 100644
--- a/includes/auth/AuthManager.php
+++ b/includes/auth/AuthManager.php
@@ -1696,7 +1696,7 @@
} else {
$this->logger->error( __METHOD__ . ': 
{username} failed with message {message}', [
'username' => $username,
-   'message' => 
$status->getWikiText( null, null, 'en' )
+   'msg' => $status->getWikiText( 
null, null, 'en' )
] );
$user->setId( 0 );
$user->loadFromId();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27f221b0f1f7203e93d1b92119dc584ba8526f5b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: LegacyLogger: Be consistent about converting log levels to int

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

Change subject: LegacyLogger: Be consistent about converting log levels to int
..


LegacyLogger: Be consistent about converting log levels to int

Normalize $level arguments to integers early to avoid confusion later
about what type the argument is.

Change-Id: I7305c0514f4383ec552afea2deb0e3fc6ba3fe8a
---
M includes/debug/logger/LegacyLogger.php
1 file changed, 9 insertions(+), 6 deletions(-)

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



diff --git a/includes/debug/logger/LegacyLogger.php 
b/includes/debug/logger/LegacyLogger.php
index 0ca20bb..4d7c84d 100644
--- a/includes/debug/logger/LegacyLogger.php
+++ b/includes/debug/logger/LegacyLogger.php
@@ -94,6 +94,9 @@
 * @return null
 */
public function log( $level, $message, array $context = [] ) {
+   if ( is_string( $level ) ) {
+   $level = self::$levelMapping[$level];
+   }
if ( $this->channel === 'DBQuery' && isset( $context['method'] )
&& isset( $context['master'] ) && isset( 
$context['runtime'] )
) {
@@ -102,8 +105,7 @@
}
 
if ( isset( self::$dbChannels[$this->channel] )
-   && isset( self::$levelMapping[$level] )
-   && self::$levelMapping[$level] >= 
self::$levelMapping[LogLevel::ERROR]
+   && $level >= self::$levelMapping[LogLevel::ERROR]
) {
// Format and write DB errors to the legacy locations
$effectiveChannel = 'wfLogDBError';
@@ -127,13 +129,17 @@
 *
 * @param string $channel
 * @param string $message
-* @param string|int $level \Psr\Log\LogEvent constant or Monlog level 
int
+* @param string|int $level \Psr\Log\LogEvent constant or Monolog level 
int
 * @param array $context
 * @return bool True if message should be sent to disk/network, false
 * otherwise
 */
public static function shouldEmit( $channel, $message, $level, $context 
) {
global $wgDebugLogFile, $wgDBerrorLog, $wgDebugLogGroups;
+
+   if ( is_string( $level ) ) {
+   $level = self::$levelMapping[$level];
+   }
 
if ( $channel === 'wfLogDBError' ) {
// wfLogDBError messages are emitted if a database log 
location is
@@ -162,9 +168,6 @@
}
 
if ( isset( $logConfig['level'] ) ) {
-   if ( is_string( $level ) ) {
-   $level = 
self::$levelMapping[$level];
-   }
$shouldEmit = $level >= 
self::$levelMapping[$logConfig['level']];
}
} else {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7305c0514f4383ec552afea2deb0e3fc6ba3fe8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: 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]: Exception rendering fixes

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

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

Change subject: Exception rendering fixes
..

Exception rendering fixes

* Actually use MWExceptionRenderer::AS_RAW. Use this after
  an error is thrown while trying to pretty render the original
  error. This is how this case was originally handled before.
* Do not show the google form or file cache in CLI mode.

Change-Id: I130499753efbf8b4d6d254ea36bacb2473952c1b
---
M includes/exception/MWExceptionHandler.php
M includes/exception/MWExceptionRenderer.php
2 files changed, 9 insertions(+), 11 deletions(-)


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

diff --git a/includes/exception/MWExceptionHandler.php 
b/includes/exception/MWExceptionHandler.php
index 797b3af..4a1f190 100644
--- a/includes/exception/MWExceptionHandler.php
+++ b/includes/exception/MWExceptionHandler.php
@@ -68,14 +68,13 @@
// removed.
$e->report();
} else {
-   MWExceptionRenderer::output(
-   $e, MWExceptionRenderer::AS_PRETTY );
+   MWExceptionRenderer::output( $e, 
MWExceptionRenderer::AS_PRETTY );
}
} catch ( Exception $e2 ) {
// Exception occurred from within exception handler
// Show a simpler message for the original exception,
// don't try to invoke report()
-   MWExceptionRenderer::output( $e, 
MWExceptionRenderer::AS_PRETTY, $e2 );
+   MWExceptionRenderer::output( $e, 
MWExceptionRenderer::AS_RAW, $e2 );
}
}
 
diff --git a/includes/exception/MWExceptionRenderer.php 
b/includes/exception/MWExceptionRenderer.php
index aba131d..8fdc417 100644
--- a/includes/exception/MWExceptionRenderer.php
+++ b/includes/exception/MWExceptionRenderer.php
@@ -35,11 +35,6 @@
public static function output( $e, $mode, $eNew = null ) {
global $wgMimeType;
 
-   if ( $e instanceof DBConnectionError ) {
-   self::reportOutageHTML( $e );
-   return;
-   }
-
if ( defined( 'MW_API' ) ) {
// Unhandled API exception, we can't be sure that 
format printer is alive
self::header( 'MediaWiki-API-Error: 
internal_api_error_' . get_class( $e ) );
@@ -47,9 +42,13 @@
} elseif ( self::isCommandLine() ) {
self::printError( self::getText( $e ) );
} elseif ( $mode === self::AS_PRETTY ) {
-   self::statusHeader( 500 );
-   self::header( "Content-Type: $wgMimeType; 
charset=utf-8" );
-   self::reportHTML( $e );
+   if ( $e instanceof DBConnectionError ) {
+   self::reportOutageHTML( $e );
+   } else {
+   self::statusHeader( 500 );
+   self::header( "Content-Type: $wgMimeType; 
charset=utf-8" );
+   self::reportHTML( $e );
+   }
} else {
if ( $eNew ) {
$message = "MediaWiki internal error.\n\n";

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I130499753efbf8b4d6d254ea36bacb2473952c1b
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] mediawiki/core[master]: mw.loader: Don't unset 'require' after execution in debug mode

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

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

Change subject: mw.loader: Don't unset 'require' after execution in debug mode
..

mw.loader: Don't unset 'require' after execution in debug mode

Follows-up bc4e07b6f6.

In production mode, 'module' and 'require' are lexically provided
through closure to the executing script and will continue to be
accessible through the script's life-time.

In debug mode, the script executes without wrapper directly from
disk (and as such, in the global scope) and variables are provided
as global variables. Since a variable can only be set to one value,
we swap the object that 'module' points to after each file. And
to avoid leakage, it is removed in-between files and after the
last one. Aside from it being technically infeasible right now,
async access to 'module' is discouraged regardless.

Late access to 'require', however, is not uncommon and should
work as expected.

Bug: T144879
Change-Id: I6ede10fd42676bb035ea26c693c78bcdc1438a7d
---
M resources/src/mediawiki/mediawiki.js
M tests/qunit/data/defineCallMwLoaderTestCallback.js
M tests/qunit/data/requireCallMwLoaderTestCallback.js
M tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
4 files changed, 21 insertions(+), 9 deletions(-)


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

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 3122d42..c7715e5 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1217,12 +1217,14 @@
 
pendingRequests.push( function () {
if ( moduleName && hasOwn.call( 
registry, moduleName ) ) {
+   // Emulate runScript() part of 
execute()
window.require = 
mw.loader.require;
window.module = registry[ 
moduleName ].module;
}
addScript( src ).always( function () {
-   // Clear environment
-   delete window.require;
+   // 'module.exports' should not 
persist after the file is executed to
+   // avoid leakage to unrelated 
code. 'require' should be kept, however,
+   // as asynchronous access to 
'require' is allowed and expected. (T144879)
delete window.module;
r.resolve();
 
diff --git a/tests/qunit/data/defineCallMwLoaderTestCallback.js 
b/tests/qunit/data/defineCallMwLoaderTestCallback.js
index afd886c..641071a 100644
--- a/tests/qunit/data/defineCallMwLoaderTestCallback.js
+++ b/tests/qunit/data/defineCallMwLoaderTestCallback.js
@@ -1 +1 @@
-module.exports = 'Define worked.';
+module.exports = 'Defined.';
diff --git a/tests/qunit/data/requireCallMwLoaderTestCallback.js 
b/tests/qunit/data/requireCallMwLoaderTestCallback.js
index 8bc087b..815a3b4 100644
--- a/tests/qunit/data/requireCallMwLoaderTestCallback.js
+++ b/tests/qunit/data/requireCallMwLoaderTestCallback.js
@@ -1,2 +1,6 @@
-var x = require( 'test.require.define' );
-module.exports = 'Require worked.' + x;
+module.exports = {
+   immediate: require( 'test.require.define' ),
+   later: function () {
+   return require( 'test.require.define' );
+   }
+};
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
index 41d800a..b69c9e8 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
@@ -664,7 +664,7 @@
} );
} );
 
-   QUnit.test( 'require() in debug mode', 1, function ( assert ) {
+   QUnit.test( 'require() in debug mode', function ( assert ) {
var path = mw.config.get( 'wgScriptPath' );
mw.loader.register( [
[ 'test.require.define', '0' ],
@@ -674,9 +674,15 @@
mw.loader.implement( 'test.require.define', [ QUnit.fixurl( 
path + '/tests/qunit/data/defineCallMwLoaderTestCallback.js' ) ] );
 
return mw.loader.using( 'test.require.callback' ).then( 
function ( require ) {
-   var exported = require( 'test.require.callback' );
-   assert.strictEqual( exported, 'Require worked.Define 
worked.',
-   'module.exports worked in debug mode' );
+   var cb = require( 'test.require.callback' );
+ 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: LegacyLogger: Be consistent about converting log levels to int

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

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

Change subject: LegacyLogger: Be consistent about converting log levels to int
..

LegacyLogger: Be consistent about converting log levels to int

Normalize $level arguments to integers early to avoid confusion later
about what type the argument is.

Change-Id: I7305c0514f4383ec552afea2deb0e3fc6ba3fe8a
---
M includes/debug/logger/LegacyLogger.php
1 file changed, 9 insertions(+), 6 deletions(-)


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

diff --git a/includes/debug/logger/LegacyLogger.php 
b/includes/debug/logger/LegacyLogger.php
index 0ca20bb..4d7c84d 100644
--- a/includes/debug/logger/LegacyLogger.php
+++ b/includes/debug/logger/LegacyLogger.php
@@ -94,6 +94,9 @@
 * @return null
 */
public function log( $level, $message, array $context = [] ) {
+   if ( is_string( $level ) ) {
+   $level = self::$levelMapping[$level];
+   }
if ( $this->channel === 'DBQuery' && isset( $context['method'] )
&& isset( $context['master'] ) && isset( 
$context['runtime'] )
) {
@@ -102,8 +105,7 @@
}
 
if ( isset( self::$dbChannels[$this->channel] )
-   && isset( self::$levelMapping[$level] )
-   && self::$levelMapping[$level] >= 
self::$levelMapping[LogLevel::ERROR]
+   && $level >= self::$levelMapping[LogLevel::ERROR]
) {
// Format and write DB errors to the legacy locations
$effectiveChannel = 'wfLogDBError';
@@ -127,13 +129,17 @@
 *
 * @param string $channel
 * @param string $message
-* @param string|int $level \Psr\Log\LogEvent constant or Monlog level 
int
+* @param string|int $level \Psr\Log\LogEvent constant or Monolog level 
int
 * @param array $context
 * @return bool True if message should be sent to disk/network, false
 * otherwise
 */
public static function shouldEmit( $channel, $message, $level, $context 
) {
global $wgDebugLogFile, $wgDBerrorLog, $wgDebugLogGroups;
+
+   if ( is_string( $level ) ) {
+   $level = self::$levelMapping[$level];
+   }
 
if ( $channel === 'wfLogDBError' ) {
// wfLogDBError messages are emitted if a database log 
location is
@@ -162,9 +168,6 @@
}
 
if ( isset( $logConfig['level'] ) ) {
-   if ( is_string( $level ) ) {
-   $level = 
self::$levelMapping[$level];
-   }
$shouldEmit = $level >= 
self::$levelMapping[$logConfig['level']];
}
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7305c0514f4383ec552afea2deb0e3fc6ba3fe8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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] translatewiki[master]: Add lib.reviews project for translation via translatewiki.net

2016-09-30 Thread Eloquence (Code Review)
Eloquence has uploaded a new change for review.

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

Change subject: Add lib.reviews project for translation via translatewiki.net
..

Add lib.reviews project for translation via translatewiki.net

Change-Id: I358bda4487707a42095206edc094fc9291adddf6
---
M TranslateSettings.php
M bin/EXTERNAL-PROJECTS
M bin/REPONG-PROJECTS
A groups/lib.reviews/lib.reviews.yaml
M repoconfig.commit.json
M repoconfig.json
6 files changed, 42 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/34/313634/1

diff --git a/TranslateSettings.php b/TranslateSettings.php
index 1bccaf5..ed1bcd0 100644
--- a/TranslateSettings.php
+++ b/TranslateSettings.php
@@ -374,3 +374,8 @@
 $wgCapitalLinkOverrides[NS_HIVEJS] = false;
 $wgCapitalLinkOverrides[NS_HIVEJS_TALK] = false;
 $wgTranslateGroupFiles[] = "$GROUPS/hivejs/hivejs.yaml";
+
+wfAddNamespace( 1268, 'libreviews' );
+$wgCapitalLinkOverrides[NS_LIBREVIEWS] = false;
+$wgCapitalLinkOverrides[NS_LIBREVIEWS_TALK] = false;
+$wgTranslateGroupFiles[] = "$GROUPS/lib.reviews/lib.reviews.yaml";
diff --git a/bin/EXTERNAL-PROJECTS b/bin/EXTERNAL-PROJECTS
index aecb9a4..862b1ed 100644
--- a/bin/EXTERNAL-PROJECTS
+++ b/bin/EXTERNAL-PROJECTS
@@ -22,6 +22,7 @@
 intuition
 jquery.uls
 kiwix
+lib.reviews
 mantis
 mathjax
 mifos
diff --git a/bin/REPONG-PROJECTS b/bin/REPONG-PROJECTS
index 9229da2..0e53c9c 100644
--- a/bin/REPONG-PROJECTS
+++ b/bin/REPONG-PROJECTS
@@ -13,6 +13,7 @@
 hivejs
 huggle
 inaturalist
+lib.reviews
 mantis
 mwgerrit
 mwgithub
diff --git a/groups/lib.reviews/lib.reviews.yaml 
b/groups/lib.reviews/lib.reviews.yaml
new file mode 100644
index 000..39736a9
--- /dev/null
+++ b/groups/lib.reviews/lib.reviews.yaml
@@ -0,0 +1,17 @@
+---
+BASIC:
+  id: libreviews
+  label: lib.reviews
+  description: "{{Special:MyLanguage/Translations:Group 
descriptions/lib.reviews/en}}"
+  class: FileBasedMessageGroup
+  namespace: NS_LIBREVIEWS
+
+MANGLER:
+  class: StringMatcher
+  prefix: libreviews-
+  patterns:
+- "*"
+
+FILES:
+  class: JsonFFS
+  sourcePattern: "%GROUPROOT%/lib.reviews/locales/%CODE%.json"
diff --git a/repoconfig.commit.json b/repoconfig.commit.json
index cc0a212..b130d13 100644
--- a/repoconfig.commit.json
+++ b/repoconfig.commit.json
@@ -165,6 +165,15 @@
}
}
},
+   "lib.reviews": {
+   "group": "libreviews",
+   "repos": {
+   "lib.reviews": {
+   "type": "git",
+   "url": 
"g...@github.com:eloquence/lib.reviews.git"
+   }
+   }
+   },
"mantis": {
"group": "out-mantis*",
"repos": {
diff --git a/repoconfig.json b/repoconfig.json
index 488139f..343de3e 100644
--- a/repoconfig.json
+++ b/repoconfig.json
@@ -164,6 +164,15 @@
}
}
},
+   "lib.reviews": {
+   "group": "libreviews",
+   "repos": {
+   "lib.reviews": {
+   "type": "git",
+   "url": 
"https://github.com/eloquence/lib.reviews.git";
+   }
+   }
+   },
"mantis": {
"group": "out-mantis*",
"repos": {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I358bda4487707a42095206edc094fc9291adddf6
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Eloquence 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix wfLogDBError channel redirect logic

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

Change subject: Fix wfLogDBError channel redirect logic
..


Fix wfLogDBError channel redirect logic

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

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



diff --git a/includes/debug/logger/LegacyLogger.php 
b/includes/debug/logger/LegacyLogger.php
index 3318ceb..0ca20bb 100644
--- a/includes/debug/logger/LegacyLogger.php
+++ b/includes/debug/logger/LegacyLogger.php
@@ -103,7 +103,7 @@
 
if ( isset( self::$dbChannels[$this->channel] )
&& isset( self::$levelMapping[$level] )
-   && self::$levelMapping[$level] >= LogLevel::ERROR
+   && self::$levelMapping[$level] >= 
self::$levelMapping[LogLevel::ERROR]
) {
// Format and write DB errors to the legacy locations
$effectiveChannel = 'wfLogDBError';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1249f9a097625c2fab6601059177594e5f3a21fc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: BryanDavis 
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]: Fix wfLogDBError channel redirect logic

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

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

Change subject: Fix wfLogDBError channel redirect logic
..

Fix wfLogDBError channel redirect logic

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/33/313633/1

diff --git a/includes/debug/logger/LegacyLogger.php 
b/includes/debug/logger/LegacyLogger.php
index 3318ceb..0ca20bb 100644
--- a/includes/debug/logger/LegacyLogger.php
+++ b/includes/debug/logger/LegacyLogger.php
@@ -103,7 +103,7 @@
 
if ( isset( self::$dbChannels[$this->channel] )
&& isset( self::$levelMapping[$level] )
-   && self::$levelMapping[$level] >= LogLevel::ERROR
+   && self::$levelMapping[$level] >= 
self::$levelMapping[LogLevel::ERROR]
) {
// Format and write DB errors to the legacy locations
$effectiveChannel = 'wfLogDBError';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1249f9a097625c2fab6601059177594e5f3a21fc
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] mediawiki...CollaborationKit[master]: Validating CollaborationListContent against a JSON Schema.

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

Change subject: Validating CollaborationListContent against a JSON Schema.
..


Validating CollaborationListContent against a JSON Schema.

Notes:
* Right now there are only two requirements: that the object as a whole has the 
description/items/options setup, and that each entry in `items` has a title.
* The schema allows `link` to be set to boolean true, even though this has not 
typically been treated as a valid option. I propose that if somehow set to 
true, link is set equal to title.
* Ditto with `image`. I propose that if somehow set to true that it just does 
its normal fallback behavior when no image is specified.
* I set some default values in the schema. Where possible, defaults should be 
registered in (and retrieved from) the schema instead of the code.
* Technically this allows you to have a `memberoptions` object within the 
larger `options` object even if `ismemberlist` is set to false. But this isn't 
really a problem because if it's not a member list the member options will just 
be ignored.

Bug: T145126
Change-Id: I1f46c373ee16c759f10c344bdc2d9e598f341286
---
M includes/content/CollaborationListContent.php
A includes/content/CollaborationListContentSchema.php
2 files changed, 105 insertions(+), 199 deletions(-)

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



diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 1a13dc1..d08c202 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -4,35 +4,7 @@
  * Important design assumption: This class assumes lists are small
  * (e.g. Average case < 500 items, outliers < 2000)
  *
- * Json structure is as follows:
- * {
- * items: [
- * {
- * "title": "The title, possibly a page name",
- * "link": "Page to link to if not title, or false to 
disable link",
- * "notes": "Freeform wikitext",
- * "image": "Image to use. Set to false to disable using 
PageImages ext",
- * "sortkey": { "name of sort criteria": "sortkey", ... }
- * "tags": [ "tag1", "tag2", ... ]
- * },
- * ...
- * ],
- * "options": {
- * "sortcriteria": { //unimplemented
- * // FIXME, not sure if this actually meets with usecase
- * "criteria name": {
- * "order": "numeric", // or potentially 
collation??
- * "default": "string-Text here" // or 
"column-title", etc
- * },
- * },
- * "defaultsort": "sort-criteria name" // or "column-title" ?? 
what about multi-key sort??
- *  "ismemberlist": true/false, // TODO, causes page to render 
totally differently
- *   "memberoptions": { // for future customizations
- *  ...
- *}
- * }
- * "description": "Some arbitrary wikitext"
- *}
+ * Schema is found in CollaborationListContentSchema.php.
  *
  */
 class CollaborationListContent extends JsonContent {
@@ -60,52 +32,23 @@
 * @return bool Whether the contents are valid
 */
public function isValid() {
+   $listSchema = include __DIR__ . 
'/CollaborationListContentSchema.php';
if ( !parent::isValid() ) {
return false;
}
-
$status = $this->getData();
if ( !is_object( $status ) || !$status->isOk() ) {
return false;
}
-
$data = $status->value;
-
-   if (
-   !property_exists( $data, "items" )
-   || !property_exists( $data, "options" )
-   || !property_exists( $data, "description" )
-   ) {
+   $jsonAsArray = json_decode( json_encode( $data ), true );
+   try {
+   EventLogging::schemaValidate( $jsonAsArray, $listSchema 
);
+   return true;
+   } catch ( JsonSchemaException $e ) {
return false;
}
-   foreach ( $data as $field => $value ) {
-   switch ( $field ) {
-   case 'items':
-   if ( !is_array( $value ) ) {
-   return false;
-   }
-   if ( !$this->validateItems( $value ) ) {
-   return false;
-   }
-   break;
-   case 'options':
-   if ( !is_object( $value ) ) {
-   

[MediaWiki-commits] [Gerrit] mediawiki...examples[master]: Just testing my setup

2016-09-30 Thread Eloquence (Code Review)
Eloquence has uploaded a new change for review.

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

Change subject: Just testing my setup
..

Just testing my setup

Change-Id: I07690fc70ae776c021ae8b785987fb9c9ce85503
---
M DataPages/DataPages.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/examples 
refs/changes/32/313632/1

diff --git a/DataPages/DataPages.php b/DataPages/DataPages.php
index a3dfda5..b0e9b49 100644
--- a/DataPages/DataPages.php
+++ b/DataPages/DataPages.php
@@ -1,5 +1,7 @@
 https://gerrit.wikimedia.org/r/313632
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07690fc70ae776c021ae8b785987fb9c9ce85503
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/examples
Gerrit-Branch: master
Gerrit-Owner: Eloquence 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix SectionProfileCallback type error

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

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

Change subject: Fix SectionProfileCallback type error
..

Fix SectionProfileCallback type error

Avoids "Argument 1 passed to Profiler::scopedProfileOut() must
be an instance of ScopedCallback, SectionProfileCallback given"

Change-Id: I92713de71df9722d8a5d7e5cd04460aff71cf096
---
M includes/profiler/Profiler.php
M includes/profiler/SectionProfiler.php
2 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php
index 297dcb2..db9c95b 100644
--- a/includes/profiler/Profiler.php
+++ b/includes/profiler/Profiler.php
@@ -162,9 +162,9 @@
abstract public function scopedProfileIn( $section );
 
/**
-* @param ScopedCallback $section
+* @param SectionProfileCallback $section
 */
-   public function scopedProfileOut( ScopedCallback &$section = null ) {
+   public function scopedProfileOut( SectionProfileCallback &$section = 
null ) {
$section = null;
}
 
diff --git a/includes/profiler/SectionProfiler.php 
b/includes/profiler/SectionProfiler.php
index bbe139b..7e3c398 100644
--- a/includes/profiler/SectionProfiler.php
+++ b/includes/profiler/SectionProfiler.php
@@ -58,7 +58,7 @@
 
/**
 * @param string $section
-* @return ScopedCallback
+* @return SectionProfileCallback
 */
public function scopedProfileIn( $section ) {
$this->profileInInternal( $section );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92713de71df9722d8a5d7e5cd04460aff71cf096
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] mediawiki/core[master]: Restore Content-Language header change from e53ff931a

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

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

Change subject: Restore Content-Language header change from e53ff931a
..

Restore Content-Language header change from e53ff931a

Change-Id: I46f376a82205a5c99b98c9e971f9e9d7868ce9fb
---
M includes/cache/HTMLFileCache.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/313630/1

diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php
index a85639f..060837e 100644
--- a/includes/cache/HTMLFileCache.php
+++ b/includes/cache/HTMLFileCache.php
@@ -167,9 +167,10 @@
$context->getTitle()->resetArticleID( 0 );
}
 
+   $contLang = $config->get( 'ContLang' );
$context->getOutput()->sendCacheControl();
header( "Content-Type: {$config->get( 'MimeType' )}; 
charset=UTF-8" );
-   header( "Content-Language: {$config->get( 'LanguageCode' )}" );
+   header( "Content-Language: {$contLang->getHtmlCode()}" );
if ( $this->useGzip() ) {
if ( wfClientAcceptsGzip() ) {
header( 'Content-Encoding: gzip' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46f376a82205a5c99b98c9e971f9e9d7868ce9fb
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] mediawiki/core[master]: database: Rename LBFactoryMW to MWLBFactory

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

Change subject: database: Rename LBFactoryMW to MWLBFactory
..


database: Rename LBFactoryMW to MWLBFactory

It's no longer an LBFactory subclass (since 5d4b009cf), and the MW-prefix
seems more natural for this class.

The class has only existed since for about 2 weeks (since 0e5cd18b7) and
is not used outside MediaWiki core across Wikimedia Git.

Change-Id: I34be982b5d10ad03e062033da9c40b4a01665289
---
M autoload.php
M includes/ServiceWiring.php
R includes/db/MWLBFactory.php
M tests/phpunit/includes/db/LBFactoryTest.php
4 files changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 5b99fac..323a01d 100644
--- a/autoload.php
+++ b/autoload.php
@@ -663,7 +663,6 @@
'KkConverter' => __DIR__ . '/languages/classes/LanguageKk.php',
'KuConverter' => __DIR__ . '/languages/classes/LanguageKu.php',
'LBFactory' => __DIR__ . '/includes/libs/rdbms/lbfactory/LBFactory.php',
-   'LBFactoryMW' => __DIR__ . '/includes/db/loadbalancer/LBFactoryMW.php',
'LBFactoryMulti' => __DIR__ . 
'/includes/libs/rdbms/lbfactory/LBFactoryMulti.php',
'LBFactorySimple' => __DIR__ . 
'/includes/libs/rdbms/lbfactory/LBFactorySimple.php',
'LBFactorySingle' => __DIR__ . 
'/includes/libs/rdbms/lbfactory/LBFactorySingle.php',
@@ -781,6 +780,7 @@
'MWFileProps' => __DIR__ . '/includes/utils/MWFileProps.php',
'MWGrants' => __DIR__ . '/includes/utils/MWGrants.php',
'MWHttpRequest' => __DIR__ . '/includes/HttpFunctions.php',
+   'MWLBFactory' => __DIR__ . '/includes/db/MWLBFactory.php',
'MWMemcached' => __DIR__ . '/includes/compat/MemcachedClientCompat.php',
'MWMessagePack' => __DIR__ . '/includes/libs/MWMessagePack.php',
'MWNamespace' => __DIR__ . '/includes/MWNamespace.php',
diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php
index 6044911..11ee616 100644
--- a/includes/ServiceWiring.php
+++ b/includes/ServiceWiring.php
@@ -45,11 +45,11 @@
'DBLoadBalancerFactory' => function( MediaWikiServices $services ) {
$mainConfig = $services->getMainConfig();
 
-   $lbConf = LBFactoryMW::applyDefaultConfig(
+   $lbConf = MWLBFactory::applyDefaultConfig(
$mainConfig->get( 'LBFactoryConf' ),
$mainConfig
);
-   $class = LBFactoryMW::getLBFactoryClass( $lbConf );
+   $class = MWLBFactory::getLBFactoryClass( $lbConf );
 
return new $class( $lbConf );
},
diff --git a/includes/db/loadbalancer/LBFactoryMW.php 
b/includes/db/MWLBFactory.php
similarity index 97%
rename from includes/db/loadbalancer/LBFactoryMW.php
rename to includes/db/MWLBFactory.php
index 9821da1..96c6e9f 100644
--- a/includes/db/loadbalancer/LBFactoryMW.php
+++ b/includes/db/MWLBFactory.php
@@ -24,10 +24,10 @@
 use MediaWiki\Logger\LoggerFactory;
 
 /**
- * Legacy MediaWiki-specific class for generating database load balancers
+ * MediaWiki-specific class for generating database load balancers
  * @ingroup Database
  */
-abstract class LBFactoryMW {
+abstract class MWLBFactory {
/**
 * @param array $lbConf Config for LBFactory::__construct()
 * @param Config $mainConfig Main config object from MediaWikiServices
diff --git a/tests/phpunit/includes/db/LBFactoryTest.php 
b/tests/phpunit/includes/db/LBFactoryTest.php
index 0f4484e..aed2d83 100644
--- a/tests/phpunit/includes/db/LBFactoryTest.php
+++ b/tests/phpunit/includes/db/LBFactoryTest.php
@@ -43,7 +43,7 @@
];
 
$this->hideDeprecated( '$wgLBFactoryConf must be updated. See 
RELEASE-NOTES for details' );
-   $result = LBFactoryMW::getLBFactoryClass( $config );
+   $result = MWLBFactory::getLBFactoryClass( $config );
 
$this->assertEquals( $expected, $result );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I34be982b5d10ad03e062033da9c40b4a01665289
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Parent5446 
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]: [WIP] Add EditActionHookHandler in clinet to inject entity u...

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

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

Change subject: [WIP] Add EditActionHookHandler in clinet to inject entity 
usage data
..

[WIP] Add EditActionHookHandler in clinet to inject entity usage data

What needs to be done:
- Get javascript working
- CI tests

Bug: T144921
Change-Id: I1f1fad785545be475f1db8c12d1647ec449a29d7
---
M client/WikibaseClient.hooks.php
M client/WikibaseClient.php
M client/i18n/en.json
M client/i18n/qqq.json
A client/includes/Hooks/EditActionHookHandler.php
5 files changed, 184 insertions(+), 0 deletions(-)


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

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 1a5ee70..abe1b52 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -23,6 +23,7 @@
 use Wikibase\Client\Hooks\DeletePageNoticeCreator;
 use Wikibase\Client\Hooks\EchoNotificationsHandlers;
 use Wikibase\Client\Hooks\InfoActionHookHandler;
+use Wikibase\Client\Hooks\EditActionHookHandler;
 use Wikibase\Client\RecentChanges\ChangeLineFormatter;
 use Wikibase\Client\RecentChanges\ExternalChangeFactory;
 use Wikibase\Client\Specials\SpecialPagesWithBadges;
@@ -438,6 +439,40 @@
}
 
/**
+* Adds the Entity usage data in ActionEdit
+*
+* @param EditPage $editor
+*
+* @return bool
+*/
+   public static function onEditAction( EditPage &$editor, &$checkboxes, 
&$tabindex ) {
+   $wikibaseClient = WikibaseClient::getDefaultInstance();
+
+   if ( $editor->preview || $editor->section != '' ) {
+   // Shorten out, like template translusion in core
+   return true;
+   }
+   $usageLookup = $wikibaseClient->getStore()->getUsageLookup();
+   $labelDescriptionLookupFactory = new 
LanguageFallbackLabelDescriptionLookupFactory(
+   $wikibaseClient->getLanguageFallbackChainFactory(),
+   $wikibaseClient->getTermLookup(),
+   $wikibaseClient->getTermBuffer()
+   );
+   $idParser = $wikibaseClient->getEntityIdParser();
+
+   $editActionHookHandler = new EditActionHookHandler(
+   $wikibaseClient->newRepoLinker(),
+   $usageLookup,
+   $labelDescriptionLookupFactory,
+   $idParser
+   );
+
+   $editActionHookHandler->handle( $editor );
+
+   return true;
+   }
+
+   /**
 * Notify the user that we have automatically updated the repo or that 
they
 * need to do that per hand.
 *
diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php
index 7b34a44..6df21ae 100644
--- a/client/WikibaseClient.php
+++ b/client/WikibaseClient.php
@@ -122,6 +122,7 @@
$wgHooks['BeforePageDisplay'][] = 
'\Wikibase\ClientHooks::onBeforePageDisplayAddJsConfig';
$wgHooks['ScribuntoExternalLibraries'][] = 
'\Wikibase\ClientHooks::onScribuntoExternalLibraries';
$wgHooks['InfoAction'][] = '\Wikibase\ClientHooks::onInfoAction';
+   $wgHooks['EditPageBeforeEditChecks'][] = 
'\Wikibase\ClientHooks::onEditAction';
$wgHooks['BaseTemplateAfterPortlet'][] = 
'\Wikibase\ClientHooks::onBaseTemplateAfterPortlet';
$wgHooks['GetBetaFeaturePreferences'][] = 
'\Wikibase\ClientHooks::onGetBetaFeaturePreferences';
$wgHooks['ArticleDeleteAfterSuccess'][] = 
'\Wikibase\ClientHooks::onArticleDeleteAfterSuccess';
diff --git a/client/i18n/en.json b/client/i18n/en.json
index 0e5f82f..0c6654d 100644
--- a/client/i18n/en.json
+++ b/client/i18n/en.json
@@ -105,6 +105,7 @@
"wikibase-pageinfo-entity-usage-T": "Title",
"wikibase-pageinfo-entity-usage-X": "All entity data",
"wikibase-pageinfo-entity-usage-O": "Other (Statements)",
+   "wikibase-entityusage-explanation": "{{WBREPONAME}} entities used in 
this page:",
"wikibase-property-render-error": "Failed to render property $1: $2",
"wikibase-otherprojects": "In other projects",
"wikibase-otherprojects-beta-message": "Other projects sidebar",
diff --git a/client/i18n/qqq.json b/client/i18n/qqq.json
index 012b245..24d1786 100644
--- a/client/i18n/qqq.json
+++ b/client/i18n/qqq.json
@@ -116,6 +116,7 @@
"wikibase-pageinfo-entity-usage-T": "Name for ''title'' entity 
usage\n{{Identical|Title}}",
"wikibase-pageinfo-entity-usage-X": "Name for ''all'' entity usage",
"wikibase-pageinfo-entity-usage-O": "Name for ''other'' entity usage",
+   "wikibase-entityusage-explanation": "Explanation on bottom of edti page 
for entity usage",
"wikibase-property-render-error": "Error message shown when the 
#property parser function fails to r

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: WIP: Beta: use TOC from core

2016-09-30 Thread Bmansurov (Code Review)
Bmansurov has uploaded a new change for review.

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

Change subject: WIP: Beta: use TOC from core
..

WIP: Beta: use TOC from core

This allows us to:
* get rid of the custom TOC in MF, thus reducing tech debt and
  bytes shipped to users, among other benefits;
* get rid of section collapsing, thus improving site performance
  with fewer reflows and front end computations; searching text in
  a page will also be possible if sections are collapsed;
* create a floating TOC for JS capable browsers;

This change also shows the TOC for non JS browsers and small
mobile devices.

Change-Id: I57ed56421b842e82652a9970329026f66eacdecb
---
M extension.json
M includes/MobileFrontend.body.php
M includes/MobileFrontend.hooks.php
A resources/mobile.toc.beta/TableOfContentsOverlay.js
A resources/mobile.toc.beta/toc.less
M resources/skins.minerva.base.styles/common.less
A resources/skins.minerva.beta.scripts/toc.js
7 files changed, 84 insertions(+), 5 deletions(-)


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

diff --git a/extension.json b/extension.json
index d03ccc9..41626cf 100644
--- a/extension.json
+++ b/extension.json
@@ -535,6 +535,28 @@
"toc"
]
},
+   "mobile.toc.beta": {
+   "targets": [
+   "mobile",
+   "desktop"
+   ],
+   "dependencies": [
+   "mobile.overlays",
+   "mobile.toc.images"
+   ],
+   "scripts": [
+   
"resources/mobile.toc.beta/TableOfContentsOverlay.js"
+   ],
+   "styles": [
+   "resources/mobile.toc.beta/toc.less"
+   ],
+   "templates": {
+   "toc.hogan": 
"resources/mobile.toc.beta/tocButton.hogan"
+   },
+   "messages": [
+   "toc"
+   ]
+   },
"mobile.ajax": {
"targets": [
"mobile",
@@ -1770,10 +1792,12 @@
"skins.minerva.scripts",
"mobile.settings",
"mobile.foreignApi",
-   "mobile.backtotop"
+   "mobile.backtotop",
+   "mobile.toc.beta"
],
"scripts": [
-   
"resources/skins.minerva.beta.scripts/fontchanger.js"
+   
"resources/skins.minerva.beta.scripts/fontchanger.js",
+   "resources/skins.minerva.beta.scripts/toc.js"
],
"messages": [
"mobile-frontend-commons-category-view"
diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index 83745f7..af45ada 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -43,7 +43,8 @@
// and the MFTOC flag has been set (which means the page 
originally had a table of contents)
$includeTOC = $out->getProperty( 'MFTOC' ) && $ns === NS_MAIN;
$formatter = MobileFormatter::newFromContext( $context, $html );
-   $formatter->enableTOCPlaceholder( $includeTOC );
+   // Enable TOC placeholder only in stable
+   $formatter->enableTOCPlaceholder( $includeTOC && 
!$context->isBetaGroupMember() );
 
Hooks::run( 'MobileFrontendBeforeDOM', [ $context, $formatter ] 
);
 
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 34f1dd7..b937c59 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -1240,7 +1240,7 @@
 
/**
 * OutputPageParserOutput hook handler
-* Disables TOC in output before it grabs HTML
+* In stable, disables TOC in output before it grabs HTML
 * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageParserOutput
 *
 * @param OutputPage $outputPage
@@ -1251,7 +1251,7 @@
$context = MobileContext::singleton();
 
if ( $context->shouldDisplayMobileView() ) {
-   $outputPage->enableTOC( false );
+   $outputPage->enableTOC( $context->isBetaGroupMember() );
$outputPage->setProperty( 'MFTOC', $po->getTOCHTML() 
!== '' );
 
if ( $context->shouldShowWikibaseDescriptions( 
'tagline' ) ) {
diff

[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Update videojs to 5.12.2, fixes playback in iOS

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

Change subject: Update videojs to 5.12.2, fixes playback in iOS
..


Update videojs to 5.12.2, fixes playback in iOS

The main fix we want is videos playing in iOS

See
https://github.com/videojs/video.js/issues/3283

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

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



diff --git a/resources/videojs/video.js b/resources/videojs/video.js
index 9419308..4c05be8 100644
--- a/resources/videojs/video.js
+++ b/resources/videojs/video.js
@@ -1,6 +1,6 @@
 /**
  * @license
- * Video.js 5.12.1 
+ * Video.js 5.12.2 
  * Copyright Brightcove, Inc. 
  * Available under Apache License Version 2.0
  * 
@@ -12768,6 +12768,8 @@
   'class': 'vjs-tech'
 }));
   }
+
+  el.playerId = this.options_.playerId;
 }
 
 // Update specific tag settings, in case they were overridden
@@ -18141,10 +18143,10 @@
  * @param {String} classToCheck Classname to check
  */
 function hasElClass(element, classToCheck) {
+  throwIfWhitespace(classToCheck);
   if (element.classList) {
 return element.classList.contains(classToCheck);
   }
-  throwIfWhitespace(classToCheck);
   return classRegExp(classToCheck).test(element.className);
 }
 
@@ -19752,7 +19754,7 @@
  *
  * @type {String}
  */
-videojs.VERSION = '5.12.1';
+videojs.VERSION = '5.12.2';
 
 /**
  * The global options object. These are the settings that take effect

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I36efab34da33bc126b3fa63993890b6caead8a20
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: TheDJ 
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]: MWExceptionHandler: Restore delegation to MWException::report

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

Change subject: MWExceptionHandler: Restore delegation to MWException::report
..


MWExceptionHandler: Restore delegation to MWException::report

Follow up to 00bee0297. Many MWException subclasses override
MWException::report to do things like special logging and setting the
HTTP response status code. We need to keep calling those methods until
MWExceptionRenderer knows how to handle all of them.

Bug: T147098
Change-Id: I2c90e2d9e9b019357458c7e14a3d602b591c6f5b
---
M includes/exception/MWExceptionHandler.php
1 file changed, 9 insertions(+), 1 deletion(-)

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



diff --git a/includes/exception/MWExceptionHandler.php 
b/includes/exception/MWExceptionHandler.php
index 8359846..797b3af 100644
--- a/includes/exception/MWExceptionHandler.php
+++ b/includes/exception/MWExceptionHandler.php
@@ -62,7 +62,15 @@
protected static function report( $e ) {
try {
// Try and show the exception prettily, with the normal 
skin infrastructure
-   MWExceptionRenderer::output( $e, 
MWExceptionRenderer::AS_PRETTY );
+   if ( $e instanceof MWException ) {
+   // Delegate to MWException until all subclasses 
are handled by
+   // MWExceptionRenderer and 
MWException::report() has been
+   // removed.
+   $e->report();
+   } else {
+   MWExceptionRenderer::output(
+   $e, MWExceptionRenderer::AS_PRETTY );
+   }
} catch ( Exception $e2 ) {
// Exception occurred from within exception handler
// Show a simpler message for the original exception,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2c90e2d9e9b019357458c7e14a3d602b591c6f5b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: MWExceptionHandler: Restore delegation to MWException::report

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

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

Change subject: MWExceptionHandler: Restore delegation to MWException::report
..

MWExceptionHandler: Restore delegation to MWException::report

Follow up to 00bee0297. Many MWException subclasses override
MWException::report to do things like special logging and setting the
HTTP response status code. We need to keep calling those methods until
MWExceptionRenderer knows how to handle all of them.

Bug: T147098
Change-Id: I2c90e2d9e9b019357458c7e14a3d602b591c6f5b
---
M includes/exception/MWExceptionHandler.php
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/313627/1

diff --git a/includes/exception/MWExceptionHandler.php 
b/includes/exception/MWExceptionHandler.php
index 8359846..797b3af 100644
--- a/includes/exception/MWExceptionHandler.php
+++ b/includes/exception/MWExceptionHandler.php
@@ -62,7 +62,15 @@
protected static function report( $e ) {
try {
// Try and show the exception prettily, with the normal 
skin infrastructure
-   MWExceptionRenderer::output( $e, 
MWExceptionRenderer::AS_PRETTY );
+   if ( $e instanceof MWException ) {
+   // Delegate to MWException until all subclasses 
are handled by
+   // MWExceptionRenderer and 
MWException::report() has been
+   // removed.
+   $e->report();
+   } else {
+   MWExceptionRenderer::output(
+   $e, MWExceptionRenderer::AS_PRETTY );
+   }
} catch ( Exception $e2 ) {
// Exception occurred from within exception handler
// Show a simpler message for the original exception,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c90e2d9e9b019357458c7e14a3d602b591c6f5b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: MWExceptionHandler: Restore delegation to MWException::report

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

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

Change subject: MWExceptionHandler: Restore delegation to MWException::report
..

MWExceptionHandler: Restore delegation to MWException::report

Many MWException subclasses override MWException::report to do things
like special logging and setting the HTTP response status code. We need
to keep calling those methods until MWExceptionRenderer knows how to
handle all of them.

Bug: T147098
Change-Id: I2c90e2d9e9b019357458c7e14a3d602b591c6f5b
---
M includes/exception/MWExceptionHandler.php
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/313626/1

diff --git a/includes/exception/MWExceptionHandler.php 
b/includes/exception/MWExceptionHandler.php
index 8359846..cf3c0e0 100644
--- a/includes/exception/MWExceptionHandler.php
+++ b/includes/exception/MWExceptionHandler.php
@@ -62,7 +62,14 @@
protected static function report( $e ) {
try {
// Try and show the exception prettily, with the normal 
skin infrastructure
-   MWExceptionRenderer::output( $e, 
MWExceptionRenderer::AS_PRETTY );
+   if ( $e instanceof MWException ) {
+   // Delegate to MWException until all subclasses 
are handled by
+   // MWExceptionRenderer.
+   $e->render();
+   } else {
+   MWExceptionRenderer::output(
+   $e, MWExceptionRenderer::AS_PRETTY );
+   }
} catch ( Exception $e2 ) {
// Exception occurred from within exception handler
// Show a simpler message for the original exception,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c90e2d9e9b019357458c7e14a3d602b591c6f5b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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] mediawiki/core[master]: Replace deprecated `constructive` with `progressive`

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

Change subject: Replace deprecated `constructive` with `progressive`
..


Replace deprecated `constructive` with `progressive`

Replacing deprecated `constructive` mediawiki.UI CSS class and OOjs UI
flag  with `progressive`.

Bug: T146923
Change-Id: I524b9722ee49692c55bb1f97d34d8a28068716ee
---
M includes/EditPage.php
M includes/Xml.php
M includes/htmlform/HTMLForm.php
M includes/htmlform/fields/HTMLSubmitField.php
M includes/specials/SpecialBotPasswords.php
M includes/specials/SpecialMovepage.php
M resources/src/mediawiki.special/mediawiki.special.apisandbox.js
M resources/src/mediawiki.ui/components/buttons.less
M resources/src/mediawiki.ui/components/forms.less
M resources/src/mediawiki.ui/components/inputs.less
M resources/src/mediawiki.ui/components/text.less
M resources/src/mediawiki/mediawiki.Upload.Dialog.js
M resources/src/mediawiki/mediawiki.feedback.js
13 files changed, 19 insertions(+), 33 deletions(-)

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



diff --git a/includes/EditPage.php b/includes/EditPage.php
index 38f8ab6..c0c0048 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -4155,7 +4155,7 @@
'name' => 'wpSave',
'tabindex' => ++$tabindex,
] + Linker::tooltipAndAccesskeyAttribs( 'save' );
-   $buttons['save'] = Html::submitButton( $buttonLabel, $attribs, 
[ 'mw-ui-constructive' ] );
+   $buttons['save'] = Html::submitButton( $buttonLabel, $attribs, 
[ 'mw-ui-progressive' ] );
 
++$tabindex; // use the same for preview and live preview
$attribs = [
diff --git a/includes/Xml.php b/includes/Xml.php
index 43f7217..b1bd098 100644
--- a/includes/Xml.php
+++ b/includes/Xml.php
@@ -452,7 +452,7 @@
 
/**
 * Convenience function to build an HTML submit button
-* When $wgUseMediaWikiUIEverywhere is true it will default to a 
constructive button
+* When $wgUseMediaWikiUIEverywhere is true it will default to a 
progressive button
 * @param string $value Label text for the button
 * @param array $attribs Optional custom attributes
 * @return string HTML
@@ -467,7 +467,7 @@
// some submit forms
// might need to be mw-ui-destructive (e.g. delete a page)
if ( $wgUseMediaWikiUIEverywhere ) {
-   $baseAttrs['class'] = 'mw-ui-button mw-ui-constructive';
+   $baseAttrs['class'] = 'mw-ui-button mw-ui-progressive';
}
// Any custom attributes will take precendence of anything in 
baseAttrs e.g. override the class
$attribs = $attribs + $baseAttrs;
diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php
index c65d97f..1f4d99e 100644
--- a/includes/htmlform/HTMLForm.php
+++ b/includes/htmlform/HTMLForm.php
@@ -176,7 +176,7 @@
protected $mFieldTree;
protected $mShowReset = false;
protected $mShowSubmit = true;
-   protected $mSubmitFlags = [ 'constructive', 'primary' ];
+   protected $mSubmitFlags = [ 'primary', 'progressive' ];
protected $mShowCancel = false;
protected $mCancelTarget;
 
diff --git a/includes/htmlform/fields/HTMLSubmitField.php 
b/includes/htmlform/fields/HTMLSubmitField.php
index cb98549..0c33ad9 100644
--- a/includes/htmlform/fields/HTMLSubmitField.php
+++ b/includes/htmlform/fields/HTMLSubmitField.php
@@ -7,7 +7,7 @@
 class HTMLSubmitField extends HTMLButtonField {
protected $buttonType = 'submit';
 
-   protected $mFlags = [ 'primary', 'constructive' ];
+   protected $mFlags = [ 'primary', 'progressive' ];
 
public function skipLoadData( $request ) {
return !$request->getCheck( $this->mName );
diff --git a/includes/specials/SpecialBotPasswords.php 
b/includes/specials/SpecialBotPasswords.php
index ed3cd5e..1dd78d7 100644
--- a/includes/specials/SpecialBotPasswords.php
+++ b/includes/specials/SpecialBotPasswords.php
@@ -224,7 +224,7 @@
'name' => 'op',
'value' => 'create',
'label-message' => 
'botpasswords-label-create',
-   'flags' => [ 'primary', 'constructive' 
],
+   'flags' => [ 'primary', 'progressive' ],
] );
}
 
diff --git a/includes/specials/SpecialMovepage.php 
b/includes/specials/SpecialMovepage.php
index 3a12cf3..7b7661d 100644
--- a/includes/specials/SpecialMovepage.php
+++ b/includes/specials/SpecialMovepage.php
@@ -462,7 +462,7 @@
'name' => 'wpMove',
'value' => $this->msg( 'movepagebtn

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: (WIP) jobqueue: runJobs log now have context passed to them ...

2016-09-30 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

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

Change subject: (WIP) jobqueue: runJobs log now have context passed to them 
(WIP)
..

(WIP) jobqueue: runJobs log now have context passed to them (WIP)

The mediawiki.runJobs errors are collected in logstash but the whole job
description and errors are a single field message. That is challenging
to split logs per job type, get the longest running jobs ...

That can be worked around on the log receiving side by parsing
MediaWiki messages eg https://gerrit.wikimedia.org/r/#/c/312504/

Bryan Davis suggested a better long term solution is to use the PSR3
logger with structured log messages.

Culprit: 'type' is a reverved word. Hence prefix all context variables
with 'job_'.

Bug: T146469
Change-Id: Ib6a771c7d3f83bd75b2994bfab9bbebfd1f5aa6c
---
M RELEASE-NOTES-1.28
M includes/jobqueue/JobRunner.php
2 files changed, 34 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/313625/1

diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index 4f687a1..610ab94 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -206,6 +206,7 @@
 * IP::isConfiguredProxy() and IP::isTrustedProxy() were removed. Callers should
   migrate to using the same functions on a ProxyLookup instance, obtainable 
from
   MediaWikiServices.
+* (T146469) 'runJobs' logs now have context attached to them.
 
 == Compatibility ==
 
diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php
index ed3aa9a..6ed98e3 100644
--- a/includes/jobqueue/JobRunner.php
+++ b/includes/jobqueue/JobRunner.php
@@ -262,7 +262,10 @@
private function executeJob( Job $job, LBFactory $lbFactory, $stats, 
$popTime ) {
$jType = $job->getType();
$msg = $job->toString() . " STARTING";
-   $this->logger->debug( $msg );
+   $this->logger->debug( $msg, [
+   # Job type is part of toString() but we need it here to 
ease processing
+   'job_type' => $job->getType()
+   ] );
$this->debugCallback( $msg );
 
// Run the job...
@@ -318,12 +321,25 @@
}
 
if ( $status === false ) {
+   $msg = $job->toString() . " t={job_duration} 
error={job_error}";
+   $this->logger->error( $msg, [
+   # Job type is part of toString() but we need it 
here to ease processing
+   'job_type' => $job->getType(),
+   'job_duration' => $timeMs,
+   'job_error' => $error,
+   ] );
+
$msg = $job->toString() . " t=$timeMs error={$error}";
-   $this->logger->error( $msg );
$this->debugCallback( $msg );
} else {
+   $msg = $job->toString() . " t={job_duration} good";
+   $this->logger->info( $msg, [
+   # Job type is part of toString() but we need it 
here to ease processing
+   'job_type' => $job->getType(),
+   'job_duration' => $timeMs,
+   ] );
+
$msg = $job->toString() . " t=$timeMs good";
-   $this->logger->info( $msg );
$this->debugCallback( $msg );
}
 
@@ -471,7 +487,12 @@
if ( $maxBytes && $usedBytes >= 0.95 * $maxBytes ) {
$msg = "Detected excessive memory usage 
($usedBytes/$maxBytes).";
$this->debugCallback( $msg );
-   $this->logger->error( $msg );
+
+   $msg = "Detected excessive memory usage 
({used_bytes}/{max_bytes}).";
+   $this->logger->error( $msg, [
+   'used_bytes' => $usedBytes,
+   'max_bytes' => $maxBytes,
+   ] );
 
return false;
}
@@ -528,8 +549,15 @@
}
 
$ms = intval( 1000 * $time );
+
+   $msg = $job->toString() . " COMMIT ENQUEUED 
[{job_commit_write_ms}ms of writes]";
+   $this->logger->info( $msg, [
+   # Job type is part of toString() but we need it here to 
ease processing
+   'job_type' => $job->getType(),
+   'job_commit_write_ms' => $ms,
+   ] );
+
$msg = $job->toString() . " COMMIT ENQUEUED [{$ms}ms of 
writes]";
-   $this->logger->info( $msg );
$this->debugCallback( $msg );
 
// Wait for an exclusive lock to commit

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

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Rename JsonPageLoadStrategy to PageDataClient

2016-09-30 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review.

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

Change subject: Rename JsonPageLoadStrategy to PageDataClient
..

Rename JsonPageLoadStrategy to PageDataClient

Bug: T136322
Change-Id: I60da7ab1a6691e69c9a163ba5dcbdc96fe7c6067
---
R app/src/main/java/org/wikipedia/page/PageDataClient.java
M app/src/main/java/org/wikipedia/page/PageFragment.java
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/page/JsonPageLoadStrategy.java 
b/app/src/main/java/org/wikipedia/page/PageDataClient.java
similarity index 99%
rename from app/src/main/java/org/wikipedia/page/JsonPageLoadStrategy.java
rename to app/src/main/java/org/wikipedia/page/PageDataClient.java
index 35704ef..23c1e84 100644
--- a/app/src/main/java/org/wikipedia/page/JsonPageLoadStrategy.java
+++ b/app/src/main/java/org/wikipedia/page/PageDataClient.java
@@ -61,7 +61,7 @@
  * - a backstack of pages and page positions visited,
  * - and many handlers.
  */
-public class JsonPageLoadStrategy implements PageLoadStrategy {
+public class PageDataClient implements PageLoadStrategy {
 private interface ErrorCallback {
 void call(@Nullable Throwable error);
 }
diff --git a/app/src/main/java/org/wikipedia/page/PageFragment.java 
b/app/src/main/java/org/wikipedia/page/PageFragment.java
index 1a1669c..0249027 100755
--- a/app/src/main/java/org/wikipedia/page/PageFragment.java
+++ b/app/src/main/java/org/wikipedia/page/PageFragment.java
@@ -255,7 +255,7 @@
 super.onCreate(savedInstanceState);
 app = (WikipediaApp) getActivity().getApplicationContext();
 model = new PageViewModel();
-pageLoadStrategy = new JsonPageLoadStrategy();
+pageLoadStrategy = new PageDataClient();
 
 initTabs();
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60da7ab1a6691e69c9a163ba5dcbdc96fe7c6067
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mholloway 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [TEST] Make PopupElement extend over containing blocks

2016-09-30 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: [TEST] Make PopupElement extend over containing blocks
..

[TEST] Make PopupElement extend over containing blocks

Bug: T146531
Change-Id: I204dca07378be25b6977be672263cc767bbf5fe7
---
M resources/lib/oojs-ui/oojs-ui-core.js
M resources/src/mediawiki.special/mediawiki.special.apisandbox.js
2 files changed, 220 insertions(+), 208 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/313623/1

diff --git a/resources/lib/oojs-ui/oojs-ui-core.js 
b/resources/lib/oojs-ui/oojs-ui-core.js
index c982010..0df24db 100644
--- a/resources/lib/oojs-ui/oojs-ui-core.js
+++ b/resources/lib/oojs-ui/oojs-ui-core.js
@@ -4600,6 +4600,213 @@
 };
 
 /**
+ * Element that will stick under a specified container, even when it is 
inserted elsewhere in the
+ * document (for example, in a OO.ui.Window's $overlay).
+ *
+ * The elements's position is automatically calculated and maintained when 
window is resized or the
+ * page is scrolled. If you reposition the container manually, you have to 
call #position to make
+ * sure the element is still placed correctly.
+ *
+ * As positioning is only possible when both the element and the container are 
attached to the DOM
+ * and visible, it's only done after you call #togglePositioning. You might 
want to do this inside
+ * the #toggle method to display a floating popup, for example.
+ *
+ * @abstract
+ * @class
+ *
+ * @constructor
+ * @param {Object} [config] Configuration options
+ * @cfg {jQuery} [$floatable] Node to position, assigned to #$floatable, omit 
to use #$element
+ * @cfg {jQuery} [$floatableContainer] Node to position below
+ */
+OO.ui.mixin.FloatableElement = function OoUiMixinFloatableElement( config ) {
+   // Configuration initialization
+   config = config || {};
+
+   // Properties
+   this.$floatable = null;
+   this.$floatableContainer = null;
+   this.$floatableWindow = null;
+   this.$floatableClosestScrollable = null;
+   this.onFloatableScrollHandler = this.position.bind( this );
+   this.onFloatableWindowResizeHandler = this.position.bind( this );
+
+   // Initialization
+   this.setFloatableContainer( config.$floatableContainer );
+   this.setFloatableElement( config.$floatable || this.$element );
+};
+
+/* Methods */
+
+/**
+ * Set floatable element.
+ *
+ * If an element is already set, it will be cleaned up before setting up the 
new element.
+ *
+ * @param {jQuery} $floatable Element to make floatable
+ */
+OO.ui.mixin.FloatableElement.prototype.setFloatableElement = function ( 
$floatable ) {
+   if ( this.$floatable ) {
+   this.$floatable.removeClass( 'oo-ui-floatableElement-floatable' 
);
+   this.$floatable.css( { left: '', top: '' } );
+   }
+
+   this.$floatable = $floatable.addClass( 
'oo-ui-floatableElement-floatable' );
+   this.position();
+};
+
+/**
+ * Set floatable container.
+ *
+ * The element will be always positioned under the specified container.
+ *
+ * @param {jQuery|null} $floatableContainer Container to keep visible, or null 
to unset
+ */
+OO.ui.mixin.FloatableElement.prototype.setFloatableContainer = function ( 
$floatableContainer ) {
+   this.$floatableContainer = $floatableContainer;
+   if ( this.$floatable ) {
+   this.position();
+   }
+};
+
+/**
+ * Toggle positioning.
+ *
+ * Do not turn positioning on until after the element is attached to the DOM 
and visible.
+ *
+ * @param {boolean} [positioning] Enable positioning, omit to toggle
+ * @chainable
+ */
+OO.ui.mixin.FloatableElement.prototype.togglePositioning = function ( 
positioning ) {
+   var closestScrollableOfContainer, closestScrollableOfFloatable;
+
+   positioning = positioning === undefined ? !this.positioning : 
!!positioning;
+
+   if ( this.positioning !== positioning ) {
+   this.positioning = positioning;
+
+   closestScrollableOfContainer = 
OO.ui.Element.static.getClosestScrollableContainer( this.$floatableContainer[ 0 
] );
+   closestScrollableOfFloatable = 
OO.ui.Element.static.getClosestScrollableContainer( this.$floatable[ 0 ] );
+   this.needsCustomPosition = closestScrollableOfContainer !== 
closestScrollableOfFloatable;
+   // If the scrollable is the root, we have to listen to scroll 
events
+   // on the window because of browser inconsistencies.
+   if ( $( closestScrollableOfContainer ).is( 'html, body' ) ) {
+   closestScrollableOfContainer = 
OO.ui.Element.static.getWindow( closestScrollableOfContainer );
+   }
+
+   if ( positioning ) {
+   this.$floatableWindow = $( this.getElementWindow() );
+   this.$floatableWindow.on( 'resize', 
this.onFlo

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Remove bogus 'inflight' store

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

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

Change subject: Remove bogus 'inflight' store
..

Remove bogus 'inflight' store

Would write things to /tmp and never do anything with them

Change-Id: I8eaf21444d1a127f2ed95a562c2188a33083b66a
---
M Core/DataStores/NullDataStore.php
M Core/Listeners/ListenerBase.php
M Core/Listeners/RestListener.php
M Core/Listeners/SoapListener.php
M PaymentProviders/Adyen/AdyenListener.php
M PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
M SmashPig.yaml
7 files changed, 7 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/22/313622/1

diff --git a/Core/DataStores/NullDataStore.php 
b/Core/DataStores/NullDataStore.php
index 36d3068..156d3cc 100644
--- a/Core/DataStores/NullDataStore.php
+++ b/Core/DataStores/NullDataStore.php
@@ -6,8 +6,7 @@
  * Class NullDataStore
  *
  * Stub datastore to use when a datastore is not desirable to
- * be used. E.g. this can be subbed into the inflight data
- * store if that redundancy is not desired.
+ * be used.
  *
  * @package SmashPig\Core\DataStores
  */
diff --git a/Core/Listeners/ListenerBase.php b/Core/Listeners/ListenerBase.php
index 98a95e9..b3304ef 100644
--- a/Core/Listeners/ListenerBase.php
+++ b/Core/Listeners/ListenerBase.php
@@ -20,12 +20,8 @@
/** @var Configuration object - stores all listener configuration */
protected $c;
 
-   /** @var KeyedOpaqueDataStore for placing messages that are in flight */
-   protected $inflightStore;
-
public function __construct() {
$this->c = Context::get()->getConfiguration();
-   $this->inflightStore = $this->c->object( 'data-store/inflight' 
);
}
 
public function execute( Request $request, Response $response ) {
@@ -114,8 +110,7 @@
 *
 * @param ListenerMessage $msg Message object to operate on
 *
-* @return bool True if the message was successfully processed. 
Returning false will keep the
-* message in the bogus inflight queue.
+* @return bool True if the message was successfully processed.
 */
protected function processMessage( ListenerMessage $msg ) {
try {
diff --git a/Core/Listeners/RestListener.php b/Core/Listeners/RestListener.php
index c007928..ff597ca 100644
--- a/Core/Listeners/RestListener.php
+++ b/Core/Listeners/RestListener.php
@@ -17,13 +17,7 @@
 
if ( is_array( $msgs ) ) {
foreach ( $msgs as $msg ) {
-   // FIXME: this looks like an elaborate 
try-catch.  If there's
-   // a fatal exception, the remaining 
messages are toast anyway,
-   // so we should... do something 
different here.
-   $this->inflightStore->addObject( $msg );
-   if ( $this->processMessage( $msg ) ) {
-   
$this->inflightStore->removeObjects( $msg );
-   }
+   $this->processMessage( $msg );
}
}
$this->ackEnvelope();
diff --git a/Core/Listeners/SoapListener.php b/Core/Listeners/SoapListener.php
index 3f2f08c..9b55db1 100644
--- a/Core/Listeners/SoapListener.php
+++ b/Core/Listeners/SoapListener.php
@@ -43,8 +43,7 @@
 
/* --- Unfortunately because of how PHP handles SOAP 
requests we cannot do the fully wrapped
loop like we could in the REST 
listener. Instead it is up to the listener itself to
-   do the required calls to 
$this->inflightStore->addObject( $msg ), $this->processMessage( $msg ),
-   and $this->inflightStore->removeObject( 
$msg ).
+   do the required call to 
$this->processMessage( $msg ).
 
It is also expected that inside the 
handle() context that an exception will throw a SOAP
fault through $this->server->fault() 
instead of doing a $response->kill_response() call.
diff --git a/PaymentProviders/Adyen/AdyenListener.php 
b/PaymentProviders/Adyen/AdyenListener.php
index 7bdbb87..ba7d7dd 100644
--- a/PaymentProviders/Adyen/AdyenListener.php
+++ b/PaymentProviders/Adyen/AdyenListener.php
@@ -94,10 +94,9 @@
// Now process each message to the best of our ability
foreach ( $messages as $msg ) {
if ( $this->processMessage( $msg ) ) {
-   Logger::debug( "Message suc

[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Minor documentation updates

2016-09-30 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: Minor documentation updates
..

Minor documentation updates

Update DatabaseBase type hint

Update some deprecated code usages

Change-Id: I86aa4507447040754d0c9f20171f7e22aed4a0cc
---
M OATHAuth.hooks.php
M OATHAuthUtils.php
M OATHUserRepository.php
M special/SpecialOATHLogin.php
4 files changed, 23 insertions(+), 8 deletions(-)


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

diff --git a/OATHAuth.hooks.php b/OATHAuth.hooks.php
index a9100f0..e3101fa 100644
--- a/OATHAuth.hooks.php
+++ b/OATHAuth.hooks.php
@@ -20,7 +20,8 @@
static $service = null;
 
if ( $service == null ) {
-   $service = new OATHUserRepository( wfGetLB( 
$wgOATHAuthDatabase ) );
+   $factory = 
\MediaWiki\MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+   $service = new OATHUserRepository( $factory->getMainLB( 
$wgOATHAuthDatabase ) );
}
 
return $service;
@@ -167,10 +168,10 @@
 * Helper function for converting old users to the new schema
 * @see OATHAuthHooks::OATHAuthSchemaUpdates
 *
-* @param DatabaseBase $db
+* @param Database $db
 * @return bool
 */
-   public static function schemaUpdateOldUsers( DatabaseBase $db ) {
+   public static function schemaUpdateOldUsers( Database $db ) {
if ( !$db->fieldExists( 'oathauth_users', 'secret_reset' ) ) {
return true;
}
diff --git a/OATHAuthUtils.php b/OATHAuthUtils.php
index 00fe248..5fcf018 100644
--- a/OATHAuthUtils.php
+++ b/OATHAuthUtils.php
@@ -48,6 +48,8 @@
/**
 * Generate encryption and hmac keys, unique to this user, based on a 
single
 * wiki secret. Use a moderate pbkdf2 work factor in case we ever leak 
keys.
+* @param string $secret
+* @param string|int $userid
 * @return array including key for encryption and integrity checking
 */
private static function getUserKeys( $secret, $userid ) {
@@ -61,6 +63,9 @@
/**
 * Actually encrypt the data, using a new random IV, and prepend the 
hmac
 * of the encrypted data + IV, using a separate hmac key.
+* @param string $data
+* @param string $encKey
+* @param string $hmacKey
 * @return string $hmac.$iv.$ciphertext, each component b64 encoded
 */
private static function seal( $data, $encKey, $hmacKey ) {
@@ -80,9 +85,9 @@
/**
 * Decrypt data sealed using seal(). First checks the hmac to prevent 
various
 * attacks.
-* @param $encrypted
-* @param $encKey
-* @param $hmacKey
+* @param string $encrypted
+* @param string $encKey
+* @param string $hmacKey
 * @return string plaintext
 * @throws Exception
 */
diff --git a/OATHUserRepository.php b/OATHUserRepository.php
index a7f6a33..8185187 100644
--- a/OATHUserRepository.php
+++ b/OATHUserRepository.php
@@ -4,6 +4,10 @@
/** @var LoadBalancer */
protected $lb;
 
+   /**
+* OATHUserRepository constructor.
+* @param LoadBalancer $lb
+*/
public function __construct( LoadBalancer $lb ) {
$this->lb = $lb;
}
@@ -26,6 +30,9 @@
return $oathUser;
}
 
+   /**
+* @param OATHUser $user
+*/
public function persist( OATHUser $user ) {
$this->getDB( DB_MASTER )->replace(
'oathauth_users',
@@ -39,6 +46,9 @@
);
}
 
+   /**
+* @param OATHUser $user
+*/
public function remove( OATHUser $user ) {
$this->getDB( DB_MASTER )->delete(
'oathauth_users',
diff --git a/special/SpecialOATHLogin.php b/special/SpecialOATHLogin.php
index a50cc6c..c7a7681 100644
--- a/special/SpecialOATHLogin.php
+++ b/special/SpecialOATHLogin.php
@@ -109,8 +109,7 @@
 * @return bool
 */
public function onAbortLogin( User $user, $password, &$abort, 
&$errorMsg ) {
-   $result = $this->OATHUser
-   ->getKey()
+   $result = $this->OATHUser->getKey()
->verifyToken( $this->getRequest()->getVal( 'token' ), 
$this->OATHUser );
 
if ( $result ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86aa4507447040754d0c9f20171f7e22aed4a0cc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: Reedy 


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: database: Rename LBFactoryMW to MWLBFactory

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

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

Change subject: database: Rename LBFactoryMW to MWLBFactory
..

database: Rename LBFactoryMW to MWLBFactory

It's no longer an LBFactory subclass (since 5d4b009cf), and the MW-prefix
seems more natural for this class.

The class has only existed since for about 2 weeks (since 0e5cd18b7) and
is not used outside MediaWiki core across Wikimedia Git.

Change-Id: I34be982b5d10ad03e062033da9c40b4a01665289
---
M autoload.php
M includes/ServiceWiring.php
R includes/db/MWLBFactory.php
M tests/phpunit/includes/db/LBFactoryTest.php
4 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/20/313620/1

diff --git a/autoload.php b/autoload.php
index 5b99fac..323a01d 100644
--- a/autoload.php
+++ b/autoload.php
@@ -663,7 +663,6 @@
'KkConverter' => __DIR__ . '/languages/classes/LanguageKk.php',
'KuConverter' => __DIR__ . '/languages/classes/LanguageKu.php',
'LBFactory' => __DIR__ . '/includes/libs/rdbms/lbfactory/LBFactory.php',
-   'LBFactoryMW' => __DIR__ . '/includes/db/loadbalancer/LBFactoryMW.php',
'LBFactoryMulti' => __DIR__ . 
'/includes/libs/rdbms/lbfactory/LBFactoryMulti.php',
'LBFactorySimple' => __DIR__ . 
'/includes/libs/rdbms/lbfactory/LBFactorySimple.php',
'LBFactorySingle' => __DIR__ . 
'/includes/libs/rdbms/lbfactory/LBFactorySingle.php',
@@ -781,6 +780,7 @@
'MWFileProps' => __DIR__ . '/includes/utils/MWFileProps.php',
'MWGrants' => __DIR__ . '/includes/utils/MWGrants.php',
'MWHttpRequest' => __DIR__ . '/includes/HttpFunctions.php',
+   'MWLBFactory' => __DIR__ . '/includes/db/MWLBFactory.php',
'MWMemcached' => __DIR__ . '/includes/compat/MemcachedClientCompat.php',
'MWMessagePack' => __DIR__ . '/includes/libs/MWMessagePack.php',
'MWNamespace' => __DIR__ . '/includes/MWNamespace.php',
diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php
index 6044911..11ee616 100644
--- a/includes/ServiceWiring.php
+++ b/includes/ServiceWiring.php
@@ -45,11 +45,11 @@
'DBLoadBalancerFactory' => function( MediaWikiServices $services ) {
$mainConfig = $services->getMainConfig();
 
-   $lbConf = LBFactoryMW::applyDefaultConfig(
+   $lbConf = MWLBFactory::applyDefaultConfig(
$mainConfig->get( 'LBFactoryConf' ),
$mainConfig
);
-   $class = LBFactoryMW::getLBFactoryClass( $lbConf );
+   $class = MWLBFactory::getLBFactoryClass( $lbConf );
 
return new $class( $lbConf );
},
diff --git a/includes/db/loadbalancer/LBFactoryMW.php 
b/includes/db/MWLBFactory.php
similarity index 97%
rename from includes/db/loadbalancer/LBFactoryMW.php
rename to includes/db/MWLBFactory.php
index 9821da1..96c6e9f 100644
--- a/includes/db/loadbalancer/LBFactoryMW.php
+++ b/includes/db/MWLBFactory.php
@@ -24,10 +24,10 @@
 use MediaWiki\Logger\LoggerFactory;
 
 /**
- * Legacy MediaWiki-specific class for generating database load balancers
+ * MediaWiki-specific class for generating database load balancers
  * @ingroup Database
  */
-abstract class LBFactoryMW {
+abstract class MWLBFactory {
/**
 * @param array $lbConf Config for LBFactory::__construct()
 * @param Config $mainConfig Main config object from MediaWikiServices
diff --git a/tests/phpunit/includes/db/LBFactoryTest.php 
b/tests/phpunit/includes/db/LBFactoryTest.php
index 0f4484e..aed2d83 100644
--- a/tests/phpunit/includes/db/LBFactoryTest.php
+++ b/tests/phpunit/includes/db/LBFactoryTest.php
@@ -43,7 +43,7 @@
];
 
$this->hideDeprecated( '$wgLBFactoryConf must be updated. See 
RELEASE-NOTES for details' );
-   $result = LBFactoryMW::getLBFactoryClass( $config );
+   $result = MWLBFactory::getLBFactoryClass( $config );
 
$this->assertEquals( $expected, $result );
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Clean up code style and docblocks

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

Change subject: Clean up code style and docblocks
..


Clean up code style and docblocks

* array() -> []
* spacing fixes
* dirname( __FILE__ ) -> __DIR__
* Add phpcs style checks using latest mediawiki-codesniffer to keep
  things clean.

Co-Authored-By: Bryan Davis 
Change-Id: I95735f928d3e5d6ac9d2a10d92b40ed01cf2737c
---
M OATHAuth.alias.php
M OATHAuth.hooks.legacy.php
M OATHAuth.hooks.php
M OATHAuthKey.php
M OATHAuthUtils.php
M OATHUser.php
M OATHUserRepository.php
M auth/TOTPAuthenticationRequest.php
M auth/TOTPSecondaryAuthenticationProvider.php
M composer.json
M maintenance/update_scratch_token_format.php
M modules/jquery.qrcode.js
A phpcs.xml
M special/ProxySpecialPage.php
M special/SpecialOATHDisable.php
M special/SpecialOATHEnable.php
M special/SpecialOATHLogin.php
17 files changed, 144 insertions(+), 121 deletions(-)

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



diff --git a/OATHAuth.alias.php b/OATHAuth.alias.php
index e454fd8..4de0434 100644
--- a/OATHAuth.alias.php
+++ b/OATHAuth.alias.php
@@ -7,39 +7,39 @@
  */
 // @codingStandardsIgnoreFile
 
-$specialPageAliases = array();
+$specialPageAliases = [];
 
 /** English (English) */
-$specialPageAliases['en'] = array(
-   'OATH' => array( 'OATH', 'OATHAuth' ),
-);
+$specialPageAliases['en'] = [
+   'OATH' => [ 'OATH', 'OATHAuth' ],
+];
 
 /** Arabic (العربية) */
-$specialPageAliases['ar'] = array(
-   'OATH' => array( 'أواث', 'أواث_أوث' ),
-);
+$specialPageAliases['ar'] = [
+   'OATH' => [ 'أواث', 'أواث_أوث' ],
+];
 
 /** Egyptian Arabic (مصرى) */
-$specialPageAliases['arz'] = array(
-   'OATH' => array( 'اواث', 'اواث_اوث' ),
-);
+$specialPageAliases['arz'] = [
+   'OATH' => [ 'اواث', 'اواث_اوث' ],
+];
 
 /** Northern Luri (لۊری شومالی) */
-$specialPageAliases['lrc'] = array(
-   'OATH' => array( 'قأسأم' ),
-);
+$specialPageAliases['lrc'] = [
+   'OATH' => [ 'قأسأم' ],
+];
 
 /** Urdu (اردو) */
-$specialPageAliases['ur'] = array(
-   'OATH' => array( 'حلف_نامہ' ),
-);
+$specialPageAliases['ur'] = [
+   'OATH' => [ 'حلف_نامہ' ],
+];
 
 /** Simplified Chinese (中文(简体)‎) */
-$specialPageAliases['zh-hans'] = array(
-   'OATH' => array( 'OATH验证' ),
-);
+$specialPageAliases['zh-hans'] = [
+   'OATH' => [ 'OATH验证' ],
+];
 
 /** Traditional Chinese (中文(繁體)‎) */
-$specialPageAliases['zh-hant'] = array(
-   'OATH' => array( 'OATH_認證' ),
-);
\ No newline at end of file
+$specialPageAliases['zh-hant'] = [
+   'OATH' => [ 'OATH_認證' ],
+];
\ No newline at end of file
diff --git a/OATHAuth.hooks.legacy.php b/OATHAuth.hooks.legacy.php
index dbe0a9f..d62b3ec 100644
--- a/OATHAuth.hooks.legacy.php
+++ b/OATHAuth.hooks.legacy.php
@@ -10,7 +10,7 @@
 * @return bool
 */
static function ChangePasswordForm( &$extraFields ) {
-   $tokenField = array( 'wpOATHToken', 'oathauth-token', 
'password', '' );
+   $tokenField = [ 'wpOATHToken', 'oathauth-token', 'password', '' 
];
array_push( $extraFields, $tokenField );
 
return true;
diff --git a/OATHAuth.hooks.php b/OATHAuth.hooks.php
index f2ad0e2..a9100f0 100644
--- a/OATHAuth.hooks.php
+++ b/OATHAuth.hooks.php
@@ -2,8 +2,6 @@
 
 use MediaWiki\Auth\AuthenticationRequest;
 use MediaWiki\Auth\AuthManager;
-use MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider;
-use MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider;
 
 /**
  * Hooks for Extension:OATHAuth
@@ -119,18 +117,17 @@
$title = SpecialPage::getTitleFor( 'OATH' );
$msg = $oathUser->getKey() !== null ? 'oathauth-disable' : 
'oathauth-enable';
 
-   $preferences[$msg] = array(
+   $preferences[$msg] = [
'type' => 'info',
'raw' => 'true',
'default' => Linker::link(
$title,
wfMessage( $msg )->escaped(),
-   array(),
-   array( 'returnto' => SpecialPage::getTitleFor( 
'Preferences' )->getPrefixedText() )
+   [],
+   [ 'returnto' => SpecialPage::getTitleFor( 
'Preferences' )->getPrefixedText() ]
),
'label-message' => 'oathauth-prefs-label',
-   'section' => 'personal/info',
-   );
+   'section' => 'personal/info', ];
 
return true;
}
@@ -140,12 +137,12 @@
 * @return bool
 */
public static function onLoadExtensionSchemaUpdates( $updater ) {
-   $base = dirname( __FILE__ );
+   $base = __DIR__;
switch ( $updater->getDB()->getTyp

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: When we have multiple tabs and NWE enabled, set the edit tab...

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

Change subject: When we have multiple tabs and NWE enabled, set the edit tab's 
URL to NWE
..


When we have multiple tabs and NWE enabled, set the edit tab's URL to NWE

For middle click/ctrl+click

Bug: T146323
Change-Id: I66d75d222cad2183beebd49759a35ee8d85969b2
---
M VisualEditor.hooks.php
1 file changed, 11 insertions(+), 0 deletions(-)

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



diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 0d6dc14..5a170b6 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -330,6 +330,17 @@
$user->getOption( 
'visualeditor-tabs' ) === 'multi-tab'
)
) {
+   if (
+   $config->get( 
'VisualEditorEnableWikitext' ) &&
+   $user->getOption( 
'visualeditor-newwikitext' )
+   ) {
+   $parsed = wfParseUrl( 
wfExpandUrl( $editTab['href'] ) );
+   $q = wfCgiToArray( 
$parsed['query'] );
+   unset( $q['action'] );
+   $q['veaction'] = 'editsource';
+   $parsed['query'] = 
wfArrayToCgi( $q );
+   $editTab['href'] = 
wfAssembleUrl( $parsed );
+   }
// Inject the VE tab before or after 
the edit tab
if ( $config->get( 
'VisualEditorTabPosition' ) === 'before' ) {
$editTab['class'] .= ' 
collapsible';

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Extend classpath via Puppet

2016-09-30 Thread Eevans (Code Review)
Eevans has uploaded a new change for review.

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

Change subject: Extend classpath via Puppet
..

Extend classpath via Puppet

Allows a list of directories to be specified, the directories are searched
for Java jars, and any files found are added to the Cassandra classpath.

This changeset specifies no directories; This is a no-op.

Bug: T133395
Change-Id: I1ca51b74e6593505143d6f783245ce54bbb3aed5
---
M modules/cassandra/manifests/init.pp
R modules/cassandra/templates/cassandra.in.sh.erb
2 files changed, 17 insertions(+), 5 deletions(-)


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

diff --git a/modules/cassandra/manifests/init.pp 
b/modules/cassandra/manifests/init.pp
index 846807d..5db29e3 100644
--- a/modules/cassandra/manifests/init.pp
+++ b/modules/cassandra/manifests/init.pp
@@ -186,8 +186,8 @@
 #   Additional options to pass to the JVM.
 #   Default: []
 #
-# [*extra_classpath*]
-#   Additional classpath to be appended to the default.
+# [*extra_classpath_directories*]
+#   An array of directories to be searched for additional jar files.
 #   Default: []
 #
 # [*jmx_port*]
@@ -294,7 +294,7 @@
 $heap_newsize = undef,
 $jmx_port = 7199,
 $additional_jvm_opts  = [],
-$extra_classpath  = [],
+$extra_classpath_directories  = [],
 $dc   = 'datacenter1',
 $rack = 'rack1',
 $key_cache_size_in_mb = 400,
@@ -328,7 +328,7 @@
 validate_re($disk_failure_policy, '^(stop|best_effort|ignore)$')
 
 validate_array($additional_jvm_opts)
-validate_array($extra_classpath)
+validate_array($extra_classpath_directories)
 
 validate_string($logstash_host)
 # lint:ignore:only_variable_string
@@ -453,7 +453,7 @@
 
 file { '/etc/cassandra.in.sh':
 ensure  => present,
-source  => "puppet:///modules/${module_name}/cassandra.in.sh",
+content => template("${module_name}/cassandra.in.sh.erb"),
 owner   => 'cassandra',
 group   => 'cassandra',
 mode=> '0444',
diff --git a/modules/cassandra/files/cassandra.in.sh 
b/modules/cassandra/templates/cassandra.in.sh.erb
similarity index 73%
rename from modules/cassandra/files/cassandra.in.sh
rename to modules/cassandra/templates/cassandra.in.sh.erb
index b0f2624..253e219 100644
--- a/modules/cassandra/files/cassandra.in.sh
+++ b/modules/cassandra/templates/cassandra.in.sh.erb
@@ -17,6 +17,18 @@
 CLASSPATH=$CLASSPATH:$jar
 done
 
+<% if not @extra_classpath_directories.empty? -%>
+for search in <%= Array(@extra_classpath_directories).join(' ') %>; do
+if test -d "$search"; then
+   for j in "$search"/*.jar; do
+   if test -e "$j"; then
+   CLASSPATH=$CLASSPATH:"$j"
+   fi
+   done
+fi
+done
+<% end -%>
+
 CLASSPATH="$CLASSPATH:$EXTRA_CLASSPATH"
 
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileApp[master]: Explicitly set "mobile edit" tag.

2016-09-30 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review.

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

Change subject: Explicitly set "mobile edit" tag.
..

Explicitly set "mobile edit" tag.

Since the Android app no longer issues API requests through the mdot
domain, its edits are not getting marked as "mobile edit", which throws
off queries by users who want to track mobile edits.

This patch explicitly adds the "mobile edit" tag, in addition to the
existing "mobile app edit" tag, to edits that come from the app. This does
not seem to conflict with the MobileFrontend extension conditionally
adding the same tag.

Bug: T141667
Change-Id: I2e07c0264d7f7129dd476310d0e3199793ee8214
---
M MobileApp.hooks.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/MobileApp.hooks.php b/MobileApp.hooks.php
index e7c0ee8..2f9a3dd 100644
--- a/MobileApp.hooks.php
+++ b/MobileApp.hooks.php
@@ -10,6 +10,7 @@
 * @return bool
 */
public static function onListDefinedTags( array &$tags ) {
+   $tags[] = 'mobile edit';
$tags[] = 'mobile app edit';
return true;
}
@@ -34,7 +35,7 @@
( $isWikipediaApp && is_null( $logType ) )
|| ( $isCommonsApp && ( is_null( $logType ) || $logType 
== 'upload' ) )
) {
-   $rc->addTags( 'mobile app edit' );
+   $rc->addTags( [ 'mobile edit', 'mobile app edit' ] );
}
return true;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e07c0264d7f7129dd476310d0e3199793ee8214
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileApp
Gerrit-Branch: master
Gerrit-Owner: Dbrant 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Replace deprecated `constructive` with `progressive`

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

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

Change subject: Replace deprecated `constructive` with `progressive`
..

Replace deprecated `constructive` with `progressive`

Replacing deprecated `constructive` mediawiki.UI CSS class and OOjs UI
flag  with `progressive`.

Bug: T146923
Change-Id: I524b9722ee49692c55bb1f97d34d8a28068716ee
---
M includes/EditPage.php
M includes/Xml.php
M includes/htmlform/HTMLForm.php
M includes/htmlform/fields/HTMLSubmitField.php
M includes/specials/SpecialBotPasswords.php
M includes/specials/SpecialMovepage.php
M resources/src/mediawiki.special/mediawiki.special.apisandbox.js
M resources/src/mediawiki.ui/components/buttons.less
M resources/src/mediawiki.ui/components/forms.less
M resources/src/mediawiki.ui/components/inputs.less
M resources/src/mediawiki.ui/components/text.less
M resources/src/mediawiki/mediawiki.Upload.Dialog.js
M resources/src/mediawiki/mediawiki.feedback.js
13 files changed, 19 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/313617/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index 38f8ab6..c0c0048 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -4155,7 +4155,7 @@
'name' => 'wpSave',
'tabindex' => ++$tabindex,
] + Linker::tooltipAndAccesskeyAttribs( 'save' );
-   $buttons['save'] = Html::submitButton( $buttonLabel, $attribs, 
[ 'mw-ui-constructive' ] );
+   $buttons['save'] = Html::submitButton( $buttonLabel, $attribs, 
[ 'mw-ui-progressive' ] );
 
++$tabindex; // use the same for preview and live preview
$attribs = [
diff --git a/includes/Xml.php b/includes/Xml.php
index 43f7217..b1bd098 100644
--- a/includes/Xml.php
+++ b/includes/Xml.php
@@ -452,7 +452,7 @@
 
/**
 * Convenience function to build an HTML submit button
-* When $wgUseMediaWikiUIEverywhere is true it will default to a 
constructive button
+* When $wgUseMediaWikiUIEverywhere is true it will default to a 
progressive button
 * @param string $value Label text for the button
 * @param array $attribs Optional custom attributes
 * @return string HTML
@@ -467,7 +467,7 @@
// some submit forms
// might need to be mw-ui-destructive (e.g. delete a page)
if ( $wgUseMediaWikiUIEverywhere ) {
-   $baseAttrs['class'] = 'mw-ui-button mw-ui-constructive';
+   $baseAttrs['class'] = 'mw-ui-button mw-ui-progressive';
}
// Any custom attributes will take precendence of anything in 
baseAttrs e.g. override the class
$attribs = $attribs + $baseAttrs;
diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php
index c65d97f..1f4d99e 100644
--- a/includes/htmlform/HTMLForm.php
+++ b/includes/htmlform/HTMLForm.php
@@ -176,7 +176,7 @@
protected $mFieldTree;
protected $mShowReset = false;
protected $mShowSubmit = true;
-   protected $mSubmitFlags = [ 'constructive', 'primary' ];
+   protected $mSubmitFlags = [ 'primary', 'progressive' ];
protected $mShowCancel = false;
protected $mCancelTarget;
 
diff --git a/includes/htmlform/fields/HTMLSubmitField.php 
b/includes/htmlform/fields/HTMLSubmitField.php
index cb98549..0c33ad9 100644
--- a/includes/htmlform/fields/HTMLSubmitField.php
+++ b/includes/htmlform/fields/HTMLSubmitField.php
@@ -7,7 +7,7 @@
 class HTMLSubmitField extends HTMLButtonField {
protected $buttonType = 'submit';
 
-   protected $mFlags = [ 'primary', 'constructive' ];
+   protected $mFlags = [ 'primary', 'progressive' ];
 
public function skipLoadData( $request ) {
return !$request->getCheck( $this->mName );
diff --git a/includes/specials/SpecialBotPasswords.php 
b/includes/specials/SpecialBotPasswords.php
index ed3cd5e..1dd78d7 100644
--- a/includes/specials/SpecialBotPasswords.php
+++ b/includes/specials/SpecialBotPasswords.php
@@ -224,7 +224,7 @@
'name' => 'op',
'value' => 'create',
'label-message' => 
'botpasswords-label-create',
-   'flags' => [ 'primary', 'constructive' 
],
+   'flags' => [ 'primary', 'progressive' ],
] );
}
 
diff --git a/includes/specials/SpecialMovepage.php 
b/includes/specials/SpecialMovepage.php
index 3a12cf3..7b7661d 100644
--- a/includes/specials/SpecialMovepage.php
+++ b/includes/specials/SpecialMovepage.php
@@ -462,7 +462,7 @@
'name' => 'wpMove',
'value' 

[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Suppress unserialize errors

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

Change subject: Suppress unserialize errors
..


Suppress unserialize errors

Bug: T130740
Change-Id: I20b076b7f3ce15d31a21f8935b74f9121f70c5a3
---
M OATHAuth.hooks.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/OATHAuth.hooks.php b/OATHAuth.hooks.php
index d500a6e..ca82423 100644
--- a/OATHAuth.hooks.php
+++ b/OATHAuth.hooks.php
@@ -186,7 +186,9 @@
);
 
foreach ( $res as $row ) {
+   MediaWiki\suppressWarnings();
$scratchTokens = unserialize( base64_decode( 
$row->scratch_tokens ) );
+   MediaWiki\restoreWarnings();
if ( $scratchTokens ) {
$db->update(
'oathauth_users',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I20b076b7f3ce15d31a21f8935b74f9121f70c5a3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: BryanDavis 
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...OATHAuth[master]: We need a master to do write actions...

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

Change subject: We need a master to do write actions...
..


We need a master to do write actions...

Change-Id: I618d371cdf76d96370c65975db702ed2fef0579c
---
M maintenance/update_scratch_token_format.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/maintenance/update_scratch_token_format.php 
b/maintenance/update_scratch_token_format.php
index 1f35319..5457f5e 100644
--- a/maintenance/update_scratch_token_format.php
+++ b/maintenance/update_scratch_token_format.php
@@ -42,8 +42,8 @@
}
 
public function execute() {
-   $dbr = wfGetDB( DB_SLAVE );
-   if ( !OATHAuthHooks::schemaUpdateOldUsers( $dbr ) ) {
+   $dbw = $this->getDB( DB_MASTER );
+   if ( !OATHAuthHooks::schemaUpdateOldUsers( $dbw ) ) {
$this->error( "Failed to update scratch_token rows.\n", 
1);
}
$this->output( "Done.\n" );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I618d371cdf76d96370c65975db702ed2fef0579c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: CSteipp 
Gerrit-Reviewer: Dpatrick 
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]: mw.feedback: Use standard OOjs UI dialog error handling

2016-09-30 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mw.feedback: Use standard OOjs UI dialog error handling
..

mw.feedback: Use standard OOjs UI dialog error handling

Previously, we'd close the original dialog on failure and display a
new one, which had the unfortunate effect of losing the user's input
(which presumably was not saved due to the failure).

Bug: T147056
Change-Id: I8893658807f6a584d6db0a84bc508d87ef508c7e
---
M languages/i18n/en.json
M languages/i18n/qqq.json
M resources/Resources.php
M resources/src/mediawiki/mediawiki.feedback.js
4 files changed, 21 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/313616/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index cbe755d..d88cefa 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -3907,7 +3907,6 @@
"feedback-external-bug-report-button": "File a technical task",
"feedback-dialog-title": "Submit feedback",
"feedback-dialog-intro": "You can use the easy form below to submit 
your feedback. Your comment will be added to the page \"$1\", along with your 
username.",
-   "feedback-error-title": "Error",
"feedback-error1": "Error: Unrecognized result from API",
"feedback-error2": "Error: Edit failed",
"feedback-error3": "Error: No response from API",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 915f629..610ebea 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -4091,7 +4091,6 @@
"feedback-external-bug-report-button": "A button for submitting an 
external technical bug report.",
"feedback-dialog-title": "Title of the feedback dialog",
"feedback-dialog-intro": "An introduction at the top of the feedback 
dialog. $1 - Feedback page link",
-   "feedback-error-title": "{{Identical|Error}}",
"feedback-error1": "Error message, appears when an unknown error occurs 
submitting feedback",
"feedback-error2": "Error message, appears when we could not add 
feedback",
"feedback-error3": "Error message, appears when we lose our connection 
to the wiki",
diff --git a/resources/Resources.php b/resources/Resources.php
index b81fbde..32a754f 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1020,7 +1020,6 @@
'feedback-cancel',
'feedback-close',
'feedback-dialog-title',
-   'feedback-error-title',
'feedback-error1',
'feedback-error2',
'feedback-error3',
diff --git a/resources/src/mediawiki/mediawiki.feedback.js 
b/resources/src/mediawiki/mediawiki.feedback.js
index 170e124..8993046 100644
--- a/resources/src/mediawiki/mediawiki.feedback.js
+++ b/resources/src/mediawiki/mediawiki.feedback.js
@@ -116,22 +116,6 @@
]
};
break;
-   case 'error1':
-   case 'error2':
-   case 'error3':
-   case 'error4':
-   dialogConfig = {
-   title: mw.msg( 'feedback-error-title' ),
-   message: mw.msg( 'feedback-' + status ),
-   actions: [
-   {
-   action: 'accept',
-   label: mw.msg( 
'feedback-close' ),
-   flags: 'primary'
-   }
-   ]
-   };
-   break;
}
 
// Show the message dialog
@@ -422,8 +406,10 @@
}, function () {
fb.status = 'error4';
mw.log.warn( 'Feedback report failed 
because MessagePoster could not be fetched' );
-   } ).always( function () {
+   } ).then( function () {
fb.close();
+   }, function () {
+   return fb.getErrorMessage();
} );
}, this );
}
@@ -432,6 +418,24 @@
};
 
/**
+* Returns an error message for the current status.
+*
+* @private
+*
+* @return {string}
+*/
+   mw.Feedback.Dialog.prototype.getErrorMessage = function () {
+ 

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Pass excludeCurrentPage option to TitleSearchWidget in link ...

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

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

Change subject: Pass excludeCurrentPage option to TitleSearchWidget in link 
inspector
..

Pass excludeCurrentPage option to TitleSearchWidget in link inspector

Logically depends on Ieade9d0ff for the actual functionality.

Bug: T147050
Change-Id: I2cc4fc170398c80d7f0103772bc5685b8baf
---
M modules/ve-mw/ui/widgets/ve.ui.MWInternalLinkAnnotationWidget.js
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWInternalLinkAnnotationWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWInternalLinkAnnotationWidget.js
index 5e50dcb..ac55a1b 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWInternalLinkAnnotationWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWInternalLinkAnnotationWidget.js
@@ -56,6 +56,7 @@
var input = new mw.widgets.TitleSearchWidget( ve.extendObject( {
icon: 'search',
showRedlink: true,
+   excludeCurrentPage: true,
showImages: mw.config.get( 'wgVisualEditor' ).usePageImages,
showDescriptions: mw.config.get( 'wgVisualEditor' 
).usePageDescriptions,
cache: ve.init.platform.linkCache

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cc4fc170398c80d7f0103772bc5685b8baf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add an option to the title widget to exclude the current page

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

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

Change subject: Add an option to the title widget to exclude the current page
..

Add an option to the title widget to exclude the current page

Useful when suggesting links, as linking to the current page
is discouraged.

Bug: T147050
Change-Id: Ieade9d0ffc05b358df6af0b65d58e60f5b87577e
---
M resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/313614/1

diff --git a/resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js 
b/resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
index 1732407..b25b2d4 100644
--- a/resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
+++ b/resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
@@ -33,6 +33,7 @@
 * @cfg {boolean} [showRedlink] Show red link to exact match if it 
doesn't exist
 * @cfg {boolean} [showImages] Show page images
 * @cfg {boolean} [showDescriptions] Show page descriptions
+* @cfg {boolean} [excludeCurrentPage] Exclude the current page from 
suggestions
 * @cfg {boolean} [validateTitle=true] Whether the input must be a 
valid title (if set to true,
 *  the widget will marks itself red for invalid inputs, including an 
empty query).
 * @cfg {Object} [cache] Result cache which implements a 'set' method, 
taking keyed values as an argument
@@ -54,6 +55,7 @@
this.showRedlink = !!config.showRedlink;
this.showImages = !!config.showImages;
this.showDescriptions = !!config.showDescriptions;
+   this.excludeCurrentPage = !!config.excludeCurrentPage;
this.validateTitle = config.validateTitle !== undefined ? 
config.validateTitle : true;
this.cache = config.cache;
 
@@ -162,6 +164,7 @@
 */
mw.widgets.TitleWidget.prototype.getOptionsFromData = function ( data ) 
{
var i, len, index, pageExists, pageExistsExact, suggestionPage, 
page, redirect, redirects,
+   currentPageName = new mw.Title( mw.config.get( 
'wgRelevantPageName' ) ).getPrefixedText(),
items = [],
titles = [],
titleObj = mw.Title.newFromText( this.getQueryValue() ),
@@ -178,6 +181,10 @@
 
for ( index in data.pages ) {
suggestionPage = data.pages[ index ];
+   // When excludeCurrentPage is set, don't list the 
current page unless the user has type the full title
+   if ( this.excludeCurrentPage && suggestionPage.title 
=== currentPageName && suggestionPage.title !== titleObj.getPrefixedText() ) {
+   continue;
+   }
pageData[ suggestionPage.title ] = {
missing: suggestionPage.missing !== undefined,
redirect: suggestionPage.redirect !== undefined,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Timestamp[master]: Fix @covers tags

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

Change subject: Fix @covers tags
..


Fix @covers tags

Change-Id: I1651cfd6d7e9be91480fb70aeb75e728982daf2c
---
M tests/TimestampTest.php
1 file changed, 10 insertions(+), 10 deletions(-)

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



diff --git a/tests/TimestampTest.php b/tests/TimestampTest.php
index 1cfec45..df1e1b9 100644
--- a/tests/TimestampTest.php
+++ b/tests/TimestampTest.php
@@ -30,7 +30,7 @@
  */
 class ConvertibleTimestampTest extends \PHPUnit_Framework_TestCase {
/**
-* @covers ConvertibleTimestamp::__construct
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp::__construct
 */
public function testConstructWithNoTimestamp() {
$timestamp = new ConvertibleTimestamp();
@@ -40,7 +40,7 @@
}
 
/**
-* @covers ConvertibleTimestamp::__toString
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp::__toString
 */
public function testToString() {
$timestamp = new ConvertibleTimestamp( '1406833268' ); // 
Equivalent to 20140731190108
@@ -58,7 +58,7 @@
 
/**
 * @dataProvider provideValidTimestampDifferences
-* @covers ConvertibleTimestamp::diff
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp::diff
 */
public function testDiff( $timestamp1, $timestamp2, $expected ) {
$timestamp1 = new ConvertibleTimestamp( $timestamp1 );
@@ -70,7 +70,7 @@
/**
 * Test parsing of valid timestamps and outputing to MW format.
 * @dataProvider provideValidTimestamps
-* @covers ConvertibleTimestamp::getTimestamp
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp::getTimestamp
 */
public function testValidParse( $format, $original, $expected ) {
$timestamp = new ConvertibleTimestamp( $original );
@@ -80,7 +80,7 @@
/**
 * Test outputting valid timestamps to different formats.
 * @dataProvider provideValidTimestamps
-* @covers ConvertibleTimestamp::getTimestamp
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp::getTimestamp
 */
public function testValidOutput( $format, $expected, $original ) {
$timestamp = new ConvertibleTimestamp( $original );
@@ -90,7 +90,7 @@
/**
 * Test an invalid timestamp.
 * @expectedException \Wikimedia\Timestamp\TimestampException
-* @covers ConvertibleTimestamp
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp
 */
public function testInvalidParse() {
new ConvertibleTimestamp( "This is not a timestamp." );
@@ -98,7 +98,7 @@
 
/**
 * @dataProvider provideValidTimestamps
-* @covers ConvertibleTimestamp::convert
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp::convert
 */
public function testConvert( $format, $expected, $original ) {
$this->assertSame( $expected, ConvertibleTimestamp::convert( 
$format, $original ) );
@@ -106,7 +106,7 @@
 
/**
 * Format an invalid timestamp.
-* @covers ConvertibleTimestamp::convert
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp::convert
 */
public function testConvertInvalid() {
$this->assertSame( false, ConvertibleTimestamp::convert( 'Not a 
timestamp', 0 ) );
@@ -116,7 +116,7 @@
 * Test an out of range timestamp
 * @dataProvider provideOutOfRangeTimestamps
 * @expectedException \Wikimedia\Timestamp\TimestampException
-* @covers   ConvertibleTimestamp
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp
 */
public function testOutOfRangeTimestamps( $format, $input ) {
$timestamp = new ConvertibleTimestamp( $input );
@@ -126,7 +126,7 @@
/**
 * Test requesting an invalid output format.
 * @expectedException \Wikimedia\Timestamp\TimestampException
-* @covers ConvertibleTimestamp::getTimestamp
+* @covers \Wikimedia\Timestamp\ConvertibleTimestamp::getTimestamp
 */
public function testInvalidOutput() {
$timestamp = new ConvertibleTimestamp( '1343761268' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1651cfd6d7e9be91480fb70aeb75e728982daf2c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/libs/Timestamp
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
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...Timestamp[master]: Avoid parsing in now()

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

Change subject: Avoid parsing in now()
..


Avoid parsing in now()

false is already special cased as now, but if we pass time(), then it has to
try and parse the time until it hits TS_UNIX.

Change-Id: If06c9291d5ddb5fb2e1be0f363f0fbf4a55180f6
---
M src/ConvertibleTimestamp.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/ConvertibleTimestamp.php b/src/ConvertibleTimestamp.php
index 6bfcb52..5ed934a 100644
--- a/src/ConvertibleTimestamp.php
+++ b/src/ConvertibleTimestamp.php
@@ -170,7 +170,7 @@
 * Convert a timestamp string to a given format.
 *
 * @param int $style Constant Output format for timestamp
-* @param string $ts Timestamp
+* @param string|int|bool $ts Timestamp
 * @return string|bool Formatted timestamp or false on failure
 */
public static function convert( $style = TS_UNIX, $ts ) {
@@ -189,7 +189,7 @@
 * @return string
 */
public static function now( $style = TS_MW ) {
-   return static::convert( $style, time() );
+   return static::convert( $style, false );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If06c9291d5ddb5fb2e1be0f363f0fbf4a55180f6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/libs/Timestamp
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: 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...Echo[master]: [WIP] Make notifications top toolbar controls sticky

2016-09-30 Thread Kmuthu (Code Review)
Kmuthu has uploaded a new change for review.

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

Change subject: [WIP]  Make notifications top toolbar controls  sticky
..

[WIP]  Make notifications top toolbar controls  sticky

Notifications top toolbar controls  is made sticky when the user scrolls 
up/down. [WIP]: the sticky toolbar collapses when the page is resized.

Bug: T14096
Change-Id: I483c91344918f602da3280b9f8ad7e966bf55596
---
M modules/styles/mw.echo.ui.NotificationsInboxWidget.less
M modules/ui/mw.echo.ui.NotificationsInboxWidget.js
2 files changed, 84 insertions(+), 26 deletions(-)


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

diff --git a/modules/styles/mw.echo.ui.NotificationsInboxWidget.less 
b/modules/styles/mw.echo.ui.NotificationsInboxWidget.less
index 62be1d6..ff8678f 100644
--- a/modules/styles/mw.echo.ui.NotificationsInboxWidget.less
+++ b/modules/styles/mw.echo.ui.NotificationsInboxWidget.less
@@ -2,12 +2,19 @@
 .mw-echo-ui-notificationsInboxWidget {
display: table;
width: 100%;
+   z-index: 1;
+   position: relative;
max-width: @specialpage-width;
 
&-row {
display: table-row;
width: 100%;
}
+
+   &-toolbarWrapper {
+   height: 4em;
+   }
+
&-cell {
display: table-cell;
vertical-align: middle;
@@ -34,8 +41,14 @@
&-toolbar {
&-top {
display: table;
-   margin-bottom: 3 * @specialpage-separation-unit;
width: 100%;
+   }
+
+   &-affixed {
+   position: fixed;
+   z-index: 2;
+   top: 0;
+   background: #fff;
}
 
&-bottom {
@@ -66,6 +79,12 @@
text-align: center;
}
}
+   &-affixed {
+   position: fixed;
+   z-index: 2;
+   top: 0;
+   background: #fff;
+   }
&-readState {
display: inline-block;
}
@@ -74,7 +93,6 @@
display: inline-block;
margin-top: 1em;
}
-
&-settings {
.oo-ui-popupWidget-popup {
text-align: left;
diff --git a/modules/ui/mw.echo.ui.NotificationsInboxWidget.js 
b/modules/ui/mw.echo.ui.NotificationsInboxWidget.js
index d46f72d..a119724 100644
--- a/modules/ui/mw.echo.ui.NotificationsInboxWidget.js
+++ b/modules/ui/mw.echo.ui.NotificationsInboxWidget.js
@@ -96,7 +96,38 @@
this.topPaginationWidget.setDisabled( true );
this.bottomPaginationWidget.setDisabled( true );
 
+   this.$topToolbar =
+   $( '' )
+   .addClass( 
'mw-echo-ui-notificationsInboxWidget-main-toolbar-top' )
+   .append(
+   $( '' )
+   .addClass( 
'mw-echo-ui-notificationsInboxWidget-row' ),
+   $( '' )
+   .addClass( 
'mw-echo-ui-notificationsInboxWidget-main-toolbar-readState' )
+   .addClass( 
'mw-echo-ui-notificationsInboxWidget-cell' )
+   .append( 
this.readStateSelectWidget.$element ),
+   $( '' )
+   .addClass( 
'mw-echo-ui-notificationsInboxWidget-cell-placeholder' ),
+   $( '' )
+   .addClass( 
'mw-echo-ui-notificationsInboxWidget-main-toolbar-pagination' )
+   .addClass( 
'mw-echo-ui-notificationsInboxWidget-cell' )
+   .append( 
this.topPaginationWidget.$element ),
+   $( '' )
+   .addClass( 
'mw-echo-ui-notificationsInboxWidget-main-toolbar-settings' )
+   .addClass( 
'mw-echo-ui-notificationsInboxWidget-cell' )
+

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Fix styling of categories now they are editable

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

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

Change subject: Fix styling of categories now they are editable
..

Fix styling of categories now they are editable

Bug: T147084
Change-Id: I8c2acf507c72f6a35aadf595bad0c8c378140a0b
---
M modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.init.css
1 file changed, 12 insertions(+), 1 deletion(-)


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

diff --git a/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.init.css 
b/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.init.css
index 983a2ad..cd0badd 100644
--- a/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.init.css
+++ b/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.init.css
@@ -41,7 +41,7 @@
 }
 
 /* Once activated, everything except the progress bar, the edit target, and 
the category footer */
-.ve-activated .ve-init-mw-desktopArticleTarget-uneditableContent 
:not([id='catlinks']),
+.ve-activated .ve-init-mw-desktopArticleTarget-uneditableContent,
 /* While loading, everything except the progress bar */
 .ve-loading #content > :not( .ve-init-mw-desktopArticleTarget-loading-overlay 
) {
/* IE9 is supported with JS events */
@@ -61,6 +61,17 @@
opacity: 0.5;
 }
 
+.ve-activated .catlinks {
+   opacity: 1;
+   pointer-events: auto; /* stylelint-disable-line 
no-unsupported-browser-features */
+   cursor: pointer;
+}
+
+.ve-activated .catlinks > * {
+   pointer-events: none;/* stylelint-disable-line 
no-unsupported-browser-features */
+}
+
+
 /* Progress bar mimicking OOUI */
 
 .ve-activated #content {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c2acf507c72f6a35aadf595bad0c8c378140a0b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: POC: MobileFrontend should be able to use MobileContentService

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

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

Change subject: POC: MobileFrontend should be able to use MobileContentService
..

POC: MobileFrontend should be able to use MobileContentService

This allows the site admin to choose between Restbase or MobileFormatter
a la apps. It should demonstrate the power of such an approach - we can
now test locally on real content.

The idea is to move away from the blob of rendering a blob of HTML and
allow skins to have more control over the components within a page and be
more dumb about where they come from.

Looking at the MobileFormatter and ApiMobileView code, it feels like we
probably want to slowly move away from using MobileFormatter as a public
interface and instead use ApiMobileView directly

TODO:
* Avoid multiple parallel RESTBase requests (read caching)
* Edit icons/reference sections do not work

Bug: T145219
Change-Id: Ibfd1d728f8e1c155858b9bc657b6d16712619968
---
M includes/MobileFrontend.body.php
M includes/MobileFrontend.hooks.php
2 files changed, 100 insertions(+), 25 deletions(-)


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

diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index 83745f7..2d08ad5 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -23,35 +23,20 @@
}
}
 
-   /**
-* Transforms content to be mobile friendly version.
-* Filters out various elements and runs the MobileFormatter.
-* @param OutputPage $out
-* @param string $mode mobile mode, i.e. stable or beta
-*
-* @return string
-*/
-   public static function DOMParse( OutputPage $out, $text = null, $isBeta 
= false ) {
-   $html = $text ? $text : $out->getHTML();
-
+   public static function formatData( OutputPage $out, $html = null, 
$isBeta = false ) {
$context = MobileContext::singleton();
$config = $context->getMFConfig();
-
$title = $out->getTitle();
$ns = $title->getNamespace();
+   $html = $html ? $html : $out->getHTML();
+
// Only include the table of contents element if the page is in 
the main namespace
// and the MFTOC flag has been set (which means the page 
originally had a table of contents)
$includeTOC = $out->getProperty( 'MFTOC' ) && $ns === NS_MAIN;
-   $formatter = MobileFormatter::newFromContext( $context, $html );
-   $formatter->enableTOCPlaceholder( $includeTOC );
+   $useRest = true;
 
-   Hooks::run( 'MobileFrontendBeforeDOM', [ $context, $formatter ] 
);
-
-   $isSpecialPage = $title->isSpecialPage();
-
-   $formatter->enableExpandableSections(
-   // Don't collapse sections e.g. on JS pages
-   $out->canUseWikiPage()
+   // Don't collapse sections e.g. on JS pages
+   $collapseSections = $out->canUseWikiPage()
&& $out->getWikiPage()->getContentModel() == 
CONTENT_MODEL_WIKITEXT
// And not in certain namespaces
&& array_search(
@@ -59,13 +44,97 @@
$config->get( 
'MFNamespacesWithoutCollapsibleSections' )
) === false
// And not when what's shown is not actually article 
text
-   && $context->getRequest()->getText( 'action', 'view' ) 
== 'view'
-   );
+   && $context->getRequest()->getText( 'action', 'view' ) 
== 'view';
+
+   if ( $useRest ) {
+   return self::restFormatData( $title, $context, 
$includeTOC, $collapseSections, $html );
+   } else {
+   return self::mobileFormatData( $title, $context, 
$includeTOC, $collapseSections, $html );
+   }
+   }
+
+   public static function restFormatData( $title, $context, $includeToc, 
$collapseSections, $html ) {
+   $text = '';
+   $url = 'https://trending.wmflabs.org/api/page/en.wikipedia/';
+   $url .= rawurlencode( $title->getPrefixedText() );
+   set_error_handler(function() {}, E_WARNING);
+   $result = file_get_contents( $url, false );
+   restore_error_handler();
+   if ( $result === false ) {
+   return self::mobileFormatData( $title, $context, 
$includeToc, $collapseSections, $html );
+   } else {
+   $json = json_decode( $result, true );
+   if ( isset( $json['lead'] ) ) {
+   $lead = $json['lead'];
+   $allSections = ar

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Move media queries to end of the file

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

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

Change subject: Hygiene: Move media queries to end of the file
..

Hygiene: Move media queries to end of the file

For readability

Change-Id: I8804daef58d1d73090d39a0ee3eba2220254374a
---
M resources/skins.minerva.base.styles/pageactions.less
1 file changed, 13 insertions(+), 13 deletions(-)


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

diff --git a/resources/skins.minerva.base.styles/pageactions.less 
b/resources/skins.minerva.base.styles/pageactions.less
index 35b434c..55ed8cf 100644
--- a/resources/skins.minerva.base.styles/pageactions.less
+++ b/resources/skins.minerva.base.styles/pageactions.less
@@ -84,19 +84,6 @@
}
 }
 
-// On small devices that don't support Javascript, hide the page actions bar
-@media all and ( max-width: @wgMFDeviceWidthMobileSmall ) {
-   .client-nojs {
-   #page-actions {
-   display: none;
-   }
-
-   #section_0 {
-   border: 0;
-   }
-   }
-}
-
 // FIXME: Merge these styles with those above as part of T130849.
 .feature-page-action-bar-v2 {
.heading-holder {
@@ -144,6 +131,19 @@
}
 }
 
+// On small devices that don't support Javascript, hide the page actions bar
+@media all and ( max-width: @wgMFDeviceWidthMobileSmall ) {
+   .client-nojs {
+   #page-actions {
+   display: none;
+   }
+
+   #section_0 {
+   border: 0;
+   }
+   }
+}
+
 @media all and ( min-width: @deviceWidthTablet ) {
.feature-page-action-bar-v2 {
#page-actions {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8804daef58d1d73090d39a0ee3eba2220254374a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
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] mediawiki...CirrusSearch[master]: Add tests for Russian folding

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

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

Change subject: Add tests for Russian folding
..

Add tests for Russian folding

Bug: T102298
Bug: T124592
Change-Id: Ide7fc6dcb3602df07c916a74f469d6346a48be62
---
M tests/browser/environments.yml
A tests/browser/features/russian_folding.feature
M tests/browser/features/step_definitions/page_steps.rb
M tests/browser/features/step_definitions/search_steps.rb
M tests/browser/features/support/hooks.rb
5 files changed, 58 insertions(+), 0 deletions(-)


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

diff --git a/tests/browser/environments.yml b/tests/browser/environments.yml
index b07b6cc..cd0d6fe 100644
--- a/tests/browser/environments.yml
+++ b/tests/browser/environments.yml
@@ -20,6 +20,7 @@
   mediawiki_commons_api_url: 
http://commons.wiki.local.wmftest.net:8080/w/api.php
   mediawiki_url: http://cirrustest.wiki.local.wmftest.net:8080/wiki/
   mediawiki_url_commons: http://commons.wiki.local.wmftest.net:8080/wiki/
+  mediawiki_url_ru: http://ru.wiki.local.wmftest.net:8080/wiki/
   mediawiki_user: admin
   mediawiki_password: vagrant
   reuse_browser: true
@@ -49,6 +50,7 @@
   mediawiki_commons_api_url: 
http://commons-cirrus-browser-bot.wmflabs.org/w/api.php
   mediawiki_url: http://cirrustest-cirrus-browser-bot.wmflabs.org/wiki/
   mediawiki_url_commons: http://commons-cirrus-browser-bot.wmflabs.org/wiki/
+  mediawiki_url_ru: http://ru-cirrus-browser-bot.wmflabs.org/wiki/
   mediawiki_user: admin
   mediawiki_password: vagrant
   reuse_browser: true
diff --git a/tests/browser/features/russian_folding.feature 
b/tests/browser/features/russian_folding.feature
new file mode 100644
index 000..ddfdefc
--- /dev/null
+++ b/tests/browser/features/russian_folding.feature
@@ -0,0 +1,17 @@
+@clean @api @ru
+Feature: Searches with Russian accents
+  Scenario: Searching for ё when text has е
+When I api search on ru for чёрная дыра
+Then Черная дыра is the first api search result
+
+  Scenario: Searching for е when text has ё
+When I api search on ru for черный
+Then Саша Чёрный is the first api search result
+
+  Scenario: Searching for no accent and lowercase
+When I api search on ru for гликберг
+Then Саша Чёрный is the first api search result
+
+  Scenario: Searching for with accent
+When I api search on ru for Бра́зер
+Then Бразер is the first api search result
diff --git a/tests/browser/features/step_definitions/page_steps.rb 
b/tests/browser/features/step_definitions/page_steps.rb
index d742ff5..5088c63 100644
--- a/tests/browser/features/step_definitions/page_steps.rb
+++ b/tests/browser/features/step_definitions/page_steps.rb
@@ -3,6 +3,13 @@
   edit_page(title, text, false)
 end
 
+Given(/^a page on (\w+) named (.*) exists(?: with contents (.*))?$/) do |wiki, 
title, text|
+  text = title unless text
+  on_wiki(wiki) do
+edit_page(title, text, false)
+  end
+end
+
 Given(/^a file named (.*) exists(?: on (commons))? with contents (.*) and 
description (.*)$/) do |title, wiki, contents, description|
   on_wiki(wiki) do
 upload_file(title, contents, description)   # Make sure the file is correct
diff --git a/tests/browser/features/step_definitions/search_steps.rb 
b/tests/browser/features/step_definitions/search_steps.rb
index 6a450aa..adecca3 100644
--- a/tests/browser/features/step_definitions/search_steps.rb
+++ b/tests/browser/features/step_definitions/search_steps.rb
@@ -46,6 +46,23 @@
 @api_error = e
   end
 end
+When(/^I api search on (\w+) for (.*)$/) do |wiki, search|
+  begin
+on_wiki(wiki) do
+  @api_result = search_for(
+search.gsub(/%[^ {]+%/, @search_vars)
+  .gsub(/%\{\\u([\dA-Fa-f]{4,6})\}%/) do  # replace %{\u}% with 
the unicode code point
+[Regexp.last_match[1].hex].pack("U")
+  end,
+{}
+  )
+end
+  rescue MediawikiApi::ApiError => e
+@api_error = e
+  rescue MediawikiApi::HttpError => e
+@api_error = e
+  end
+end
 When(/^I get api suggestions for (.*?)(?: using the (.*) profile)?$/) do 
|search, profile|
   begin
 profile = profile ? profile : "fuzzy"
diff --git a/tests/browser/features/support/hooks.rb 
b/tests/browser/features/support/hooks.rb
index e8b082d..20e04d3 100644
--- a/tests/browser/features/support/hooks.rb
+++ b/tests/browser/features/support/hooks.rb
@@ -680,6 +680,18 @@
   end
 end
 
+ruwiki = false
+setup_ruwiki = lambda do |world|
+  unless ruwiki
+world.steps %(
+Given a page on ru named Черная дыра exists with contents Черная дыра́ — 
область пространства-времени
+  And a page on ru named Саша Чёрный exists with contents настоящее имя 
Алекса́ндр Миха́йлович Гли́кберг
+  And a page on ru named Бразер exists with contents белорусский советский 
скульптор
+)
+ruwiki = true
+  end
+end
+
 # Optimization for paralle

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

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

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


Merge branch 'master' into deployment

bde092f Don't return a reference to object, that means nothing
e88fe9e Remove Configuration::setDefaultConfig()
d71fc11 Add required gross_currency to PP refunds

Change-Id: I8fbdff77535ade2cc263ee9f8b464afdea437792
---
D Tests/TestingConfiguration.php
1 file changed, 0 insertions(+), 51 deletions(-)

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



diff --git a/Tests/TestingConfiguration.php b/Tests/TestingConfiguration.php
deleted file mode 100644
index 6e447a8..000
--- a/Tests/TestingConfiguration.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<<< HEAD   (8ff195 Merge branch 'master' into deployment)
-===
-override( $data );
-   return $config;
-   }
-
-   public static function tearDownConfiguration() {
-   $konfig = new ReflectionClass( 'SmashPig\Core\Configuration' );
-   $defaultConfig = $konfig->getProperty( 'defaultObj' );
-   $defaultConfig->setAccessible( true );
-   $defaultConfig->setValue( null );
-   }
-}
->>> BRANCH (d71fc1 Add required gross_currency to PP refunds)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8fbdff77535ade2cc263ee9f8b464afdea437792
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
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...SmashPig[deployment]: Merge branch 'master' into deployment

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

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

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

Merge branch 'master' into deployment

bde092f Don't return a reference to object, that means nothing
e88fe9e Remove Configuration::setDefaultConfig()
d71fc11 Add required gross_currency to PP refunds

Change-Id: I8fbdff77535ade2cc263ee9f8b464afdea437792
---
D Tests/TestingConfiguration.php
1 file changed, 0 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/08/313608/1

diff --git a/Tests/TestingConfiguration.php b/Tests/TestingConfiguration.php
deleted file mode 100644
index 6e447a8..000
--- a/Tests/TestingConfiguration.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<<< HEAD   (8ff195 Merge branch 'master' into deployment)
-===
-override( $data );
-   return $config;
-   }
-
-   public static function tearDownConfiguration() {
-   $konfig = new ReflectionClass( 'SmashPig\Core\Configuration' );
-   $defaultConfig = $konfig->getProperty( 'defaultObj' );
-   $defaultConfig->setAccessible( true );
-   $defaultConfig->setValue( null );
-   }
-}
->>> BRANCH (d71fc1 Add required gross_currency to PP refunds)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fbdff77535ade2cc263ee9f8b464afdea437792
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
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...SmashPig[master]: Add required gross_currency to PP refunds

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

Change subject: Add required gross_currency to PP refunds
..


Add required gross_currency to PP refunds

Change-Id: I73fecdc6c0938587d1c1c7fb569459ab2d18d9ba
---
M PaymentProviders/PayPal/Job.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/PaymentProviders/PayPal/Job.php b/PaymentProviders/PayPal/Job.php
index 56d6e1f..97a1245 100644
--- a/PaymentProviders/PayPal/Job.php
+++ b/PaymentProviders/PayPal/Job.php
@@ -83,6 +83,7 @@
// FIXME represent special case as var_map config 
override?
if ( $msg_type === 'refund' ) {
$new_msg->gateway_refund_id = 
$request['txn_id'];
+   $new_msg->gross_currency = $request['mc_gross'];
}
 
// FIXME once recurring uses normalized msg it needs 
this too

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I73fecdc6c0938587d1c1c7fb569459ab2d18d9ba
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Cdentinger 
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]: Add required gross_currency to PP refunds

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

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

Change subject: Add required gross_currency to PP refunds
..

Add required gross_currency to PP refunds

Change-Id: I73fecdc6c0938587d1c1c7fb569459ab2d18d9ba
---
M PaymentProviders/PayPal/Job.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/07/313607/1

diff --git a/PaymentProviders/PayPal/Job.php b/PaymentProviders/PayPal/Job.php
index 56d6e1f..97a1245 100644
--- a/PaymentProviders/PayPal/Job.php
+++ b/PaymentProviders/PayPal/Job.php
@@ -83,6 +83,7 @@
// FIXME represent special case as var_map config 
override?
if ( $msg_type === 'refund' ) {
$new_msg->gateway_refund_id = 
$request['txn_id'];
+   $new_msg->gross_currency = $request['mc_gross'];
}
 
// FIXME once recurring uses normalized msg it needs 
this too

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73fecdc6c0938587d1c1c7fb569459ab2d18d9ba
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
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/core[master]: Bidi-isolate revisions count in Special:Import

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

Change subject: Bidi-isolate revisions count in Special:Import
..


Bidi-isolate revisions count in Special:Import

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

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



diff --git a/includes/specials/SpecialImport.php 
b/includes/specials/SpecialImport.php
index fe1dd98..c58af60 100644
--- a/includes/specials/SpecialImport.php
+++ b/includes/specials/SpecialImport.php
@@ -594,9 +594,13 @@
$this->mPageCount++;
 
if ( $successCount > 0 ) {
+   //  prevents jumbling of the versions count
+   // in RTL wikis in case the page title is LTR
$this->getOutput()->addHTML(
"" . Linker::linkKnown( $title ) . " " .
+   "" .
$this->msg( 'import-revision-count' 
)->numParams( $successCount )->escaped() .
+   "" .
"\n"
);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3aacc10dd76aba9f4315db284a4bafe629219bc1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Mooeypoo 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: TTO 
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]: Add check for stable data before running GC charges.

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

Change subject: Add check for stable data before running GC charges.
..


Add check for stable data before running GC charges.

When running drush recurring-globalcollect an error will be thrown if
any scheduled dates are more than 2 days away from a one month range
and it will not continue. This is a back stop against miscalculated dates

Bug: T144557

Change-Id: Icbddc60d4b45849b3b1960f47ba0d3df960a643a
---
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.info
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
M sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
4 files changed, 88 insertions(+), 43 deletions(-)

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



diff --git 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc
index fcb9dd1..91a939f 100644
--- 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc
+++ 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc
@@ -14,7 +14,7 @@
 
   $items['recurring-globalcollect'] = array(
 'description' => 'Process recurring payments through GlobalCollect. ',
-'examples' => array( 
+'examples' => array(
   'drush recurring-globalcollect'   => '# Process recurring payments',
   'drush rg --batch=10'=> '# Process up to 10 
contributions.',
   'drush rg --date=2011-12-31' => '# Specify a date to 
process. By default, today will be processed.',
@@ -56,17 +56,17 @@
   $date = drush_get_option('date');
   $url = drush_get_option('url');
   $batch = drush_get_option('batch');
-  
+
   $options = array();
 
   // Set the date
   $options['date'] = drush_recurring_globalcollect_parse_date($date);
- 
+
   // Set the url
   if ( !is_null($url)) {
 $options['url'] = $url;
   }
- 
+
   // Set the number of contributions to batch
   if ( !is_null( $batch ) ) {
 $options['batch'] = $batch;
@@ -91,7 +91,7 @@
 
 /**
  * drush_recurring_globalcollect_validate
- * 
+ *
  * This function is called magically from within Drush
  *
  * Numeric values for batch will be converted to an integer:
@@ -119,8 +119,16 @@
 
   $batch = drush_get_option('batch');
   $date = drush_get_option('date');
-  
+
   $batch_max = (integer) variable_get('recurring_globalcollect_batch_max', 
100);
+  if (is_found_globalcollect_invalid_next_sched_dates()) {
+$message = 'Global Collect recurring processing aborted '
+  . 'until invalid next scheduled recurring dates resolved. The query '
+  . ' to find them is in 
https://phabricator.wikimedia.org/T144557#2673161';
+wmf_common_failmail('Invalid data blocking global collect', $message);
+drush_set_error('SCHED_DATE_CHECK', dt($message));
+return false;
+  }
 
   /**
* Validate batch:
@@ -137,18 +145,18 @@
   drush_set_error('BATCHING', dt($message));
   return false;
 }
-
+
 // $batch is numeric, convert it to an integer for further testing.
 $batch = (integer) $batch;
-
+
 if ($batch < 1) {
-  
+
   $message = 'Batching is disabled: $batch = "' . $batch . '"';
   $link = l('Edit recurring GlobalCollect settings', 
'admin/config/recurring_globalcollect');
   watchdog('recurring_globalcollect', $message, array(), WATCHDOG_WARNING, 
$link);
-  return false; 
+  return false;
 }
-
+
 if ($batch < 0) {
 
   $message = 'You specified a negative number. You must specify either'
@@ -157,7 +165,7 @@
   drush_set_error('BATCHING', dt($message));
   return false;
 }
-
+
 if ($batch > $batch_max) {
   $message = 'You are attempting to batch ' . $batch .' payments, which'
 . ' is more than the maximum allowed: ' . $batch_max .'. Either batch'
@@ -173,7 +181,7 @@
* - failures_before_cancellation
*/
   $failures_before_cancellation = (integer) 
variable_get('recurring_globalcollect_failures_before_cancellation', 0);
-  
+
   if ( $failures_before_cancellation < 1 ) {
 $message = 'The value in settings, "Failures before subscription is'
  . ' cancelled" must be a postive integer. You specifed ['
@@ -196,7 +204,7 @@
  * @return Returns the date with the format: 'Y-m-d'
  */
 function drush_recurring_globalcollect_parse_date($date) {
-  
+
   if (!empty($date)) {
 $oldTimezone = date_default_timezone_get();
 date_default_timezone_set( "UTC" );
@@ -204,20 +212,20 @@
 $now_stamp = time();
 $now = date('Y-m-d', $now_stamp);
 $date_stamp = strtotime($date);
-
+
 // Set date from stamp so we have the proper format expected by the module.
 $date = d

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Add check for stable data before running GC charges.

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

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

Change subject: Add check for stable data before running GC charges.
..

Add check for stable data before running GC charges.

When running drush recurring-globalcollect an error will be thrown if
any scheduled dates are more than 2 days away from a one month range
and it will not continue. This is a back stop against miscalculated dates

Bug: T144557

Change-Id: Icbddc60d4b45849b3b1960f47ba0d3df960a643a
---
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.info
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
M sites/all/modules/recurring_globalcollect/recurring_globalcollect_common.inc
4 files changed, 88 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/06/313606/1

diff --git 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc
index fcb9dd1..91a939f 100644
--- 
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc
+++ 
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.drush.inc
@@ -14,7 +14,7 @@
 
   $items['recurring-globalcollect'] = array(
 'description' => 'Process recurring payments through GlobalCollect. ',
-'examples' => array( 
+'examples' => array(
   'drush recurring-globalcollect'   => '# Process recurring payments',
   'drush rg --batch=10'=> '# Process up to 10 
contributions.',
   'drush rg --date=2011-12-31' => '# Specify a date to 
process. By default, today will be processed.',
@@ -56,17 +56,17 @@
   $date = drush_get_option('date');
   $url = drush_get_option('url');
   $batch = drush_get_option('batch');
-  
+
   $options = array();
 
   // Set the date
   $options['date'] = drush_recurring_globalcollect_parse_date($date);
- 
+
   // Set the url
   if ( !is_null($url)) {
 $options['url'] = $url;
   }
- 
+
   // Set the number of contributions to batch
   if ( !is_null( $batch ) ) {
 $options['batch'] = $batch;
@@ -91,7 +91,7 @@
 
 /**
  * drush_recurring_globalcollect_validate
- * 
+ *
  * This function is called magically from within Drush
  *
  * Numeric values for batch will be converted to an integer:
@@ -119,8 +119,16 @@
 
   $batch = drush_get_option('batch');
   $date = drush_get_option('date');
-  
+
   $batch_max = (integer) variable_get('recurring_globalcollect_batch_max', 
100);
+  if (is_found_globalcollect_invalid_next_sched_dates()) {
+$message = 'Global Collect recurring processing aborted '
+  . 'until invalid next scheduled recurring dates resolved. The query '
+  . ' to find them is in 
https://phabricator.wikimedia.org/T144557#2673161';
+wmf_common_failmail('Invalid data blocking global collect', $message);
+drush_set_error('SCHED_DATE_CHECK', dt($message));
+return false;
+  }
 
   /**
* Validate batch:
@@ -137,18 +145,18 @@
   drush_set_error('BATCHING', dt($message));
   return false;
 }
-
+
 // $batch is numeric, convert it to an integer for further testing.
 $batch = (integer) $batch;
-
+
 if ($batch < 1) {
-  
+
   $message = 'Batching is disabled: $batch = "' . $batch . '"';
   $link = l('Edit recurring GlobalCollect settings', 
'admin/config/recurring_globalcollect');
   watchdog('recurring_globalcollect', $message, array(), WATCHDOG_WARNING, 
$link);
-  return false; 
+  return false;
 }
-
+
 if ($batch < 0) {
 
   $message = 'You specified a negative number. You must specify either'
@@ -157,7 +165,7 @@
   drush_set_error('BATCHING', dt($message));
   return false;
 }
-
+
 if ($batch > $batch_max) {
   $message = 'You are attempting to batch ' . $batch .' payments, which'
 . ' is more than the maximum allowed: ' . $batch_max .'. Either batch'
@@ -173,7 +181,7 @@
* - failures_before_cancellation
*/
   $failures_before_cancellation = (integer) 
variable_get('recurring_globalcollect_failures_before_cancellation', 0);
-  
+
   if ( $failures_before_cancellation < 1 ) {
 $message = 'The value in settings, "Failures before subscription is'
  . ' cancelled" must be a postive integer. You specifed ['
@@ -196,7 +204,7 @@
  * @return Returns the date with the format: 'Y-m-d'
  */
 function drush_recurring_globalcollect_parse_date($date) {
-  
+
   if (!empty($date)) {
 $oldTimezone = date_default_timezone_get();
 date_default_timezone_set( "UTC" );
@@ -204,20 +212,20 @@
 $now_stamp = time();
 $now = date('Y-m-d', $now_stamp);
 $date_stamp = strtotime($date);
-
+
 // Set date from stamp so we have the p

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove MinervaUsePageActionBarV2 config variable

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

Change subject: Remove MinervaUsePageActionBarV2 config variable
..


Remove MinervaUsePageActionBarV2 config variable

It doesn't seem like we add any value to ourselves by continuing
to support this given we shipped this 2 months ago
(Ic14a7593ee6c268d619f72f5557b20a588b9e42e)

This begins the cleanup of new  language button related code
`.feature-page-action-bar-v2' class will be removed in a follow up
patch

Changes:
* Add test for when a page has no languages and AlwaysShowLanguageButton
is false

Bug: T146912
Change-Id: I61d04012d3456ee80c0548903e1a51b65f70579d
---
M README.md
M extension.json
M includes/MobileFrontend.hooks.php
M includes/skins/SkinMinerva.php
M tests/browser/LocalSettings.php
M tests/phpunit/skins/SkinMinervaPageActionsTest.php
6 files changed, 9 insertions(+), 27 deletions(-)

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



diff --git a/README.md b/README.md
index cc92b8a..8b5fd92 100644
--- a/README.md
+++ b/README.md
@@ -723,14 +723,3 @@
 "image/svg+xml",
   ]
 ```
-
- $wgMinervaUsePageActionBarV2
-
-Whether or not to use the v2 styles for the page action bar – the set of icons
-displayed near to the title of the page.
-
-When enabled the page actions will appear horizontally below the title at 
mobile widths and to the
-right of the title at tablet widths. The language switcher will always be the 
leftmost page action.
-
-* Type: `Boolean`
-* Default: `false`
diff --git a/extension.json b/extension.json
index bff0f1d..0bc8393 100644
--- a/extension.json
+++ b/extension.json
@@ -2049,7 +2049,6 @@
"MinervaAlwaysShowLanguageButton": true,
"MinervaBottomLanguageButton": true,
"MinervaUseFooterV2": false,
-   "MinervaUsePageActionBarV2": false,
"MFStripResponsiveImages": true,
"MFResponsiveImageWhitelist": [
"image/svg+xml"
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index e62b6a0..34f1dd7 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -1270,7 +1270,6 @@
/**
 * OutputPageBodyAttributes hook handler.
 *
-* If the new action bar is enabled, via the 
$wgMinervaUsePageActionBarV2, then the
 * feature-action-bar-v2 CSS feature flag is added to the 
body tag.
 *
 * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageBodyAttributes
@@ -1287,10 +1286,8 @@
$context = MobileContext::singleton();
$config = $context->getMFConfig();
 
-   // TODO: Remove this when the new action bar is actually 
considered stable (see T130849).
-   if ( $config->get( 'MinervaUsePageActionBarV2' ) || 
$context->isBetaGroupMember() ) {
-   $bodyAttributes['class'] .= ' 
feature-page-action-bar-v2';
-   }
+   $bodyAttributes['class'] .= ' feature-page-action-bar-v2';
+
if ( $config->get( 'MinervaUseFooterV2' ) || 
$context->isBetaGroupMember() ) {
$bodyAttributes['class'] .= ' feature-footer-v2';
}
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 4d7952a..3ed347e 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -143,8 +143,8 @@
 * The "edit" page action is not allowed if editing is not possible on 
the page
 * see @method: isCurrentPageEditable
 *
-* The "switch-language" is allowed if 
$wgMinervaUsePageActionBarV2 is truthy and
-* there are interlanguage links on the page, or 
$wgMinervaAlwaysShowLanguageButton
+* The "switch-language" is allowed if there are interlanguage links on 
the page,
+* or $wgMinervaAlwaysShowLanguageButton
 * is truthy.
 *
 * @param string $action
@@ -167,8 +167,7 @@
}
 
if ( $action === 'switch-language' ) {
-   return $config->get( 'MinervaUsePageActionBarV2' ) &&
-   ( $this->doesPageHaveLanguages || $config->get( 
'MinervaAlwaysShowLanguageButton' ) );
+   return $this->doesPageHaveLanguages || $config->get( 
'MinervaAlwaysShowLanguageButton' );
}
 
return true;
diff --git a/tests/browser/LocalSettings.php b/tests/browser/LocalSettings.php
index e18d7b4..26f9757 100644
--- a/tests/browser/LocalSettings.php
+++ b/tests/browser/LocalSettings.php
@@ -24,7 +24,6 @@
 
 // needed for testing whether the language button is displayed and disabled
 $wgMinervaAlwaysShowLanguageButton = true;
-$wgMinervaUsePageActionBarV2 = true;
 
 // For those who have wikibase installed.
 $wgMFUseWikibase = true;
diff --git a/tests/phpunit/skins/SkinMinervaPage

[MediaWiki-commits] [Gerrit] oojs/ui[master]: demo: Fix for IE 9

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

Change subject: demo: Fix for IE 9
..


demo: Fix for IE 9

IE 9 has a global 'performance' object, but it doesn't have a 'now' method.
Also, simplify the checks for 'performance'.

Change-Id: I4cdda5d15bbc53a2bf50e7dc7b776326e94961f6
---
M demos/demo.js
M demos/infusion.js
2 files changed, 2 insertions(+), 4 deletions(-)

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



diff --git a/demos/demo.js b/demos/demo.js
index ec12ec5..2d27c3c 100644
--- a/demos/demo.js
+++ b/demos/demo.js
@@ -194,8 +194,7 @@
 
// Helper function to get high resolution profiling data, where 
available.
function now() {
-   /* global performance */
-   return ( typeof performance !== 'undefined' ) ? 
performance.now() :
+   return ( window.performance && performance.now ) ? 
performance.now() :
Date.now ? Date.now() : new Date().getTime();
}
 
diff --git a/demos/infusion.js b/demos/infusion.js
index 7007eca..daf5b22 100644
--- a/demos/infusion.js
+++ b/demos/infusion.js
@@ -5,8 +5,7 @@
 
 // Helper function to get high resolution profiling data, where available.
 function now() {
-   /* global performance */
-   return ( typeof performance !== 'undefined' ) ? performance.now() :
+   return ( window.performance && performance.now ) ? performance.now() :
Date.now ? Date.now() : new Date().getTime();
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4cdda5d15bbc53a2bf50e7dc7b776326e94961f6
Gerrit-PatchSet: 2
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: VolkerE 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Citoid[master]: Decode input before sending to citoid

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

Change subject: Decode input before sending to citoid
..


Decode input before sending to citoid

The citoid service seems to expect non-encoded URLs as input. So, decode first
as most pasted URLs will have been automatically encoded by the browser when
copied.

Bug: T146539
Bug: T106234
Change-Id: Ia7146ed9027420177e42f47972afe14edf50848f
---
M modules/ve.ui.CiteFromIdInspector.js
1 file changed, 8 insertions(+), 1 deletion(-)

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



diff --git a/modules/ve.ui.CiteFromIdInspector.js 
b/modules/ve.ui.CiteFromIdInspector.js
index 1e1dea7..9689e3d 100644
--- a/modules/ve.ui.CiteFromIdInspector.js
+++ b/modules/ve.ui.CiteFromIdInspector.js
@@ -527,6 +527,7 @@
  */
 ve.ui.CiteFromIdInspector.prototype.performLookup = function () {
var xhr,
+   search,
inspector = this;
 
// TODO: Add caching for requested urls
@@ -540,12 +541,18 @@
this.lookupButton.setDisabled( true );
this.lookupInput.setDisabled( true ).pushPending();
 
+   search = this.lookupInput.getValue();
+   // Common case: pasting a URI into this field. Citoid expects
+   // minimally encoded input, so do some speculative decoding here to
+   // avoid 404 fetches. T146539
+   search = ve.safeDecodeURIComponent( search );
+
// We have to first set up a get response so we can have
// a proper xhr object with "abort" method, so we can
// hand off this abort method to the jquery promise
xhr = this.service
.get( {
-   search: this.lookupInput.getValue(),
+   search: search,
format: ve.ui.CiteFromIdInspector.static.citoidFormat,
basefields: 'true' // Request base fields from API i.e. 
publicationTitle instead of websiteTitle
} );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia7146ed9027420177e42f47972afe14edf50848f
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Citoid
Gerrit-Branch: master
Gerrit-Owner: DLynch 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: DLynch 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: Mvolz 
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...CirrusSearch[master]: Remove UserTesting logging

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

Change subject: Remove UserTesting logging
..


Remove UserTesting logging

We don't use this specific logging anymore. We have mostly changed over
from using backend splits to having frontend code do the splits and
logging, and having the backend code trigger off query parameters. As
such we don't use these backend logs anymore.

The same information still makes it into hive via the
CirrusSearchRequestSet data, so nothing is being lost.

Change-Id: Ia6804d12e945c95d1763b10db2820b9f09bb4307
---
M includes/ElasticsearchIntermediary.php
1 file changed, 4 insertions(+), 65 deletions(-)

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



diff --git a/includes/ElasticsearchIntermediary.php 
b/includes/ElasticsearchIntermediary.php
index 4ddaa6e..88b9eda 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -50,10 +50,6 @@
 */
protected $user;
/**
-* @var UserTesting Reports on this requests participation in tests
-*/
-   protected $ut;
-   /**
 * @var float|null start time of current request or null if none is 
running
 */
private $requestStart = null;
@@ -112,7 +108,10 @@
$this->user = $user;
$this->slowMillis = (int) ( 1000 * $slowSeconds );
$this->extraBackendLatency = $extraBackendLatency;
-   $this->ut = UserTesting::getInstance();
+   // This isn't explicitly used, but we need to make sure it is
+   // instantiated so it has the opportunity to override global
+   // configuration for test buckets.
+   UserTesting::getInstance();
}
 
/**
@@ -124,7 +123,6 @@
return;
}
self::buildRequestSetLog();
-   self::buildUserTestingLog();
self::$logContexts = [];
}
 
@@ -320,65 +318,6 @@
}
$matches->rewind();
return $strings;
-   }
-
-   private static function buildUserTestingLog() {
-   global $wgRequest;
-
-   $ut = UserTesting::getInstance();
-   if ( !$ut->getActiveTestNames() ) {
-   return;
-   }
-   $queries = [];
-   $parameters = [
-   'index' => [],
-   'queryType' => [],
-   'acceptLang' => $wgRequest->getHeader( 
'Accept-Language' ),
-   ];
-   $elasticTook = 0;
-   $hits = 0;
-   foreach ( self::$logContexts as $context ) {
-   $hits += isset( $context['hitsTotal'] ) ? 
$context['hitsTotal'] : 0;
-   if ( isset( $context['query'] ) ) {
-   $queries[] = $context['query'];
-   }
-   if ( isset( $context['elasticTookMs'] ) ) {
-   $elasticTook += $context['elasticTookMs'];
-   }
-   if ( isset( $context['index'] ) ) {
-   $parameters['index'][] = $context['index'];
-   }
-   if ( isset( $context['queryType'] ) ) {
-   $parameters['queryType'][] = 
$context['queryType'];
-   }
-   if ( !empty( $context['langdetect' ] ) ) {
-   $parameters['langdetect'] = 
$context['langdetect'];
-   }
-   }
-
-   foreach ( [ 'index', 'queryType' ] as $key ) {
-   $parameters[$key] = array_values( array_unique( 
$parameters[$key] ) );
-   }
-
-   $message = [
-   wfWikiID(),
-   '',
-   FormatJson::encode( $queries ),
-   $hits,
-   Util::getExecutionContext(),
-   $elasticTook,
-   $wgRequest->getIP(),
-   preg_replace( "/[\t\"']/", "", $wgRequest->getHeader( 
'User-Agent') ),
-   FormatJson::encode( $parameters ),
-   Util::generateIdentToken(),
-   ];
-
-   $logger = LoggerFactory::getInstance( 'CirrusSearchUserTesting' 
);
-   foreach ( $ut->getActiveTestNames() as $test ) {
-   $bucket = $ut->getBucket( $test );
-   $message[1] = "{$test}-{$bucket}";
-   $logger->debug( implode( "\t", $message ) );
-   }
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/313523
To unsubscr

[MediaWiki-commits] [Gerrit] wikimedia...dashboard[master]: Update Vagrant config & provisioning

2016-09-30 Thread Bearloga (Code Review)
Bearloga has submitted this change and it was merged.

Change subject: Update Vagrant config & provisioning
..


Update Vagrant config & provisioning

Change-Id: I4cbe080c3a0da5a087bfae31aa65e04a7ab5c849
---
M README.md
M Vagrantfile
M setup.sh
3 files changed, 80 insertions(+), 66 deletions(-)

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



diff --git a/README.md b/README.md
index 9aed7c7..2a3eab0 100644
--- a/README.md
+++ b/README.md
@@ -2,23 +2,21 @@
 
 This is a collection of dashboards and tools for exploring aggregated 
Wikimedia search data. It contains everything from API usage to direct user 
interactions, and will only grow over time. The idea is that this will provide 
data for internal use and external use, to see how well we're doing.
 
-## Running in labs
+## Running in Labs
 
-Go to Special:NovaInstance on wikitech and start a new instance. The
-The small instance with 2GB of memory is sufficient. Leave the image
-type at the default of 'debian-8.1-jessie' and click go. Wait for
-the instance to start, then login via ssh.
+Go to Special:NovaInstance on wikitech and start a new instance. The small 
instance with 2GB of memory is sufficient. Choose the image 
'ubuntu-14.04-trusty' and click go. Wait for the instance to start, then login 
via SSH.
 
-First we need to clone the repository:
+Follow [the instructions for setting up your instance with 
MediaWiki-Vagrant](https://wikitech.wikimedia.org/wiki/Help:MediaWiki-Vagrant_in_Labs#Setting_up_your_instance_with_MediaWiki-Vagrant).
 Specifically, add "role::labs::vagrant_lxc" and run `sudo puppet agent --test 
--verbose`
 
-```
-$ sudo git clone https://gerrit.wikimedia.org/r/wikimedia/discovery/dashboard 
/srv/dashboards
-```
+Log out and log back in.
 
-Then we need to provision everything:
-
-```
-$ sudo bash /srv/dashboards/setup.sh
+```bash
+sudo git clone https://gerrit.wikimedia.org/r/wikimedia/discovery/dashboard 
/srv/dashboards
+cd /srv/dashboards
+sudo git submodule update --init --recursive
+sudo vagrant up
+sudo chown -R mwvagrant .vagrant
+vagrant up
 ```
 
 **shiny-server** should now be running on port 3838. To make this
@@ -30,22 +28,20 @@
 
 Perform this step after merging a patch:
 
-```
-$ sudo make update
+```bash
+sudo make update
 ```
 
 ### Manually restarting Shiny Server
 
 ```
-$ mwvagrant ssh
-$ sudo service shiny-server restart
+$> mwvagrant ssh
+ssh> sudo service shiny-server restart
 ```
 
 ## Running on your machine
 
-```
-$ vagrant up
-```
+Download and install [Vagrant](https://www.vagrantup.com/downloads.html) & 
[VirtualBox](https://www.virtualbox.org/wiki/Downloads). Then clone the repo, 
initialize the submodules, and `vagrant up`
 
 ## Dashboards as submodules
 
@@ -53,9 +49,9 @@
 
 ### Adding
 
-```
-$ git submodule add .git shiny-server/
-$ git submodule update --init --recursive
+```bash
+git submodule add .git shiny-server/
+git submodule update --init --recursive
 ```
 
 ### Updating the dashboards in this repository
@@ -65,17 +61,17 @@
 are kept as git submodules. To point the submodules at the latest
 versions, use the following command:
 
-```
-$ git submodule foreach git pull origin master
+```bash
+git submodule foreach git pull origin master
 ```
 
 Please remember to describe the changes in [CHANGELOG.md](CHANGELOG.md), then:
 
-```
-$ git add -A
-$ git commit -m "Updating dashboards..."
-$ git review
-$ 
+```bash
+git add -A
+git commit -m "Updating dashboards..."
+git review
+
 ```
 
 ## Additional information
diff --git a/Vagrantfile b/Vagrantfile
index 89b09a0..fb04dd2 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -22,7 +22,7 @@
   # config.vm.network :forwarded_port, guest: 80, host: 8080
 
   config.vm.network :forwarded_port,
-guest: 3838, host: 3838, id: 'shiny'
+guest: 3838, host: 3838, id: 'shiny', host_ip: "0.0.0.0"
 
   # Create a private network, which allows host-only access to the machine
   # using a specific IP.
@@ -68,6 +68,11 @@
   config.vm.provider :lxc do |lxc, override|
 override.vm.box = 'Wikimedia/trusty64-puppet-lxc'
   end
+  
+  config.vm.provision "fix-no-tty", type: "shell" do |s|
+s.privileged = false
+s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' 
/root/.profile"
+  end
 
   config.vm.provision "shell", path: "./setup.sh"
 
diff --git a/setup.sh b/setup.sh
index 699c0f4..d430d3a 100755
--- a/setup.sh
+++ b/setup.sh
@@ -31,19 +31,18 @@
 install_r_package() {
   local TARGET="/usr/local/lib/R/site-library/$1"
   if [ ! -d "$TARGET" ]; then
-/usr/bin/R -e "install.packages('$1', repos='https://cran.rstudio.com'); 
q(save = 'no')"
+/usr/bin/R -e "install.packages('$1', repos='https://cran.rstudio.com')"
 test -d $TARGET
 RESTART_SHINY=1
   fi
 }
-
 # This requires the devtools package so for all that's good and beautiful
 # in the world do not put a call to it in a line before install_r_package 
devtools.
 git_install_r_package() 

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Batch gallery imageinfo requests via ImageInfoCache subclass

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

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

Change subject: Batch gallery imageinfo requests via ImageInfoCache subclass
..

Batch gallery imageinfo requests via ImageInfoCache subclass

Bug: T147067
Change-Id: Ifcca300d65e28d6fb9003fcac5e076a5129a
---
M extension.json
A modules/ve-mw/init/ve.init.mw.GalleryImageInfoCache.js
M modules/ve-mw/init/ve.init.mw.Platform.js
M modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
M modules/ve-mw/ui/styles/dialogs/ve.ui.MWGalleryDialog.css
5 files changed, 69 insertions(+), 23 deletions(-)


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

diff --git a/extension.json b/extension.json
index 3930bf9..d2bb94a 100644
--- a/extension.json
+++ b/extension.json
@@ -460,6 +460,7 @@

"modules/ve-mw/init/ve.init.mw.ApiResponseCache.js",
"modules/ve-mw/init/ve.init.mw.LinkCache.js",

"modules/ve-mw/init/ve.init.mw.ImageInfoCache.js",
+   
"modules/ve-mw/init/ve.init.mw.GalleryImageInfoCache.js",
"modules/ve-mw/init/ve.init.mw.Platform.js",

"modules/ve-mw/init/ve.init.mw.Platform.init.js",
"modules/ve-mw/init/ve.init.mw.Target.js",
diff --git a/modules/ve-mw/init/ve.init.mw.GalleryImageInfoCache.js 
b/modules/ve-mw/init/ve.init.mw.GalleryImageInfoCache.js
new file mode 100644
index 000..d2af18c
--- /dev/null
+++ b/modules/ve-mw/init/ve.init.mw.GalleryImageInfoCache.js
@@ -0,0 +1,42 @@
+/*!
+ * VisualEditor MediaWiki Initialization GalleryImageInfoCache class.
+ *
+ * @copyright 2011-2016 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * Get information about images.
+ *
+ * @class
+ * @extends ve.init.mw.ApiResponseCache
+ * @constructor
+ */
+ve.init.mw.GalleryImageInfoCache = function VeInitMwGalleryImageInfoCache() {
+   ve.init.mw.GalleryImageInfoCache.super.call( this );
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.init.mw.GalleryImageInfoCache, ve.init.mw.ImageInfoCache );
+
+/* Methods */
+
+/**
+ * @inheritdoc
+ */
+ve.init.mw.GalleryImageInfoCache.prototype.getRequestPromise = function ( 
subqueue ) {
+   // If you change what `iiprop`s are being fetched, update
+   // ve.ui.MWMediaDialog to add the same ones to the cache.
+   return new mw.Api().get(
+   {
+   action: 'query',
+   prop: 'imageinfo',
+   iiprop: 'url',
+   titles: subqueue.join( '|' ),
+   iiurlwidth: 200,
+   iiurlheight: 200,
+   },
+   { type: 'POST' }
+   );
+};
diff --git a/modules/ve-mw/init/ve.init.mw.Platform.js 
b/modules/ve-mw/init/ve.init.mw.Platform.js
index c293dd1..789def2 100644
--- a/modules/ve-mw/init/ve.init.mw.Platform.js
+++ b/modules/ve-mw/init/ve.init.mw.Platform.js
@@ -29,6 +29,7 @@
this.parsedMessages = {};
this.linkCache = new ve.init.mw.LinkCache();
this.imageInfoCache = new ve.init.mw.ImageInfoCache();
+   this.galleryImageInfoCache = new ve.init.mw.GalleryImageInfoCache();
 };
 
 /* Inheritance */
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
index 71fdf3d..01aa55f 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
@@ -257,7 +257,7 @@
 ve.ui.MWGalleryDialog.prototype.getSetupProcess = function ( data ) {
return ve.ui.MWGalleryDialog.super.prototype.getSetupProcess.call( 
this, data )
.next( function () {
-   var titlesString, title, titleText, imageTitles, mode,
+   var title, titleText, imageTitles, mode,
caption, widths, heights, perrow,
showFilename, classes, styles,
dialog = this,
@@ -298,9 +298,8 @@
);
 
// Populate menu and edit panels
-   titlesString = imageTitles.join( '|' );
this.imagesPromise = this.requestImages( {
-   titlesString: titlesString
+   titles: imageTitles
} ).done( function () {
dialog.onHighlightItem();
} );
@@ -392,34 +391,37 @@
  * @param {Object} options Options for the request
  */
 ve.ui.MWGalleryDialog.prototype.requestImages = function ( options ) {
-   return new mw.Api().get( {
-   

[MediaWiki-commits] [Gerrit] mediawiki...HitCounters[master]: Add hitcounter value to every page as semantic mediawiki pro...

2016-09-30 Thread Ljonka (Code Review)
Ljonka has uploaded a new change for review.

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

Change subject: Add hitcounter value to every page as semantic mediawiki 
property
..

Add hitcounter value to every page as semantic mediawiki property

Depends on BlueSpiceSMWConnector,
which debends on SemanticExtraSpecialProperties

Change-Id: I1be878d520492eb239774cebf930e3a92ba1fef7
---
M HitCounters.php
M includes/HitCounters.body.php
M includes/HitCounters.hooks.php
3 files changed, 36 insertions(+), 16 deletions(-)


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

diff --git a/HitCounters.php b/HitCounters.php
index 706aab4..71b8317 100644
--- a/HitCounters.php
+++ b/HitCounters.php
@@ -35,19 +35,25 @@
  * @file
  */
 
-call_user_func(
-   function () {
-   if ( function_exists( 'wfLoadExtension' ) ) {
-   wfLoadExtension( 'HitCounters' );
-   wfWarn(
-  'Deprecated PHP entry point used for HitCounters 
extension. ' .
-  'Please use wfLoadExtension instead, ' .
-  'see 
https://www.mediawiki.org/wiki/Extension_registration ' .
-  'for more details.'
-   );
-   return;
-   } else {
-   die( 'This extension requires MediaWiki 1.25+' );
-   }
-   }
-);
+
+if ( function_exists( 'wfLoadExtension' ) ) {
+wfLoadExtension( 'HitCounters' );
+wfWarn(
+'Deprecated PHP entry point used for HitCounters extension. ' .
+'Please use wfLoadExtension instead, ' .
+'see https://www.mediawiki.org/wiki/Extension_registration ' .
+'for more details.'
+);
+} else {
+die( 'This extension requires MediaWiki 1.25+' );
+}
+
+$GLOBALS["bssDefinitions"]["_HITCOUNTERS"] = array(
+ "id" => "___HITCOUNTERS",
+ "type" => 1,
+ "show" => false,
+ "msgkey" => "hitcounters-extensionname",
+ "alias" => "Hit counter",
+ "label" => "HitCounters",
+ "mapping" => "HitCounters\\HitCounters::smwMappingFunction"
+);
\ No newline at end of file
diff --git a/includes/HitCounters.body.php b/includes/HitCounters.body.php
index f607f87..b30fb52 100644
--- a/includes/HitCounters.body.php
+++ b/includes/HitCounters.body.php
@@ -133,4 +133,15 @@
)
);
}
+
+public static function smwMappingFunction( 
+\SMW\SemanticData $aSemanticData, 
+\WikiPage $aWikiPage, 
+\SMW\DIProperty $aProperty ) {
+$intCount = ( int ) self::getCount( $aWikiPage->getTitle() );
+//add data finally
+$aSemanticData->addPropertyObjectValue(
+$aProperty, new \SMWDINumber( $intCount )
+);
+}
 }
diff --git a/includes/HitCounters.hooks.php b/includes/HitCounters.hooks.php
index f38e388..1d624ea 100644
--- a/includes/HitCounters.hooks.php
+++ b/includes/HitCounters.hooks.php
@@ -129,6 +129,9 @@
);
DeferredUpdates::addUpdate( new SiteStatsUpdate( 1, 0, 
0 ) );
}
+if ( $wikipage->getContent() != null ) {
+\DataUpdate::runUpdates( 
$wikipage->getContent()->getSecondaryDataUpdates( $wikipage->getTitle() ) );
+}
}
 
public static function onSkinTemplateOutputPageBeforeExec(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1be878d520492eb239774cebf930e3a92ba1fef7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/HitCounters
Gerrit-Branch: master
Gerrit-Owner: Ljonka 

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


[MediaWiki-commits] [Gerrit] mediawiki...UniversalLanguageSelector[master]: Replace deprecated .mw-ui-constructive with .mw-ui-progressive

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

Change subject: Replace deprecated .mw-ui-constructive with .mw-ui-progressive
..


Replace deprecated .mw-ui-constructive with .mw-ui-progressive

Bug: T146923
Change-Id: I5d4b5e9fa41ef7657442b734702b3ea21d90c66a
---
M resources/js/ext.uls.inputsettings.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/resources/js/ext.uls.inputsettings.js 
b/resources/js/ext.uls.inputsettings.js
index 60c436d..dd3e871 100644
--- a/resources/js/ext.uls.inputsettings.js
+++ b/resources/js/ext.uls.inputsettings.js
@@ -54,7 +54,7 @@
'' +
'' +
'' +
-   '' +
+   '' +
'' +
'';
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5d4b5e9fa41ef7657442b734702b3ea21d90c66a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Update India base category

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

Change subject: Update India base category
..


Update India base category

The category was renamed in 2013.

Change-Id: I463e5bda5eb274828ad840fc3cd4fb4a3d9ae300
---
M erfgoedbot/monuments_config.py
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/erfgoedbot/monuments_config.py b/erfgoedbot/monuments_config.py
index e64069c..9eacd01 100755
--- a/erfgoedbot/monuments_config.py
+++ b/erfgoedbot/monuments_config.py
@@ -4592,7 +4592,7 @@
 'rowTemplate': u'ASI Monument row',
 'commonsTemplate': u'ASI Monument',
 'unusedImagesPage': u'Wikipedia:WikiProject India/Wiki Loves 
Monuments/Unused ASI Monuments images',
-'commonsTrackerCategory': u'ASI Monuments with known IDs',
+'commonsTrackerCategory': u"ASI monuments with known ID's",
 'commonsCategoryBase': u'Cultural heritage monuments in India',
 'namespaces': [0, 4],
 'table': u'monuments_in_(en)',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I463e5bda5eb274828ad840fc3cd4fb4a3d9ae300
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Jean-Frédéric 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: Multichill 
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]: Use MAX_LOCK_TTL in RedisLockManager to avoid premature lock...

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

Change subject: Use MAX_LOCK_TTL in RedisLockManager to avoid premature lock 
expiration
..


Use MAX_LOCK_TTL in RedisLockManager to avoid premature lock expiration

App servers should not lower the redis structure TTL of locks set
from CLI scripts, which is what would typically happen before if
they touched the same keys. Instead, keep a high lock record TTL
and rely on the logical TTLs for expiry semantics.

Change-Id: I2948369845c47d2682a85dd0564673f3b813be83
---
M includes/libs/lockmanager/RedisLockManager.php
1 file changed, 4 insertions(+), 3 deletions(-)

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



diff --git a/includes/libs/lockmanager/RedisLockManager.php 
b/includes/libs/lockmanager/RedisLockManager.php
index 6001705..ea9dde7 100644
--- a/includes/libs/lockmanager/RedisLockManager.php
+++ b/includes/libs/lockmanager/RedisLockManager.php
@@ -102,7 +102,7 @@
 <lockTTL, // ARGV[2]
-   time() // ARGV[3]
+   self::MAX_LOCK_TTL, // ARGV[3]
+   time() // ARGV[4]
]
),
count( $pathsByKey ) # number of first 
argument(s) that are keys

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2948369845c47d2682a85dd0564673f3b813be83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: BryanDavis 
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]: Cleanup MemcLockManager and move it to /libs

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

Change subject: Cleanup MemcLockManager and move it to /libs
..


Cleanup MemcLockManager and move it to /libs

* Remove wf* function and ObjectCache dependencies.
* Use the base class session field.
* Lower physical lock structure TTL and move it to the base
  class as a constant.
* Resolve TODO about acquiring mixed lock types in one pass.
* Only mark servers down for 30 seconds in case of long-running
  scripts.

Change-Id: Icd4be407e599524cc620975d27e85666d2532b95
---
M autoload.php
M includes/libs/lockmanager/LockManager.php
R includes/libs/lockmanager/MemcLockManager.php
M includes/libs/lockmanager/QuorumLockManager.php
M includes/libs/objectcache/MemcachedBagOStuff.php
5 files changed, 113 insertions(+), 138 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 3b42870..4cd28da 100644
--- a/autoload.php
+++ b/autoload.php
@@ -921,7 +921,7 @@
'MediaWiki\\Widget\\TitleInputWidget' => __DIR__ . 
'/includes/widget/TitleInputWidget.php',
'MediaWiki\\Widget\\UserInputWidget' => __DIR__ . 
'/includes/widget/UserInputWidget.php',
'MemCachedClientforWiki' => __DIR__ . 
'/includes/compat/MemcachedClientCompat.php',
-   'MemcLockManager' => __DIR__ . 
'/includes/filebackend/lockmanager/MemcLockManager.php',
+   'MemcLockManager' => __DIR__ . 
'/includes/libs/lockmanager/MemcLockManager.php',
'MemcachedBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/MemcachedBagOStuff.php',
'MemcachedClient' => __DIR__ . 
'/includes/libs/objectcache/MemcachedClient.php',
'MemcachedPeclBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/MemcachedPeclBagOStuff.php',
diff --git a/includes/libs/lockmanager/LockManager.php 
b/includes/libs/lockmanager/LockManager.php
index 42391a0..e89a9c7 100644
--- a/includes/libs/lockmanager/LockManager.php
+++ b/includes/libs/lockmanager/LockManager.php
@@ -68,6 +68,9 @@
const LOCK_UW = 2; // shared lock (for reads used to write elsewhere)
const LOCK_EX = 3; // exclusive lock (for writes)
 
+   /** @var int Max expected lock expiry in any context */
+   const MAX_LOCK_TTL = 7200; // 2 hours
+
/**
 * Construct a new instance from configuration
 *
@@ -87,6 +90,11 @@
$this->lockTTL = max( 5 * 60, 2 * (int)$met );
}
 
+   // Upper bound on how long to keep lock structures around. This 
is useful when setting
+   // TTLs, as the "lockTTL" value may vary based on CLI mode and 
app server group. This is
+   // a "safe" value that can be used to avoid clobbering other 
locks that use high TTLs.
+   $this->lockTTL = min( $this->lockTTL, self::MAX_LOCK_TTL );
+
$random = [];
for ( $i = 1; $i <= 5; ++$i ) {
$random[] = mt_rand( 0, 0xFFF );
diff --git a/includes/filebackend/lockmanager/MemcLockManager.php 
b/includes/libs/lockmanager/MemcLockManager.php
similarity index 62%
rename from includes/filebackend/lockmanager/MemcLockManager.php
rename to includes/libs/lockmanager/MemcLockManager.php
index 81ce424..83334fe 100644
--- a/includes/filebackend/lockmanager/MemcLockManager.php
+++ b/includes/libs/lockmanager/MemcLockManager.php
@@ -43,14 +43,10 @@
self::LOCK_EX => self::LOCK_EX
];
 
-   /** @var array Map server names to MemcachedBagOStuff objects */
-   protected $bagOStuffs = [];
-
-   /** @var array (server name => bool) */
-   protected $serversUp = [];
-
-   /** @var string Random UUID */
-   protected $session = '';
+   /** @var MemcachedBagOStuff[] Map of (server name => 
MemcachedBagOStuff) */
+   protected $cacheServers = [];
+   /** @var HashBagOStuff Server status cache */
+   protected $statusCache;
 
/**
 * Construct a new instance from configuration.
@@ -59,8 +55,9 @@
 *   - lockServers  : Associative array of server names to 
":" strings.
 *   - srvsByBucket : Array of 1-16 consecutive integer keys, starting 
from 0,
 *each having an odd-numbered list of server names 
(peers) as values.
-*   - memcConfig   : Configuration array for 
ObjectCache::newFromParams. [optional]
-*If set, this must use one of the memcached 
classes.
+*   - memcConfig   : Configuration array for 
MemcachedBagOStuff::construct() with an
+*additional 'class' parameter specifying which 
MemcachedBagOStuff
+*subclass to use. The server names will be 
injected. [optional]
 * @throws Exception
 */
public function __construct( array $config ) {
@@ -70,69 +67,31 @@
$this->srvsByBucket = array_filter( $c

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Workaround asciifolding issue with preserve_original

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

Change subject: Workaround asciifolding issue with preserve_original
..


Workaround asciifolding issue with preserve_original

See: https://issues.apache.org/jira/browse/LUCENE-7468

Bug: T146886
Change-Id: I2ef0ed25cbc4945813b4f9ad0708837786aee8d9
---
M includes/Maintenance/AnalysisConfigBuilder.php
A tests/unit/Maintenance/AnalysisConfigBuilderTest.php
2 files changed, 144 insertions(+), 0 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/Maintenance/AnalysisConfigBuilder.php 
b/includes/Maintenance/AnalysisConfigBuilder.php
index 291f4d8..80ded63 100644
--- a/includes/Maintenance/AnalysisConfigBuilder.php
+++ b/includes/Maintenance/AnalysisConfigBuilder.php
@@ -510,6 +510,42 @@
}, $analyzer[ 'filter' ] );
}
}
+
+   $config = $this->fixAsciiFolding( $config );
+   return $config;
+   }
+
+   /**
+* Workaround for https://issues.apache.org/jira/browse/LUCENE-7468
+* The preserve_original duplicates token even if they are
+* not modified, leading to more space used and wrong term frequencies.
+* Workaround is to append a unique filter to remove the dups.
+* (made public for unit tests)
+*
+* @param mixed[] $config
+* @return mixed[] update mapping
+*/
+   public function fixAsciiFolding( array $config ) {
+   $needDedupFilter = false;
+   foreach( $config['analyzer'] as $name => &$value ) {
+   if ( isset( $value['type'] ) && $value['type'] != 
'custom' ) {
+   continue;
+   }
+   if ( !isset( $value['filter'] ) ) {
+   continue;
+   }
+   $ascii_idx = array_search( 'asciifolding_preserve', 
$value['filter'] );
+   if ( $ascii_idx !== FALSE ) {
+   $needDedupFilter = true;
+   array_splice( $value['filter'], $ascii_idx + 1, 
0, ['dedup_asciifolding'] );
+   }
+   }
+   if ( $needDedupFilter ) {
+   $config['filter']['dedup_asciifolding'] = [
+   'type' => 'unique',
+   'only_on_same_position' => true,
+   ];
+   }
return $config;
}
 
diff --git a/tests/unit/Maintenance/AnalysisConfigBuilderTest.php 
b/tests/unit/Maintenance/AnalysisConfigBuilderTest.php
new file mode 100644
index 000..fcb520e
--- /dev/null
+++ b/tests/unit/Maintenance/AnalysisConfigBuilderTest.php
@@ -0,0 +1,108 @@
+fixAsciiFolding( $input );
+
+   $this->assertEquals( $expected['analyzer'], $result['analyzer'] 
);
+   if ( isset( $expected['filter'] ) ) {
+   $this->assertEquals( $expected['filter'], 
$result['filter'] );
+   } else {
+   $this->assertFalse( isset ( $result['filter'] ) );
+   }
+   }
+
+   public static function provideASCIIFoldingFilters() {
+   return [
+   'only custom is updated' => [
+   [
+   'analyzer' => [
+   'french' => [
+   'type' => 'french',
+   'filter' => 
['asciifolding_preserve']
+   ]
+   ],
+   ],
+   [
+   'analyzer' => [
+   'french' => [
+   'type' => 'french',
+   'filter' => 
['asciifolding_preserve']
+   ]
+   ],
+   ],
+   ],
+   'only asciifolding_preserve is updated' => [
+   [
+   'analyzer' => [
+   'french' => [
+   'type' => 'custom',
+   'filter' => 
['asciifolding']
+   ]
+   ],
+   ],
+

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Don't use class_exists to test if the PoolCounter extension ...

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

Change subject: Don't use class_exists to test if the PoolCounter extension is 
installed
..


Don't use class_exists to test if the PoolCounter extension is installed

The autoloader isn't setup yet, so the class exists call doesn't check
for anything meaningfull. Instead look for the poolcounter extension
to be installed.

Change-Id: I5dff57b98879d29cbf6e8a0d116a2e249b61a595
---
M tests/jenkins/FullyFeaturedConfig.php
1 file changed, 1 insertion(+), 1 deletion(-)

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/tests/jenkins/FullyFeaturedConfig.php 
b/tests/jenkins/FullyFeaturedConfig.php
index 3ff39d3..7a6f5b9 100644
--- a/tests/jenkins/FullyFeaturedConfig.php
+++ b/tests/jenkins/FullyFeaturedConfig.php
@@ -59,7 +59,7 @@
),
 );
 
-if ( class_exists( 'PoolCounter_Client' ) ) {
+if ( is_dir( "$IP/extensions/PoolCounter" ) ) {
// If the pool counter is around set up prod like pool counter settings
$wgPoolCounterConf[ 'CirrusSearch-Search' ] = array(
'class' => 'PoolCounter_Client',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5dff57b98879d29cbf6e8a0d116a2e249b61a595
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse 
Gerrit-Reviewer: Cindy-the-browser-test-bot 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Manybubbles 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Ignore defineProperty() failures in mw.log.deprecate

2016-09-30 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Ignore defineProperty() failures in mw.log.deprecate
..

Ignore defineProperty() failures in mw.log.deprecate

Bug: T145570
Change-Id: I9ed4cf7b379116f33cfcaee3de053739f9b25b7e
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 21 insertions(+), 18 deletions(-)


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

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 3122d42..1d7f9f8 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -489,25 +489,28 @@
logged.add( trace );
return true;
}
-   Object.defineProperty( obj, key, {
-   configurable: true,
-   enumerable: true,
-   get: function () {
-   if ( uniqueTrace() ) {
-   mw.track( 'mw.deprecate', key );
-   mw.log.warn( msg );
+   try {
+   Object.defineProperty( obj, key, {
+   configurable: true,
+   enumerable: true,
+   get: function () {
+   if ( uniqueTrace() ) {
+   mw.track( 
'mw.deprecate', key );
+   mw.log.warn( msg );
+   }
+   return val;
+   },
+   set: function ( newVal ) {
+   if ( uniqueTrace() ) {
+   mw.track( 
'mw.deprecate', key );
+   mw.log.warn( msg );
+   }
+   val = newVal;
}
-   return val;
-   },
-   set: function ( newVal ) {
-   if ( uniqueTrace() ) {
-   mw.track( 'mw.deprecate', key );
-   mw.log.warn( msg );
-   }
-   val = newVal;
-   }
-   } );
-
+   } );
+   } catch ( er ) {
+   obj[ key ] = val;
+   }
};
 
return log;

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: k8s: Make the kubernetes user be a member of ssl-certs group

2016-09-30 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: k8s: Make the kubernetes user be a member of ssl-certs group
..


k8s: Make the kubernetes user be a member of ssl-certs group

This allows it to read ssl certificate private keys, which
is needed by the k8s master

Change-Id: Ifa34fed9a16e4775c3943d72e12460d7bb8c3c4a
---
M modules/k8s/manifests/users.pp
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/modules/k8s/manifests/users.pp b/modules/k8s/manifests/users.pp
index 11c889d..65e0286 100644
--- a/modules/k8s/manifests/users.pp
+++ b/modules/k8s/manifests/users.pp
@@ -9,5 +9,6 @@
 shell  => '/bin/false',
 system => true,
 managehome => false,
+groups => ['ssl-cert']
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa34fed9a16e4775c3943d72e12460d7bb8c3c4a
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Gehel 
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/puppet[production]: grafana: Fix paths for grafana datasource plugin

2016-09-30 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: grafana: Fix paths for grafana datasource plugin
..


grafana: Fix paths for grafana datasource plugin

Change-Id: I092512305772a0ac3b3eb1903dd304776c80d47d
---
M modules/role/manifests/grafana/labs.pp
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved
  Addshore: Looks good to me, but someone else must approve



diff --git a/modules/role/manifests/grafana/labs.pp 
b/modules/role/manifests/grafana/labs.pp
index a2ad0ae..4c67030 100644
--- a/modules/role/manifests/grafana/labs.pp
+++ b/modules/role/manifests/grafana/labs.pp
@@ -22,10 +22,17 @@
 }
 
 # https://phabricator.wikimedia.org/T141636
+# We clone this, but need to symlink into the 'dist' directory for plugin 
to actually work
 git::clone { 'operations/software/grafana/simple-json-datasource':
 ensure=> present,
 branch=> '3.0',
 directory => 
'/usr/share/grafana/public/app/plugins/datasource/simple-json-datasource',
 require   => Package['grafana'],
 }
+
+file { 
'/usr/share/grafana/public/app/plugins/datasource/datasource-plugin-genericdatasource':
+ensure  => link,
+target  => 
'/usr/share/grafana/public/app/plugins/datasource/simple-json-datasource/dist',
+require => 
Git::Clone['operations/software/grafana/simple-json-datasource'],
+}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I092512305772a0ac3b3eb1903dd304776c80d47d
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Addshore 
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] mediawiki/core[master]: Pass interwiki option to SearchEngine

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

Change subject: Pass interwiki option to SearchEngine
..


Pass interwiki option to SearchEngine

Currently interwiki result are always computed even if the client does
not request them.
Pass the option via featureData to allow SearchEngine not to run
interwiki searches when not needed.

Bug: T147003
Change-Id: I55067bc7e5d926a3e37f4d24fb8e085bd252c376
---
M includes/api/ApiQuerySearch.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php
index ba60da9..6be5198 100644
--- a/includes/api/ApiQuerySearch.php
+++ b/includes/api/ApiQuerySearch.php
@@ -75,6 +75,7 @@
// Create search engine instance and set options
$search = $this->buildSearchEngine( $params );
$search->setFeatureData( 'rewrite', 
(bool)$params['enablerewrites'] );
+   $search->setFeatureData( 'interwiki', (bool)$interwiki );
 
$query = $search->transformSearchTerm( $query );
$query = $search->replacePrefixes( $query );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I55067bc7e5d926a3e37f4d24fb8e085bd252c376
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: DCausse 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: EBernhardson 
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]: Raise abusefilter condition limit for Meta-Wiki

2016-09-30 Thread MarcoAurelio (Code Review)
MarcoAurelio has uploaded a new change for review.

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

Change subject: Raise abusefilter condition limit for Meta-Wiki
..

Raise abusefilter condition limit for Meta-Wiki

Bug: T147063
Change-Id: I4f646903997fc309e8eb2906672fb41b628da8bb
---
M wmf-config/abusefilter.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/wmf-config/abusefilter.php b/wmf-config/abusefilter.php
index ff8c694..37f6f0b 100644
--- a/wmf-config/abusefilter.php
+++ b/wmf-config/abusefilter.php
@@ -286,6 +286,7 @@
$wgAbuseFilterAnonBlockDuration = '3 months'; // T72828
break;
case 'metawiki':
+   $wgAbuseFilterConditionLimit = 2000; // T147063
$wgGroupPermissions['*']['abusefilter-log-detail'] = true;
$wgGroupPermissions['sysop']['abusefilter-modify-restricted'] = 
true; // T76270
$wgGroupPermissions['sysop']['abusefilter-revert'] = true; // 
T76270

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: cache_misc: change doc/integration.wm.o backend

2016-09-30 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

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

Change subject: cache_misc: change doc/integration.wm.o backend
..

cache_misc: change doc/integration.wm.o backend

To be applied when CI backends have been properly moved from
gallium.wikimedia.org to contint1001.wikimedia.org

Change-Id: Id002f72423c4ef36a2abaf89a1ca09d1ed86b103
---
M modules/role/manifests/cache/misc.pp
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/modules/role/manifests/cache/misc.pp 
b/modules/role/manifests/cache/misc.pp
index 367c2af..bccd339 100644
--- a/modules/role/manifests/cache/misc.pp
+++ b/modules/role/manifests/cache/misc.pp
@@ -109,10 +109,10 @@
 'be_opts'  => merge($app_def_be_opts, { 'port' => 9001 }),
 'req_host' => 'etherpad.wikimedia.org',
 },
-'gallium' => { # CI server
+'contint1001' => { # CI server
 'dynamic'  => 'no',
 'type' => 'random',
-'backends' => ['gallium.wikimedia.org' ],
+'backends' => ['contint1001.wikimedia.org' ],
 'be_opts'  => $app_def_be_opts,
 'req_host' => [
 'doc.wikimedia.org',

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: nodepool: point to Jenkins on contint1001

2016-09-30 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

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

Change subject: nodepool: point to Jenkins on contint1001
..

nodepool: point to Jenkins on contint1001

Part of the migration from gallium to contint1001. Will be done during a
maintenance window.

Change-Id: I215e958986cf1e4f3db00b95f48d1635be7e
---
M modules/nodepool/templates/nodepool.yaml.erb
1 file changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/modules/nodepool/templates/nodepool.yaml.erb 
b/modules/nodepool/templates/nodepool.yaml.erb
index 4d45cd6..70f36ba 100644
--- a/modules/nodepool/templates/nodepool.yaml.erb
+++ b/modules/nodepool/templates/nodepool.yaml.erb
@@ -35,11 +35,12 @@
 
 # Jenkins masters emits jobs start/completion over zeromq
 zmq-publishers:
-  - tcp://gallium.wikimedia.org:
+  - tcp://contint1001.wikimedia.org:
 
 # CI systems to attach instances to
 targets:
-  - name: gallium.wikimedia.org
+  # Do not put dot in name, it is used for statsd metrics
+  - name: contint1001
 jenkins:
   url: 'https://integration.wikimedia.org/ci/'
   user: '<%= @jenkins_api_user -%>'

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Pass interwiki option to SearchEngine

2016-09-30 Thread DCausse (Code Review)
DCausse has uploaded a new change for review.

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

Change subject: Pass interwiki option to SearchEngine
..

Pass interwiki option to SearchEngine

Currently interwiki result are always computed even if user does not
request them.
Pass the option via featureData to allow SearchEngine not to run
interwiki searches when not needed.

Bug: T147003
Change-Id: I55067bc7e5d926a3e37f4d24fb8e085bd252c376
---
M includes/api/ApiQuerySearch.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/98/313598/1

diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php
index ba60da9..9f0ef94 100644
--- a/includes/api/ApiQuerySearch.php
+++ b/includes/api/ApiQuerySearch.php
@@ -75,6 +75,7 @@
// Create search engine instance and set options
$search = $this->buildSearchEngine( $params );
$search->setFeatureData( 'rewrite', 
(bool)$params['enablerewrites'] );
+   $search->setFeatureData( 'interwiki', (bool) $interwiki );
 
$query = $search->transformSearchTerm( $query );
$query = $search->replacePrefixes( $query );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Merge: "Fix AuthManagerSpecialPage submit button logic" into...

2016-09-30 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review.

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

Change subject: Merge: "Fix AuthManagerSpecialPage submit button logic" into 
REL1_27
..

Merge: "Fix AuthManagerSpecialPage submit button logic" into REL1_27

Bug: T143840
Change-Id: I7fe442f5044c3dce27f89d83b8003dc6e4170296
---
M includes/specialpage/AuthManagerSpecialPage.php
1 file changed, 29 insertions(+), 21 deletions(-)


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

diff --git a/includes/specialpage/AuthManagerSpecialPage.php 
b/includes/specialpage/AuthManagerSpecialPage.php
index bf8ef9f..ed70db3 100644
--- a/includes/specialpage/AuthManagerSpecialPage.php
+++ b/includes/specialpage/AuthManagerSpecialPage.php
@@ -555,38 +555,46 @@
}
 
/**
-* Returns true if the form built from the given AuthenticationRequests 
has fields which take
-* values. If all available providers use the redirect flow, the form 
might contain nothing
-* but submit buttons, in which case we should not add an extra submit 
button which does nothing.
+* Returns true if the form built from the given AuthenticationRequests 
needs a submit button.
+* Providers using redirect flow (e.g. Google login) need their own 
submit buttons; if using
+* one of those custom buttons is the only way to proceed, there is no 
point in displaying the
+* default button which won't do anything useful.
 *
 * @param AuthenticationRequest[] $requests An array of 
AuthenticationRequests from which the
 *  form will be built
 * @return bool
 */
protected function needsSubmitButton( array $requests ) {
+   $customSubmitButtonPresent = false;
+
+   // Secondary and preauth providers always need their data; they 
will not care what button
+   // is used, so they can be ignored. So can OPTIONAL buttons 
createdby primary providers;
+   // that's the point in being optional. Se we need to check 
whether all primary providers
+   // have their own buttons and whether there is at least one 
button present.
foreach ( $requests as $req ) {
-   if ( $req->required === 
AuthenticationRequest::PRIMARY_REQUIRED &&
-   $this->doesRequestNeedsSubmitButton( $req )
-   ) {
+   if ( $req->required === 
AuthenticationRequest::PRIMARY_REQUIRED ) {
+   if ( $this->hasOwnSubmitButton( $req ) ) {
+   $customSubmitButtonPresent = true;
+   } else {
+   return true;
+   }
+   }
+   }
+   return !$customSubmitButtonPresent;
+   }
+
+   /**
+* Checks whether the given AuthenticationRequest has its own submit 
button.
+* @param AuthenticationRequest $req
+* @return bool
+*/
+   protected function hasOwnSubmitButton( AuthenticationRequest $req ) {
+   foreach ( $req->getFieldInfo() as $field => $info ) {
+   if ( $info['type'] === 'button' ) {
return true;
}
}
return false;
-   }
-
-   /**
-* Checks if the given AuthenticationRequest needs a submit button or 
not.
-*
-* @param AuthenticationRequest $req The request to check
-* @return bool
-*/
-   protected function doesRequestNeedsSubmitButton( AuthenticationRequest 
$req ) {
-   foreach ( $req->getFieldInfo() as $field => $info ) {
-   if ( $info['type'] === 'button' ) {
-   return false;
-   }
-   }
-   return true;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7fe442f5044c3dce27f89d83b8003dc6e4170296
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_27
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Gergő Tisza 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Merge "Special:UserLogin: Don't show login button when not r...

2016-09-30 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review.

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

Change subject: Merge "Special:UserLogin: Don't show login button when not 
required" into REL1_27
..

Merge "Special:UserLogin: Don't show login button when not required" into 
REL1_27

If no AuthenticationRequest requires a separate login button, it
shouldn'tbe visible. This is, for example, the case, when only
link providers are used, that require the user to redirect to a third
party site, as it usually just shows a single submit button.

In this case, the login button is still visible because of other additional
fields, such as the remember  me button. This change checks each primary
authentication provider, if it provides its provide his own submit
button or not, and if so, removes the login button completely.

Bug: T141471
Change-Id: Ib18a69582cb3f79d438ab009d8755f0d5e415bcb
---
M includes/specialpage/AuthManagerSpecialPage.php
M includes/specialpage/LoginSignupSpecialPage.php
M includes/specials/SpecialChangeCredentials.php
3 files changed, 33 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/96/313596/1

diff --git a/includes/specialpage/AuthManagerSpecialPage.php 
b/includes/specialpage/AuthManagerSpecialPage.php
index 9833c73..bf8ef9f 100644
--- a/includes/specialpage/AuthManagerSpecialPage.php
+++ b/includes/specialpage/AuthManagerSpecialPage.php
@@ -537,7 +537,7 @@
$form->setAction( $this->getFullTitle()->getFullURL( 
$this->getPreservedParams() ) );
$form->addHiddenField( $this->getTokenName(), 
$this->getToken()->toString() );
$form->addHiddenField( 'authAction', $this->authAction );
-   $form->suppressDefaultSubmit( !$this->needsSubmitButton( 
$formDescriptor ) );
+   $form->suppressDefaultSubmit( !$this->needsSubmitButton( 
$requests ) );
 
return $form;
}
@@ -555,24 +555,38 @@
}
 
/**
-* Returns true if the form has fields which take values. If all 
available providers use the
-* redirect flow, the form might contain nothing but submit buttons, in 
which case we should
-* not add an extra submit button which does nothing.
+* Returns true if the form built from the given AuthenticationRequests 
has fields which take
+* values. If all available providers use the redirect flow, the form 
might contain nothing
+* but submit buttons, in which case we should not add an extra submit 
button which does nothing.
 *
-* @param array $formDescriptor A HTMLForm descriptor
+* @param AuthenticationRequest[] $requests An array of 
AuthenticationRequests from which the
+*  form will be built
 * @return bool
 */
-   protected function needsSubmitButton( $formDescriptor ) {
-   return (bool)array_filter( $formDescriptor, function ( $item ) {
-   $class = false;
-   if ( array_key_exists( 'class', $item ) ) {
-   $class = $item['class'];
-   } elseif ( array_key_exists( 'type', $item ) ) {
-   $class = HTMLForm::$typeMappings[$item['type']];
+   protected function needsSubmitButton( array $requests ) {
+   foreach ( $requests as $req ) {
+   if ( $req->required === 
AuthenticationRequest::PRIMARY_REQUIRED &&
+   $this->doesRequestNeedsSubmitButton( $req )
+   ) {
+   return true;
}
-   return !is_a( $class, \HTMLInfoField::class, true ) &&
-   !is_a( $class, \HTMLSubmitField::class, true );
-   } );
+   }
+   return false;
+   }
+
+   /**
+* Checks if the given AuthenticationRequest needs a submit button or 
not.
+*
+* @param AuthenticationRequest $req The request to check
+* @return bool
+*/
+   protected function doesRequestNeedsSubmitButton( AuthenticationRequest 
$req ) {
+   foreach ( $req->getFieldInfo() as $field => $info ) {
+   if ( $info['type'] === 'button' ) {
+   return false;
+   }
+   }
+   return true;
}
 
/**
diff --git a/includes/specialpage/LoginSignupSpecialPage.php 
b/includes/specialpage/LoginSignupSpecialPage.php
index 2a9a938..90774ef 100644
--- a/includes/specialpage/LoginSignupSpecialPage.php
+++ b/includes/specialpage/LoginSignupSpecialPage.php
@@ -586,7 +586,7 @@
$this->fakeTemplate = $fakeTemplate; // FIXME there should be a 
saner way to pass this to the hook
// this will call onAuthChangeFormFields()
$fo

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Avoid using long-deprecated ApiBase::getResultData()

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

Change subject: Avoid using long-deprecated ApiBase::getResultData()
..


Avoid using long-deprecated ApiBase::getResultData()

Change-Id: I2ad5ab9eb530a9451dc8f14bbb568b44690e41de
---
M Flexiskin/Flexiskin.class.php
1 file changed, 9 insertions(+), 1 deletion(-)

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



diff --git a/Flexiskin/Flexiskin.class.php b/Flexiskin/Flexiskin.class.php
index 86b1570..fbc6def 100755
--- a/Flexiskin/Flexiskin.class.php
+++ b/Flexiskin/Flexiskin.class.php
@@ -96,7 +96,15 @@
 
$oResult = $api->execute();
 
-   $oData = $api->getResultData();
+   if ( defined( 'ApiResult::META_CONTENT' ) ) {
+   $oData = $api->getResult()->getResultData( null, array(
+   'BC' => array(),
+   'Types' => array(),
+   'Strip' => 'all',
+   ) );
+   } else {
+   $oData = $api->getResultData();
+   }
if ( $oData ) {
$aData = array();
foreach ( $oData['results'] as $aConf ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2ad5ab9eb530a9451dc8f14bbb568b44690e41de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Anomie 
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...SemanticWatchlist[master]: Avoid using long-deprecated ApiBase::getResultData()

2016-09-30 Thread Anomie (Code Review)
Anomie has uploaded a new change for review.

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

Change subject: Avoid using long-deprecated ApiBase::getResultData()
..

Avoid using long-deprecated ApiBase::getResultData()

Change-Id: I5f7fa9836ea6b8f8139f241f579c4b94576c6f4a
---
M specials/SpecialSemanticWatchlist.php
1 file changed, 9 insertions(+), 1 deletion(-)


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

diff --git a/specials/SpecialSemanticWatchlist.php 
b/specials/SpecialSemanticWatchlist.php
index 5312518..1e56201 100644
--- a/specials/SpecialSemanticWatchlist.php
+++ b/specials/SpecialSemanticWatchlist.php
@@ -299,7 +299,15 @@
 
$api = new ApiMain( new FauxRequest( $requestData, true ), true 
);
$api->execute();
-   return $api->getResultData();
+   if ( defined( 'ApiResult::META_CONTENT' ) ) {
+   return $api->getResult()->getResultData( null, array(
+   'BC' => array(),
+   'Types' => array(),
+   'Strip' => 'all',
+   ) );
+   } else {
+   return $api->getResultData();
+   }
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f7fa9836ea6b8f8139f241f579c4b94576c6f4a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticWatchlist
Gerrit-Branch: master
Gerrit-Owner: Anomie 

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


[MediaWiki-commits] [Gerrit] mediawiki...SemanticForms[master]: Avoid using long-deprecated ApiBase::getResultData()

2016-09-30 Thread Anomie (Code Review)
Anomie has uploaded a new change for review.

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

Change subject: Avoid using long-deprecated ApiBase::getResultData()
..

Avoid using long-deprecated ApiBase::getResultData()

Change-Id: I0664d3af6d04338a05a4f5754f2e194f5252999f
---
M includes/forminputs/SF_TextInput.php
M specials/SF_FormEdit.php
2 files changed, 18 insertions(+), 2 deletions(-)


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

diff --git a/includes/forminputs/SF_TextInput.php 
b/includes/forminputs/SF_TextInput.php
index 9320724..2345de0 100644
--- a/includes/forminputs/SF_TextInput.php
+++ b/includes/forminputs/SF_TextInput.php
@@ -110,7 +110,15 @@
), true ), true );
 
$api->execute();
-   $result = $api->getResultData();
+   if ( defined( 'ApiResult::META_CONTENT' ) ) {
+   $result = $api->getResult()->getResultData( null, array(
+   'BC' => array(),
+   'Types' => array(),
+   'Strip' => 'all',
+   ) );
+   } else {
+   $result = $api->getResultData();
+   }
 
$url = false;
 
diff --git a/specials/SF_FormEdit.php b/specials/SF_FormEdit.php
index 49498e1..f2ba8591 100644
--- a/specials/SF_FormEdit.php
+++ b/specials/SF_FormEdit.php
@@ -100,7 +100,15 @@
}
} else {
 
-   $resultData = $module->getResultData();
+   if ( defined( 'ApiResult::META_CONTENT' ) ) {
+   $resultData = 
$module->getResult()->getResultData( null, array(
+   'BC' => array(),
+   'Types' => array(),
+   'Strip' => 'all',
+   ) );
+   } else {
+   $resultData = $module->getResultData();
+   }
 
if ( array_key_exists( 'errors', $resultData ) ) {
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0664d3af6d04338a05a4f5754f2e194f5252999f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Anomie 

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


[MediaWiki-commits] [Gerrit] mediawiki...Html2Wiki[master]: Avoid using long-deprecated ApiBase::getResultData()

2016-09-30 Thread Anomie (Code Review)
Anomie has uploaded a new change for review.

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

Change subject: Avoid using long-deprecated ApiBase::getResultData()
..

Avoid using long-deprecated ApiBase::getResultData()

Change-Id: I15c25b7d4e88e14530aefeb1146c61931d546b38
---
M specials/SpecialHtml2Wiki.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/specials/SpecialHtml2Wiki.php b/specials/SpecialHtml2Wiki.php
index 4362e63..3224109 100644
--- a/specials/SpecialHtml2Wiki.php
+++ b/specials/SpecialHtml2Wiki.php
@@ -938,7 +938,6 @@
 $enableWrite = true; // This is set to false by default, in the 
ApiMain constructor
 $api = new ApiMain($params, $enableWrite);
 $api->execute();
-$data = &$api->getResultData();
 }
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I15c25b7d4e88e14530aefeb1146c61931d546b38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Html2Wiki
Gerrit-Branch: master
Gerrit-Owner: Anomie 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Avoid using long-deprecated ApiBase::getResultData()

2016-09-30 Thread Anomie (Code Review)
Anomie has uploaded a new change for review.

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

Change subject: Avoid using long-deprecated ApiBase::getResultData()
..

Avoid using long-deprecated ApiBase::getResultData()

Change-Id: I2ad5ab9eb530a9451dc8f14bbb568b44690e41de
---
M Flexiskin/Flexiskin.class.php
1 file changed, 9 insertions(+), 1 deletion(-)


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

diff --git a/Flexiskin/Flexiskin.class.php b/Flexiskin/Flexiskin.class.php
index 86b1570..fbc6def 100755
--- a/Flexiskin/Flexiskin.class.php
+++ b/Flexiskin/Flexiskin.class.php
@@ -96,7 +96,15 @@
 
$oResult = $api->execute();
 
-   $oData = $api->getResultData();
+   if ( defined( 'ApiResult::META_CONTENT' ) ) {
+   $oData = $api->getResult()->getResultData( null, array(
+   'BC' => array(),
+   'Types' => array(),
+   'Strip' => 'all',
+   ) );
+   } else {
+   $oData = $api->getResultData();
+   }
if ( $oData ) {
$aData = array();
foreach ( $oData['results'] as $aConf ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ad5ab9eb530a9451dc8f14bbb568b44690e41de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Anomie 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ApiBase: Remove deprecated getResultData()

2016-09-30 Thread Anomie (Code Review)
Anomie has uploaded a new change for review.

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

Change subject: ApiBase: Remove deprecated getResultData()
..

ApiBase: Remove deprecated getResultData()

It was broken by I3ca7c981, and should probably have been removed in
that patch too.

Change-Id: I66ce52348406372a09d39f9d876123026f6c2bad
---
M RELEASE-NOTES-1.28
M includes/api/ApiBase.php
2 files changed, 1 insertion(+), 10 deletions(-)


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

diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index a24f97a..508d00b 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -114,6 +114,7 @@
   interact with ApiParse and ApiExpandTemplates.
 * (T139565) SECURITY: API: Generate head items in the context of the given 
title
 * (T115333) SECURITY: Check read permission when loading page content in 
ApiParse
+* ApiBase::getResultData() was removed (deprecated since 1.25)
 * ApiBase::makeHelpArrayToString() was removed (deprecated since 1.25)
 * ApiBase::makeHelpMsgParameters() was removed (deprecated since 1.25)
 * ApiBase::makeHelpMsg() was removed (deprecated since 1.25)
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index 809d567..bf33838 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -2746,16 +2746,6 @@
}
 
/**
-* Get the result data array (read-only)
-* @deprecated since 1.25, use $this->getResult() methods instead
-* @return array
-*/
-   public function getResultData() {
-   wfDeprecated( __METHOD__, '1.25' );
-   return $this->getResult()->getData();
-   }
-
-   /**
 * Call wfTransactionalTimeLimit() if this request was POSTed
 * @since 1.26
 */

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ssh public key for jgreen

2016-09-30 Thread Jgreen (Code Review)
Jgreen has submitted this change and it was merged.

Change subject: ssh public key for jgreen
..


ssh public key for jgreen

Change-Id: I133b204017b9f645ef258aba621fddca0d752851
---
M modules/admin/data/data.yaml
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index e727bbe..8714fd4 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -651,7 +651,9 @@
 gid: 500
 name: jgreen
 realname: Jeff Green
-ssh_keys: [ssh-rsa 
B3NzaC1yc2EDAQABAAABAQC+bdjMc3xayu9twy6HlYSpbfF1i0q+yylefuR6Kqol/0YeK133qNwGDBXCs3j7y/M/h6V9fQIfS15g/fyH7H7NMz6ESTVXehBXw+2Lk8PAPNS0c+ZyVbCbBeBV+2lPmrCiQ1vTrunSB86IUIfHnPQIK/+jkCTF56GmVv8ifV8Vp20jsJ/yfoxM+rC9PkbX8RTtDrrWfzrdXBMsm6QSr9s4i320+uyj2w6hROfsYQPDnw+GlIS741DED8dhLOJUKVQdqv0mAXJC3dMGNF1G0VN5okDsTAiFdrfhObMC/PjsPyQyloFv4EGCLEqVDs+nNmWZwMjEqOy7FoPw45Qz0cv1
 jgreen@neo]
+ssh_keys:
+  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQC+bdjMc3xayu9twy6HlYSpbfF1i0q+yylefuR6Kqol/0YeK133qNwGDBXCs3j7y/M/h6V9fQIfS15g/fyH7H7NMz6ESTVXehBXw+2Lk8PAPNS0c+ZyVbCbBeBV+2lPmrCiQ1vTrunSB86IUIfHnPQIK/+jkCTF56GmVv8ifV8Vp20jsJ/yfoxM+rC9PkbX8RTtDrrWfzrdXBMsm6QSr9s4i320+uyj2w6hROfsYQPDnw+GlIS741DED8dhLOJUKVQdqv0mAXJC3dMGNF1G0VN5okDsTAiFdrfhObMC/PjsPyQyloFv4EGCLEqVDs+nNmWZwMjEqOy7FoPw45Qz0cv1
 jgreen@neo
+  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCtlXCYUGn23LVRlgDM9T1onBsTuD20QEbVAplIakTAE55hN1ko1kY09Qb01l4VoAqDPapx0ROYd1on9oYYwSOGgSHKIOrB0OGg+3KX66Pjlr5ohpii20WSHS/NEI1gT76nQX7RN7tHq5/3ciNmCeQZ81YsDwCbmr7DRB5XiHUCaaCp/GIb6GXTliqtSL5oC+Rrzw4cqMeG/M7yExohVetjEK/AMOjgzMZEBHjZczvZiNpijHQ4WAIzl2KzuRDcqLKnOi48Wp+ANaKZmQngJdu8pAI51vqFIEhEwNpQrrUi1JXY2gXmYudRrvg/BvXgPJUDMmm9TOHNnBwwX8xafUgD
 jgr...@wertyukio.trouser.org
 uid: 2074
   gage:
 ensure: absent

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I133b204017b9f645ef258aba621fddca0d752851
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jgreen 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Jgreen 
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/dns[master]: Remove changeprop.svc.eqiad.wmnet

2016-09-30 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Remove changeprop.svc.eqiad.wmnet
..

Remove changeprop.svc.eqiad.wmnet

Never really existed, this is a leftover, remove it

Change-Id: Iffbd5335e88b2e78d8f1435f6b58d6387e10e732
---
M templates/10.in-addr.arpa
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/90/313590/1

diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa
index 672daa8..aa49e39 100644
--- a/templates/10.in-addr.arpa
+++ b/templates/10.in-addr.arpa
@@ -45,7 +45,6 @@
 1   1H  IN PTR  appservers.svc.eqiad.wmnet.
 3   1H  IN PTR  hhvm-api.svc.eqiad.wmnet.
 10  1H  IN PTR  ores.svc.eqiad.wmnet.
-10  1H  IN PTR  changeprop.svc.eqiad.wmnet.
 11  1H  IN PTR  apertium.svc.eqiad.wmnet.
 12  1H  IN PTR  aqs.svc.eqiad.wmnet.
 13  1H  IN PTR  kartotherian.svc.eqiad.wmnet.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffbd5335e88b2e78d8f1435f6b58d6387e10e732
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ssh public key for jgreen

2016-09-30 Thread Jgreen (Code Review)
Jgreen has uploaded a new change for review.

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

Change subject: ssh public key for jgreen
..

ssh public key for jgreen

Change-Id: I133b204017b9f645ef258aba621fddca0d752851
---
M modules/admin/data/data.yaml
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/89/313589/1

diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index e727bbe..8714fd4 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -651,7 +651,9 @@
 gid: 500
 name: jgreen
 realname: Jeff Green
-ssh_keys: [ssh-rsa 
B3NzaC1yc2EDAQABAAABAQC+bdjMc3xayu9twy6HlYSpbfF1i0q+yylefuR6Kqol/0YeK133qNwGDBXCs3j7y/M/h6V9fQIfS15g/fyH7H7NMz6ESTVXehBXw+2Lk8PAPNS0c+ZyVbCbBeBV+2lPmrCiQ1vTrunSB86IUIfHnPQIK/+jkCTF56GmVv8ifV8Vp20jsJ/yfoxM+rC9PkbX8RTtDrrWfzrdXBMsm6QSr9s4i320+uyj2w6hROfsYQPDnw+GlIS741DED8dhLOJUKVQdqv0mAXJC3dMGNF1G0VN5okDsTAiFdrfhObMC/PjsPyQyloFv4EGCLEqVDs+nNmWZwMjEqOy7FoPw45Qz0cv1
 jgreen@neo]
+ssh_keys:
+  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQC+bdjMc3xayu9twy6HlYSpbfF1i0q+yylefuR6Kqol/0YeK133qNwGDBXCs3j7y/M/h6V9fQIfS15g/fyH7H7NMz6ESTVXehBXw+2Lk8PAPNS0c+ZyVbCbBeBV+2lPmrCiQ1vTrunSB86IUIfHnPQIK/+jkCTF56GmVv8ifV8Vp20jsJ/yfoxM+rC9PkbX8RTtDrrWfzrdXBMsm6QSr9s4i320+uyj2w6hROfsYQPDnw+GlIS741DED8dhLOJUKVQdqv0mAXJC3dMGNF1G0VN5okDsTAiFdrfhObMC/PjsPyQyloFv4EGCLEqVDs+nNmWZwMjEqOy7FoPw45Qz0cv1
 jgreen@neo
+  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCtlXCYUGn23LVRlgDM9T1onBsTuD20QEbVAplIakTAE55hN1ko1kY09Qb01l4VoAqDPapx0ROYd1on9oYYwSOGgSHKIOrB0OGg+3KX66Pjlr5ohpii20WSHS/NEI1gT76nQX7RN7tHq5/3ciNmCeQZ81YsDwCbmr7DRB5XiHUCaaCp/GIb6GXTliqtSL5oC+Rrzw4cqMeG/M7yExohVetjEK/AMOjgzMZEBHjZczvZiNpijHQ4WAIzl2KzuRDcqLKnOi48Wp+ANaKZmQngJdu8pAI51vqFIEhEwNpQrrUi1JXY2gXmYudRrvg/BvXgPJUDMmm9TOHNnBwwX8xafUgD
 jgr...@wertyukio.trouser.org
 uid: 2074
   gage:
 ensure: absent

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Merge "AuthManager: do not rewrite PRIMARY_REQUIRED to REQUI...

2016-09-30 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review.

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

Change subject: Merge "AuthManager: do not rewrite PRIMARY_REQUIRED to 
REQUIRED" into REL1_27
..

Merge "AuthManager: do not rewrite PRIMARY_REQUIRED to REQUIRED" into REL1_27

AuthManager::getAuthenticationRequests() changes
AuthenticationRequest::$required from REQUIRED to PRIMARY_REQUIRED
if the request is from a primary; it made an exception when
all primary providers returned a given request. That exception is
not particularly useful (AuthenticationRequest::mergeFieldInfo()
used to rely on it to determine which fields are required, but
since I9d33bd2 that's not really needed), and knowing which request
is from a primary is useful for other means.

This changes required field semantics in a corner case: when a
primary provider returns two required requests, the previous
behavior was to assume that they are both required; the new one
is to treat them as alternatives (as if they were returned by
two different providers). So when all primary providers return
request X, and one of them returns Y in addition, the fields of X
will not be marked required, while previously that would have been
the case.

Instead of overcomplicating the interface for something that is
unlikely to come up in any real use case, add a new requirement
to PrimaryAuthenticationProvider that it should not return
multiple required requests.

Bug: T141471
Change-Id: I1c1f44d4d6b66f77c876e3459fb97f03483db744
---
M includes/auth/AuthManager.php
M includes/auth/AuthenticationRequest.php
M includes/auth/PrimaryAuthenticationProvider.php
M tests/phpunit/includes/auth/AuthManagerTest.php
4 files changed, 20 insertions(+), 22 deletions(-)


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

diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php
index e6d950e..79555b6 100644
--- a/includes/auth/AuthManager.php
+++ b/includes/auth/AuthManager.php
@@ -2000,37 +2000,26 @@
 
// Query them and merge results
$reqs = [];
-   $allPrimaryRequired = null;
foreach ( $providers as $provider ) {
$isPrimary = $provider instanceof 
PrimaryAuthenticationProvider;
-   $thisRequired = [];
foreach ( $provider->getAuthenticationRequests( 
$providerAction, $options ) as $req ) {
$id = $req->getUniqueId();
 
-   // If it's from a Primary, mark it as 
"primary-required" but
-   // track it for later.
+   // If a required request if from a Primary, 
mark it as "primary-required" instead
if ( $isPrimary ) {
if ( $req->required ) {
-   $thisRequired[$id] = true;
$req->required = 
AuthenticationRequest::PRIMARY_REQUIRED;
}
}
 
-   if ( !isset( $reqs[$id] ) || $req->required === 
AuthenticationRequest::REQUIRED ) {
+   if (
+   !isset( $reqs[$id] )
+   || $req->required === 
AuthenticationRequest::REQUIRED
+   || $reqs[$id] === 
AuthenticationRequest::OPTIONAL
+   ) {
$reqs[$id] = $req;
}
}
-
-   // Track which requests are required by all primaries
-   if ( $isPrimary ) {
-   $allPrimaryRequired = $allPrimaryRequired === 
null
-   ? $thisRequired
-   : array_intersect_key( 
$allPrimaryRequired, $thisRequired );
-   }
-   }
-   // Any requests that were required by all primaries are 
required.
-   foreach ( (array)$allPrimaryRequired as $id => $dummy ) {
-   $reqs[$id]->required = AuthenticationRequest::REQUIRED;
}
 
// AuthManager has its own req for some actions
diff --git a/includes/auth/AuthenticationRequest.php 
b/includes/auth/AuthenticationRequest.php
index ff4d52e..f6f949e 100644
--- a/includes/auth/AuthenticationRequest.php
+++ b/includes/auth/AuthenticationRequest.php
@@ -43,7 +43,8 @@
const REQUIRED = 1;
 
/** Indicates that the request is required by a primary authentication
-* provdier, but other primary authentication providers do not require 
it. */
+* provdier. Since the user can choose which primary to authenticate 
wi

[MediaWiki-commits] [Gerrit] operations/puppet[production]: grafana: Fix paths for grafana datasource plugin

2016-09-30 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: grafana: Fix paths for grafana datasource plugin
..

grafana: Fix paths for grafana datasource plugin

Change-Id: I092512305772a0ac3b3eb1903dd304776c80d47d
---
M modules/role/manifests/grafana/labs.pp
1 file changed, 7 insertions(+), 0 deletions(-)


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

diff --git a/modules/role/manifests/grafana/labs.pp 
b/modules/role/manifests/grafana/labs.pp
index a2ad0ae..4c67030 100644
--- a/modules/role/manifests/grafana/labs.pp
+++ b/modules/role/manifests/grafana/labs.pp
@@ -22,10 +22,17 @@
 }
 
 # https://phabricator.wikimedia.org/T141636
+# We clone this, but need to symlink into the 'dist' directory for plugin 
to actually work
 git::clone { 'operations/software/grafana/simple-json-datasource':
 ensure=> present,
 branch=> '3.0',
 directory => 
'/usr/share/grafana/public/app/plugins/datasource/simple-json-datasource',
 require   => Package['grafana'],
 }
+
+file { 
'/usr/share/grafana/public/app/plugins/datasource/datasource-plugin-genericdatasource':
+ensure  => link,
+target  => 
'/usr/share/grafana/public/app/plugins/datasource/simple-json-datasource/dist',
+require => 
Git::Clone['operations/software/grafana/simple-json-datasource'],
+}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move ChronologyProtector up a directory instead of being by ...

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

Change subject: Move ChronologyProtector up a directory instead of being by 
itself
..


Move ChronologyProtector up a directory instead of being by itself

Change-Id: Ie4859a24fb22e5816718a7d1d9444316b1f444c4
---
M autoload.php
R includes/libs/rdbms/ChronologyProtector.php
2 files changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/autoload.php b/autoload.php
index 3b42870..3ec653f 100644
--- a/autoload.php
+++ b/autoload.php
@@ -242,7 +242,7 @@
'CheckStorage' => __DIR__ . '/maintenance/storage/checkStorage.php',
'CheckSyntax' => __DIR__ . '/maintenance/checkSyntax.php',
'CheckUsernames' => __DIR__ . '/maintenance/checkUsernames.php',
-   'ChronologyProtector' => __DIR__ . 
'/includes/libs/rdbms/chronologyprotector/ChronologyProtector.php',
+   'ChronologyProtector' => __DIR__ . 
'/includes/libs/rdbms/ChronologyProtector.php',
'ClassCollector' => __DIR__ . '/includes/utils/AutoloadGenerator.php',
'CleanupAncientTables' => __DIR__ . 
'/maintenance/cleanupAncientTables.php',
'CleanupBlocks' => __DIR__ . '/maintenance/cleanupBlocks.php',
diff --git a/includes/libs/rdbms/chronologyprotector/ChronologyProtector.php 
b/includes/libs/rdbms/ChronologyProtector.php
similarity index 100%
rename from includes/libs/rdbms/chronologyprotector/ChronologyProtector.php
rename to includes/libs/rdbms/ChronologyProtector.php

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie4859a24fb22e5816718a7d1d9444316b1f444c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Addshore 
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...ORES[master]: Use aliases with "damaging" in them so we can add other ones...

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

Change subject: Use aliases with "damaging" in them so we can add other ones 
(e.g. "goodfaith")
..


Use aliases with "damaging" in them so we can add other ones (e.g. "goodfaith")

Change-Id: I2f5859c12da50bffab096d9ee9e6fc4bca6d52c4
---
M includes/Hooks.php
1 file changed, 34 insertions(+), 34 deletions(-)

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



diff --git a/includes/Hooks.php b/includes/Hooks.php
index b0de940..0b5955b 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -137,34 +137,34 @@
$threshold = self::getDamagingThreshold( $wgUser );
$dbr = \wfGetDB( DB_REPLICA );
 
-   $tables[] = 'ores_model';
-   $tables[] = 'ores_classification';
+   $tables['ores_damaging_mdl'] = 'ores_model';
+   $tables['ores_damaging_cls'] = 'ores_classification';
 
-   $fields[] = 'oresc_probability';
+   $fields['ores_damaging_score'] = 
'ores_damaging_cls.oresc_probability';
// Add user-based threshold
-   $fields[] = $dbr->addQuotes( $threshold ) . ' AS 
ores_threshold';
+   $fields['ores_damaging_threshold'] = $dbr->addQuotes( 
$threshold );
 
-   $join_conds['ores_model'] = [ 'LEFT JOIN', [
-   'oresm_is_current' => 1,
-   'oresm_name' => 'damaging'
+   $join_conds['ores_damaging_mdl'] = [ 'LEFT JOIN', [
+   'ores_damaging_mdl.oresm_is_current' => 1,
+   'ores_damaging_mdl.oresm_name' => 'damaging'
] ];
-   $join_conds['ores_classification'] = [ 'LEFT JOIN', [
-   'oresc_model = oresm_id',
-   'rc_this_oldid = oresc_rev',
-   'oresc_class' => 1
+   $join_conds['ores_damaging_cls'] = [ 'LEFT JOIN', [
+   'ores_damaging_cls.oresc_model = 
ores_damaging_mdl.oresm_id',
+   'rc_this_oldid = ores_damaging_cls.oresc_rev',
+   'ores_damaging_cls.oresc_class' => 1
] ];
 
if ( self::isModelEnabled( 'damaging' ) && $opts->getValue( 
'hidenondamaging' ) ) {
// Filter out non-damaging edits.
-   $conds[] = 'oresc_probability > '
+   $conds[] = 'ores_damaging_cls.oresc_probability > '
. $dbr->addQuotes( $threshold );
$conds['rc_patrolled'] = 0;
 
// Performance hacks: add STRAIGHT_JOIN (146111) and 
override the LEFT JOINs
// to be INNER JOINs (T137895)
$query_options[] = 'STRAIGHT_JOIN';
-   $join_conds['ores_model'][0] = 'INNER JOIN';
-   $join_conds['ores_classification'][0] = 'INNER JOIN';
+   $join_conds['ores_damaging_mdl'][0] = 'INNER JOIN';
+   $join_conds['ores_damaging_cls'][0] = 'INNER JOIN';
}
 
return true;
@@ -272,22 +272,22 @@
$threshold = self::getDamagingThreshold( $pager->getUser() );
$dbr = \wfGetDB( DB_REPLICA );
 
-   $query['tables'][] = 'ores_model';
-   $query['tables'][] = 'ores_classification';
+   $query['tables']['ores_damaging_mdl'] = 'ores_model';
+   $query['tables']['ores_damaging_cls'] = 'ores_classification';
 
-   $query['fields'][] = 'oresc_probability';
+   $query['fields']['ores_damaging_score'] = 
'ores_damaging_cls.oresc_probability';
// Add user-based threshold
-   $query['fields'][] = $dbr->addQuotes( $threshold ) . ' AS 
ores_threshold';
+   $query['fields']['ores_damaging_threshold'] = $dbr->addQuotes( 
$threshold );
 
-   $query['join_conds']['ores_model'] = [ 'LEFT JOIN', [
-   'oresm_is_current' => 1,
-   'oresm_name' => 'damaging',
+   $query['join_conds']['ores_damaging_mdl'] = [ 'LEFT JOIN', [
+   'ores_damaging_mdl.oresm_is_current' => 1,
+   'ores_damaging_mdl.oresm_name' => 'damaging',
] ];
 
-   $query['join_conds']['ores_classification'] = [ 'LEFT JOIN', [
-   'oresc_model = oresm_id',
-   'rev_id = oresc_rev',
-   'oresc_class' => 1
+   $query['join_conds']['ores_damaging_cls'] = [ 'LEFT JOIN', [
+   'ores_damaging_cls.oresc_model = 
ores_damaging_mdl.oresm_id',
+   'rev_id = ores_damaging_cls.oresc_rev',
+   'ores_damaging_cls.oresc_class' => 1
] ];
 
   

[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Refactor and simplify changeslist/contribs queries a bit

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

Change subject: Refactor and simplify changeslist/contribs queries a bit
..


Refactor and simplify changeslist/contribs queries a bit

Change-Id: Ic19ad7dd2ca10bdfab48a95c7deb1247dc655d47
---
M includes/Hooks.php
1 file changed, 29 insertions(+), 47 deletions(-)

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



diff --git a/includes/Hooks.php b/includes/Hooks.php
index 73755d5..b0de940 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -137,43 +137,34 @@
$threshold = self::getDamagingThreshold( $wgUser );
$dbr = \wfGetDB( DB_REPLICA );
 
-   $tables[] = 'ores_classification';
$tables[] = 'ores_model';
+   $tables[] = 'ores_classification';
 
$fields[] = 'oresc_probability';
// Add user-based threshold
$fields[] = $dbr->addQuotes( $threshold ) . ' AS 
ores_threshold';
 
-   $conds[] = '(oresm_name = ' . $dbr->addQuotes( 'damaging' ) .
-   ' OR oresm_name IS NULL)';
-
-   $conds[] = '(oresm_is_current != 0 OR oresm_is_current IS 
NULL)';
-
-   $join_conds['ores_classification'] = [
-   'LEFT JOIN',
-   'rc_this_oldid = oresc_rev ' .
-   'AND oresc_class = 1'
-   ];
-
-   $join_conds['ores_model'] = [
-   'LEFT JOIN',
-   'oresc_model = oresm_id ' .
-   'AND oresm_is_current = 1'
-   ];
+   $join_conds['ores_model'] = [ 'LEFT JOIN', [
+   'oresm_is_current' => 1,
+   'oresm_name' => 'damaging'
+   ] ];
+   $join_conds['ores_classification'] = [ 'LEFT JOIN', [
+   'oresc_model = oresm_id',
+   'rc_this_oldid = oresc_rev',
+   'oresc_class' => 1
+   ] ];
 
if ( self::isModelEnabled( 'damaging' ) && $opts->getValue( 
'hidenondamaging' ) ) {
-   // Override the join conditions.
-   $join_conds['ores_classification'] = [
-   'INNER JOIN',
-   'rc_this_oldid = oresc_rev ' .
-   'AND oresc_class = 1'
-   ];
-
// Filter out non-damaging edits.
$conds[] = 'oresc_probability > '
. $dbr->addQuotes( $threshold );
$conds['rc_patrolled'] = 0;
+
+   // Performance hacks: add STRAIGHT_JOIN (146111) and 
override the LEFT JOINs
+   // to be INNER JOINs (T137895)
$query_options[] = 'STRAIGHT_JOIN';
+   $join_conds['ores_model'][0] = 'INNER JOIN';
+   $join_conds['ores_classification'][0] = 'INNER JOIN';
}
 
return true;
@@ -281,44 +272,35 @@
$threshold = self::getDamagingThreshold( $pager->getUser() );
$dbr = \wfGetDB( DB_REPLICA );
 
-   $query['tables'][] = 'ores_classification';
$query['tables'][] = 'ores_model';
+   $query['tables'][] = 'ores_classification';
 
$query['fields'][] = 'oresc_probability';
// Add user-based threshold
$query['fields'][] = $dbr->addQuotes( $threshold ) . ' AS 
ores_threshold';
 
-   $query['conds'][] = '(oresm_name = ' . $dbr->addQuotes( 
'damaging' ) .
-   ' OR oresm_name IS NULL)';
+   $query['join_conds']['ores_model'] = [ 'LEFT JOIN', [
+   'oresm_is_current' => 1,
+   'oresm_name' => 'damaging',
+   ] ];
 
-   $query['conds'][] = '(oresm_is_current != 0 OR oresm_is_current 
IS NULL)';
-
-   $query['join_conds']['ores_classification'] = [
-   'LEFT JOIN',
-   'rev_id = oresc_rev ' .
-   'AND oresc_class = 1'
-   ];
-
-   $query['join_conds']['ores_model'] = [
-   'LEFT JOIN',
-   'oresc_model = oresm_id ' .
-   'AND oresm_is_current = 1'
-   ];
+   $query['join_conds']['ores_classification'] = [ 'LEFT JOIN', [
+   'oresc_model = oresm_id',
+   'rev_id = oresc_rev',
+   'oresc_class' => 1
+   ] ];
 
if (
self::isModelEnabled( 'damaging' ) &&
$pager->getContext()->getRequest()->getVal( 
'hidenondamaging' )
) {
-

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Cleanup MemcLockManager and move it to /libs

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

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

Change subject: Cleanup MemcLockManager and move it to /libs
..

Cleanup MemcLockManager and move it to /libs

* Remove wf* function and ObjectCache dependencies.
* Use the base class session field.
* Lower physical lock structure TTL and move it to the base
  class as a constant.
* Resolve TODO about acquiring mixed lock types in one pass.
* Only mark servers down for 30 seconds in case of long-running
  scripts.

Change-Id: Icd4be407e599524cc620975d27e85666d2532b95
---
M autoload.php
M includes/libs/lockmanager/LockManager.php
R includes/libs/lockmanager/MemcLockManager.php
M includes/libs/lockmanager/QuorumLockManager.php
M includes/libs/objectcache/MemcachedBagOStuff.php
5 files changed, 113 insertions(+), 138 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/313585/1

diff --git a/autoload.php b/autoload.php
index 3b42870..4cd28da 100644
--- a/autoload.php
+++ b/autoload.php
@@ -921,7 +921,7 @@
'MediaWiki\\Widget\\TitleInputWidget' => __DIR__ . 
'/includes/widget/TitleInputWidget.php',
'MediaWiki\\Widget\\UserInputWidget' => __DIR__ . 
'/includes/widget/UserInputWidget.php',
'MemCachedClientforWiki' => __DIR__ . 
'/includes/compat/MemcachedClientCompat.php',
-   'MemcLockManager' => __DIR__ . 
'/includes/filebackend/lockmanager/MemcLockManager.php',
+   'MemcLockManager' => __DIR__ . 
'/includes/libs/lockmanager/MemcLockManager.php',
'MemcachedBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/MemcachedBagOStuff.php',
'MemcachedClient' => __DIR__ . 
'/includes/libs/objectcache/MemcachedClient.php',
'MemcachedPeclBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/MemcachedPeclBagOStuff.php',
diff --git a/includes/libs/lockmanager/LockManager.php 
b/includes/libs/lockmanager/LockManager.php
index 42391a0..e89a9c7 100644
--- a/includes/libs/lockmanager/LockManager.php
+++ b/includes/libs/lockmanager/LockManager.php
@@ -68,6 +68,9 @@
const LOCK_UW = 2; // shared lock (for reads used to write elsewhere)
const LOCK_EX = 3; // exclusive lock (for writes)
 
+   /** @var int Max expected lock expiry in any context */
+   const MAX_LOCK_TTL = 7200; // 2 hours
+
/**
 * Construct a new instance from configuration
 *
@@ -87,6 +90,11 @@
$this->lockTTL = max( 5 * 60, 2 * (int)$met );
}
 
+   // Upper bound on how long to keep lock structures around. This 
is useful when setting
+   // TTLs, as the "lockTTL" value may vary based on CLI mode and 
app server group. This is
+   // a "safe" value that can be used to avoid clobbering other 
locks that use high TTLs.
+   $this->lockTTL = min( $this->lockTTL, self::MAX_LOCK_TTL );
+
$random = [];
for ( $i = 1; $i <= 5; ++$i ) {
$random[] = mt_rand( 0, 0xFFF );
diff --git a/includes/filebackend/lockmanager/MemcLockManager.php 
b/includes/libs/lockmanager/MemcLockManager.php
similarity index 62%
rename from includes/filebackend/lockmanager/MemcLockManager.php
rename to includes/libs/lockmanager/MemcLockManager.php
index 81ce424..83334fe 100644
--- a/includes/filebackend/lockmanager/MemcLockManager.php
+++ b/includes/libs/lockmanager/MemcLockManager.php
@@ -43,14 +43,10 @@
self::LOCK_EX => self::LOCK_EX
];
 
-   /** @var array Map server names to MemcachedBagOStuff objects */
-   protected $bagOStuffs = [];
-
-   /** @var array (server name => bool) */
-   protected $serversUp = [];
-
-   /** @var string Random UUID */
-   protected $session = '';
+   /** @var MemcachedBagOStuff[] Map of (server name => 
MemcachedBagOStuff) */
+   protected $cacheServers = [];
+   /** @var HashBagOStuff Server status cache */
+   protected $statusCache;
 
/**
 * Construct a new instance from configuration.
@@ -59,8 +55,9 @@
 *   - lockServers  : Associative array of server names to 
":" strings.
 *   - srvsByBucket : Array of 1-16 consecutive integer keys, starting 
from 0,
 *each having an odd-numbered list of server names 
(peers) as values.
-*   - memcConfig   : Configuration array for 
ObjectCache::newFromParams. [optional]
-*If set, this must use one of the memcached 
classes.
+*   - memcConfig   : Configuration array for 
MemcachedBagOStuff::construct() with an
+*additional 'class' parameter specifying which 
MemcachedBagOStuff
+*subclass to use. The server names will be 
injected. [optional]
 * @throws Exception
 */
public function __construct( array $config ) {
@@ -70,69 +67,31 @@

  1   2   >