[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: VisualEditor: spaced pre after heading

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

Change subject: VisualEditor: spaced pre after heading
..


VisualEditor: spaced pre after heading

pre initiated with space after a heading lead to the heading not
being rendered. Fixed this by changing line boundaries and the
logic of line breaks.

Change-Id: I235217c8b7ade94a2c4920b780c2c418fd226b73
Internal: ERM4108
---
M VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
1 file changed, 11 insertions(+), 6 deletions(-)

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



diff --git a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js 
b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
index 862bd50..3434a24 100644
--- a/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
+++ b/VisualEditor/resources/tiny_mce_plugins/bswikicode/plugin.js
@@ -2090,15 +2090,19 @@
// line being recognized since the regex then matches line 
endings at the beginning
// and at the end.
// There is a lookahead for tables: ?!' + _preTagsSpace[i] + '');
-
+   // preserve newline at the beginning of a line
+   var newlineAtBeginning = 
_preTagsSpace[i].charAt(0) == "\n";
+   // trim pre content
+   _preTagsSpace[i] = _preTagsSpace[i].replace( 
/\n/g, "").substr(1, _preTagsSpace[i].length);
+   text = text.replace(
+   "@@@PRE_SPACE" + i + "@@@",
+   ( newlineAtBeginning ? "\n" : "" ) + 
'' + _preTagsSpace[i] + ''
+   );
}
}
 
@@ -2274,7 +2278,8 @@
 
do {
_processFlag = false;
-   text = 
text.replace(/(^|\n|\b)([^\n]+)\n([^\n]{1,5})/gi, __preserveSingleLinebreaks);
+   // (^|\n|>| ): only last word. Used to be \b, but this 
matches @ which is unwanted
+   text = text.replace(/(^|\n|>| 
)([^\n]+)\n([^\n]{1,5})/gi, __preserveSingleLinebreaks);
 
} while (_processFlag);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I235217c8b7ade94a2c4920b780c2c418fd226b73
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Mglaser 
Gerrit-Reviewer: Dvogel hallowelt 
Gerrit-Reviewer: Ljonka 
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...BlueSpiceCategoryManager[master]: Remove "edit" button from UI

2016-10-27 Thread Robert Vogel (Code Review)
Robert Vogel has submitted this change and it was merged.

Change subject: Remove "edit" button from UI
..


Remove "edit" button from UI

... as this is not implemented yet.

Change-Id: I74f043ce4106d9532228ec461f3ea3c648792210
---
M resources/BS.BlueSpiceCategoryManager/TreePanel.js
1 file changed, 9 insertions(+), 0 deletions(-)

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



diff --git a/resources/BS.BlueSpiceCategoryManager/TreePanel.js 
b/resources/BS.BlueSpiceCategoryManager/TreePanel.js
index 255f360..01b9372 100644
--- a/resources/BS.BlueSpiceCategoryManager/TreePanel.js
+++ b/resources/BS.BlueSpiceCategoryManager/TreePanel.js
@@ -214,5 +214,14 @@
scope: this
}
);
+   },
+
+   opPermitted: function( operation ) {
+   //Edit functionality is not yet implemented. For the time being 
this
+   //is the simplest way to hide the "edit" button from the UI.
+   if( operation === 'update' ) {
+   return false;
+   }
+   return this.callParent( arguments );
}
 } );
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I74f043ce4106d9532228ec461f3ea3c648792210
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceCategoryManager
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel 
Gerrit-Reviewer: Dvogel hallowelt 
Gerrit-Reviewer: Ljonka 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: Pwirth 
Gerrit-Reviewer: Robert Vogel 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceSMWConnector[master]: Fix E_NOTICE

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

Change subject: Fix E_NOTICE
..


Fix E_NOTICE

Check isset before using $wgExtensionFunctions

Bug: T149343
Change-Id: Ieadefb3ef5c074c3e1c2abea20bee842780fe84e
---
M BlueSpiceSMWConnector.php
1 file changed, 8 insertions(+), 6 deletions(-)

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



diff --git a/BlueSpiceSMWConnector.php b/BlueSpiceSMWConnector.php
index f699914..6dd2c00 100644
--- a/BlueSpiceSMWConnector.php
+++ b/BlueSpiceSMWConnector.php
@@ -21,13 +21,15 @@
  *
  * -- RV
  */
-$iEchoKey = array_search( 'EchoHooks::initEchoExtension', 
$wgExtensionFunctions ) ;
-if( $iEchoKey !== false ) {
-   unset($wgExtensionFunctions[$iEchoKey]);
-   $wgExtensionFunctions[] = 'EchoHooks::initEchoExtension';
+if ( isset( $wgExtensionFunctions ) ) {
+   $iEchoKey = array_search( 'EchoHooks::initEchoExtension', 
$wgExtensionFunctions ) ;
+   if( $iEchoKey !== false ) {
+   unset($wgExtensionFunctions[$iEchoKey]);
+   $wgExtensionFunctions[] = 'EchoHooks::initEchoExtension';
+   }
+   unset( $iEchoKey );
+   unset( $aResourceModuleTemplate );
 }
-unset( $iEchoKey );
-unset( $aResourceModuleTemplate );
 
 $GLOBALS[ 'wgExtensionFunctions' ][] = function() {
BSExtraPropertyAnnotator::processProperties();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieadefb3ef5c074c3e1c2abea20bee842780fe84e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceSMWConnector
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger 
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...CollaborationKit[master]: Make subpage ToC still show a name for projects without a di...

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

Change subject: Make subpage ToC still show a name for projects without a 
displayname
..


Make subpage ToC still show a name for projects without a displayname

Bug: T149033
Change-Id: I3f2c9307b2b2050dad249a97a569b0b2a6845eb7
---
M includes/content/CollaborationHubTOC.php
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/includes/content/CollaborationHubTOC.php 
b/includes/content/CollaborationHubTOC.php
index 2b12aa4..5ebdaf4 100644
--- a/includes/content/CollaborationHubTOC.php
+++ b/includes/content/CollaborationHubTOC.php
@@ -103,7 +103,10 @@
);
 
// hubpage
-   $link = $this->renderItem( $title, $content->getDisplayName(), 
$image, 16 );
+
+   $name = $content->getDisplayName() == '' ? $title->getText() : 
$content->getDisplayName();
+   $link = $this->renderItem( $title, $name, $image, 16 );
+
$html .= Html::rawElement(
'div',
[ 'class' => 'mw-ck-toc-subpage-hub' ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3f2c9307b2b2050dad249a97a569b0b2a6845eb7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Isarra 
Gerrit-Reviewer: Harej 
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...CollaborationKit[master]: Merge "Clean up css classes as .mw-ck-whatever-stuff"

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

Change subject: Merge "Clean up css classes as .mw-ck-whatever-stuff"
..


Merge "Clean up css classes as .mw-ck-whatever-stuff"

Change-Id: Ibe6382d8a09a4c184eee8b91d9abecfa79161aea
---
M CollaborationKit.hooks.php
M includes/content/CollaborationHubContent.php
2 files changed, 14 insertions(+), 5 deletions(-)

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



diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index d89ce7b..a1e16e1 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -97,6 +97,7 @@
 
if ( $parentHub
&& $out->getProperty( 'CollaborationHubSubpage' ) === 
'in-progress'
+   && count( Revision::newFromTitle( $parentHub 
)->getContent()->getContent() ) > 0
) {
$toc = new CollaborationHubTOC();
$out->prependHtml( $toc->renderSubpageToC( $parentHub ) 
);
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index d093be8..a8408a0 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -248,17 +248,25 @@
$this->getParsedAnnouncements( $title, $options 
)
);
// get table of contents
-   $html .= Html::rawElement(
-   'div',
-   [ 'class' => 'mw-ck-hub-toc' ],
-   $this->getTableOfContents( $title, $options )
-   );
+   if ( count( $this->getContent() ) > 0 ) {
+   $html .= Html::rawElement(
+   'div',
+   [ 'class' => 'mw-ck-hub-toc' ],
+   $this->getTableOfContents( $title, 
$options )
+   );
+   }
+
+   $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
// get transcluded content
$html .= Html::rawElement(
'div',
[ 'class' => 'mw-ck-hub-content' ],
$this->getParsedContent( $title, $options, 
$output )
);
+
+   $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
// get footer
$html .= Html::rawElement(
'div',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe6382d8a09a4c184eee8b91d9abecfa79161aea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 
Gerrit-Reviewer: Harej 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: WIP: Add Wikidata description editing dataclient

2016-10-27 Thread BearND (Code Review)
BearND has uploaded a new change for review.

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

Change subject: WIP: Add Wikidata description editing dataclient
..

WIP: Add Wikidata description editing dataclient

Edits don't work yet: 
{"servedby":"mw1189","error":{"code":"unknownerror","info":"Unknown error: 
\"wikibase-no-direct-editing\"","*":"See https://www.wikidata.org/w/api.php for 
API usage"}}

See more details in the task comments.

Bug: T146641
Change-Id: I2a7c4659fb51c5189f6e188dc10bfa8cb1f7eca0
---
M app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java
M app/src/main/java/org/wikipedia/editing/Edit.java
A 
app/src/main/java/org/wikipedia/editing/wikidata/WikidataDescriptionEditDataClient.java
3 files changed, 128 insertions(+), 8 deletions(-)


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

diff --git 
a/app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java 
b/app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java
index eeaea17..0b73987 100644
--- a/app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java
+++ b/app/src/main/java/org/wikipedia/descriptions/DescriptionEditFragment.java
@@ -12,6 +12,8 @@
 import android.view.ViewGroup;
 
 import org.wikipedia.R;
+import org.wikipedia.editing.EditingResult;
+import org.wikipedia.editing.wikidata.WikidataDescriptionEditDataClient;
 import org.wikipedia.json.GsonMarshaller;
 import org.wikipedia.json.GsonUnmarshaller;
 import org.wikipedia.page.PageTitle;
@@ -81,8 +83,22 @@
 private class EditViewCallback implements DescriptionEditView.Callback {
 @Override
 public void onSaveClick() {
-// TODO: save it!
 editView.setSaveState(true);
+WikidataDescriptionEditDataClient client = new 
WikidataDescriptionEditDataClient();
+client.submitDescription(pageTitle, editView.getDescription(),
+new WikidataDescriptionEditDataClient.Callback() {
+@Override
+public void success(@NonNull EditingResult result) {
+editView.setSaveState(false);
+// TODO: go to success fragment
+}
+
+@Override
+public void failure(@NonNull Throwable caught) {
+editView.setSaveState(false);
+// TODO: go to failure fragment
+}
+});
 }
 }
 }
diff --git a/app/src/main/java/org/wikipedia/editing/Edit.java 
b/app/src/main/java/org/wikipedia/editing/Edit.java
index 1b18608..c2570de 100644
--- a/app/src/main/java/org/wikipedia/editing/Edit.java
+++ b/app/src/main/java/org/wikipedia/editing/Edit.java
@@ -5,18 +5,18 @@
 
 public class Edit {
 @SuppressWarnings("unused,NullableProblems") @NonNull private Result edit;
-@NonNull protected Result edit() {
+@Nullable public Result edit() {
 return edit;
 }
 
-protected class Result {
+public class Result {
 @Nullable private String result;
-@Nullable protected String status() {
+@Nullable public String status() {
 return result;
 }
 
 private int newrevid;
-protected int newRevId() {
+public int newRevId() {
 return newrevid;
 }
 
@@ -30,7 +30,7 @@
 return code;
 }
 
-protected boolean hasErrorCode() {
+public boolean hasErrorCode() {
 return code != null;
 }
 
@@ -39,11 +39,11 @@
 }
 
 @Nullable private String spamblacklist;
-@Nullable protected String spamblacklist() {
+@Nullable public String spamblacklist() {
 return spamblacklist;
 }
 
-protected boolean hasSpamBlacklistResponse() {
+public boolean hasSpamBlacklistResponse() {
 return spamblacklist != null;
 }
 }
diff --git 
a/app/src/main/java/org/wikipedia/editing/wikidata/WikidataDescriptionEditDataClient.java
 
b/app/src/main/java/org/wikipedia/editing/wikidata/WikidataDescriptionEditDataClient.java
new file mode 100644
index 000..cf4ac9a
--- /dev/null
+++ 
b/app/src/main/java/org/wikipedia/editing/wikidata/WikidataDescriptionEditDataClient.java
@@ -0,0 +1,104 @@
+package org.wikipedia.editing.wikidata;
+
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.annotation.VisibleForTesting;
+
+import org.wikipedia.dataclient.WikiSite;
+import org.wikipedia.dataclient.retrofit.MwCachedService;
+import org.wikipedia.editing.Edit;
+import org.wikipedia.editing.EditingResult;
+import org.wikipedia.editing.SuccessEditResult;
+import org.wikipedia.login.User;
+import org.wikipedia.page.PageTitle;
+import org.wikipedia.util.log.L;
+
+import java.util.concurrent.TimeUnit;
+
+import retrofit2.Call;
+import retrofit

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Merge "Clean up css classes as .mw-ck-whatever-stuff"

2016-10-27 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Merge "Clean up css classes as .mw-ck-whatever-stuff"
..

Merge "Clean up css classes as .mw-ck-whatever-stuff"

Change-Id: Ibe6382d8a09a4c184eee8b91d9abecfa79161aea
---
M CollaborationKit.hooks.php
M includes/content/CollaborationHubContent.php
2 files changed, 14 insertions(+), 5 deletions(-)


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

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index d89ce7b..a1e16e1 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -97,6 +97,7 @@
 
if ( $parentHub
&& $out->getProperty( 'CollaborationHubSubpage' ) === 
'in-progress'
+   && count( Revision::newFromTitle( $parentHub 
)->getContent()->getContent() ) > 0
) {
$toc = new CollaborationHubTOC();
$out->prependHtml( $toc->renderSubpageToC( $parentHub ) 
);
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index d093be8..a8408a0 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -248,17 +248,25 @@
$this->getParsedAnnouncements( $title, $options 
)
);
// get table of contents
-   $html .= Html::rawElement(
-   'div',
-   [ 'class' => 'mw-ck-hub-toc' ],
-   $this->getTableOfContents( $title, $options )
-   );
+   if ( count( $this->getContent() ) > 0 ) {
+   $html .= Html::rawElement(
+   'div',
+   [ 'class' => 'mw-ck-hub-toc' ],
+   $this->getTableOfContents( $title, 
$options )
+   );
+   }
+
+   $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
// get transcluded content
$html .= Html::rawElement(
'div',
[ 'class' => 'mw-ck-hub-content' ],
$this->getParsedContent( $title, $options, 
$output )
);
+
+   $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
// get footer
$html .= Html::rawElement(
'div',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe6382d8a09a4c184eee8b91d9abecfa79161aea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Expand Content-Security-Policy on upload test to fr.

2016-10-27 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review.

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

Change subject: Expand Content-Security-Policy on upload test to fr.
..

Expand Content-Security-Policy on upload test to fr.

Slowly adding larger wikis to make sure this doesn't add more log
traffic than expected.

Bug: T117618
Change-Id: I3c3c0ce4d041869bbd176aaeaa4ad8c077a18731
---
M modules/varnish/templates/upload-frontend.inc.vcl.erb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/90/318490/1

diff --git a/modules/varnish/templates/upload-frontend.inc.vcl.erb 
b/modules/varnish/templates/upload-frontend.inc.vcl.erb
index e322aa1..fc1d126 100644
--- a/modules/varnish/templates/upload-frontend.inc.vcl.erb
+++ b/modules/varnish/templates/upload-frontend.inc.vcl.erb
@@ -120,7 +120,7 @@
 
// Restrict uploads from loading external resources. (T117618)
// Currently experimental and testing on test/test2/el.wikipedia.org 
only.
-   if (req.url ~ "^/wikipedia/(el|test)") {
+   if (req.url ~ "^/wikipedia/(el|fr|test)") {
set resp.http.Content-Security-Policy-Report-Only = 
"default-src 'none'; style-src 'unsafe-inline' data:; font-src data:; img-src 
data: https://upload.wikimedia.org/favicon.ico; media-src data:; sandbox; 
report-uri 
https://test.wikipedia.org/w/api.php?reportonly=1&source=image&action=cspreport&format=json&";;
set resp.http.X-Content-Security-Policy-Report-Only = 
resp.http.Content-Security-Policy-Report-Only;
set resp.http.X-Webkit-CSP-Report-Only = 
resp.http.Content-Security-Policy-Report-Only;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c3c0ce4d041869bbd176aaeaa4ad8c077a18731
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Clean up css classes as .mw-ck-whatever-stuff

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

Change subject: Clean up css classes as .mw-ck-whatever-stuff
..


Clean up css classes as .mw-ck-whatever-stuff

* Prefixed everything with mw-ck
* Sort of consistentified hyphenation
* Make icons inherit colour from theme on hubs by setting a colour theme class
  there (icons still have colours directly set (for lists etc), which
  overrides this)
* Remove $colour variable from ToC item rendering in order to simply inherit
  it from parents (or set it just at the start on subpages)

Probably missed/broke some things

Bug: T141584
Bug: T141197
Change-Id: I956160ec158933f069a63d53df8313c9b42c2aba
---
M extension.json
M includes/SpecialCreateCollaborationHub.php
M includes/SpecialCreateHubFeature.php
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationHubTOC.php
M includes/content/CollaborationKitIcon.php
M includes/content/CollaborationListContent.php
M modules/ext.CollaborationKit.hub.styles.less
M modules/ext.CollaborationKit.hub.subpage.styles.less
M modules/ext.CollaborationKit.list.edit.js
M modules/ext.CollaborationKit.list.styles.less
M modules/ext.CollaborationKit.mixins.less
12 files changed, 200 insertions(+), 200 deletions(-)

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



diff --git a/extension.json b/extension.json
index 1ab6b63..c120287 100644
--- a/extension.json
+++ b/extension.json
@@ -189,8 +189,8 @@
]
},
"ext.CollaborationKit.blots": {
-   "selectorWithoutVariant": ".mw-cklist-{name} ul",
-   "selectorWithVariant": ".mw-cklist-{name}-{variant} ul",
+   "selectorWithoutVariant": 
".mw-ck-theme.mw-ck-list-{name} ul",
+   "selectorWithVariant": 
".mw-ck-theme-{variant}.mw-ck-list-{name} ul",
"class": "ResourceLoaderListStyleModule",
"variants": {
"red1": { "color": "#700", "global": true },
@@ -221,8 +221,8 @@
}
},
"ext.CollaborationKit.icons": {
-   "selectorWithoutVariant": ".mw-ckicon-{name}",
-   "selectorWithVariant": ".mw-ckicon-{name}-{variant}",
+   "selectorWithoutVariant": ".mw-ck-theme 
.mw-ck-icon-{name}, .mw-ck-icon-{name}",
+   "selectorWithVariant": ".mw-ck-theme-{variant} 
.mw-ck-icon-{name}, .mw-ck-icon-{name}-{variant}",
"class": "ResourceLoaderImageModule",
"variants": {
"red1": { "color": "#700", "global": true },
diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 26c761b..35f891a 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -33,19 +33,19 @@
// autofilled from how they got here, hopefully
'title' => [
'type' => 'text',
-   'cssclass' => 'mw-ck-titleinput',
+   'cssclass' => 'mw-ck-title-input',
'label-message' => 
'collaborationkit-createhub-title',
],
// Display name can be different from page title
'display_name' => [
'type' => 'text',
-   'cssclass' => 'mw-ck-displayinput',
+   'cssclass' => 'mw-ck-display-input',
'label-message' => 
'collaborationkit-createhub-displayname',
],
// Hub image/icon thing
'icon' => [
'type' => 'text',
-   'cssclass' => 'mw-ck-iconinput',
+   'cssclass' => 'mw-ck-icon-input',
'label-message' => 
'collaborationkit-createhub-image',
],
];
@@ -56,7 +56,7 @@
}
$fields['colour'] = [
'type' => 'select',
-   'cssclass' => 'mw-ck-colourinput',
+   'cssclass' => 'mw-ck-colour-input',
'id' => 'wpCollabHubColour',
'label-message' => 'collaborationkit-createhub-colour',
'options' => $this->getOptions( $colours ),
@@ -73,20 +73,20 @@
] ),
'default' => 'new', // might want to change default to 
clone from the default? (TODO add a canned default as example and stuff: 
T136470)
'label-message' => 'collaborationkit-createh

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: MessageCache invalidation improvements

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

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

Change subject: MessageCache invalidation improvements
..

MessageCache invalidation improvements

* Increase time range for getValidationHash() using "latest" values.
  The lower value ran the risk of regenerating from slaves and ending
  up with *older* data than what was there.
* Avoid cache set() calls in replace() unless the lock was acquired.
  Use delete() instead in that case, which invalidates the cache.
* Remember if the cache is volatile in process memory instead of doing
  check key lookups for each "big" message to determine this.
* Add logging when replace() fails to acquire the lock.
* Factored message cache update code duplication into a new method.
* User makeKey() in more places, replacing deprecated wfMemcKey().

Change-Id: Idc337a787171949c4f70186b13d7b65304c9b57f
---
M includes/cache/MessageCache.php
M includes/page/WikiPage.php
2 files changed, 95 insertions(+), 72 deletions(-)


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

diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index dc8c589..0af8511 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -53,6 +53,11 @@
protected $mCache;
 
/**
+* @var bool[] Map of (language code => boolean) for recently purged 
cache data
+*/
+   protected $mCacheVolatile = [];
+
+   /**
 * Should mean that database cannot be used, but check
 * @var bool $mDisable
 */
@@ -65,10 +70,12 @@
protected $mExpiry;
 
/**
-* Message cache has its own parser which it uses to transform
-* messages.
+* Message cache has its own parser which it uses to transform messages
+* @var ParserOptions
 */
-   protected $mParserOptions, $mParser;
+   protected $mParserOptions;
+   /** @var Parser */
+   protected $mParser;
 
/**
 * Variable for tracking which variables are already loaded
@@ -129,6 +136,7 @@
 */
public static function normalizeKey( $key ) {
global $wgContLang;
+
$lckey = strtr( $key, ' ', '_' );
if ( ord( $lckey ) < 128 ) {
$lckey[0] = strtolower( $lckey[0] );
@@ -262,6 +270,7 @@
# Hash of the contents is stored in memcache, to detect if 
data-center cache
# or local cache goes out of date (e.g. due to replace() on 
some other server)
list( $hash, $hashVolatile ) = $this->getValidationHash( $code 
);
+   $this->mCacheVolatile[$code] = $hashVolatile;
 
# Try the local cache and check against the cluster hash key...
$cache = $this->getLocalCache( $code );
@@ -544,31 +553,36 @@
// a self-deadlock. This is safe as no reads happen *directly* 
in this
// method between getReentrantScopedLock() and load() below. 
There is
// no risk of data "changing under our feet" for replace().
-   $cacheKey = wfMemcKey( 'messages', $code );
-   $scopedLock = $this->getReentrantScopedLock( $cacheKey );
+   $scopedLock = $this->getReentrantScopedLock( wfMemcKey( 
'messages', $code ) );
+   // Load the messages from the master DB to avoid race conditions
$this->load( $code, self::FOR_UPDATE );
 
-   $titleKey = wfMemcKey( 'messages', 'individual', $title );
+   // Load the process cache values and set the per-title cache 
keys.
+   $titleKey = $this->wanCache->makeKey( 'messages', 'individual', 
$title );
if ( $text === false ) {
// Article was deleted
$this->mCache[$code][$title] = '!NONEXISTENT';
$this->wanCache->delete( $titleKey );
} elseif ( strlen( $text ) > $wgMaxMsgCacheEntrySize ) {
-   // Check for size
$this->mCache[$code][$title] = '!TOO BIG';
-   $this->wanCache->set( $titleKey, ' ' . $text, 
$this->mExpiry );
+   $scopedLock
+   ? $this->wanCache->set( $titleKey, " $text", 
$this->mExpiry )
+   // Avoid the risk of set() collisions on the 
same title key
+   : $this->wanCache->delete( $titleKey );
} else {
$this->mCache[$code][$title] = ' ' . $text;
$this->wanCache->delete( $titleKey );
}
-
-   // Mark this cache as definitely "latest" (non-volatile) so
+   // Mark this cache as definitely being "latest" (non-volatile) 
so
// load() calls do try to refresh t

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] Avoid races in MessageCache::replace()

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

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

Change subject: [WIP] Avoid races in MessageCache::replace()
..

[WIP] Avoid races in MessageCache::replace()

Do the process cache update immediately (as before) but push
the shared cache updates to a deferred update. This update
will thus start with a clear transaction snapshot, so it can
acquire the lock before the first SELECT as is proper.

Also added some missing method visibilities.

Change-Id: I462554b300d4688b09ab80cd1bb8a4340ffaa786
---
M includes/cache/MessageCache.php
1 file changed, 108 insertions(+), 85 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/318489/1

diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 0af8511..ece2479 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -447,7 +447,7 @@
 * @param integer $mode Use MessageCache::FOR_UPDATE to skip process 
cache
 * @return array Loaded messages for storing in caches
 */
-   function loadFromDB( $code, $mode = null ) {
+   protected function loadFromDB( $code, $mode = null ) {
global $wgMaxMsgCacheEntrySize, $wgLanguageCode, 
$wgAdaptiveMessageCache;
 
$dbr = wfGetDB( ( $mode == self::FOR_UPDATE ) ? DB_MASTER : 
DB_REPLICA );
@@ -478,7 +478,8 @@
} else {
# Effectively disallows use of '/' character in 
NS_MEDIAWIKI for uses
# other than language code.
-   $conds[] = 'page_title NOT' . $dbr->buildLike( 
$dbr->anyString(), '/', $dbr->anyString() );
+   $conds[] = 'page_title NOT' .
+   $dbr->buildLike( $dbr->anyString(), '/', 
$dbr->anyString() );
}
 
# Conditions to fetch oversized pages to ignore them
@@ -536,7 +537,7 @@
 * @param mixed $text New contents of the page.
 */
public function replace( $title, $text ) {
-   global $wgMaxMsgCacheEntrySize, $wgContLang, $wgLanguageCode;
+   global $wgLanguageCode;
 
if ( $this->mDisable ) {
return;
@@ -548,66 +549,77 @@
return;
}
 
-   // Note that if the cache is volatile, load() may trigger a DB 
fetch.
-   // In that case we reenter/reuse the existing cache key lock to 
avoid
-   // a self-deadlock. This is safe as no reads happen *directly* 
in this
-   // method between getReentrantScopedLock() and load() below. 
There is
-   // no risk of data "changing under our feet" for replace().
-   $scopedLock = $this->getReentrantScopedLock( wfMemcKey( 
'messages', $code ) );
-   // Load the messages from the master DB to avoid race conditions
-   $this->load( $code, self::FOR_UPDATE );
-
-   // Load the process cache values and set the per-title cache 
keys.
-   $titleKey = $this->wanCache->makeKey( 'messages', 'individual', 
$title );
+   // (a) Update the process cache with the new message text
if ( $text === false ) {
-   // Article was deleted
+   // Page deleted
$this->mCache[$code][$title] = '!NONEXISTENT';
-   $this->wanCache->delete( $titleKey );
-   } elseif ( strlen( $text ) > $wgMaxMsgCacheEntrySize ) {
-   $this->mCache[$code][$title] = '!TOO BIG';
-   $scopedLock
-   ? $this->wanCache->set( $titleKey, " $text", 
$this->mExpiry )
-   // Avoid the risk of set() collisions on the 
same title key
-   : $this->wanCache->delete( $titleKey );
} else {
+   // Ignore $wgMaxMsgCacheEntrySize so the process cache 
is up to date
$this->mCache[$code][$title] = ' ' . $text;
-   $this->wanCache->delete( $titleKey );
}
-   // Mark this cache as definitely being "latest" (non-volatile) 
so
-   // load() calls do try to refresh the cache with replica DB data
-   $this->mCache[$code]['LATEST'] = time();
 
-   // Update caches if the lock was acquired
-   if ( $scopedLock ) {
+   // (b) Update the shared caches in a deferred update with a 
fresh DB snapshot
+   DeferredUpdates::addCallableUpdate( function () use ( $title, 
$msg, $code ) {
+   global $wgContLang, $wgMaxMsgCacheEntrySize;
+   // Note that if the cache is volatile, load() may 
trigger a DB fetch.
+   // In that case we reenter/r

[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: Don't normalize away null values

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

Change subject: Don't normalize away null values
..


Don't normalize away null values

 * An MWOAuthConsumer is often initialized w/ id == null so that the
   field auto-increments when being inserted.  Normalizing to an int
   converts the value to 0, which doesn't play nice w/ sqlite.

 * Maybe a better solution is to explicitly set the field to null in the
   row before inserting, and keeping this normalization?

Change-Id: I06858d50687efdb94c76c6e9360185138449d24e
---
M backend/MWOAuthConsumer.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/backend/MWOAuthConsumer.php b/backend/MWOAuthConsumer.php
index d63fde3..60e3b2d 100644
--- a/backend/MWOAuthConsumer.php
+++ b/backend/MWOAuthConsumer.php
@@ -269,7 +269,8 @@
}
 
protected function normalizeValues() {
-   $this->id = (int)$this->id;
+   // Keep null values since we're constructing w/ them to 
auto-increment
+   $this->id = is_null( $this->id ) ? null : (int)$this->id;
$this->userId = (int)$this->userId;
$this->registration = wfTimestamp( TS_MW, $this->registration );
$this->stage = (int)$this->stage;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I06858d50687efdb94c76c6e9360185138449d24e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Arlolra 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Arlolra 
Gerrit-Reviewer: Gergő Tisza 
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]: Add $wgCSPFalsePositiveUrls to release notes

2016-10-27 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review.

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

Change subject: Add $wgCSPFalsePositiveUrls to release notes
..

Add $wgCSPFalsePositiveUrls to release notes

Follow up d84479c4.

Change-Id: I604bdd601b9b1e36964342eed3858336e683d769
---
M RELEASE-NOTES-1.28
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index a2a986f..85dc10d 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -34,6 +34,8 @@
   instead of just administrators ('sysop'). Documentation for this feature is
   available at .
 * $wgRevisionCacheExpiry is now set to one week by default instead of being 
disabled.
+* New config variable $wgCSPFalsePositiveUrls to control what URLs to ignore
+  in upcoming Content-Security-Policy feature's reporting.
 
 === New features in 1.28 ===
 * User::isBot() method for checking if an account is a bot role account.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I604bdd601b9b1e36964342eed3858336e683d769
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] mediawiki...Graph[master]: [WIP] Row widget model

2016-10-27 Thread Ferdbold (Code Review)
Ferdbold has uploaded a new change for review.

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

Change subject: [WIP] Row widget model
..

[WIP] Row widget model

Change-Id: I45657f22d5e0b1c70e665cf46229a983ec93275a
---
M extension.json
A modules/ve-graph/widgets/ve.dm.RowWidgetModel.js
M modules/ve-graph/widgets/ve.dm.TableWidgetModel.js
3 files changed, 344 insertions(+), 14 deletions(-)


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

diff --git a/extension.json b/extension.json
index b46e34c..cba8a3e 100644
--- a/extension.json
+++ b/extension.json
@@ -109,6 +109,7 @@
"modules/ve-graph/ve.dm.MWGraphNode.js",
"modules/ve-graph/ve.ui.MWGraphDialog.js",
"modules/ve-graph/ve.ui.MWGraphDialogTool.js",
+   
"modules/ve-graph/widgets/ve.dm.RowWidgetModel.js",

"modules/ve-graph/widgets/ve.dm.TableWidgetModel.js",
"modules/ve-graph/widgets/ve.ui.RowWidget.js",
"modules/ve-graph/widgets/ve.ui.TableWidget.js"
diff --git a/modules/ve-graph/widgets/ve.dm.RowWidgetModel.js 
b/modules/ve-graph/widgets/ve.dm.RowWidgetModel.js
new file mode 100644
index 000..7eafd4e
--- /dev/null
+++ b/modules/ve-graph/widgets/ve.dm.RowWidgetModel.js
@@ -0,0 +1,329 @@
+/*!
+ * VisualEditor DataModel RowWidgetModel class
+ *
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+ /**
+   * RowWidget model.
+   *
+   * @class
+   * @mixins OO.EventEmitter
+   *
+   * @constructor
+   * @param {Object} [config] Configuration options
+   * @cfg {Array} [keys] An array of keys for easy cell selection
+   * @cfg {Array} [data] An array containing all values of the row
+   * @cfg {RegExp|Function|string} [validate] Validation pattern to apply 
on every cell
+   * @cfg {string} [label=''] Row label. Defaults to empty string.
+   * @cfg {boolean} [showLabel=true] Show row label. Defaults to true.
+   */
+ve.dm.RowWidgetModel = function VeDmRowWidgetModel( config ) {
+   config = config || {};
+
+   // Mixin constructors
+   OO.EventEmitter.call( this, config );
+
+   this.data = config.data || [];
+   this.validate = config.validate;
+   this.label = ( config.label !== undefined ) ? config.label : '';
+   this.showLabel = ( config.showLabel !== undefined ) ? 
!!config.showLabel : true;
+
+   this.initializeProps( config.keys );
+};
+
+/* Inheritance */
+
+OO.mixinClass( ve.dm.RowWidgetModel, OO.EventEmitter );
+
+/* Events */
+
+/**
+ * @event valueChange
+ *
+ * Fired when a value inside the row has changed.
+ *
+ * @param {number} The column index of the updated cell
+ * @param {number} The new valueChange
+ */
+
+/**
+ * @event insertCell
+ *
+ * Fired when a new cell is inserted into the row.
+ *
+ * @param {Array} The initial data
+ * @param {number} The index in which to insert the new cell
+ * @param {string} The cell key
+ */
+
+/**
+ * @event removeCell
+ *
+ * Fired when a cell is removed from the row.
+ *
+ * @param {number} The removed cell index
+ * @param {string} The removed cell key
+ */
+
+/**
+ * @event clear
+ *
+ * Fired when the row is cleared
+ *
+ * @param {boolean} Clear cell properties
+ */
+
+/* Methods */
+
+/**
+ * Initializes and ensures the proper creation of the cell property array.
+ * If data exceeds the number of cells given, new ones will be created.
+ *
+ * @private
+ * @param {Array} props The initial cell props
+ */
+ve.dm.RowWidgetModel.prototype.initializeProps = function ( props ) {
+   var i, len;
+
+   this.cells = [];
+
+   if ( Array.isArray( props ) ) {
+   for ( i = 0, len = props.length; i < len; i++ ) {
+   this.cells.push( {
+   index: i,
+   key: props[ i ]
+   } );
+   }
+   }
+};
+
+/**
+ * Triggers the initialization process and builds the initial row.
+ *
+ * @fires insertCell
+ */
+ve.dm.RowWidgetModel.prototype.setupRow = function () {
+   this.verifyData();
+   this.buildRow();
+};
+
+/**
+ * Verifies if the table data is complete and synced with
+ * cell properties, and adds empty strings as cell data if
+ * cells are missing
+ *
+ * @private
+ */
+ve.dm.RowWidgetModel.prototype.verifyData = function () {
+   var i, len;
+
+   for ( i = 0, len = this.cells.length; i < len; i++ ) {
+   if ( this.data[ i ] === undefined ) {
+   this.data.push( '' );
+   }
+   }
+};
+
+/**
+ * Build initial row
+ *
+ * @private
+ * @fires insertCell
+ */
+ve.dm.RowWidgetModel.prototype.buildRow = function () {
+   var i, len;
+
+   for ( i = 0, len = this.cells.length; i < len; i++ ) 

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Don't allow an image to be inserted into a gallery twice sim...

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

Change subject: Don't allow an image to be inserted into a gallery twice 
simultaneously
..


Don't allow an image to be inserted into a gallery twice simultaneously

One after the other is okay though.
Also fix this so that, if the user is fast enough, two images simultaneously
also works.

Bug: T148558
Change-Id: I94f4fadd84cd3ed97d9676043cadc64f0e09f0b9
---
M modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
1 file changed, 19 insertions(+), 18 deletions(-)

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



diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
index 2669bd7..5ddb705 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
@@ -52,6 +52,7 @@
// States
this.highlightedItem = null;
this.searchPanelVisible = false;
+   this.imageCaptions = {};
 
// Default settings
this.defaults = mw.config.get( 'wgVisualEditorConfig' ).galleryOptions;
@@ -280,7 +281,6 @@
// If editing an existing gallery, populate with the 
images...
if ( this.selectedNode ) {
imageTitles = [];
-   this.imageData = [];
 
// Get image and caption data
// TODO: Can be multiple pipes. See parser.php 
-> renderImageGallery in MediaWiki
@@ -300,10 +300,7 @@
if ( title ) {
titleText = 
title.getPrefixedText();

imageTitles.push( titleText );
-   
dialog.imageData.push( {
-   title: 
titleText,
-   
caption: matches[ 3 ]
-   } );
+   
dialog.imageCaptions[ titleText ] = matches[ 3 ];
}
}
}
@@ -424,7 +421,7 @@
  * @param {Object} response jQuery response object
  */
 ve.ui.MWGalleryDialog.prototype.onRequestImagesSuccess = function ( deferred, 
response ) {
-   var index,
+   var index, title,
thumbUrls = {},
items = [],
pages = response.responseJSON.query.pages;
@@ -436,11 +433,16 @@
}
}
 
-   // Make items for every image in imageData
-   this.imageData.forEach( function ( image ) {
-   image.thumbUrl = thumbUrls[ image.title ];
-   items.push( new ve.ui.MWGalleryItemWidget( image ) );
-   } );
+   for ( title in this.imageCaptions ) {
+   if ( Object.prototype.hasOwnProperty.call( thumbUrls, title ) ) 
{
+   items.push( new ve.ui.MWGalleryItemWidget( {
+   title: title,
+   caption: this.imageCaptions[ title ],
+   thumbUrl: thumbUrls[ title ]
+   } ) );
+   delete this.imageCaptions[ title ];
+   }
+   }
this.galleryGroup.addItems( items );
 
// Gallery is no longer empty
@@ -457,11 +459,8 @@
 ve.ui.MWGalleryDialog.prototype.addNewImage = function ( title ) {
var dialog = this;
 
-   // Reset this.imageData, for onRequestImagesSuccess
-   this.imageData = [ {
-   title: title,
-   caption: ''
-   } ];
+   // Reset this.imageCaptions, for onRequestImagesSuccess
+   this.imageCaptions[ title ] = '';
 
// Request image
this.requestImages( {
@@ -472,7 +471,6 @@
var items = dialog.galleryGroup.items;
dialog.onHighlightItem( items[ items.length - 1 ] );
dialog.highlightedCaptionInput.focus();
-
} );
 };
 
@@ -482,7 +480,10 @@
  * @param {ve.ui.MWMediaResultWidget} item Chosen item
  */
 ve.ui.MWGalleryDialog.prototype.onSearchResultsChoose = function ( item ) {
-   this.addNewImage( item.getData().title );
+   var title = item.getData().title;
+   if ( !Object.prototype.hasOwnProperty( this.imageCaptions, title ) ) {
+   this.addNewImage( title );
+   }
 };
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I94f4fadd84cd3ed97d9676043cadc64f0e09f0b

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Align mw.widgets.DateInputWidget to OOjs UI's MediaWiki them...

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

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

Change subject: Align mw.widgets.DateInputWidget to OOjs UI's MediaWiki theme 
widgets
..

Align mw.widgets.DateInputWidget to OOjs UI's MediaWiki theme widgets

Aligning mw.widgets.DateInputWidget to improved color palette and to
other MediaWiki theme widgets.

Bug: T149270
Change-Id: I6b5b99f444a02f68933c85ccd2b8898d3a8758bf
---
M resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less
1 file changed, 31 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/318485/1

diff --git a/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less 
b/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less
index 46e6b62..9aa655b 100644
--- a/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less
+++ b/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less
@@ -21,6 +21,7 @@
 
 .oo-ui-inline-spacing( @spacing, @cancelled-spacing: 0 ) {
margin-right: @spacing;
+
&:last-child {
margin-right: @cancelled-spacing;
}
@@ -32,14 +33,20 @@
display: inline-block;
position: relative;
 
+   // Theme-specific styles
+   width: 21em;
+   margin-top: 0.25em;
+   .oo-ui-inline-spacing( 0.5em );
+   margin-bottom: 0.25em;
+   margin-left: 0;
+
&-handle {
width: 100%;
display: inline-block;
cursor: pointer;
position: relative;
-
.oo-ui-unselectable();
-   .oo-ui-box-sizing(border-box);
+   .oo-ui-box-sizing( border-box );
 
> .oo-ui-indicatorElement-indicator {
display: none;
@@ -63,18 +70,12 @@
z-index: 1;
}
 
-   // Theme-specific styles
-   width: 21em;
-   margin: 0.25em 0;
-
-   .oo-ui-inline-spacing(0.5em);
-
&-handle {
-   padding: 0.5em 1em;
-   border: 1px solid #ccc;
-   border-radius: 0.1em;
-   line-height: 1.275em;
background-color: #fff;
+   padding: 0.5em;
+   border: 1px solid #9aa0a7;
+   border-radius: 2px;
+   line-height: 1.275;
 
> .oo-ui-labelElement-label {
padding: 0;
@@ -103,24 +104,11 @@
}
}
 
-   &.oo-ui-widget-enabled {
-   .mw-widget-dateInputWidget-handle:hover {
-   border-color: #36c;
-   }
-   }
-
-   &.oo-ui-widget-disabled {
+   &-empty {
.mw-widget-dateInputWidget-handle {
-   color: #ccc;
-   text-shadow: 0 1px 1px #fff;
-   border-color: #ddd;
-   background-color: #f3f3f3;
-
-   > .oo-ui-indicatorElement-indicator {
-   opacity: 0.2;
-   }
+   color: #54595d;
+   outline: 0;
}
-
}
 
&.oo-ui-flaggedElement-invalid {
@@ -130,9 +118,22 @@
}
}
 
-   &-empty {
+   &.oo-ui-widget-enabled {
+   .mw-widget-dateInputWidget-handle:hover {
+   border-color: #72777d;
+   }
+   }
+
+   &.oo-ui-widget-disabled {
.mw-widget-dateInputWidget-handle {
-   color: #ccc;
+   background-color: #eaecf0;
+   color: #72777d;
+   border-color: #c8ccd1;
+   text-shadow: 0 1px 1px #fff;
+
+   > .oo-ui-indicatorElement-indicator {
+   opacity: 0.51;
+   }
}
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wmf-auto-reimage: add option --new for new hosts

2016-10-27 Thread Volans (Code Review)
Volans has uploaded a new change for review.

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

Change subject: wmf-auto-reimage: add option --new for new hosts
..

wmf-auto-reimage: add option --new for new hosts

Bug: T148816
Change-Id: I2d6b9345cba4b85cd0cf942f9f9efd50b9816d8d
---
M modules/salt/files/wmf_auto_reimage.py
1 file changed, 27 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/04/318304/1

diff --git a/modules/salt/files/wmf_auto_reimage.py 
b/modules/salt/files/wmf_auto_reimage.py
index eee139b..19436b7 100644
--- a/modules/salt/files/wmf_auto_reimage.py
+++ b/modules/salt/files/wmf_auto_reimage.py
@@ -63,10 +63,16 @@
 help='do not reboot the host after the reimage a first Puppet run')
 parser.add_argument(
 '--no-verify', action='store_true',
-help='do not fail if hosts verification fails, just log it')
+help=('do not fail if hosts verification fails, just log it. Has no '
+  'effect if --new is also set.'))
+parser.add_argument(
+'--new', action='store_true',
+help='for first imaging of new hosts, skip some steps on old hosts')
 parser.add_argument(
 '-c', '--conftool', action='store_true',
-help='depool the host via conftool before proceeding')
+help=('depool the host via conftool before proceeding, print the '
+  'command to repool at the end and in the Phabricator task if -p '
+  'is set. If --new is also set just print the pool message.'))
 parser.add_argument(
 '-a', '--apache', action='store_true',
 help='run apache-fast-test on the hosts after the reimage')
@@ -633,7 +639,8 @@
 return success_hosts
 
 
-def reimage_hosts(puppetmaster_host, hosts, custom_mgmts, ipmi_password):
+def reimage_hosts(
+puppetmaster_host, hosts, custom_mgmts, ipmi_password, is_new=False):
 """ Reimage hosts, return the list of successful ones
 
 TODO: assuming all are successful for now because the minion job
@@ -644,15 +651,22 @@
 puppetmaster_host -- the hostname of the Puppet Master server
 hosts -- the list of FQDN of the hosts to be reimaged
 ipmi_password -- the password for the IPMI
+is_new-- whether this is the first image for a new host
+ [optional, default: False]
 """
 # Hack to avoid a Salt parser bug. Using 'kwarg' doesn't work either
 # at least in our current version.
-command = ("true; IPMI_PASSWORD='{password}' wmf-reimage -s 10 "
+command = ("true; IPMI_PASSWORD='{password}' wmf-reimage -s 10 {new} "
"-y '{host}' '{mgmt}' | tee -a '/root/{host}.log'")
 
 success_hosts = []
 hosts_commands = {}
 audit_commands = {}
+
+if is_new:
+new = '--no-clean'
+else:
+new = ''
 
 print("Running wmf-reimage on hosts: {hosts}".format(hosts=hosts))
 
@@ -667,9 +681,9 @@
 continue
 
 hosts_commands[host] = [command.format(
-password=ipmi_password, host=host, mgmt=mgmt_host)]
+password=ipmi_password, new=new, host=host, mgmt=mgmt_host)]
 audit_commands[host] = [command.format(
-password='**', host=host, mgmt=mgmt_host)]
+password='**', new=new, host=host, mgmt=mgmt_host)]
 print("wmf-reimage log is on {puppetmaster}:/root/{host}.log".format(
 puppetmaster=puppetmaster_host, host=host))
 
@@ -987,7 +1001,8 @@
 hosts_status = None
 
 # Validate hosts
-validate_hosts(puppetmaster_host, args.hosts, args.no_verify)
+if not args.new:
+validate_hosts(puppetmaster_host, args.hosts, args.no_verify)
 
 # Update the Phabricator task
 if args.phab_task_id is not None:
@@ -997,10 +1012,11 @@
 log=log_path))
 
 # Set downtime on Icinga
-hosts = icinga_downtime(icinga_host, hosts, user, args.phab_task_id)
+if not args.new:
+hosts = icinga_downtime(icinga_host, hosts, user, args.phab_task_id)
 
 # Depool via conftool
-if args.conftool:
+if args.conftool and not args.new:
 hosts_status = conftool_depool_hosts(puppetmaster_host, hosts)
 hosts = conftool_ensure_depooled(puppetmaster_host, hosts)
 # Run Puppet on the deployment host to update DSH groups
@@ -1010,7 +1026,7 @@
 # Start the reimage
 reimage_time = datetime.now()
 hosts = reimage_hosts(puppetmaster_host, hosts, custom_mgmts=custom_mgmts,
-  ipmi_password=ipmi_password)
+  ipmi_password=ipmi_password, is_new=args.new)
 hosts = check_reimage(puppetmaster_host, hosts)
 hosts = check_uptime(
 hosts, maximum=int((datetime.now() - reimage_time).total_seconds()))
@@ -1028,7 +1044,7 @@
 hosts, maximum=int((datetime.now() - reboot_time).total_

[MediaWiki-commits] [Gerrit] operations...wikistats[master]: use https for wikis in $tables_with_suffix_wiki_last (w3c)

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

Change subject: use https for wikis in $tables_with_suffix_wiki_last (w3c)
..


use https for wikis in $tables_with_suffix_wiki_last (w3c)

W3C wikis switched from http to https-only in 2016-05.

This broke updates (T149000), they all just got 301s.

We have a config option "$tables_https_only" but we don't
need to use that and add another check for that in the update.php
code since, for now, W3C wikis are the only ones with the
"$tables_with_suffix_wiki_last" URL format.

So we can just change the URL for those to use https, easier change.

Bug: T149000
Change-Id: I807bee25f5557eb7380454d479926f8cfe2c1bc6
---
M usr/lib/wikistats/update.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/usr/lib/wikistats/update.php b/usr/lib/wikistats/update.php
index 29f426b..ebabfe8 100644
--- a/usr/lib/wikistats/update.php
+++ b/usr/lib/wikistats/update.php
@@ -332,7 +332,7 @@
 
$url="http://${domain}/wiki/".$row['prefix']."/api.php${api_query_stat}";
 } elseif (in_array($table, $tables_with_suffix_wiki_last)) {
 $prefix=$row['prefix'];
-
$url="http://${domain}/".$row['prefix']."/wiki/api.php${api_query_stat}";
+
$url="https://${domain}/".$row['prefix']."/wiki/api.php${api_query_stat}";
 } elseif (in_array($table, $tables_https_only)) {
 $prefix=$row['prefix'];
 $url="https://${prefix}.${domain}/w/api.php${api_query_stat}";;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I807bee25f5557eb7380454d479926f8cfe2c1bc6
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/wikistats
Gerrit-Branch: master
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: RobiH 
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...wikistats[master]: use https for wikis in $tables_with_suffix_wiki_last (w3c)

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

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

Change subject: use https for wikis in $tables_with_suffix_wiki_last (w3c)
..

use https for wikis in $tables_with_suffix_wiki_last (w3c)

W3C wikis switched from http to https-only in 2016-05.

This broke updates (T149000), they all just got 301s.

We have a config option "$tables_https_only" but we don't
need to use that and add another check for that in the update.php
code since, for now, W3C wikis are the only ones with the
"$tables_with_suffix_wiki_last" URL format.

So we can just change the URL for those to use https, easier change.

Bug: T149000
Change-Id: I807bee25f5557eb7380454d479926f8cfe2c1bc6
---
M usr/lib/wikistats/update.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/wikistats 
refs/changes/84/318484/1

diff --git a/usr/lib/wikistats/update.php b/usr/lib/wikistats/update.php
index 29f426b..ebabfe8 100644
--- a/usr/lib/wikistats/update.php
+++ b/usr/lib/wikistats/update.php
@@ -332,7 +332,7 @@
 
$url="http://${domain}/wiki/".$row['prefix']."/api.php${api_query_stat}";
 } elseif (in_array($table, $tables_with_suffix_wiki_last)) {
 $prefix=$row['prefix'];
-
$url="http://${domain}/".$row['prefix']."/wiki/api.php${api_query_stat}";
+
$url="https://${domain}/".$row['prefix']."/wiki/api.php${api_query_stat}";
 } elseif (in_array($table, $tables_https_only)) {
 $prefix=$row['prefix'];
 $url="https://${prefix}.${domain}/w/api.php${api_query_stat}";;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I807bee25f5557eb7380454d479926f8cfe2c1bc6
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/wikistats
Gerrit-Branch: master
Gerrit-Owner: Dzahn 

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Update eslint config to 0.2 and make a pass

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

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

Change subject: Update eslint config to 0.2 and make a pass
..

Update eslint config to 0.2 and make a pass

Change-Id: I382ea63049dfef76610edf46c2c8c3e5b7f8b3ff
---
M demos/ve/ve.demo.init.js
M package.json
M src/ce/nodes/ve.ce.TableNode.js
M src/ce/nodes/ve.ce.TableRowNode.js
M src/dm/ve.dm.Converter.js
M src/dm/ve.dm.InternalList.js
M src/ui/actions/ve.ui.TableAction.js
M src/ui/dialogs/ve.ui.FindAndReplaceDialog.js
M src/ui/dialogs/ve.ui.LanguageSearchDialog.js
M src/ui/ve.ui.DebugBar.js
M src/ve.Filibuster.js
M src/ve.utils.js
M tests/ce/imetests/input-ie11-win8.1-korean.js
M tests/ce/ve.ce.Surface.test.js
M tests/dm/lineardata/ve.dm.ElementLinearData.test.js
M tests/dm/ve.dm.Transaction.test.js
M tests/dm/ve.dm.TransactionProcessor.test.js
M tests/ve.qunit.js
M tests/ve.test.js
19 files changed, 62 insertions(+), 62 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/83/318483/1

diff --git a/demos/ve/ve.demo.init.js b/demos/ve/ve.demo.init.js
index 82c229f..cb5038c 100644
--- a/demos/ve/ve.demo.init.js
+++ b/demos/ve/ve.demo.init.js
@@ -8,6 +8,7 @@
 
var $toolbar = $( '.ve-demo-targetToolbar' ),
$editor = $( '.ve-demo-editor' ),
+   // eslint-disable-next-line new-cap
target = new ve.demo.target(),
hashChanging = false,
 
diff --git a/package.json b/package.json
index a2c3354..b8eaff5 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
 }
   ],
   "devDependencies": {
-"eslint-config-wikimedia": "0.1.0",
+"eslint-config-wikimedia": "0.2.0",
 "grunt": "1.0.1",
 "grunt-banana-checker": "0.5.0",
 "grunt-contrib-clean": "1.0.0",
diff --git a/src/ce/nodes/ve.ce.TableNode.js b/src/ce/nodes/ve.ce.TableNode.js
index 0a2a0fe..484b629 100644
--- a/src/ce/nodes/ve.ce.TableNode.js
+++ b/src/ce/nodes/ve.ce.TableNode.js
@@ -375,7 +375,7 @@
}
// Ignore update the overlay if the table selection changed, 
i.e. not an in-cell selection change
if ( selection instanceof ve.dm.TableSelection ) {
-   this.updateOverlayDebounced( true  );
+   this.updateOverlayDebounced( true );
}
} else if ( !active && this.active ) {
this.$overlay.addClass( 'oo-ui-element-hidden' );
diff --git a/src/ce/nodes/ve.ce.TableRowNode.js 
b/src/ce/nodes/ve.ce.TableRowNode.js
index 8df7ac1..2e0f989 100644
--- a/src/ce/nodes/ve.ce.TableRowNode.js
+++ b/src/ce/nodes/ve.ce.TableRowNode.js
@@ -90,7 +90,7 @@
 ve.ce.TableRowNode.prototype.onMissingCellClick = function () {
var row, col,
surfaceModel = this.getRoot().getSurface().getModel(),
-   documentModel =  surfaceModel.getDocument(),
+   documentModel = surfaceModel.getDocument(),
tableModel = this.findParent( ve.ce.TableNode ).getModel(),
matrix = tableModel.getMatrix();
 
diff --git a/src/dm/ve.dm.Converter.js b/src/dm/ve.dm.Converter.js
index f74c158..23acaa7 100644
--- a/src/dm/ve.dm.Converter.js
+++ b/src/dm/ve.dm.Converter.js
@@ -1226,7 +1226,7 @@
}
endOffset = findEndOfNode( i );
// Remove this node's data from dataCopy
-   dataCopy.splice( i - ( dataLen - 
dataCopy.length ),  endOffset - i );
+   dataCopy.splice( i - ( dataLen - 
dataCopy.length ), endOffset - i );
// Move i such that it will be at endOffset in 
the next iteration
i = endOffset - 1;
}
diff --git a/src/dm/ve.dm.InternalList.js b/src/dm/ve.dm.InternalList.js
index 1f43ba1..f4b9b01 100644
--- a/src/dm/ve.dm.InternalList.js
+++ b/src/dm/ve.dm.InternalList.js
@@ -260,7 +260,7 @@
index = this.getItemNodeCount();
this.keyIndexes[ groupName + '/' + key ] = index;
 
-   itemData = [ { type: 'internalItem' } ].concat( data,  [ { 
type: '/internalItem' } ] );
+   itemData = [ { type: 'internalItem' } ].concat( data, [ { type: 
'/internalItem' } ] );
tx = ve.dm.Transaction.newFromInsertion(
this.getDocument(),
this.getListNode().getRange().end,
diff --git a/src/ui/actions/ve.ui.TableAction.js 
b/src/ui/actions/ve.ui.TableAction.js
index 3cff02a..68b711f 100644
--- a/src/ui/actions/ve.ui.TableAction.js
+++ b/src/ui/actions/ve.ui.TableAction.js
@@ -798,7 +798,7 @@
// Detect if the owner of a spanning cell gets deleted and
// leaves orphaned placeholders
span = cell.node.getSpans()[ mode ];
-   if ( cell[ mode ] + span 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Remove content import fields from specialcreatecollaborationhub

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

Change subject: Remove content import fields from specialcreatecollaborationhub
..


Remove content import fields from specialcreatecollaborationhub

What's there is now commented out with a note about the task.

Bug: T149014
Change-Id: I2a917154afd4913c2aad2435e87ee2ec21974366
---
M includes/SpecialCreateCollaborationHub.php
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 26c761b..bba5124 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -63,6 +63,7 @@
'default' => 'blue5'
];
 
+   /* Comment this out until it's actually implemented (T135408)
// Content source options
$fields['content_source'] = [
'type' => 'select',
@@ -81,6 +82,7 @@
'hide-if' => [ '===', 'wpcontent_source', 'new' ],
'cssclass' => 'mw-ck-sourceinput'
];
+   */
 
$fields['introduction'] = [
'type' => 'textarea',
@@ -124,6 +126,7 @@
return Status::newFatal( 
'collaborationhkit-createhub-nopermission' );
}
 
+   /* Comment this out until it's actually implemented (T135408)
// ACTUAL STUFF HERE
if ( $data['content_source'] !== 'new' ) { // Importing from 
wikitext
$source = Title::newFromText( $data['source'] );
@@ -148,6 +151,7 @@
 
// ...?
}
+   */
 
$title = Title::newFromText( $data['title'] );
if ( !$title ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2a917154afd4913c2aad2435e87ee2ec21974366
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Isarra 
Gerrit-Reviewer: Harej 
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/selenium[master]: Avoid endless recursion when environments.yml is missing

2016-10-27 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has uploaded a new change for review.

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

Change subject: Avoid endless recursion when environments.yml is missing
..

Avoid endless recursion when environments.yml is missing

File.dirname('.') is returning '.' and thus causing
endless recursion in search_for_configuration if
environments.yml is missing.

Bug: T149311
Change-Id: Id032ff33aaeeb827c51948b6813087adbd1353a7
---
M lib/mediawiki_selenium/environment.rb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium 
refs/changes/05/318305/1

diff --git a/lib/mediawiki_selenium/environment.rb 
b/lib/mediawiki_selenium/environment.rb
index efaaf87..fab29f6 100644
--- a/lib/mediawiki_selenium/environment.rb
+++ b/lib/mediawiki_selenium/environment.rb
@@ -108,7 +108,7 @@
   # @return [String] Qualified path to the configuration file
   #
   def search_for_configuration(path)
-return default_configuration if path.nil? || path.empty?
+return default_configuration if path.nil? || path.empty? || path == '.'
 
 file_path = File.join(path, default_configuration)
 return file_path if File.exist?(file_path)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id032ff33aaeeb827c51948b6813087adbd1353a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/selenium
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher 

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Remove comment about jscs binary space rule

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

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

Change subject: Remove comment about jscs binary space rule
..

Remove comment about jscs binary space rule

This is correctly enforced in eslint.

Change-Id: Ic2e77173fb2c0f6103096fcf2b17f9c69365b0e6
---
M tests/ve.test.js
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/82/318482/1

diff --git a/tests/ve.test.js b/tests/ve.test.js
index f62534e..366017a 100644
--- a/tests/ve.test.js
+++ b/tests/ve.test.js
@@ -297,7 +297,6 @@
}
tests = [
/* jshint elision:true (awaiting eslint replacement; T149262) */
-   // jscs:disable disallowSpaceBeforeBinaryOperators (awaiting 
eslint replacement; T149263)
// arr, offset, remove, data, expectedReturn, expectedArray, msg
[ [], 0, 0, [ , 3 ], [], [ , 3 ], 'insert empty, leading hole' 
],
[ [], 0, 0, [ 1, , 3 ], [], [ 1, , 3 ], 'insert empty, middle 
hole' ],
@@ -318,7 +317,6 @@
[ [ 4, , 5, , 6 ], 0, 3, [ 1, , 3 ], [ 4, , 5 ], [ 1, , 3, , 6 
], 'diff=0 start' ],
[ [ 4, , 5, , 6 ], 1, 3, [ 1, , 3 ], [ , 5, , ], [ 4, 1, , 3, 6 
], 'diff=0 mid' ],
[ [ 4, , 5, , 6 ], 2, 3, [ 1, , 3 ], [ 5, , 6 ], [ 4, , 1, , 3 
], 'diff=0 end' ]
-   // jscs:enable disallowSpaceBeforeBinaryOperators
/* jshint elision:false */
];
QUnit.expect( 2 * tests.length + 1 );

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

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

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Remove comment about jscs empty blocks rule

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

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

Change subject: Remove comment about jscs empty blocks rule
..

Remove comment about jscs empty blocks rule

We do have an eslint rule, it just allows blocks with comments.

Change-Id: I2bfe963c65d1a99e9d163666cd1f2549d0cef977
---
M src/ce/ve.ce.TextState.js
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/81/318481/1

diff --git a/src/ce/ve.ce.TextState.js b/src/ce/ve.ce.TextState.js
index dbc8d42..dee3553 100644
--- a/src/ce/ve.ce.TextState.js
+++ b/src/ce/ve.ce.TextState.js
@@ -69,7 +69,6 @@
// If appropriate, step into first child and loop
// If no next sibling, step out until there is (breaking if we 
leave element)
// Step to next sibling and loop
-   // jscs:disable disallowEmptyBlocks (awaiting eslint 
replacement; T149266)
if ( node.nodeType === Node.TEXT_NODE ) {
add( node.data.replace( /\u00A0/g, ' ' ) );
} else if (

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Use unique dom tag for static and interactive mapframe

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

Change subject: Use unique dom tag for static and interactive mapframe
..


Use unique dom tag for static and interactive mapframe

Bug: T149383
Change-Id: Ic336ea43e853ff380d7f96f79b63d72c57cfcf86
---
M includes/Tag/MapFrame.php
M styles/kartographer.less
M tests/parserTests.txt
3 files changed, 22 insertions(+), 25 deletions(-)

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



diff --git a/includes/Tag/MapFrame.php b/includes/Tag/MapFrame.php
index ee368fd..faae6c9 100644
--- a/includes/Tag/MapFrame.php
+++ b/includes/Tag/MapFrame.php
@@ -172,7 +172,7 @@
$attrs['style'] .= " width: {$width}; height: 
{$height};";
$attrs['class'] .= " {$containerClass} 
{$alignClasses[$this->align]}";
 
-   return Html::rawElement( $useSnapshot ? 'a' : 'div', 
$attrs );
+   return Html::rawElement( 'a', $attrs );
}
 
$attrs['style'] .= " height: {$height};";
@@ -181,7 +181,7 @@
$captionFrame = Html::rawElement( 'div', [ 'class' => 
'thumbcaption' ],
$this->parser->recursiveTagParse( $caption ) );
 
-   $mapDiv = Html::rawElement( $useSnapshot ? 'a' : 'div', $attrs 
);
+   $mapDiv = Html::rawElement( 'a', $attrs );
 
return Html::rawElement( 'div', [ 'class' => $containerClass ],
Html::rawElement( 'div', [
diff --git a/styles/kartographer.less b/styles/kartographer.less
index 5cc1c95..a36866c 100644
--- a/styles/kartographer.less
+++ b/styles/kartographer.less
@@ -64,6 +64,7 @@
background-position: center;
background-repeat: no-repeat;
background-size: contain;
+   display: block;
 
&.leaflet-container {
background-size: contain;
@@ -118,8 +119,4 @@
 
 .mw-kartographer-container.mw-kartographer-full {
width: 100%;
-}
-
-a.mw-kartographer-map {
-   display: block;
 }
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 26588a5..ee40be5 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -125,19 +125,19 @@
 
 
 !! result
-https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,300x480.png); height: 
480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,800x480.png); height: 
480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,800x480.png); height: 
480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); width: 
640px; height: 480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); width: 
640px; height: 480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,300x480.png); width: 
300px; height: 480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,800x480.png); width: 100%; 
height: 480px;">
-https://maps.wikimedia.org/img/osm-intl,13,10,20,800x480.png); width: 100%; 
height: 480px;">
-
+https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,300x480.png); height: 
480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,800x480.png); height: 
480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,800x480.png); height: 
480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); width: 
640px; height: 480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); width: 
640px; height: 480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,300x480.png); width: 
300px; height: 480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,800x480.png); width: 100%; 
height: 480px;">
+https://maps.wikimedia.org/img/osm-intl,13,10,20,800x480.png); width: 100%; 
height: 480px;">
+
 !! end
 
 !! test
@@ -150,12 +150,12 @@
 https://example.com bar]"" />
 
 !! result
-https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">Foo is a bar
+https://maps.wikimedia.org/img/osm-intl,13,10,20,640x480.png); height: 
480px;">Foo is a bar
 
 
 
-https://maps.wikimedia.org/img/osm-intl,13,10,20,300x480.png); height: 
480px;">Frameless gets cynically igno

[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: build: Replace jscs and jshint with eslint

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

Change subject: build: Replace jscs and jshint with eslint
..


build: Replace jscs and jshint with eslint

Change-Id: Idc3bd7947e084c108f92b80179dab44bed719ce0
---
A .eslintrc.json
D .jscsrc
D .jshintignore
D .jshintrc
M Gruntfile.js
M modules/box/Map.js
M modules/box/dataLayerOpts.js
M modules/box/index.js
M modules/box/openfullscreen_control.js
M modules/box/scale_control.js
M modules/dialog-sidebar/sidebar.js
M modules/dialog/closefullscreen_control.js
M modules/dialog/dialog.js
M modules/linkbox/Link.js
M modules/linkbox/index.js
M modules/ve-maps/ve.ce.MWInlineMapsNode.js
M modules/ve-maps/ve.ce.MWMapsNode.js
M modules/ve-maps/ve.ui.MWMapsDialog.js
M modules/wikivoyage/ControlLayers.js
M modules/wikivoyage/ControlNearby.js
M modules/wikivoyage/WVMap.js
M modules/wikivoyage/WVMapLayers.js
M modules/wikivoyage/wikivoyage.js
M package.json
24 files changed, 134 insertions(+), 153 deletions(-)

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



diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 000..1ae4a09
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,22 @@
+{
+   "extends": "wikimedia",
+   "env": {
+   "browser": true,
+   "jquery": true,
+   "qunit": true
+   },
+   "globals": {
+   "ve": true,
+   "mw": true,
+   "mediaWiki": false,
+   "OO": false,
+   "L": false
+   },
+   "rules": {
+   "dot-notation": 0,
+   "wrap-iife": 0,
+   "no-console": "error",
+   "spaced-comment": ["error", "always", { "exceptions": ["*", 
"!"] }],
+   "vars-on-top": "error"
+   }
+}
diff --git a/.jscsrc b/.jscsrc
deleted file mode 100644
index 1959eea..000
--- a/.jscsrc
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-   "preset": "wikimedia",
-
-   "jsDoc": {
-   "checkAnnotations": {
-   "preset": "jsduck5",
-   "extra": {
-   "this": true,
-   "source": true,
-   "see": true
-   }
-   },
-   "checkTypes": "strictNativeCase",
-   "checkParamNames": true,
-   "checkRedundantAccess": true,
-   "checkRedundantReturns": true,
-   "requireNewlineAfterDescription": true,
-   "requireParamTypes": true,
-   "requireReturnTypes": true
-   }
-}
diff --git a/.jshintignore b/.jshintignore
deleted file mode 100644
index 9d8d624..000
--- a/.jshintignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Third party components */
-lib/
-
-/* Tooling */
-node_modules/
-
-/* Documentation */
-docs/
\ No newline at end of file
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index bce2780..000
--- a/.jshintrc
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-   // Enforcing
-   "bitwise": true,
-   "eqeqeq": true,
-   "freeze": true,
-   "latedef": "nofunc",
-   "futurehostile": true,
-   "noarg": true,
-   "nonew": true,
-   "undef": true,
-   "unused": true,
-
-   "strict": false,
-
-   // Relaxing
-   "es5": false,
-
-   // Environment
-   "browser": true,
-   "jquery": true,
-
-   "globals": {
-   "L": false,
-   "mediaWiki": false,
-   "mw": false,
-   "OO": false,
-   "ve": false,
-   "QUnit": false
-   }
-}
diff --git a/Gruntfile.js b/Gruntfile.js
index fc4540c..00b8ae5 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,46 +1,35 @@
-/*jshint node:true */
+/* eslint-env node */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
-   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
-   grunt.loadNpmTasks( 'grunt-jscs' );
+   grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
 
grunt.initConfig( {
-   jshint: {
-   options: {
-   jshintrc: true
+   eslint: {
+   fix: {
+   options: {
+   fix: true
+   },
+   src: [
+   '<%= eslint.main %>'
+   ]
},
-   all: [
+   main: [
'**/*.js',
'!node_modules/**',
'!lib/**',
'!docs/**'
]
 

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Remove jshint comment, no rule required

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

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

Change subject: Remove jshint comment, no rule required
..

Remove jshint comment, no rule required

Change-Id: Id785b33d7fb2cbd4983fe1efec8cd2fffd73f53d
---
M src/ce/ve.ce.Surface.js
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/80/318480/1

diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index 4aeab2e..9530472 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -1870,7 +1870,6 @@
  * @return {boolean} False if the event is cancelled
  */
 ve.ce.Surface.prototype.afterPaste = function () {
-   // jshint unused:false (awaiting eslint replacement; T149267)
var clipboardKey, clipboardHash,
$elements, pasteData, slice, internalListRange,
data, pastedDocumentModel, htmlDoc, $body, $images, i,

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

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

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


[MediaWiki-commits] [Gerrit] All-Projects[refs/meta/config]: Add lable just for liking a change

2016-10-27 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Add lable just for liking a change
..

Insert the description of the change.

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


  git pull ssh://gerrit.wikimedia.org:29418/All-Projects 
refs/changes/79/318479/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66f5f2436a62668c956e57a19b25bc1eb9b525fa
Gerrit-PatchSet: 1
Gerrit-Project: All-Projects
Gerrit-Branch: refs/meta/config
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: PHPSessionHandler: Workaround PHP5 bug

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

Change subject: PHPSessionHandler: Workaround PHP5 bug
..


PHPSessionHandler: Workaround PHP5 bug

PHP5 has a bug in handling boolean return values for
SessionHandlerInterface methods, it expects 0 or -1 instead of true or
false. See .

PHP7 and HHVM are not affected.

No tests are added here because the only case where it actually makes a
difference is a can-never-happen branch.

Also, since I'm touching it already, add a @codeCoverageIgnore for the
code no longer tested thanks to I6e153ec8.

Change-Id: Id87478964b3985ed8bf4dd00bbc09f65ddfcc130
---
M includes/session/PHPSessionHandler.php
1 file changed, 40 insertions(+), 12 deletions(-)

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



diff --git a/includes/session/PHPSessionHandler.php 
b/includes/session/PHPSessionHandler.php
index 695ce5a..084ac05 100644
--- a/includes/session/PHPSessionHandler.php
+++ b/includes/session/PHPSessionHandler.php
@@ -163,11 +163,38 @@
}
 
/**
+* Workaround for PHP5 bug
+*
+* PHP5 has a bug in handling boolean return values for
+* SessionHandlerInterface methods, it expects 0 or -1 instead of true 
or
+* false. See .
+*
+* PHP7 and HHVM are not affected.
+*
+* @todo When we drop support for Zend PHP 5, this can be removed.
+* @return bool|int
+* @codeCoverageIgnore
+*/
+   protected static function returnSuccess() {
+   return defined( 'HHVM_VERSION' ) || version_compare( 
PHP_VERSION, '7.0.0', '>=' ) ? true : 0;
+   }
+
+   /**
+* Workaround for PHP5 bug
+* @see self::returnSuccess()
+* @return bool|int
+* @codeCoverageIgnore
+*/
+   protected static function returnFailure() {
+   return defined( 'HHVM_VERSION' ) || version_compare( 
PHP_VERSION, '7.0.0', '>=' ) ? false : -1;
+   }
+
+   /**
 * Initialize the session (handler)
 * @private For internal use only
 * @param string $save_path Path used to store session files (ignored)
 * @param string $session_name Session name (ignored)
-* @return bool Success
+* @return bool|int Success (see self::returnSuccess())
 */
public function open( $save_path, $session_name ) {
if ( self::$instance !== $this ) {
@@ -176,20 +203,20 @@
if ( !$this->enable ) {
throw new \BadMethodCallException( 'Attempt to use PHP 
session management' );
}
-   return true;
+   return self::returnSuccess();
}
 
/**
 * Close the session (handler)
 * @private For internal use only
-* @return bool Success
+* @return bool|int Success (see self::returnSuccess())
 */
public function close() {
if ( self::$instance !== $this ) {
throw new \UnexpectedValueException( __METHOD__ . ': 
Wrong instance called!' );
}
$this->sessionFieldCache = [];
-   return true;
+   return self::returnSuccess();
}
 
/**
@@ -224,7 +251,7 @@
 * @param string $dataStr Session data. Not that you should ever call 
this
 *   directly, but note that this has the same issues with code 
injection
 *   via user-controlled data as does PHP's unserialize function.
-* @return bool Success
+* @return bool|int Success (see self::returnSuccess())
 */
public function write( $id, $dataStr ) {
if ( self::$instance !== $this ) {
@@ -243,14 +270,14 @@
[
'session' => $id,
] );
-   return true;
+   return self::returnSuccess();
}
 
// First, decode the string PHP handed us
$data = \Wikimedia\PhpSessionSerializer::decode( $dataStr );
if ( $data === null ) {
// @codeCoverageIgnoreStart
-   return false;
+   return self::returnFailure();
// @codeCoverageIgnoreEnd
}
 
@@ -323,14 +350,14 @@
 
$session->persist();
 
-   return true;
+   return self::returnSuccess();
}
 
/**
 * Destroy a session
 * @private For internal use only
 * @param string $id Session id
-* @return bool Success
+* @return bool|int Success (see self::returnSuccess())
 */
public function destroy( $id ) {
if ( self::

[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: build: Replace jscs and jshint with eslint

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

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

Change subject: build: Replace jscs and jshint with eslint
..

build: Replace jscs and jshint with eslint

Change-Id: Idc3bd7947e084c108f92b80179dab44bed719ce0
---
A .eslintrc.json
D .jscsrc
D .jshintignore
D .jshintrc
M Gruntfile.js
M modules/box/Map.js
M modules/box/dataLayerOpts.js
M modules/box/index.js
M modules/box/openfullscreen_control.js
M modules/box/scale_control.js
M modules/dialog-sidebar/sidebar.js
M modules/dialog/closefullscreen_control.js
M modules/dialog/dialog.js
M modules/linkbox/Link.js
M modules/linkbox/index.js
M modules/ve-maps/ve.ce.MWInlineMapsNode.js
M modules/ve-maps/ve.ce.MWMapsNode.js
M modules/ve-maps/ve.ui.MWMapsDialog.js
M modules/wikivoyage/ControlLayers.js
M modules/wikivoyage/ControlNearby.js
M modules/wikivoyage/WVMap.js
M modules/wikivoyage/WVMapLayers.js
M modules/wikivoyage/wikivoyage.js
M package.json
24 files changed, 134 insertions(+), 153 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/78/318478/1

diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 000..1ae4a09
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,22 @@
+{
+   "extends": "wikimedia",
+   "env": {
+   "browser": true,
+   "jquery": true,
+   "qunit": true
+   },
+   "globals": {
+   "ve": true,
+   "mw": true,
+   "mediaWiki": false,
+   "OO": false,
+   "L": false
+   },
+   "rules": {
+   "dot-notation": 0,
+   "wrap-iife": 0,
+   "no-console": "error",
+   "spaced-comment": ["error", "always", { "exceptions": ["*", 
"!"] }],
+   "vars-on-top": "error"
+   }
+}
diff --git a/.jscsrc b/.jscsrc
deleted file mode 100644
index 1959eea..000
--- a/.jscsrc
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-   "preset": "wikimedia",
-
-   "jsDoc": {
-   "checkAnnotations": {
-   "preset": "jsduck5",
-   "extra": {
-   "this": true,
-   "source": true,
-   "see": true
-   }
-   },
-   "checkTypes": "strictNativeCase",
-   "checkParamNames": true,
-   "checkRedundantAccess": true,
-   "checkRedundantReturns": true,
-   "requireNewlineAfterDescription": true,
-   "requireParamTypes": true,
-   "requireReturnTypes": true
-   }
-}
diff --git a/.jshintignore b/.jshintignore
deleted file mode 100644
index 9d8d624..000
--- a/.jshintignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Third party components */
-lib/
-
-/* Tooling */
-node_modules/
-
-/* Documentation */
-docs/
\ No newline at end of file
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index bce2780..000
--- a/.jshintrc
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-   // Enforcing
-   "bitwise": true,
-   "eqeqeq": true,
-   "freeze": true,
-   "latedef": "nofunc",
-   "futurehostile": true,
-   "noarg": true,
-   "nonew": true,
-   "undef": true,
-   "unused": true,
-
-   "strict": false,
-
-   // Relaxing
-   "es5": false,
-
-   // Environment
-   "browser": true,
-   "jquery": true,
-
-   "globals": {
-   "L": false,
-   "mediaWiki": false,
-   "mw": false,
-   "OO": false,
-   "ve": false,
-   "QUnit": false
-   }
-}
diff --git a/Gruntfile.js b/Gruntfile.js
index fc4540c..00b8ae5 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,46 +1,35 @@
-/*jshint node:true */
+/* eslint-env node */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
-   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
-   grunt.loadNpmTasks( 'grunt-jscs' );
+   grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
 
grunt.initConfig( {
-   jshint: {
-   options: {
-   jshintrc: true
+   eslint: {
+   fix: {
+   options: {
+   fix: true
+   },
+   src: [
+   '<%= eslint.main %>'
+   ]
},
-   all: [
+   main: [
'**/*.js',
'!node_modules/**',
'!lib/**',
   

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Do not spam logs when the loginwiki user is unattached due t...

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

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

Change subject: Do not spam logs when the loginwiki user is unattached due to a 
race
..

Do not spam logs when the loginwiki user is unattached due to a race

Bug: T149356
Change-Id: Id41f378c3238f9cd78dd483e8ed5010415dc0e50
---
M i18n/en.json
M i18n/qqq.json
M includes/specials/SpecialCentralLogin.php
3 files changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/77/318477/1

diff --git a/i18n/en.json b/i18n/en.json
index 57fef37..a5142ec 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -560,6 +560,7 @@
"centralauth-uwbr-editcount": "Edit count",
"centralauth-uwbr-intro": "This page lists users registered with this 
wiki who will be renamed.",
"centralauth-delete-empty-account": "Empty account",
+   "centralauth-error-unattached": "Could not log you in; an account by 
your name exists on the central login wiki, but it is not centrally attached. 
If you have registered just now, you can ignore this error; just try again.",
"sessionprovider-centralauthsessionprovider": "central cookie-based 
sessions",
"sessionprovider-centralauthtokensessionprovider": "centralauthtoken 
sessions",
"log-action-filter-globalauth": "Type of change:",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 1d85e4c..5ab3961 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -576,6 +576,7 @@
"centralauth-uwbr-editcount": "Heading for column in table",
"centralauth-uwbr-intro": "Text above table which lists users who will 
be renamed.",
"centralauth-delete-empty-account": "Used as the reason by the 
deleteEmptyAccounts.php maintenance script when deleting an account with no 
attached local accounts.",
+   "centralauth-error-unattached": "Error message shown when the loginwiki 
account is not attached. This happens sometimes at account creation due to race 
conditions.",
"sessionprovider-centralauthsessionprovider": "Description of the 
sessions provided by the CentralAuthSessionProvider class, which use HTTP 
cookies. Should be phrased to make sense when added to a message such as 
{{msg-mw|cannotloginnow-text}}.",
"sessionprovider-centralauthtokensessionprovider": "Description of the 
sessions provided by the CentralAuthTokenSessionProvider class, which uses the 
'centralauthtoken' parameter on API requests. Should be phrased to make sense 
when added to a message such as {{msg-mw|cannotloginnow-text}}.",
"log-action-filter-globalauth": 
"{{doc-log-action-filter-type|globalauth}}",
diff --git a/includes/specials/SpecialCentralLogin.php 
b/includes/specials/SpecialCentralLogin.php
index e5c9a88..547ab84 100644
--- a/includes/specials/SpecialCentralLogin.php
+++ b/includes/specials/SpecialCentralLogin.php
@@ -81,7 +81,13 @@
} elseif ( $centralUser->getId() !== $info['guid'] ) { // sanity
throw new Exception( "Global user does not have ID 
'{$info['guid']}'." );
} elseif ( !$centralUser->isAttached() && !$user->isAnon() ) { 
// sanity
-   throw new Exception( "User '{$info['name']}' exists 
locally but is not attached." );
+   if ( wfTimestamp( TS_UNIX ) - wfTimestamp( TS_UNIX, 
$centralUser->getRegistration() ) < 10 ) {
+   // Probably just a race condition. Fail but do 
not log.
+   $this->showError( 
'centralauth-error-unattached' );
+   return;
+   } else {
+   throw new Exception( "User '{$info['name']}' 
exists locally but is not attached." );
+   }
}
 
$session = CentralAuthUtils::getCentralSession();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id41f378c3238f9cd78dd483e8ed5010415dc0e50
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
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] operations/puppet[production]: prometheus: change file_sd_config syntax after upgrade

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: prometheus: change file_sd_config syntax after upgrade
..


prometheus: change file_sd_config syntax after upgrade

Change-Id: I3c3c0ce4d041869bbd176aaeaa4ad8c077a1874b
---
M modules/role/manifests/prometheus/ops.pp
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/modules/role/manifests/prometheus/ops.pp 
b/modules/role/manifests/prometheus/ops.pp
index 1831229..5212298 100644
--- a/modules/role/manifests/prometheus/ops.pp
+++ b/modules/role/manifests/prometheus/ops.pp
@@ -47,25 +47,25 @@
   {
 'job_name'=> 'varnish-text',
 'file_sd_configs' => [
-  { 'names' => [ "${targets_path}/varnish-text_*.yaml"] },
+  { 'files' => [ "${targets_path}/varnish-text_*.yaml"] },
 ]
   },
   {
 'job_name'=> 'varnish-upload',
 'file_sd_configs' => [
-  { 'names' => [ "${targets_path}/varnish-upload_*.yaml"] },
+  { 'files' => [ "${targets_path}/varnish-upload_*.yaml"] },
 ]
   },
   {
 'job_name'=> 'varnish-maps',
 'file_sd_configs' => [
-  { 'names' => [ "${targets_path}/varnish-maps_*.yaml"] },
+  { 'files' => [ "${targets_path}/varnish-maps_*.yaml"] },
 ]
   },
   {
 'job_name'=> 'varnish-misc',
 'file_sd_configs' => [
-  { 'names' => [ "${targets_path}/varnish-misc_*.yaml"] },
+  { 'files' => [ "${targets_path}/varnish-misc_*.yaml"] },
 ]
   },
 ]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c3c0ce4d041869bbd176aaeaa4ad8c077a1874b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Filippo Giunchedi 
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]: prometheus: change file_sd_config syntax after upgrade

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

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

Change subject: prometheus: change file_sd_config syntax after upgrade
..

prometheus: change file_sd_config syntax after upgrade

Change-Id: I3c3c0ce4d041869bbd176aaeaa4ad8c077a1874b
---
M modules/role/manifests/prometheus/ops.pp
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/76/318476/1

diff --git a/modules/role/manifests/prometheus/ops.pp 
b/modules/role/manifests/prometheus/ops.pp
index 1831229..5212298 100644
--- a/modules/role/manifests/prometheus/ops.pp
+++ b/modules/role/manifests/prometheus/ops.pp
@@ -47,25 +47,25 @@
   {
 'job_name'=> 'varnish-text',
 'file_sd_configs' => [
-  { 'names' => [ "${targets_path}/varnish-text_*.yaml"] },
+  { 'files' => [ "${targets_path}/varnish-text_*.yaml"] },
 ]
   },
   {
 'job_name'=> 'varnish-upload',
 'file_sd_configs' => [
-  { 'names' => [ "${targets_path}/varnish-upload_*.yaml"] },
+  { 'files' => [ "${targets_path}/varnish-upload_*.yaml"] },
 ]
   },
   {
 'job_name'=> 'varnish-maps',
 'file_sd_configs' => [
-  { 'names' => [ "${targets_path}/varnish-maps_*.yaml"] },
+  { 'files' => [ "${targets_path}/varnish-maps_*.yaml"] },
 ]
   },
   {
 'job_name'=> 'varnish-misc',
 'file_sd_configs' => [
-  { 'names' => [ "${targets_path}/varnish-misc_*.yaml"] },
+  { 'files' => [ "${targets_path}/varnish-misc_*.yaml"] },
 ]
   },
 ]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c3c0ce4d041869bbd176aaeaa4ad8c077a1874b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: fix ganglia varnish cluster name

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: prometheus: fix ganglia varnish cluster name
..


prometheus: fix ganglia varnish cluster name

Change-Id: Ic648566f7a97e94a4152e171d468b6b4d26e99de
---
M modules/prometheus/manifests/varnish_2layer.pp
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/prometheus/manifests/varnish_2layer.pp 
b/modules/prometheus/manifests/varnish_2layer.pp
index ee42580..dba040c 100644
--- a/modules/prometheus/manifests/varnish_2layer.pp
+++ b/modules/prometheus/manifests/varnish_2layer.pp
@@ -8,7 +8,7 @@
 prometheus::varnish_config{ "${cache_name}_backend":
 dest=> 
"${targets_path}/varnish-${cache_name}_${::site}_backend.yaml",
 site=> $::site,
-cluster => "varnish_${cache_name}",
+cluster => "cache_${cache_name}",
 port=> '9331',
 labels  => {
   'layer' => 'backend'
@@ -18,7 +18,7 @@
 prometheus::varnish_config{ "${cache_name}_frontend":
 dest=> 
"${targets_path}/varnish-${cache_name}_${::site}_frontend.yaml",
 site=> $::site,
-cluster => "varnish_${cache_name}",
+cluster => "cache_${cache_name}",
 port=> '9131',
 labels  => {
   'layer' => 'frontend'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic648566f7a97e94a4152e171d468b6b4d26e99de
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Filippo Giunchedi 
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]: Follow-up Id0021594: Remove extra code for redlink suggestions

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

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

Change subject: Follow-up Id0021594: Remove extra code for redlink suggestions
..

Follow-up Id0021594: Remove extra code for redlink suggestions

We do a second query now instead which handles this by itself.

Bug: T149130
Change-Id: Iddc542d2aa02fd14a88014c78bd5a18e1f39f37e
---
M languages/i18n/en.json
M languages/i18n/qqq.json
M resources/Resources.php
M resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
4 files changed, 1 insertion(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/75/318475/1

diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index c759984..0f62dcb 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -4094,7 +4094,6 @@
"mw-widgets-dateinput-no-date": "No date selected",
"mw-widgets-dateinput-placeholder-day": "-MM-DD",
"mw-widgets-dateinput-placeholder-month": "-MM",
-   "mw-widgets-titleinput-description-new-page": "page does not exist yet",
"mw-widgets-titleinput-description-redirect": "redirect to $1",
"sessionmanager-tie": "Cannot combine multiple request authentication 
types: $1.",
"sessionprovider-generic": "$1 sessions",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 04048d4..0868593 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -4278,7 +4278,6 @@
"mw-widgets-dateinput-no-date": "Label of a date input field when no 
date has been selected.",
"mw-widgets-dateinput-placeholder-day": "[[File:DateInputWidget active, 
empty.png|frame|Screenshot]]\nPlaceholder displayed in a date input field when 
it's empty, representing a date format with 4 digits for year, 2 digits for 
month, and 2 digits for day, separated with hyphens. This should be uppercase, 
if possible, and must not include any additional explanations. If there is no 
good way to translate it, make this message blank.",
"mw-widgets-dateinput-placeholder-month": "Placeholder displayed in a 
date input field when it's empty, representing a date format with 4 digits for 
year and 2 digits for month, separated with hyphens (without a day). This 
should be uppercase, if possible, and must not include any additional 
explanations. If there is no good way to translate it, make this message 
blank.",
-   "mw-widgets-titleinput-description-new-page": "Description label for a 
new page in the title input widget.",
"mw-widgets-titleinput-description-redirect": "Description label for a 
redirect in the title input widget.",
"sessionmanager-tie": "Used as an error message when multiple session 
sources are tied in priority.\n\nParameters:\n* $1 - List of dession type 
descriptions, from messages like 
{{msg-mw|sessionprovider-mediawiki-session-cookiesessionprovider}}.",
"sessionprovider-generic": "Used to create a generic session type 
description when one isn't provided via the proper message. Should be phrased 
to make sense when added to a message such as 
{{msg-mw|cannotloginnow-text}}.\n\nParameters:\n* $1 - PHP classname.",
diff --git a/resources/Resources.php b/resources/Resources.php
index 2e4a15d..0f80a7c 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -2227,7 +2227,6 @@
'blanknamespace',
'namespacesall',
// TitleInputWidget
-   'mw-widgets-titleinput-description-new-page',
'mw-widgets-titleinput-description-redirect',
],
'targets' => [ 'desktop', 'mobile' ],
diff --git a/resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js 
b/resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
index 222586f..db60cb4 100644
--- a/resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
+++ b/resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
@@ -30,7 +30,6 @@
 * @cfg {boolean} [relative=true] If a namespace is set, display titles 
relative to it
 * @cfg {boolean} [suggestions=true] Display search suggestions
 * @cfg {boolean} [showRedirectTargets=true] Show the targets of 
redirects
-* @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
@@ -52,7 +51,6 @@
this.relative = config.relative !== undefined ? config.relative 
: true;
this.suggestions = config.suggestions !== undefined ? 
config.suggestions : true;
this.showRedirectTargets = config.showRedirectTargets !== false;
-   this.showRedlink = !!config.showRedlink;
this.showImages

[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: fix ganglia varnish cluster name

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

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

Change subject: prometheus: fix ganglia varnish cluster name
..

prometheus: fix ganglia varnish cluster name

Change-Id: Ic648566f7a97e94a4152e171d468b6b4d26e99de
---
M modules/prometheus/manifests/varnish_2layer.pp
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/74/318474/1

diff --git a/modules/prometheus/manifests/varnish_2layer.pp 
b/modules/prometheus/manifests/varnish_2layer.pp
index ee42580..dba040c 100644
--- a/modules/prometheus/manifests/varnish_2layer.pp
+++ b/modules/prometheus/manifests/varnish_2layer.pp
@@ -8,7 +8,7 @@
 prometheus::varnish_config{ "${cache_name}_backend":
 dest=> 
"${targets_path}/varnish-${cache_name}_${::site}_backend.yaml",
 site=> $::site,
-cluster => "varnish_${cache_name}",
+cluster => "cache_${cache_name}",
 port=> '9331',
 labels  => {
   'layer' => 'backend'
@@ -18,7 +18,7 @@
 prometheus::varnish_config{ "${cache_name}_frontend":
 dest=> 
"${targets_path}/varnish-${cache_name}_${::site}_frontend.yaml",
 site=> $::site,
-cluster => "varnish_${cache_name}",
+cluster => "cache_${cache_name}",
 port=> '9131',
 labels  => {
   'layer' => 'frontend'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic648566f7a97e94a4152e171d468b6b4d26e99de
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: build: Replace jscs and jshint with eslint

2016-10-27 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review.

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

Change subject: build: Replace jscs and jshint with eslint
..

build: Replace jscs and jshint with eslint

It's new, it's fresh, it's amazing, it's here.

Change-Id: I5dc784411f704685ed5cc763a2b2b1c5d3e5a610
---
A .eslintrc.json
D .jscsrc
D .jshintignore
D .jshintrc
M Gruntfile.js
M build/screenshots.js
M build/tasks/jsduckcatconfig.js
M modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js
M modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js
M modules/ve-mw/dm/models/ve.dm.MWImageModel.js
M modules/ve-mw/dm/models/ve.dm.MWMediaResourceQueue.js
M modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js
M modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
M modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
M modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js
M modules/ve-mw/init/ve.init.mw.LinkCache.js
M modules/ve-mw/init/ve.init.mw.Platform.init.js
M modules/ve-mw/tests/dm/nodes/ve.dm.MWTransclusionNode.test.js
M modules/ve-mw/tests/init/targets/ve.init.mw.DesktopArticleTarget.test.js
M modules/ve-mw/tests/ve.test.utils.js
M modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js
M modules/ve-mw/ui/widgets/ve.ui.MWMediaInfoFieldWidget.js
M modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js
M modules/ve-mw/ui/widgets/ve.ui.MWTemplateTitleInputWidget.js
M package.json
28 files changed, 205 insertions(+), 251 deletions(-)


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

diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 000..321cf06
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,25 @@
+{
+   "extends": "wikimedia",
+   "env": {
+   "browser": true,
+   "jquery": true,
+   "qunit": true
+   },
+   "globals": {
+   "ve": true,
+   "VisualEditorSupportCheck": false,
+   "OO": false,
+   "unicodeJS": false,
+   "RangeFix": false,
+   "Papa": false,
+   "mw": false
+   },
+   "rules": {
+   "dot-notation": 0,
+   "wrap-iife": 0,
+   "no-console": "error",
+   "no-use-before-define": ["error", { "functions": true, 
"classes": true }],
+   "spaced-comment": ["error", "always", { "exceptions": ["*", 
"!"] }],
+   "valid-jsdoc": 0
+   }
+}
diff --git a/.jscsrc b/.jscsrc
deleted file mode 100644
index 6473d3f..000
--- a/.jscsrc
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-   "preset": "wikimedia",
-
-   "jsDoc": {
-   "checkAnnotations": {
-   "preset": "jsduck5",
-   "extra": {
-   "this": "some",
-   "source": "some",
-   "see": "some"
-   }
-   },
-   "checkTypes": "strictNativeCase",
-   "checkParamNames": true,
-   "checkRedundantAccess": true,
-   "checkRedundantReturns": true,
-   "requireNewlineAfterDescription": true,
-   "requireParamTypes": true,
-   "requireReturnTypes": true
-   },
-
-   "excludeFiles": [
-   "modules/ve-mw/init/classListSkipFunction.js"
-   ]
-}
diff --git a/.jshintignore b/.jshintignore
deleted file mode 100644
index 74ae9a1..000
--- a/.jshintignore
+++ /dev/null
@@ -1,3 +0,0 @@
-docs
-lib
-node_modules
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index fa174f6..000
--- a/.jshintrc
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-   // Enforcing
-   "bitwise": true,
-   "eqeqeq": true,
-   "freeze": true,
-   "latedef": "nofunc",
-   "futurehostile": true,
-   "noarg": true,
-   "nonew": true,
-   "undef": true,
-   "unused": true,
-
-   "strict": false,
-
-   // Relaxing
-
-   // Environment
-   "browser": true,
-   "jquery": true,
-
-   "globals": {
-   "mw": false,
-   "OO": false,
-   "QUnit": false,
-   "unicodeJS": false,
-   "ve": false,
-   "VisualEditorSupportCheck": false
-   }
-}
diff --git a/Gruntfile.js b/Gruntfile.js
index d69994b..de8ba22 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -6,17 +6,16 @@
 
 require( 'babel-polyfill' );
 
-/*jshint node:true */
+/* eslint-env node */
 module.exports = function ( grunt ) {
var modules = grunt.file.readJSON( 'lib/ve/build/modules.json' );
 
-   grunt.loadNpmTasks( 'grunt-contrib-copy' );
-   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
- 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: move get_clusters to varnish_config.erb

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: prometheus: move get_clusters to varnish_config.erb
..


prometheus: move get_clusters to varnish_config.erb

Same approach as modules/role/templates/prometheus/node_site.yaml.erb

Change-Id: Id969a368ddc15fbcfcd2796e941dac8258117996
---
M modules/prometheus/manifests/varnish_config.pp
M modules/prometheus/templates/varnish_config.erb
2 files changed, 19 insertions(+), 13 deletions(-)

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



diff --git a/modules/prometheus/manifests/varnish_config.pp 
b/modules/prometheus/manifests/varnish_config.pp
index 83c80d2..abfa9e7 100644
--- a/modules/prometheus/manifests/varnish_config.pp
+++ b/modules/prometheus/manifests/varnish_config.pp
@@ -33,11 +33,6 @@
 validate_re($port, '^[0-9]+$')
 validate_hash($labels)
 
-$hosts = get_clusters({
-  'site' => [$site],
-  'cluster' => [$cluster],
-})
-
 file { $dest:
 ensure  => present,
 owner   => 'root',
diff --git a/modules/prometheus/templates/varnish_config.erb 
b/modules/prometheus/templates/varnish_config.erb
index 90ab7b5..b333561 100644
--- a/modules/prometheus/templates/varnish_config.erb
+++ b/modules/prometheus/templates/varnish_config.erb
@@ -1,9 +1,20 @@
-<%
-  targets_config = []
-  targets_config.push({
-'labels'  => @labels,
-'targets' => @hosts[@cluster][@site].map{ |x| "#{x}:#{@port}" }
-  })
--%>
+<%-
+all = []
+clusters = scope.function_get_clusters([{
+ 'site' => [@site],
+ 'cluster' => [@cluster],
+}])
 
-<%= scope.function_ordered_yaml(targets_config) -%>
+clusters.each do |cluster, sites|
+  sites.each do |site, targets|
+  all.push(
+{
+  'labels' => @labels,
+  'targets' => targets.map{|t| "#{t.split('.')[0]}:#{@port}" },
+}
+  )
+  end
+end
+-%>
+# This file is managed by puppet
+<%= scope.function_ordered_yaml([all]) %>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id969a368ddc15fbcfcd2796e941dac8258117996
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Filippo Giunchedi 
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]: prometheus: move get_clusters to varnish_config.erb

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

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

Change subject: prometheus: move get_clusters to varnish_config.erb
..

prometheus: move get_clusters to varnish_config.erb

Same approach as modules/role/templates/prometheus/node_site.yaml.erb

Change-Id: Id969a368ddc15fbcfcd2796e941dac8258117996
---
M modules/prometheus/manifests/varnish_config.pp
M modules/prometheus/templates/varnish_config.erb
2 files changed, 19 insertions(+), 13 deletions(-)


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

diff --git a/modules/prometheus/manifests/varnish_config.pp 
b/modules/prometheus/manifests/varnish_config.pp
index 83c80d2..abfa9e7 100644
--- a/modules/prometheus/manifests/varnish_config.pp
+++ b/modules/prometheus/manifests/varnish_config.pp
@@ -33,11 +33,6 @@
 validate_re($port, '^[0-9]+$')
 validate_hash($labels)
 
-$hosts = get_clusters({
-  'site' => [$site],
-  'cluster' => [$cluster],
-})
-
 file { $dest:
 ensure  => present,
 owner   => 'root',
diff --git a/modules/prometheus/templates/varnish_config.erb 
b/modules/prometheus/templates/varnish_config.erb
index 90ab7b5..b333561 100644
--- a/modules/prometheus/templates/varnish_config.erb
+++ b/modules/prometheus/templates/varnish_config.erb
@@ -1,9 +1,20 @@
-<%
-  targets_config = []
-  targets_config.push({
-'labels'  => @labels,
-'targets' => @hosts[@cluster][@site].map{ |x| "#{x}:#{@port}" }
-  })
--%>
+<%-
+all = []
+clusters = scope.function_get_clusters([{
+ 'site' => [@site],
+ 'cluster' => [@cluster],
+}])
 
-<%= scope.function_ordered_yaml(targets_config) -%>
+clusters.each do |cluster, sites|
+  sites.each do |site, targets|
+  all.push(
+{
+  'labels' => @labels,
+  'targets' => targets.map{|t| "#{t.split('.')[0]}:#{@port}" },
+}
+  )
+  end
+end
+-%>
+# This file is managed by puppet
+<%= scope.function_ordered_yaml([all]) %>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id969a368ddc15fbcfcd2796e941dac8258117996
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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


mediawiki-commits@lists.wikimedia.org

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

Change subject: ve.init.mw.DesktopArticleTarget: Fix missing '&&'
..


ve.init.mw.DesktopArticleTarget: Fix missing '&&'

Change-Id: I0e91cde3d38d3f5bdd7dde790093db21d8a64036
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index d18c2a6..bdb2ea8 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -877,7 +877,7 @@
activateTarget( editModes[ 
uri.query.veaction ], section );
} else {
if (
-   init.isWikitextAvailable
+   
init.isWikitextAvailable &&
(
tabPreference 
=== 'prefer-ve' ||
(

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: use lists as arguments for selectors for get_clu...

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: prometheus: use lists as arguments for selectors for 
get_clusters
..


prometheus: use lists as arguments for selectors for get_clusters

The error generated is:

Detail: undefined method `[]' for nil:NilClass at
/etc/puppet/modules/prometheus/manifests/varnish_config.pp:46 on node
prometheus2001.codfw.wmnet

Change-Id: I002da329eae4b72df70b6e704e21e6c4a4c7267f
---
M modules/prometheus/manifests/varnish_config.pp
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/prometheus/manifests/varnish_config.pp 
b/modules/prometheus/manifests/varnish_config.pp
index e93cbe8..83c80d2 100644
--- a/modules/prometheus/manifests/varnish_config.pp
+++ b/modules/prometheus/manifests/varnish_config.pp
@@ -34,8 +34,8 @@
 validate_hash($labels)
 
 $hosts = get_clusters({
-  'site' => $site,
-  'cluster' => $cluster,
+  'site' => [$site],
+  'cluster' => [$cluster],
 })
 
 file { $dest:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I002da329eae4b72df70b6e704e21e6c4a4c7267f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Filippo Giunchedi 
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]: prometheus: use lists as arguments for selectors for get_clu...

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

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

Change subject: prometheus: use lists as arguments for selectors for 
get_clusters
..

prometheus: use lists as arguments for selectors for get_clusters

The error generated is:

Detail: undefined method `[]' for nil:NilClass at
/etc/puppet/modules/prometheus/manifests/varnish_config.pp:46 on node
prometheus2001.codfw.wmnet

Change-Id: I002da329eae4b72df70b6e704e21e6c4a4c7267f
---
M modules/prometheus/manifests/varnish_config.pp
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/71/318471/1

diff --git a/modules/prometheus/manifests/varnish_config.pp 
b/modules/prometheus/manifests/varnish_config.pp
index e93cbe8..83c80d2 100644
--- a/modules/prometheus/manifests/varnish_config.pp
+++ b/modules/prometheus/manifests/varnish_config.pp
@@ -34,8 +34,8 @@
 validate_hash($labels)
 
 $hosts = get_clusters({
-  'site' => $site,
-  'cluster' => $cluster,
+  'site' => [$site],
+  'cluster' => [$cluster],
 })
 
 file { $dest:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I002da329eae4b72df70b6e704e21e6c4a4c7267f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: swap cluster/site returned by get_clusters

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: prometheus: swap cluster/site returned by get_clusters
..


prometheus: swap cluster/site returned by get_clusters

The error is this:

Detail: undefined method `[]' for nil:NilClass at
/etc/puppet/modules/prometheus/manifests/varnish_config.pp:46 on node
prometheus2001.codfw.wmnet

Change-Id: I8b2970f16bc85e6f0d70e74379dcd63277b18300
---
M modules/prometheus/templates/varnish_config.erb
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/prometheus/templates/varnish_config.erb 
b/modules/prometheus/templates/varnish_config.erb
index d5522f7..90ab7b5 100644
--- a/modules/prometheus/templates/varnish_config.erb
+++ b/modules/prometheus/templates/varnish_config.erb
@@ -2,7 +2,7 @@
   targets_config = []
   targets_config.push({
 'labels'  => @labels,
-'targets' => @hosts[@site][@cluster].map{ |x| "#{x}:#{@port}" }
+'targets' => @hosts[@cluster][@site].map{ |x| "#{x}:#{@port}" }
   })
 -%>
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b2970f16bc85e6f0d70e74379dcd63277b18300
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Filippo Giunchedi 
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]: prometheus: swap cluster/site returned by get_clusters

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

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

Change subject: prometheus: swap cluster/site returned by get_clusters
..

prometheus: swap cluster/site returned by get_clusters

The error is this:

Detail: undefined method `[]' for nil:NilClass at
/etc/puppet/modules/prometheus/manifests/varnish_config.pp:46 on node
prometheus2001.codfw.wmnet

Change-Id: I8b2970f16bc85e6f0d70e74379dcd63277b18300
---
M modules/prometheus/templates/varnish_config.erb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/70/318470/1

diff --git a/modules/prometheus/templates/varnish_config.erb 
b/modules/prometheus/templates/varnish_config.erb
index d5522f7..90ab7b5 100644
--- a/modules/prometheus/templates/varnish_config.erb
+++ b/modules/prometheus/templates/varnish_config.erb
@@ -2,7 +2,7 @@
   targets_config = []
   targets_config.push({
 'labels'  => @labels,
-'targets' => @hosts[@site][@cluster].map{ |x| "#{x}:#{@port}" }
+'targets' => @hosts[@cluster][@site].map{ |x| "#{x}:#{@port}" }
   })
 -%>
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b2970f16bc85e6f0d70e74379dcd63277b18300
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Use unique dom tag for static and interactive mapframe

2016-10-27 Thread JGirault (Code Review)
JGirault has uploaded a new change for review.

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

Change subject: Use unique dom tag for static and interactive mapframe
..

Use unique dom tag for static and interactive mapframe

Bug: T149383
Change-Id: Ic336ea43e853ff380d7f96f79b63d72c57cfcf86
---
M styles/kartographer.less
1 file changed, 1 insertion(+), 4 deletions(-)


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

diff --git a/styles/kartographer.less b/styles/kartographer.less
index 5cc1c95..a36866c 100644
--- a/styles/kartographer.less
+++ b/styles/kartographer.less
@@ -64,6 +64,7 @@
background-position: center;
background-repeat: no-repeat;
background-size: contain;
+   display: block;
 
&.leaflet-container {
background-size: contain;
@@ -118,8 +119,4 @@
 
 .mw-kartographer-container.mw-kartographer-full {
width: 100%;
-}
-
-a.mw-kartographer-map {
-   display: block;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic336ea43e853ff380d7f96f79b63d72c57cfcf86
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: JGirault 

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


mediawiki-commits@lists.wikimedia.org

2016-10-27 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review.

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

Change subject: ve.init.mw.DesktopArticleTarget: Fix missing '&&'
..

ve.init.mw.DesktopArticleTarget: Fix missing '&&'

Change-Id: I0e91cde3d38d3f5bdd7dde790093db21d8a64036
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index d18c2a6..bdb2ea8 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -877,7 +877,7 @@
activateTarget( editModes[ 
uri.query.veaction ], section );
} else {
if (
-   init.isWikitextAvailable
+   
init.isWikitextAvailable &&
(
tabPreference 
=== 'prefer-ve' ||
(

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: T149241: Whitelist content model fallbacks

2016-10-27 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: T149241: Whitelist content model fallbacks
..

T149241: Whitelist content model fallbacks

 * And, warn instead of err on mismatch.

Change-Id: I6755f6f6795511a7465e1013155dfdb4e78fa823
---
M lib/config/MWParserEnvironment.js
1 file changed, 12 insertions(+), 1 deletion(-)


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

diff --git a/lib/config/MWParserEnvironment.js 
b/lib/config/MWParserEnvironment.js
index 4f0d650..c30d3d7 100644
--- a/lib/config/MWParserEnvironment.js
+++ b/lib/config/MWParserEnvironment.js
@@ -774,6 +774,15 @@
 };
 
 /**
+ * Content model whitelist
+ *
+ * Suppress warnings for these fallbacks to wikitext.
+ */
+var whitelist = new Set([
+   'wikibase-item',
+]);
+
+/**
  * @method
  *
  * Get an appropriate content handler, given a contentmodel.
@@ -788,7 +797,9 @@
this.page.meta.revision.contentmodel ||
'wikitext';
if (!this.conf.wiki.extContentModel.has(contentmodel)) {
-   this.log('error', 'Unknown contentmodel', contentmodel);
+   if (!whitelist.has(contentmodel)) {
+   this.log('warning', 'Unknown contentmodel', 
contentmodel);
+   }
contentmodel = 'wikitext';
}
return this.conf.wiki.extContentModel.get(contentmodel);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6755f6f6795511a7465e1013155dfdb4e78fa823
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: quote hash keys in varnish_config template

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: prometheus: quote hash keys in varnish_config template
..


prometheus: quote hash keys in varnish_config template

Getting an error similar to:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Failed to parse template prometheus/varnish_config.erb:
  Filepath: /usr/lib/ruby/vendor_ruby/puppet/parser/templatewrapper.rb
  Line: 82
  Detail: Could not find value for 'targets' at
/etc/puppet/modules/prometheus/templates/varnish_config.erb:5 at
/etc/puppet/modules/prometheus/manifests/varnish_config.pp:46 on node
prometheus2001.codfw.wmnet

Change-Id: Ie13ea9bcef5d0d2855f3f7a638f90490664b30f5
---
M modules/prometheus/templates/varnish_config.erb
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/prometheus/templates/varnish_config.erb 
b/modules/prometheus/templates/varnish_config.erb
index cf24f51..d5522f7 100644
--- a/modules/prometheus/templates/varnish_config.erb
+++ b/modules/prometheus/templates/varnish_config.erb
@@ -1,8 +1,8 @@
 <%
   targets_config = []
   targets_config.push({
-labels  => @labels,
-targets => @hosts[@site][@cluster].map{ |x| "#{x}:#{@port}" }
+'labels'  => @labels,
+'targets' => @hosts[@site][@cluster].map{ |x| "#{x}:#{@port}" }
   })
 -%>
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie13ea9bcef5d0d2855f3f7a638f90490664b30f5
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Filippo Giunchedi 
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]: prometheus: quote hash keys in varnish_config template

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

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

Change subject: prometheus: quote hash keys in varnish_config template
..

prometheus: quote hash keys in varnish_config template

Getting an error similar to:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Failed to parse template prometheus/varnish_config.erb:
  Filepath: /usr/lib/ruby/vendor_ruby/puppet/parser/templatewrapper.rb
  Line: 82
  Detail: Could not find value for 'targets' at
/etc/puppet/modules/prometheus/templates/varnish_config.erb:5 at
/etc/puppet/modules/prometheus/manifests/varnish_config.pp:46 on node
prometheus2001.codfw.wmnet

Change-Id: Ie13ea9bcef5d0d2855f3f7a638f90490664b30f5
---
M modules/prometheus/templates/varnish_config.erb
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/66/318466/1

diff --git a/modules/prometheus/templates/varnish_config.erb 
b/modules/prometheus/templates/varnish_config.erb
index cf24f51..d5522f7 100644
--- a/modules/prometheus/templates/varnish_config.erb
+++ b/modules/prometheus/templates/varnish_config.erb
@@ -1,8 +1,8 @@
 <%
   targets_config = []
   targets_config.push({
-labels  => @labels,
-targets => @hosts[@site][@cluster].map{ |x| "#{x}:#{@port}" }
+'labels'  => @labels,
+'targets' => @hosts[@site][@cluster].map{ |x| "#{x}:#{@port}" }
   })
 -%>
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie13ea9bcef5d0d2855f3f7a638f90490664b30f5
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: contint: add module xdummy for Jenkins' Android emulation tests

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

Change subject: contint: add module xdummy for Jenkins' Android emulation tests
..


contint: add module xdummy for Jenkins' Android emulation tests

Xdummy is an Xorg virtual display that X11 clients may show windows on
just like a desktop machine. This functionality is needed by the
Jenkins' Android emulation tests which include view tests that are
screen captured. Xvfb does not support GLX extensions, which the Android
emulator requires, so it cannot be used.

Bug: T133183
Change-Id: I41f4dac74da20aeb36509d9f2cd267f1ccc5c729
---
M modules/contint/manifests/packages/androidsdk.pp
A modules/xdummy/manifests/init.pp
A modules/xdummy/templates/initscripts/xdummy.systemd.erb
A modules/xdummy/templates/initscripts/xdummy.upstart.erb
4 files changed, 86 insertions(+), 0 deletions(-)

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



diff --git a/modules/contint/manifests/packages/androidsdk.pp 
b/modules/contint/manifests/packages/androidsdk.pp
index b2b3302..cc56481 100644
--- a/modules/contint/manifests/packages/androidsdk.pp
+++ b/modules/contint/manifests/packages/androidsdk.pp
@@ -10,6 +10,12 @@
 'lib32stdc++6',
 # Android emulation
 'qemu',
+# Xdummy
+'xpra',
+'xorg',
+# Image diffing
+'imagemagick',
+'python-pillow'
 ]: ensure => present,
 }
 }
diff --git a/modules/xdummy/manifests/init.pp b/modules/xdummy/manifests/init.pp
new file mode 100644
index 000..8ff7733
--- /dev/null
+++ b/modules/xdummy/manifests/init.pp
@@ -0,0 +1,53 @@
+# == Class: xdummy
+#
+# Configure a persistent Xdummy daemon.
+#
+# Xdummy is an X11 server that performs all graphical operations,
+# including GLX, on a virtual display.
+#
+# === Parameters
+#
+# [*display*]
+#   X display number. Default: 95.
+#
+# === Examples
+#
+#  class { 'xdummy':
+#display=> 86
+#  }
+#
+class xdummy(
+$display= 95
+) {
+package { 'xorg':
+ensure => present,
+}
+
+package { 'xpra':
+ensure => present,
+}
+
+group { 'xdummy':
+ensure => present,
+}
+
+user { 'xdummy':
+ensure => present,
+gid=> 'xdummy',
+shell  => '/bin/false',
+home   => '/nonexistent',
+system => true,
+}
+
+base::service_unit { 'xdummy':
+ensure  => present,
+refresh => true,
+upstart => true,
+systemd => true,
+require => [
+Package['Xorg'],
+Package['xpra'],
+User['xdummy']
+]
+}
+}
diff --git a/modules/xdummy/templates/initscripts/xdummy.systemd.erb 
b/modules/xdummy/templates/initscripts/xdummy.systemd.erb
new file mode 100644
index 000..f61bbc3
--- /dev/null
+++ b/modules/xdummy/templates/initscripts/xdummy.systemd.erb
@@ -0,0 +1,13 @@
+[Unit]
+Description=Virtual X11 display
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/Xorg -config /etc/xpra/xorg.conf :<%= @display %>
+Restart=always
+User=xdummy
+Group=xdummy
+
+[Install]
+WantedBy=multi-user.target
diff --git a/modules/xdummy/templates/initscripts/xdummy.upstart.erb 
b/modules/xdummy/templates/initscripts/xdummy.upstart.erb
new file mode 100644
index 000..ca0d4ad
--- /dev/null
+++ b/modules/xdummy/templates/initscripts/xdummy.upstart.erb
@@ -0,0 +1,14 @@
+# Upstart service job for Xdummy
+#
+description "Virtual X11 display"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+
+setuid xdummy
+setgid xdummy
+
+respawn
+respawn limit 10 5
+
+exec Xorg -config /etc/xpra/xorg.conf :<%= @display %>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I41f4dac74da20aeb36509d9f2cd267f1ccc5c729
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Niedzielski 
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...OAuth[REL1_26]: Use correct user for isUsableBy check in Special:OAuth/identify

2016-10-27 Thread Code Review
Gergő Tisza has submitted this change and it was merged.

Change subject: Use correct user for isUsableBy check in Special:OAuth/identify
..


Use correct user for isUsableBy check in Special:OAuth/identify

The special page's $this->getUser() comes from the normal
CookieSessionProvider cookies (or other non-OAuth mechanism), not the
OAuth headers that are being validated here for use by the /identify
endpoint.

We need to use the user associated with the MWOAuthConsumerAcceptance
instead for proper operation.

Bug: T149194
Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
(cherry picked from commit 5ec60f469f1cb0520db2710ee25604811d11057b)
---
M frontend/specialpages/SpecialMWOAuth.php
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Gergő Tisza: Verified; Looks good to me, approved



diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index 2dea5a3..285eef9 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -143,21 +143,21 @@
$wiki = wfWikiID();
$dbr = MWOAuthUtils::getCentralDB( 
DB_SLAVE );
$access = 
MWOAuthConsumerAcceptance::newFromToken( $dbr, $token->key );
+   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
+   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
+   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
+   }
// Access token is for this wiki
if ( $access->get( 'wiki' ) !== '*' && 
$access->get( 'wiki' ) !== $wiki ) {
throw new MWOAuthException(

'mwoauth-invalid-authorization-wrong-wiki',
array( $wiki )
);
-   } elseif ( !$consumer->isUsableBy( 
$user ) ) {
+   } elseif ( !$consumer->isUsableBy( 
$localUser ) ) {
throw new MWOAuthException( 
'mwoauth-invalid-authorization-not-approved',
$consumer->get( 'name' 
) );
-   }
-   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
-   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
-   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
}
 
// We know the identity of the user who 
granted the authorization

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: REL1_26
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Anomie 
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...OAuth[REL1_23]: Use correct user for isUsableBy check in Special:OAuth/identify

2016-10-27 Thread Code Review
Gergő Tisza has submitted this change and it was merged.

Change subject: Use correct user for isUsableBy check in Special:OAuth/identify
..


Use correct user for isUsableBy check in Special:OAuth/identify

The special page's $this->getUser() comes from the normal
CookieSessionProvider cookies (or other non-OAuth mechanism), not the
OAuth headers that are being validated here for use by the /identify
endpoint.

We need to use the user associated with the MWOAuthConsumerAcceptance
instead for proper operation.

Bug: T149194
Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
(cherry picked from commit 5ec60f469f1cb0520db2710ee25604811d11057b)
---
M frontend/specialpages/SpecialMWOAuth.php
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Gergő Tisza: Verified; Looks good to me, approved



diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index dd46415..e519d0b 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -137,21 +137,21 @@
$wiki = wfWikiID();
$dbr = MWOAuthUtils::getCentralDB( 
DB_SLAVE );
$access = 
MWOAuthConsumerAcceptance::newFromToken( $dbr, $token->key );
+   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
+   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
+   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
+   }
// Access token is for this wiki
if ( $access->get( 'wiki' ) !== '*' && 
$access->get( 'wiki' ) !== $wiki ) {
throw new MWOAuthException(

'mwoauth-invalid-authorization-wrong-wiki',
array( $wiki )
);
-   } elseif ( !$consumer->isUsableBy( 
$user ) ) {
+   } elseif ( !$consumer->isUsableBy( 
$localUser ) ) {
throw new MWOAuthException( 
'mwoauth-invalid-authorization-not-approved',
$consumer->get( 'name' 
) );
-   }
-   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
-   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
-   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
}
 
// We know the identity of the user who 
granted the authorization

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: REL1_23
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Anomie 
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...CentralAuth[REL1_23]: SECURITY: Check that the loginwiki account is attached when ...

2016-10-27 Thread Code Review
Gergő Tisza has submitted this change and it was merged.

Change subject: SECURITY: Check that the loginwiki account is attached when 
logging in
..


SECURITY: Check that the loginwiki account is attached when logging in

For Special:CentralAutoLogin/checkLoggedIn, we make sure the loginwiki
user is attached. For good measure, the same is done in /validateSession
and /refreshCookies even though we shouldn't have gotten to this point
if it isn't. We don't do it for the edge wiki in /createSession or
/setCookies for reasons already explained in the comment on line 435.

For Special:CentralLogin/start, we now raise an error if the local
loginwiki account exists but isn't attached. If it doesn't exist
locally, we don't error because we assume it'll be auto-created later.

For Special:CentralLogin/complete, we check that the local edge wiki
account is attached too, even though we shouldn't have gotten to this
point if it isn't.

Bug: T137551
Change-Id: Ib2018d13ced726b6d7416fce0502d678a123f638
(cherry picked from commit 7228cdf5c43f8102e2e48391e3243f3ba6c9e3a9)
---
M specials/SpecialCentralAutoLogin.php
M specials/SpecialCentralLogin.php
2 files changed, 17 insertions(+), 1 deletion(-)

Approvals:
  Gergő Tisza: Verified; Looks good to me, approved



diff --git a/specials/SpecialCentralAutoLogin.php 
b/specials/SpecialCentralAutoLogin.php
index 825e921..68fa07d 100644
--- a/specials/SpecialCentralAutoLogin.php
+++ b/specials/SpecialCentralAutoLogin.php
@@ -124,7 +124,7 @@
 
CentralAuthUser::setP3P();
$centralUser = CentralAuthUser::getInstance( 
$this->getUser() );
-   if ( $centralUser && $centralUser->getId() ) {
+   if ( $centralUser && $centralUser->getId() && 
$centralUser->isAttached() ) {
$centralSession = $this->getCentralSession( 
$centralUser, $this->getUser() );
 
// Refresh 'remember me' preference
@@ -192,6 +192,15 @@
// We're pretty sure this user is logged in, so pass 
back
// headers to prevent caching, just in case
$this->getOutput()->enableClientCache( false );
+
+   // Sanity check: If the loginwiki account isn't 
attached, things are broken (T137551)
+   if ( !$centralUser->isAttached() ) {
+   $this->doFinalOutput( false,
+   'Account on central wiki is not 
attached (this shouldn\'t happen)',
+   self::getInlineScript( 'anon-set.js' )
+   );
+   return;
+   }
 
$memcData = array( 'gu_id' => $centralUser->getId() );
$token = MWCryptRand::generateHex( 32 );
@@ -298,6 +307,7 @@
$memcData['wikiid'] !== $wikiid ||
!$centralUser ||
!$centralUser->getId() ||
+   !$centralUser->isAttached() ||
$memcData['gu_id'] != $centralUser->getId()
) {
$this->doFinalOutput( false, 'Invalid 
parameters' );
diff --git a/specials/SpecialCentralLogin.php b/specials/SpecialCentralLogin.php
index 20ff18b..479219f 100644
--- a/specials/SpecialCentralLogin.php
+++ b/specials/SpecialCentralLogin.php
@@ -57,11 +57,14 @@
return;
}
 
+   $user = User::newFromName( $info['name'] );
$centralUser = new CentralAuthUser( $info['name'] );
if ( !$centralUser->exists() ) { // sanity
throw new MWException( "Global user '{$info['name']}' 
does not exist." );
} elseif ( $centralUser->getId() !== $info['guid'] ) { // sanity
throw new MWException( "Global user does not have ID 
'{$info['guid']}'." );
+   } elseif ( !$centralUser->isAttached() && !$user->isAnon() ) { 
// sanity
+   throw new MWException( "User '{$info['name']}' exists 
locally but is not attached." );
}
 
$session = CentralAuthUser::getSession();
@@ -168,6 +171,9 @@
}
$centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->getId() ) { // sanity
+   throw new MWException( "The central user account does 
not exist." );
+   }
+   if ( !$centralUser->isAttached() ) { // sanity
throw new MWException( "The user account is not 
attached." );
}
 

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[REL1_26]: SECURITY: Check that the loginwiki account is attached when ...

2016-10-27 Thread Code Review
Gergő Tisza has submitted this change and it was merged.

Change subject: SECURITY: Check that the loginwiki account is attached when 
logging in
..


SECURITY: Check that the loginwiki account is attached when logging in

For Special:CentralAutoLogin/checkLoggedIn, we make sure the loginwiki
user is attached. For good measure, the same is done in /validateSession
and /refreshCookies even though we shouldn't have gotten to this point
if it isn't. We don't do it for the edge wiki in /createSession or
/setCookies for reasons already explained in the comment on line 435.

For Special:CentralLogin/start, we now raise an error if the local
loginwiki account exists but isn't attached. If it doesn't exist
locally, we don't error because we assume it'll be auto-created later.

For Special:CentralLogin/complete, we check that the local edge wiki
account is attached too, even though we shouldn't have gotten to this
point if it isn't.

Bug: T137551
Change-Id: Ib2018d13ced726b6d7416fce0502d678a123f638
(cherry picked from commit 7228cdf5c43f8102e2e48391e3243f3ba6c9e3a9)
---
M includes/specials/SpecialCentralAutoLogin.php
M includes/specials/SpecialCentralLogin.php
2 files changed, 17 insertions(+), 1 deletion(-)

Approvals:
  Gergő Tisza: Verified; Looks good to me, approved



diff --git a/includes/specials/SpecialCentralAutoLogin.php 
b/includes/specials/SpecialCentralAutoLogin.php
index ce8a0dc..e210d7b 100644
--- a/includes/specials/SpecialCentralAutoLogin.php
+++ b/includes/specials/SpecialCentralAutoLogin.php
@@ -124,7 +124,7 @@
 
CentralAuthUser::setP3P();
$centralUser = CentralAuthUser::getInstance( 
$this->getUser() );
-   if ( $centralUser && $centralUser->getId() ) {
+   if ( $centralUser && $centralUser->getId() && 
$centralUser->isAttached() ) {
$centralSession = $this->getCentralSession( 
$centralUser, $this->getUser() );
 
// Refresh 'remember me' preference
@@ -195,6 +195,15 @@
// We're pretty sure this user is logged in, so pass 
back
// headers to prevent caching, just in case
$this->getOutput()->enableClientCache( false );
+
+   // Sanity check: If the loginwiki account isn't 
attached, things are broken (T137551)
+   if ( !$centralUser->isAttached() ) {
+   $this->doFinalOutput( false,
+   'Account on central wiki is not 
attached (this shouldn\'t happen)',
+   self::getInlineScript( 'anon-set.js' )
+   );
+   return;
+   }
 
$memcData = array( 'gu_id' => $centralUser->getId() );
$token = MWCryptRand::generateHex( 32 );
@@ -303,6 +312,7 @@
$memcData['wikiid'] !== $wikiid ||
!$centralUser ||
!$centralUser->getId() ||
+   !$centralUser->isAttached() ||
$memcData['gu_id'] != $centralUser->getId()
) {
$this->doFinalOutput( false, 'Invalid 
parameters' );
diff --git a/includes/specials/SpecialCentralLogin.php 
b/includes/specials/SpecialCentralLogin.php
index c244c83..0e1f1a3 100644
--- a/includes/specials/SpecialCentralLogin.php
+++ b/includes/specials/SpecialCentralLogin.php
@@ -57,11 +57,14 @@
return;
}
 
+   $user = User::newFromName( $info['name'] );
$centralUser = new CentralAuthUser( $info['name'] );
if ( !$centralUser->exists() ) { // sanity
throw new Exception( "Global user '{$info['name']}' 
does not exist." );
} elseif ( $centralUser->getId() !== $info['guid'] ) { // sanity
throw new Exception( "Global user does not have ID 
'{$info['guid']}'." );
+   } elseif ( !$centralUser->isAttached() && !$user->isAnon() ) { 
// sanity
+   throw new Exception( "User '{$info['name']}' exists 
locally but is not attached." );
}
 
$session = CentralAuthUser::getSession();
@@ -171,6 +174,9 @@
}
$centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->getId() ) { // sanity
+   throw new Exception( "The central user account does not 
exist." );
+   }
+   if ( !$centralUser->isAttached() ) { // sanity
throw new Exception( "The user account is not 
attached." );
}
 

-- 
To view, visit https://gerrit.wikim

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[REL1_23]: SECURITY: Check that the loginwiki account is attached when ...

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

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

Change subject: SECURITY: Check that the loginwiki account is attached when 
logging in
..

SECURITY: Check that the loginwiki account is attached when logging in

For Special:CentralAutoLogin/checkLoggedIn, we make sure the loginwiki
user is attached. For good measure, the same is done in /validateSession
and /refreshCookies even though we shouldn't have gotten to this point
if it isn't. We don't do it for the edge wiki in /createSession or
/setCookies for reasons already explained in the comment on line 435.

For Special:CentralLogin/start, we now raise an error if the local
loginwiki account exists but isn't attached. If it doesn't exist
locally, we don't error because we assume it'll be auto-created later.

For Special:CentralLogin/complete, we check that the local edge wiki
account is attached too, even though we shouldn't have gotten to this
point if it isn't.

Bug: T137551
Change-Id: Ib2018d13ced726b6d7416fce0502d678a123f638
(cherry picked from commit 7228cdf5c43f8102e2e48391e3243f3ba6c9e3a9)
---
M specials/SpecialCentralAutoLogin.php
M specials/SpecialCentralLogin.php
2 files changed, 17 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/65/318465/1

diff --git a/specials/SpecialCentralAutoLogin.php 
b/specials/SpecialCentralAutoLogin.php
index 825e921..68fa07d 100644
--- a/specials/SpecialCentralAutoLogin.php
+++ b/specials/SpecialCentralAutoLogin.php
@@ -124,7 +124,7 @@
 
CentralAuthUser::setP3P();
$centralUser = CentralAuthUser::getInstance( 
$this->getUser() );
-   if ( $centralUser && $centralUser->getId() ) {
+   if ( $centralUser && $centralUser->getId() && 
$centralUser->isAttached() ) {
$centralSession = $this->getCentralSession( 
$centralUser, $this->getUser() );
 
// Refresh 'remember me' preference
@@ -192,6 +192,15 @@
// We're pretty sure this user is logged in, so pass 
back
// headers to prevent caching, just in case
$this->getOutput()->enableClientCache( false );
+
+   // Sanity check: If the loginwiki account isn't 
attached, things are broken (T137551)
+   if ( !$centralUser->isAttached() ) {
+   $this->doFinalOutput( false,
+   'Account on central wiki is not 
attached (this shouldn\'t happen)',
+   self::getInlineScript( 'anon-set.js' )
+   );
+   return;
+   }
 
$memcData = array( 'gu_id' => $centralUser->getId() );
$token = MWCryptRand::generateHex( 32 );
@@ -298,6 +307,7 @@
$memcData['wikiid'] !== $wikiid ||
!$centralUser ||
!$centralUser->getId() ||
+   !$centralUser->isAttached() ||
$memcData['gu_id'] != $centralUser->getId()
) {
$this->doFinalOutput( false, 'Invalid 
parameters' );
diff --git a/specials/SpecialCentralLogin.php b/specials/SpecialCentralLogin.php
index 20ff18b..479219f 100644
--- a/specials/SpecialCentralLogin.php
+++ b/specials/SpecialCentralLogin.php
@@ -57,11 +57,14 @@
return;
}
 
+   $user = User::newFromName( $info['name'] );
$centralUser = new CentralAuthUser( $info['name'] );
if ( !$centralUser->exists() ) { // sanity
throw new MWException( "Global user '{$info['name']}' 
does not exist." );
} elseif ( $centralUser->getId() !== $info['guid'] ) { // sanity
throw new MWException( "Global user does not have ID 
'{$info['guid']}'." );
+   } elseif ( !$centralUser->isAttached() && !$user->isAnon() ) { 
// sanity
+   throw new MWException( "User '{$info['name']}' exists 
locally but is not attached." );
}
 
$session = CentralAuthUser::getSession();
@@ -168,6 +171,9 @@
}
$centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->getId() ) { // sanity
+   throw new MWException( "The central user account does 
not exist." );
+   }
+   if ( !$centralUser->isAttached() ) { // sanity
throw new MWException( "The user account is not 
attached." );
}
 

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

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[REL1_26]: SECURITY: Check that the loginwiki account is attached when ...

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

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

Change subject: SECURITY: Check that the loginwiki account is attached when 
logging in
..

SECURITY: Check that the loginwiki account is attached when logging in

For Special:CentralAutoLogin/checkLoggedIn, we make sure the loginwiki
user is attached. For good measure, the same is done in /validateSession
and /refreshCookies even though we shouldn't have gotten to this point
if it isn't. We don't do it for the edge wiki in /createSession or
/setCookies for reasons already explained in the comment on line 435.

For Special:CentralLogin/start, we now raise an error if the local
loginwiki account exists but isn't attached. If it doesn't exist
locally, we don't error because we assume it'll be auto-created later.

For Special:CentralLogin/complete, we check that the local edge wiki
account is attached too, even though we shouldn't have gotten to this
point if it isn't.

Bug: T137551
Change-Id: Ib2018d13ced726b6d7416fce0502d678a123f638
(cherry picked from commit 7228cdf5c43f8102e2e48391e3243f3ba6c9e3a9)
---
M includes/specials/SpecialCentralAutoLogin.php
M includes/specials/SpecialCentralLogin.php
2 files changed, 17 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/64/318464/1

diff --git a/includes/specials/SpecialCentralAutoLogin.php 
b/includes/specials/SpecialCentralAutoLogin.php
index ce8a0dc..e210d7b 100644
--- a/includes/specials/SpecialCentralAutoLogin.php
+++ b/includes/specials/SpecialCentralAutoLogin.php
@@ -124,7 +124,7 @@
 
CentralAuthUser::setP3P();
$centralUser = CentralAuthUser::getInstance( 
$this->getUser() );
-   if ( $centralUser && $centralUser->getId() ) {
+   if ( $centralUser && $centralUser->getId() && 
$centralUser->isAttached() ) {
$centralSession = $this->getCentralSession( 
$centralUser, $this->getUser() );
 
// Refresh 'remember me' preference
@@ -195,6 +195,15 @@
// We're pretty sure this user is logged in, so pass 
back
// headers to prevent caching, just in case
$this->getOutput()->enableClientCache( false );
+
+   // Sanity check: If the loginwiki account isn't 
attached, things are broken (T137551)
+   if ( !$centralUser->isAttached() ) {
+   $this->doFinalOutput( false,
+   'Account on central wiki is not 
attached (this shouldn\'t happen)',
+   self::getInlineScript( 'anon-set.js' )
+   );
+   return;
+   }
 
$memcData = array( 'gu_id' => $centralUser->getId() );
$token = MWCryptRand::generateHex( 32 );
@@ -303,6 +312,7 @@
$memcData['wikiid'] !== $wikiid ||
!$centralUser ||
!$centralUser->getId() ||
+   !$centralUser->isAttached() ||
$memcData['gu_id'] != $centralUser->getId()
) {
$this->doFinalOutput( false, 'Invalid 
parameters' );
diff --git a/includes/specials/SpecialCentralLogin.php 
b/includes/specials/SpecialCentralLogin.php
index c244c83..0e1f1a3 100644
--- a/includes/specials/SpecialCentralLogin.php
+++ b/includes/specials/SpecialCentralLogin.php
@@ -57,11 +57,14 @@
return;
}
 
+   $user = User::newFromName( $info['name'] );
$centralUser = new CentralAuthUser( $info['name'] );
if ( !$centralUser->exists() ) { // sanity
throw new Exception( "Global user '{$info['name']}' 
does not exist." );
} elseif ( $centralUser->getId() !== $info['guid'] ) { // sanity
throw new Exception( "Global user does not have ID 
'{$info['guid']}'." );
+   } elseif ( !$centralUser->isAttached() && !$user->isAnon() ) { 
// sanity
+   throw new Exception( "User '{$info['name']}' exists 
locally but is not attached." );
}
 
$session = CentralAuthUser::getSession();
@@ -171,6 +174,9 @@
}
$centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->getId() ) { // sanity
+   throw new Exception( "The central user account does not 
exist." );
+   }
+   if ( !$centralUser->isAttached() ) { // sanity
throw new Exception( "The user account is not 
at

[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[REL1_27]: SECURITY: Check that the loginwiki account is attached when ...

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

Change subject: SECURITY: Check that the loginwiki account is attached when 
logging in
..


SECURITY: Check that the loginwiki account is attached when logging in

For Special:CentralAutoLogin/checkLoggedIn, we make sure the loginwiki
user is attached. For good measure, the same is done in /validateSession
and /refreshCookies even though we shouldn't have gotten to this point
if it isn't. We don't do it for the edge wiki in /createSession or
/setCookies for reasons already explained in the comment on line 435.

For Special:CentralLogin/start, we now raise an error if the local
loginwiki account exists but isn't attached. If it doesn't exist
locally, we don't error because we assume it'll be auto-created later.

For Special:CentralLogin/complete, we check that the local edge wiki
account is attached too, even though we shouldn't have gotten to this
point if it isn't.

Bug: T137551
Change-Id: Ib2018d13ced726b6d7416fce0502d678a123f638
(cherry picked from commit 7228cdf5c43f8102e2e48391e3243f3ba6c9e3a9)
---
M includes/specials/SpecialCentralAutoLogin.php
M includes/specials/SpecialCentralLogin.php
2 files changed, 18 insertions(+), 2 deletions(-)

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



diff --git a/includes/specials/SpecialCentralAutoLogin.php 
b/includes/specials/SpecialCentralAutoLogin.php
index 1e9e86f..56b2dc3 100644
--- a/includes/specials/SpecialCentralAutoLogin.php
+++ b/includes/specials/SpecialCentralAutoLogin.php
@@ -166,7 +166,7 @@
 
CentralAuthUtils::setP3P();
$centralUser = CentralAuthUser::getInstance( 
$this->getUser() );
-   if ( $centralUser && $centralUser->getId() ) {
+   if ( $centralUser && $centralUser->getId() && 
$centralUser->isAttached() ) {
$centralSession = $this->getCentralSession( 
$centralUser, $this->getUser() );
 
// Refresh 'remember me' preference
@@ -253,6 +253,15 @@
// We're pretty sure this user is logged in, so pass 
back
// headers to prevent caching, just in case
$this->getOutput()->enableClientCache( false );
+
+   // Sanity check: If the loginwiki account isn't 
attached, things are broken (T137551)
+   if ( !$centralUser->isAttached() ) {
+   $this->doFinalOutput( false,
+   'Account on central wiki is not 
attached (this shouldn\'t happen)',
+   self::getInlineScript( 'anon-set.js' )
+   );
+   return;
+   }
 
$memcData = array( 'gu_id' => $centralUser->getId() );
$token = MWCryptRand::generateHex( 32 );
@@ -365,6 +374,7 @@
$memcData['wikiid'] !== $wikiid ||
!$centralUser ||
!$centralUser->getId() ||
+   !$centralUser->isAttached() ||
$memcData['gu_id'] != $centralUser->getId()
) {
$this->doFinalOutput( false, 'Invalid 
parameters' );
diff --git a/includes/specials/SpecialCentralLogin.php 
b/includes/specials/SpecialCentralLogin.php
index da1d70a..a2cc910 100644
--- a/includes/specials/SpecialCentralLogin.php
+++ b/includes/specials/SpecialCentralLogin.php
@@ -72,11 +72,14 @@
return;
}
 
-   $centralUser = CentralAuthUser::getInstanceByName( 
$info['name'] );
+   $user = User::newFromName( $info['name'] );
+   $centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->exists() ) { // sanity
throw new Exception( "Global user '{$info['name']}' 
does not exist." );
} elseif ( $centralUser->getId() !== $info['guid'] ) { // sanity
throw new Exception( "Global user does not have ID 
'{$info['guid']}'." );
+   } elseif ( !$centralUser->isAttached() && !$user->isAnon() ) { 
// sanity
+   throw new Exception( "User '{$info['name']}' exists 
locally but is not attached." );
}
 
$session = CentralAuthUtils::getCentralSession();
@@ -199,6 +202,9 @@
}
$centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->getId() ) { // sanity
+   throw new Exception( "The central user account does not 
exist." );
+   }
+   if ( !$centralUser->isAttached() ) { // sanity
throw new E

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Introduce role/class to manage mgmt interfaces

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

Change subject: Introduce role/class to manage mgmt interfaces
..


Introduce role/class to manage mgmt interfaces

Working on a script to be able to change the mgmt password and
 sshpass is needed to execute remote racadm and ilo
 commands from the hosts running the script .

The script will be added in a follow-up patch, this is to 
introduce the role and put it on neodymium, the salt master,
so that sshpass gets installed there as a pre-requisite for the
script to work.

Change-Id: I1367ad13b1fb34b77e2f2bb58b18cef762d429e1
---
M manifests/site.pp
A modules/mgmt/manifests/init.pp
A modules/role/manifests/mgmt/drac_ilo.pp
3 files changed, 23 insertions(+), 1 deletion(-)

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



diff --git a/manifests/site.pp b/manifests/site.pp
index a241f36..78e35ab 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2255,7 +2255,8 @@
 # salt master
 node 'neodymium.eqiad.wmnet' {
 role(salt::masters::production, deployment::salt_masters,
-  debdeploy::master, ipmi::mgmt, access_new_install, mariadb::client)
+  debdeploy::master, ipmi::mgmt, access_new_install, mariadb::client,
+  mgmt::drac_ilo)
 include standard
 include base::firewall
 }
diff --git a/modules/mgmt/manifests/init.pp b/modules/mgmt/manifests/init.pp
new file mode 100644
index 000..e7a8bc8
--- /dev/null
+++ b/modules/mgmt/manifests/init.pp
@@ -0,0 +1,10 @@
+# manage management consoles
+# like setting passwords on 'mgmt'
+class mgmt {
+
+# sshpass is needed to login on DRAC consoles
+package { 'sshpass':
+ensure => present,
+}
+
+}
diff --git a/modules/role/manifests/mgmt/drac_ilo.pp 
b/modules/role/manifests/mgmt/drac_ilo.pp
new file mode 100644
index 000..1610788
--- /dev/null
+++ b/modules/role/manifests/mgmt/drac_ilo.pp
@@ -0,0 +1,11 @@
+# manage management interfaces
+# like setting passwords on DRACs/iLOs
+class role::mgmt::drac_ilo {
+
+system::role { 'role::mgmt::drac_ilo':
+description => 'Manage management interfaces'
+}
+
+include ::mgmt
+}
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1367ad13b1fb34b77e2f2bb58b18cef762d429e1
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Papaul 
Gerrit-Reviewer: Cmjohnson 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: RobH 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Add/update tests for W0 Retrofit client

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

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

Change subject: Add/update tests for W0 Retrofit client
..

Add/update tests for W0 Retrofit client

Change-Id: Ia345f1ad269059dba2ba6eb0651b3510fa63f1e2
---
M app/src/test/java/org/wikipedia/test/MockWebServerTest.java
D app/src/test/java/org/wikipedia/zero/WikipediaZeroTaskTest.java
A app/src/test/java/org/wikipedia/zero/ZeroConfigClientTest.java
A app/src/test/java/org/wikipedia/zero/ZeroUnmarshallingTest.java
A app/src/test/res/raw/wikipedia_zero_test_eligible.json
R app/src/test/res/raw/wikipedia_zero_test_malformed.json
6 files changed, 183 insertions(+), 77 deletions(-)


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

diff --git a/app/src/test/java/org/wikipedia/test/MockWebServerTest.java 
b/app/src/test/java/org/wikipedia/test/MockWebServerTest.java
index bd204be..6ea389f 100644
--- a/app/src/test/java/org/wikipedia/test/MockWebServerTest.java
+++ b/app/src/test/java/org/wikipedia/test/MockWebServerTest.java
@@ -39,6 +39,11 @@
 server.enqueue(new MockResponse().setResponseCode(code).setBody("Not 
Found"));
 }
 
+protected void enqueueEmpty() {
+final int code = 200;
+server.enqueue(new MockResponse().setResponseCode(code).setBody("{}"));
+}
+
 @NonNull public  T service(Class clazz) {
 return service(clazz, server().getUrl());
 }
diff --git a/app/src/test/java/org/wikipedia/zero/WikipediaZeroTaskTest.java 
b/app/src/test/java/org/wikipedia/zero/WikipediaZeroTaskTest.java
deleted file mode 100644
index e6767ac..000
--- a/app/src/test/java/org/wikipedia/zero/WikipediaZeroTaskTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.wikipedia.zero;
-
-import android.graphics.Color;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.wikipedia.test.ImmediateExecutor;
-import org.wikipedia.test.MockWebServerTest;
-import org.wikipedia.test.TestApi;
-import org.wikipedia.test.TestFileUtil;
-import org.wikipedia.test.TestRunner;
-import org.wikipedia.testlib.TestLatch;
-
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
-
-@RunWith(TestRunner.class)
-public class WikipediaZeroTaskTest extends MockWebServerTest {
-@Test
-public void testOnFinishIneligible() throws Exception {
-testOnFinish("{}", null);
-}
-
-@Test
-public void testOnFinishEligible() throws Exception {
-
testOnFinish(TestFileUtil.readRawFile("wikipedia_zero_task_test_eligible.json"),
-new ZeroConfig.Builder("Overstay your stay!", Color.WHITE, 
Color.CYAN)
-.exitTitle("")
-.exitWarning("")
-.partnerInfoText("")
-.partnerInfoUrl("")
-.bannerUrl("")
-.build());
-}
-
-private void testOnFinish(String responseBody,
-  @Nullable ZeroConfig expected) throws Exception {
-TestLatch latch = new TestLatch();
-Subject subject = new Subject(latch, expected);
-
-server().enqueue(responseBody);
-
-subject.execute();
-
-server().takeRequest();
-latch.await();
-}
-
-private class Subject extends WikipediaZeroTask {
-@NonNull
-private final TestLatch latch;
-
-@Nullable
-private final ZeroConfig expected;
-
-Subject(@NonNull TestLatch latch, @Nullable ZeroConfig expected) {
-super(new TestApi(server()), "userAgent");
-this.latch = latch;
-this.expected = expected;
-}
-
-@Override
-public void onFinish(ZeroConfig result) {
-super.onFinish(result);
-assertThat(result, is(expected));
-latch.countDown();
-}
-
-@Override
-public void execute() {
-super.executeOnExecutor(new ImmediateExecutor());
-}
-}
-}
\ No newline at end of file
diff --git a/app/src/test/java/org/wikipedia/zero/ZeroConfigClientTest.java 
b/app/src/test/java/org/wikipedia/zero/ZeroConfigClientTest.java
new file mode 100644
index 000..8ad3f1c
--- /dev/null
+++ b/app/src/test/java/org/wikipedia/zero/ZeroConfigClientTest.java
@@ -0,0 +1,112 @@
+package org.wikipedia.zero;
+
+
+import android.support.annotation.NonNull;
+
+import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+import org.wikipedia.WikipediaApp;
+import org.wikipedia.test.MockWebServerTest;
+import org.wikipedia.zero.ZeroConfigClient.Callback;
+import org.wikipedia.zero.ZeroConfigClient.Service;
+
+import okhttp3.mockwebserver.RecordedRequest;
+import retrofit2.Call;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsS

[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: generate Varnish targets

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: prometheus: generate Varnish targets
..


prometheus: generate Varnish targets

Bug: T147424
Change-Id: I45ef6f6ba0b5aebb1abcf8d0120051f4e83871a3
---
A modules/prometheus/manifests/varnish_2layer.pp
M modules/role/manifests/prometheus/ops.pp
2 files changed, 37 insertions(+), 0 deletions(-)

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



diff --git a/modules/prometheus/manifests/varnish_2layer.pp 
b/modules/prometheus/manifests/varnish_2layer.pp
new file mode 100644
index 000..ee42580
--- /dev/null
+++ b/modules/prometheus/manifests/varnish_2layer.pp
@@ -0,0 +1,27 @@
+# Generate Prometheus targets configuration for varnish frontend and backend
+# instances, using data from get_clusters().
+
+define prometheus::varnish_2layer(
+$targets_path,
+$cache_name,
+) {
+prometheus::varnish_config{ "${cache_name}_backend":
+dest=> 
"${targets_path}/varnish-${cache_name}_${::site}_backend.yaml",
+site=> $::site,
+cluster => "varnish_${cache_name}",
+port=> '9331',
+labels  => {
+  'layer' => 'backend'
+},
+}
+
+prometheus::varnish_config{ "${cache_name}_frontend":
+dest=> 
"${targets_path}/varnish-${cache_name}_${::site}_frontend.yaml",
+site=> $::site,
+cluster => "varnish_${cache_name}",
+port=> '9131',
+labels  => {
+  'layer' => 'frontend'
+},
+}
+}
diff --git a/modules/role/manifests/prometheus/ops.pp 
b/modules/role/manifests/prometheus/ops.pp
index 472a770..1831229 100644
--- a/modules/role/manifests/prometheus/ops.pp
+++ b/modules/role/manifests/prometheus/ops.pp
@@ -126,4 +126,14 @@
 file { "${rules_path}/rules_ops.conf":
 source => 'puppet:///modules/role/prometheus/rules_ops.conf',
 }
+
+prometheus::varnish_2layer{ 'maps':
+targets_path => $targets_path,
+cache_name   => 'maps',
+}
+
+prometheus::varnish_2layer{ 'misc':
+targets_path => $targets_path,
+cache_name   => 'misc',
+}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I45ef6f6ba0b5aebb1abcf8d0120051f4e83871a3
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Filippo Giunchedi 
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...Kartographer[wmf/1.28.0-wmf.23]: Disable hash update temporarily, to avoid polluting browser ...

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

Change subject: Disable hash update temporarily, to avoid polluting browser 
history
..


Disable hash update temporarily, to avoid polluting browser history

Bug: T144880
Change-Id: Id98f23a83edfe3ec2d517e3b7905ea758a34322f
(cherry picked from commit e6f63a123f4a26c0934b570875a8f19c53803cfd)
---
M modules/dialog/dialog.js
1 file changed, 0 insertions(+), 4 deletions(-)

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



diff --git a/modules/dialog/dialog.js b/modules/dialog/dialog.js
index fbbdc6b..e58a1cd 100644
--- a/modules/dialog/dialog.js
+++ b/modules/dialog/dialog.js
@@ -185,10 +185,6 @@
return;
}
this.map.doWhenReady( function ( ) {
-
-   if ( this.map.useRouter ) {
-   this.map.on( 'moveend', 
this.onMapMove, this );
-   }
mw.hook( 'wikipage.maps' ).fire( 
this.map, true /* isFullScreen */ );
}, this );
}, this );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id98f23a83edfe3ec2d517e3b7905ea758a34322f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: wmf/1.28.0-wmf.23
Gerrit-Owner: Yurik 
Gerrit-Reviewer: JGirault 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Set Api-User-Agent in requests to RESTBase/Parsoid

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

Change subject: Set Api-User-Agent in requests to RESTBase/Parsoid
..


Set Api-User-Agent in requests to RESTBase/Parsoid

Bug: T149050
Change-Id: I7670450724f18865a7d9c7c7eb182449964f32b0
---
M ApiVisualEditor.php
M modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js
2 files changed, 11 insertions(+), 5 deletions(-)

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



diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index ad19fe7..e7fe07f 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -93,6 +93,7 @@
// Should be synchronised with 
modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js
$reqheaders['Accept'] = 'text/html; charset=utf-8; 
profile="mediawiki.org/specs/html/1.2.0"';
$reqheaders['User-Agent'] = 'VisualEditor-MediaWiki/' . 
$wgVersion;
+   $reqheaders['Api-User-Agent'] = 'VisualEditor-MediaWiki/' . 
$wgVersion;
$request['headers'] = $reqheaders;
$response = $this->serviceClient->run( $request );
if ( $response['code'] === 200 && $response['error'] === "" ) {
diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js 
b/modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js
index 8676e6a..33920ea 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js
@@ -122,7 +122,7 @@
},
 
requestParsoidData: function ( pageName, oldid, targetName, 
modified, wikitext ) {
-   var start, apiXhr, restbaseXhr, apiPromise, 
restbasePromise, dataPromise, pageHtmlUrl,
+   var start, apiXhr, restbaseXhr, apiPromise, 
restbasePromise, dataPromise, pageHtmlUrl, headers,
switched = false,
fromEditedState = false,
data = {
@@ -157,6 +157,13 @@
 
if ( conf.fullRestbaseUrl || conf.restbaseUrl ) {
ve.track( 'trace.restbaseLoad.enter' );
+
+   // Should be synchronised with 
ApiVisualEditor.php
+   headers = {
+   Accept: 'text/html; charset=utf-8; 
profile="mediawiki.org/specs/html/1.2.0"',
+   'Api-User-Agent': 
'VisualEditor-MediaWiki/' + mw.config.get( 'wgVersion' )
+   };
+
if (
conf.fullRestbaseUrl &&
( wikitext || ( wikitext = $( 
'#wpTextbox1' ).textSelection( 'getContents' ) ) ) &&
@@ -177,8 +184,7 @@
wikitext: wikitext,
stash: 'true'
},
-   // Should be synchronised with 
ApiVisualEditor.php
-   headers: { Accept: 'text/html; 
charset=utf-8; profile="mediawiki.org/specs/html/1.2.0"' },
+   headers: headers,
dataType: 'text'
} );
} else {
@@ -191,8 +197,7 @@
url: pageHtmlUrl + 
encodeURIComponent( pageName ) +
( oldid === undefined ? 
'' : '/' + oldid ) + '?redirect=false',
type: 'GET',
-   // Should be synchronised with 
ApiVisualEditor.php
-   headers: { Accept: 'text/html; 
charset=utf-8; profile="mediawiki.org/specs/html/1.2.0"' },
+   headers: headers,
dataType: 'text'
} );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7670450724f18865a7d9c7c7eb182449964f32b0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester 
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] mediawiki...CollaborationKit[master]: Only show ToC for hubs if the hubs have content

2016-10-27 Thread Isarra (Code Review)
Isarra has uploaded a new change for review.

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

Change subject: Only show ToC for hubs if the hubs have content
..

Only show ToC for hubs if the hubs have content

Also added a couple of visualclears, except not because apparently not all
skins actually use visualclears.

Bug: T149032
Change-Id: Id9f71c0b6a1b0812160d21a81438ff17aa0f5630
---
M CollaborationKit.hooks.php
M includes/content/CollaborationHubContent.php
2 files changed, 14 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/62/318462/1

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index d89ce7b..a1e16e1 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -97,6 +97,7 @@
 
if ( $parentHub
&& $out->getProperty( 'CollaborationHubSubpage' ) === 
'in-progress'
+   && count( Revision::newFromTitle( $parentHub 
)->getContent()->getContent() ) > 0
) {
$toc = new CollaborationHubTOC();
$out->prependHtml( $toc->renderSubpageToC( $parentHub ) 
);
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index 0a93742..51ef591 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -248,17 +248,25 @@
$this->getParsedAnnouncements( $title, $options 
)
);
// get table of contents
-   $html .= Html::rawElement(
-   'div',
-   [ 'class' => 'wp-toc' ],
-   $this->getTableOfContents( $title, $options )
-   );
+   if ( count( $this->getContent() ) > 0 ) {
+   $html .= Html::rawElement(
+   'div',
+   [ 'class' => 'wp-toc' ],
+   $this->getTableOfContents( $title, 
$options )
+   );
+   }
+
+   $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
// get transcluded content
$html .= Html::rawElement(
'div',
[ 'class' => 'wp-content' ],
$this->getParsedContent( $title, $options, 
$output )
);
+
+   $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
// get footer
$html .= Html::rawElement(
'div',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9f71c0b6a1b0812160d21a81438ff17aa0f5630
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Isarra 

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Update VE core submodule to master (e4c8003)

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

Change subject: Update VE core submodule to master (e4c8003)
..


Update VE core submodule to master (e4c8003)

New changes:
e4c8003 Bring in target 'mode' property from MW

Local changes:
Use upstream Target#setMode functionality

Depends-On: I9d501cb77c714fbd299b5816d302b0bdde7833cd
Change-Id: I2fcda6ca7d82d880101d9ba2a027d4ef066aa238
---
M lib/ve
M modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
M modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
5 files changed, 25 insertions(+), 20 deletions(-)

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



diff --git a/lib/ve b/lib/ve
index 8bdf0f7..e4c8003 16
--- a/lib/ve
+++ b/lib/ve
@@ -1 +1 @@
-Subproject commit 8bdf0f796b4fba3e748c4b9697cf84a5b4cb4a3e
+Subproject commit e4c8003349ae01ba19215a3fa059a5dede9964b2
diff --git a/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css 
b/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css
index 2c5b4e0..9065a74 100644
--- a/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css
+++ b/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css
@@ -51,7 +51,7 @@
text-decoration: none;
 }
 
-.ve-init-mw-articleTarget-source .catlinks {
+.ve-init-target-source .catlinks {
display: none;
 }
 
diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index b34d03c..d18c2a6 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -150,10 +150,22 @@
return 
mw.libs.ve.targetLoader.loadModules();
} )
.then( function () {
-   var target;
+   var target,
+   modes = [];
+
+   if ( init.isVisualAvailable ) {
+   modes.push( 'visual' );
+   }
+
+   if ( init.isWikitextAvailable ) {
+   modes.push( 'source' );
+   }
 
target = 
ve.init.mw.targetFactory.create(
-   conf.contentModels[ 
mw.config.get( 'wgPageContentModel' ) ]
+   conf.contentModels[ 
mw.config.get( 'wgPageContentModel' ) ], {
+   modes: modes,
+   mode: mode
+   }
);
target.setContainer( $( '#content' ) );
targetLoaded = true;
@@ -163,13 +175,12 @@
} );
}
 
-   targetPromise.then( function ( target ) {
+   targetPromise.then( function () {
// Enqueue the loading of deferred modules (that is, 
modules which provide
// functionality that is not needed for loading the 
editor).
setTimeout( function () {
mw.loader.load( 'easy-deflate.deflate' );
}, 500 );
-   target.setMode( mode );
} );
 
return targetPromise;
diff --git 
a/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js
index 2facd2f..17588d7 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js
@@ -424,6 +424,6 @@
// Parent method
ve.ui.MWEditModeVisualTool.super.prototype.onUpdateState.apply( this, 
arguments );
 
-   this.setDisabled( !mw.libs.ve.isVisualAvailable );
+   this.setDisabled( ve.init.target.modes.indexOf( 'visual' ) === -1 );
 };
 ve.ui.toolFactory.register( ve.ui.MWEditModeVisualTool );
diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 
b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
index d7635d0..18c7197 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
@@ -39,7 +39,6 @@
this.pageName = pageName;
this.pageExists = mw.config.get( 'wgRelevantArticleId', 0 ) !== 0;
this.too

[MediaWiki-commits] [Gerrit] mediawiki...OAuth[REL1_27]: Use correct user for isUsableBy check in Special:OAuth/identify

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

Change subject: Use correct user for isUsableBy check in Special:OAuth/identify
..


Use correct user for isUsableBy check in Special:OAuth/identify

The special page's $this->getUser() comes from the normal
CookieSessionProvider cookies (or other non-OAuth mechanism), not the
OAuth headers that are being validated here for use by the /identify
endpoint.

We need to use the user associated with the MWOAuthConsumerAcceptance
instead for proper operation.

Bug: T149194
Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
(cherry picked from commit 5ec60f469f1cb0520db2710ee25604811d11057b)
---
M frontend/specialpages/SpecialMWOAuth.php
1 file changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index df993cf..d1537fc 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -153,21 +153,21 @@
$wiki = wfWikiID();
$dbr = MWOAuthUtils::getCentralDB( 
DB_SLAVE );
$access = 
MWOAuthConsumerAcceptance::newFromToken( $dbr, $token->key );
+   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
+   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
+   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
+   }
// Access token is for this wiki
if ( $access->get( 'wiki' ) !== '*' && 
$access->get( 'wiki' ) !== $wiki ) {
throw new MWOAuthException(

'mwoauth-invalid-authorization-wrong-wiki',
array( $wiki )
);
-   } elseif ( !$consumer->isUsableBy( 
$user ) ) {
+   } elseif ( !$consumer->isUsableBy( 
$localUser ) ) {
throw new MWOAuthException( 
'mwoauth-invalid-authorization-not-approved',
$consumer->get( 'name' 
) );
-   }
-   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
-   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
-   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
}
 
// We know the identity of the user who 
granted the authorization

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: REL1_27
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: ve.dm.Transaction: add 'author' field

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

Change subject: ve.dm.Transaction: add 'author' field
..


ve.dm.Transaction: add 'author' field

Also remove toJSON method, as it is no longer needed

Change-Id: Icfbd542d0c66ecc656bd734d1d1fb44dd1869d90
---
M src/dm/ve.dm.Transaction.js
M src/ve.debug.js
M tests/dm/ve.dm.Transaction.test.js
3 files changed, 7 insertions(+), 13 deletions(-)

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



diff --git a/src/dm/ve.dm.Transaction.js b/src/dm/ve.dm.Transaction.js
index 251aea7..11cb1a0 100644
--- a/src/dm/ve.dm.Transaction.js
+++ b/src/dm/ve.dm.Transaction.js
@@ -25,6 +25,7 @@
 ve.dm.Transaction = function VeDmTransaction( operations ) {
this.operations = operations || [];
this.applied = false;
+   this.author = null;
 };
 
 /* Static Methods */
@@ -904,15 +905,6 @@
 /* Methods */
 
 /**
- * Get a serializable object describing the transaction
- *
- * @return {Object} Serializable object
- */
-ve.dm.Transaction.prototype.toJSON = function () {
-   return this.operations;
-};
-
-/**
  * Create a clone of this transaction.
  *
  * The returned transaction will be exactly the same as this one, except that 
its 'applied' flag
@@ -924,6 +916,7 @@
 ve.dm.Transaction.prototype.clone = function () {
var tx = new this.constructor();
tx.operations = ve.copy( this.operations );
+   tx.author = this.author;
return tx;
 };
 
@@ -951,6 +944,7 @@
}
tx.operations.push( newOp );
}
+   tx.author = this.author;
return tx;
 };
 
diff --git a/src/ve.debug.js b/src/ve.debug.js
index f6c7b54..27cbc4e 100644
--- a/src/ve.debug.js
+++ b/src/ve.debug.js
@@ -122,7 +122,7 @@
}
} ).join( '' ) + '\'';
}
-   return '(' + tx.operations.map( function ( op ) {
+   return '(' + tx.author + ' ' + tx.operations.map( function ( op ) {
if ( op.type === 'retain' ) {
return ( annotations ? 'annotate ' : 'retain ' ) + 
op.length;
} else if ( op.type === 'replace' ) {
diff --git a/tests/dm/ve.dm.Transaction.test.js 
b/tests/dm/ve.dm.Transaction.test.js
index 6001f7e..2c8bd6d 100644
--- a/tests/dm/ve.dm.Transaction.test.js
+++ b/tests/dm/ve.dm.Transaction.test.js
@@ -2464,7 +2464,7 @@
} );
 } );
 
-QUnit.test( 'toJSON/build with operations', function ( assert ) {
+QUnit.test( 'operations/build from operations', function ( assert ) {
var i, tx, ops,
doc = ve.dm.example.createExampleDocument(),
underline = ve.dm.example.createAnnotation( 
ve.dm.example.underline ),
@@ -2545,8 +2545,8 @@
for ( i = 0; i < cases.length; i++ ) {
 
tx = ve.dm.Transaction[ cases[ i ].method ].apply( 
ve.dm.Transaction, cases[ i ].args );
-   ops = JSON.parse( JSON.stringify( tx.toJSON() ) );
-   assert.deepEqual( ops, cases[ i ].expected, cases[ i ].msg + ': 
toJSON' );
+   ops = ve.copy( tx.operations );
+   assert.deepEqual( ops, cases[ i ].expected, cases[ i ].msg + ': 
operations' );
if ( cases[ i ].roundTripArgs ) {
tx = ve.dm.Transaction[ cases[ i ].method ].apply( 
ve.dm.Transaction, cases[ i ].roundTripArgs );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icfbd542d0c66ecc656bd734d1d1fb44dd1869d90
Gerrit-PatchSet: 4
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Divec 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[REL1_27]: SECURITY: Check that the loginwiki account is attached when ...

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

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

Change subject: SECURITY: Check that the loginwiki account is attached when 
logging in
..

SECURITY: Check that the loginwiki account is attached when logging in

For Special:CentralAutoLogin/checkLoggedIn, we make sure the loginwiki
user is attached. For good measure, the same is done in /validateSession
and /refreshCookies even though we shouldn't have gotten to this point
if it isn't. We don't do it for the edge wiki in /createSession or
/setCookies for reasons already explained in the comment on line 435.

For Special:CentralLogin/start, we now raise an error if the local
loginwiki account exists but isn't attached. If it doesn't exist
locally, we don't error because we assume it'll be auto-created later.

For Special:CentralLogin/complete, we check that the local edge wiki
account is attached too, even though we shouldn't have gotten to this
point if it isn't.

Bug: T137551
Change-Id: Ib2018d13ced726b6d7416fce0502d678a123f638
(cherry picked from commit 7228cdf5c43f8102e2e48391e3243f3ba6c9e3a9)
---
M includes/specials/SpecialCentralAutoLogin.php
M includes/specials/SpecialCentralLogin.php
2 files changed, 18 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/61/318461/1

diff --git a/includes/specials/SpecialCentralAutoLogin.php 
b/includes/specials/SpecialCentralAutoLogin.php
index 1e9e86f..56b2dc3 100644
--- a/includes/specials/SpecialCentralAutoLogin.php
+++ b/includes/specials/SpecialCentralAutoLogin.php
@@ -166,7 +166,7 @@
 
CentralAuthUtils::setP3P();
$centralUser = CentralAuthUser::getInstance( 
$this->getUser() );
-   if ( $centralUser && $centralUser->getId() ) {
+   if ( $centralUser && $centralUser->getId() && 
$centralUser->isAttached() ) {
$centralSession = $this->getCentralSession( 
$centralUser, $this->getUser() );
 
// Refresh 'remember me' preference
@@ -253,6 +253,15 @@
// We're pretty sure this user is logged in, so pass 
back
// headers to prevent caching, just in case
$this->getOutput()->enableClientCache( false );
+
+   // Sanity check: If the loginwiki account isn't 
attached, things are broken (T137551)
+   if ( !$centralUser->isAttached() ) {
+   $this->doFinalOutput( false,
+   'Account on central wiki is not 
attached (this shouldn\'t happen)',
+   self::getInlineScript( 'anon-set.js' )
+   );
+   return;
+   }
 
$memcData = array( 'gu_id' => $centralUser->getId() );
$token = MWCryptRand::generateHex( 32 );
@@ -365,6 +374,7 @@
$memcData['wikiid'] !== $wikiid ||
!$centralUser ||
!$centralUser->getId() ||
+   !$centralUser->isAttached() ||
$memcData['gu_id'] != $centralUser->getId()
) {
$this->doFinalOutput( false, 'Invalid 
parameters' );
diff --git a/includes/specials/SpecialCentralLogin.php 
b/includes/specials/SpecialCentralLogin.php
index da1d70a..a2cc910 100644
--- a/includes/specials/SpecialCentralLogin.php
+++ b/includes/specials/SpecialCentralLogin.php
@@ -72,11 +72,14 @@
return;
}
 
-   $centralUser = CentralAuthUser::getInstanceByName( 
$info['name'] );
+   $user = User::newFromName( $info['name'] );
+   $centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->exists() ) { // sanity
throw new Exception( "Global user '{$info['name']}' 
does not exist." );
} elseif ( $centralUser->getId() !== $info['guid'] ) { // sanity
throw new Exception( "Global user does not have ID 
'{$info['guid']}'." );
+   } elseif ( !$centralUser->isAttached() && !$user->isAnon() ) { 
// sanity
+   throw new Exception( "User '{$info['name']}' exists 
locally but is not attached." );
}
 
$session = CentralAuthUtils::getCentralSession();
@@ -199,6 +202,9 @@
}
$centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->getId() ) { // sanity
+   throw new Exception( "The central user account does not 
exist." );
+   }
+   if ( !$centralUser->isAt

[MediaWiki-commits] [Gerrit] mediawiki...OAuth[REL1_23]: Use correct user for isUsableBy check in Special:OAuth/identify

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

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

Change subject: Use correct user for isUsableBy check in Special:OAuth/identify
..

Use correct user for isUsableBy check in Special:OAuth/identify

The special page's $this->getUser() comes from the normal
CookieSessionProvider cookies (or other non-OAuth mechanism), not the
OAuth headers that are being validated here for use by the /identify
endpoint.

We need to use the user associated with the MWOAuthConsumerAcceptance
instead for proper operation.

Bug: T149194
Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
(cherry picked from commit 5ec60f469f1cb0520db2710ee25604811d11057b)
---
M frontend/specialpages/SpecialMWOAuth.php
1 file changed, 7 insertions(+), 7 deletions(-)


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

diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index dd46415..e519d0b 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -137,21 +137,21 @@
$wiki = wfWikiID();
$dbr = MWOAuthUtils::getCentralDB( 
DB_SLAVE );
$access = 
MWOAuthConsumerAcceptance::newFromToken( $dbr, $token->key );
+   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
+   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
+   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
+   }
// Access token is for this wiki
if ( $access->get( 'wiki' ) !== '*' && 
$access->get( 'wiki' ) !== $wiki ) {
throw new MWOAuthException(

'mwoauth-invalid-authorization-wrong-wiki',
array( $wiki )
);
-   } elseif ( !$consumer->isUsableBy( 
$user ) ) {
+   } elseif ( !$consumer->isUsableBy( 
$localUser ) ) {
throw new MWOAuthException( 
'mwoauth-invalid-authorization-not-approved',
$consumer->get( 'name' 
) );
-   }
-   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
-   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
-   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
}
 
// We know the identity of the user who 
granted the authorization

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: REL1_23
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Anomie 

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


[MediaWiki-commits] [Gerrit] mediawiki...OAuth[REL1_26]: Use correct user for isUsableBy check in Special:OAuth/identify

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

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

Change subject: Use correct user for isUsableBy check in Special:OAuth/identify
..

Use correct user for isUsableBy check in Special:OAuth/identify

The special page's $this->getUser() comes from the normal
CookieSessionProvider cookies (or other non-OAuth mechanism), not the
OAuth headers that are being validated here for use by the /identify
endpoint.

We need to use the user associated with the MWOAuthConsumerAcceptance
instead for proper operation.

Bug: T149194
Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
(cherry picked from commit 5ec60f469f1cb0520db2710ee25604811d11057b)
---
M frontend/specialpages/SpecialMWOAuth.php
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/59/318459/1

diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index 2dea5a3..285eef9 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -143,21 +143,21 @@
$wiki = wfWikiID();
$dbr = MWOAuthUtils::getCentralDB( 
DB_SLAVE );
$access = 
MWOAuthConsumerAcceptance::newFromToken( $dbr, $token->key );
+   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
+   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
+   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
+   }
// Access token is for this wiki
if ( $access->get( 'wiki' ) !== '*' && 
$access->get( 'wiki' ) !== $wiki ) {
throw new MWOAuthException(

'mwoauth-invalid-authorization-wrong-wiki',
array( $wiki )
);
-   } elseif ( !$consumer->isUsableBy( 
$user ) ) {
+   } elseif ( !$consumer->isUsableBy( 
$localUser ) ) {
throw new MWOAuthException( 
'mwoauth-invalid-authorization-not-approved',
$consumer->get( 'name' 
) );
-   }
-   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
-   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
-   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
}
 
// We know the identity of the user who 
granted the authorization

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: REL1_26
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Anomie 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: generate varnish targets from get_clusters()

2016-10-27 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: prometheus: generate varnish targets from get_clusters()
..


prometheus: generate varnish targets from get_clusters()

Pull a map of varnish host => varnish cluster from conftool data, use that map
to generate Prometheus per-varnish-cluster targets configuration.

Our varnish configuration is 2layer everywhere, therefore also 'service' is
used to distinguish frontend varnish from backend varnish. Two instances of
prometheus-varnish-exporter are ran per machine, one for each fe/be.

Bug: T147424
Change-Id: I76acecafdc5cc4a9472a79b5f3514daebf043471
---
A modules/prometheus/manifests/varnish_config.pp
A modules/prometheus/templates/varnish_config.erb
M modules/role/manifests/prometheus/ops.pp
3 files changed, 86 insertions(+), 1 deletion(-)

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



diff --git a/modules/prometheus/manifests/varnish_config.pp 
b/modules/prometheus/manifests/varnish_config.pp
new file mode 100644
index 000..e93cbe8
--- /dev/null
+++ b/modules/prometheus/manifests/varnish_config.pp
@@ -0,0 +1,48 @@
+# == Define: prometheus::varnish_config
+#
+# Generate prometheus targets configuration for varnish clusters.
+# Data is gathered using get_clusters()
+
+# == Parameters
+# $dest:The output file where to write the result.
+# $site:The site to use.
+# $cluster: The cluster to use.
+# $port:The port varnish_exporter is listening on.
+# $labels:  Labels to attach to the cluster's hosts.
+
+# == Example
+#
+#  prometheus::varnish_config{ 'maps_fe':
+#  dest=> "${targets_path}/varnish-maps_${::site}_frontend.yaml",
+#  site=> $::site,
+#  cluster => 'cache_maps',
+#  port=> '9331',
+#  labels  => {'layer' => 'frontend' },
+#  }
+
+define prometheus::varnish_config(
+  $dest,
+  $site,
+  $cluster,
+  $port,
+  $labels,
+) {
+validate_string($dest)
+validate_string($site)
+validate_string($cluster)
+validate_re($port, '^[0-9]+$')
+validate_hash($labels)
+
+$hosts = get_clusters({
+  'site' => $site,
+  'cluster' => $cluster,
+})
+
+file { $dest:
+ensure  => present,
+owner   => 'root',
+group   => 'root',
+mode=> '0444',
+content => template('prometheus/varnish_config.erb'),
+}
+}
diff --git a/modules/prometheus/templates/varnish_config.erb 
b/modules/prometheus/templates/varnish_config.erb
new file mode 100644
index 000..cf24f51
--- /dev/null
+++ b/modules/prometheus/templates/varnish_config.erb
@@ -0,0 +1,9 @@
+<%
+  targets_config = []
+  targets_config.push({
+labels  => @labels,
+targets => @hosts[@site][@cluster].map{ |x| "#{x}:#{@port}" }
+  })
+-%>
+
+<%= scope.function_ordered_yaml(targets_config) -%>
diff --git a/modules/role/manifests/prometheus/ops.pp 
b/modules/role/manifests/prometheus/ops.pp
index eabc97e..472a770 100644
--- a/modules/role/manifests/prometheus/ops.pp
+++ b/modules/role/manifests/prometheus/ops.pp
@@ -42,9 +42,37 @@
   },
 ]
 
+# one job per varnish cache 'role'
+$varnish_jobs = [
+  {
+'job_name'=> 'varnish-text',
+'file_sd_configs' => [
+  { 'names' => [ "${targets_path}/varnish-text_*.yaml"] },
+]
+  },
+  {
+'job_name'=> 'varnish-upload',
+'file_sd_configs' => [
+  { 'names' => [ "${targets_path}/varnish-upload_*.yaml"] },
+]
+  },
+  {
+'job_name'=> 'varnish-maps',
+'file_sd_configs' => [
+  { 'names' => [ "${targets_path}/varnish-maps_*.yaml"] },
+]
+  },
+  {
+'job_name'=> 'varnish-misc',
+'file_sd_configs' => [
+  { 'names' => [ "${targets_path}/varnish-misc_*.yaml"] },
+]
+  },
+]
+
 prometheus::server { 'ops':
 listen_address   => '127.0.0.1:9900',
-scrape_configs_extra => $mysql_jobs,
+scrape_configs_extra => array_concat($mysql_jobs, $varnish_jobs),
 }
 
 prometheus::web { 'ops':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I76acecafdc5cc4a9472a79b5f3514daebf043471
Gerrit-PatchSet: 8
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Ema 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Volans 
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...OAuth[REL1_27]: Use correct user for isUsableBy check in Special:OAuth/identify

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

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

Change subject: Use correct user for isUsableBy check in Special:OAuth/identify
..

Use correct user for isUsableBy check in Special:OAuth/identify

The special page's $this->getUser() comes from the normal
CookieSessionProvider cookies (or other non-OAuth mechanism), not the
OAuth headers that are being validated here for use by the /identify
endpoint.

We need to use the user associated with the MWOAuthConsumerAcceptance
instead for proper operation.

Bug: T149194
Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
(cherry picked from commit 5ec60f469f1cb0520db2710ee25604811d11057b)
---
M frontend/specialpages/SpecialMWOAuth.php
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/58/318458/1

diff --git a/frontend/specialpages/SpecialMWOAuth.php 
b/frontend/specialpages/SpecialMWOAuth.php
index df993cf..d1537fc 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -153,21 +153,21 @@
$wiki = wfWikiID();
$dbr = MWOAuthUtils::getCentralDB( 
DB_SLAVE );
$access = 
MWOAuthConsumerAcceptance::newFromToken( $dbr, $token->key );
+   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
+   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
+   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
+   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
+   }
// Access token is for this wiki
if ( $access->get( 'wiki' ) !== '*' && 
$access->get( 'wiki' ) !== $wiki ) {
throw new MWOAuthException(

'mwoauth-invalid-authorization-wrong-wiki',
array( $wiki )
);
-   } elseif ( !$consumer->isUsableBy( 
$user ) ) {
+   } elseif ( !$consumer->isUsableBy( 
$localUser ) ) {
throw new MWOAuthException( 
'mwoauth-invalid-authorization-not-approved',
$consumer->get( 'name' 
) );
-   }
-   $localUser = 
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
-   if ( !$localUser || 
!$localUser->isLoggedIn() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-invalid-user' );
-   } elseif ( $localUser->isLocked() || 
$wgBlockDisablesLogin && $localUser->isBlocked() ) {
-   throw new MWOAuthException( 
'mwoauth-invalid-authorization-blocked-user' );
}
 
// We know the identity of the user who 
granted the authorization

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a9f78c4fe7e592a3dbbf084858ba9942a8fac38
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: REL1_27
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Anomie 

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


[MediaWiki-commits] [Gerrit] operations/dns[master]: delete virt1000.wikimedia.org

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

Change subject: delete virt1000.wikimedia.org
..


delete virt1000.wikimedia.org

Change-Id: Ia90fd14c8d522b0c06cdcf6ca2eceec0ca05bc3e
---
M templates/154.80.208.in-addr.arpa
M templates/wikimedia.org
2 files changed, 1 insertion(+), 3 deletions(-)

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



diff --git a/templates/154.80.208.in-addr.arpa 
b/templates/154.80.208.in-addr.arpa
index 25289e9..28181bb 100644
--- a/templates/154.80.208.in-addr.arpa
+++ b/templates/154.80.208.in-addr.arpa
@@ -26,7 +26,7 @@
 15  1H  IN PTR  sodium.wikimedia.org.
 16  1H  IN PTR  ms1001.wikimedia.org.
 17  1H  IN PTR  contint1001.wikimedia.org.
-18  1H  IN PTR  virt1000.wikimedia.org.
+
 20  1H  IN PTR  labs-recursor1.wikimedia.org.
 39  1H  IN PTR  radium.wikimedia.org.
 
diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index fbd7519..b716bc3 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -197,8 +197,6 @@
 ununpentium 1H  IN A208.80.154.84
 uranium 1H  IN A208.80.154.53
 uranium 1H  IN  2620:0:861:1:208:80:154:53
-virt10001H  IN A208.80.154.18
-
 
 ; Service aliases
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia90fd14c8d522b0c06cdcf6ca2eceec0ca05bc3e
Gerrit-PatchSet: 2
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/dns[master]: repeat hostname for AAAA (tegmen, einsteinium, uranium)

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

Change subject: repeat hostname for  (tegmen,einsteinium,uranium)
..


repeat hostname for  (tegmen,einsteinium,uranium)

Change-Id: I534b3c51c438dab2fc7291827df0a26fa4a7e2a4
---
M templates/wikimedia.org
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index df32e77..fbd7519 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -120,7 +120,7 @@
 eeden   1H  IN A91.198.174.121
 1H  IN  2620:0:862:1:91:198:174:121
 einsteinium 1H  IN A208.80.155.119
-1H  IN  2620:0:861:4:208:80:155:119
+einsteinium 1H  IN  2620:0:861:4:208:80:155:119
 fermium 1H  IN A208.80.154.74 ; VM on the ganeti01.svc.eqiad.wmnet 
cluster
 fermium 1H  IN  2620:0:861:3:208:80:154:74
 frdata-eqiad  1H  IN A208.80.155.10
@@ -192,11 +192,11 @@
 silver  1H  IN A208.80.154.136
 silver  1H  IN  2620:0:861:2:208:80:154:136
 tegmen  1H  IN A208.80.153.74
-1H  IN  2620:0:860:3:208:80:153:74
+tegmen  1H  IN  2620:0:860:3:208:80:153:74
 tellurium   1H  IN A208.80.155.9
 ununpentium 1H  IN A208.80.154.84
 uranium 1H  IN A208.80.154.53
-1H  IN  2620:0:861:1:208:80:154:53
+uranium 1H  IN  2620:0:861:1:208:80:154:53
 virt10001H  IN A208.80.154.18
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I534b3c51c438dab2fc7291827df0a26fa4a7e2a4
Gerrit-PatchSet: 2
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Bring in target 'mode' property from MW

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

Change subject: Bring in target 'mode' property from MW
..


Bring in target 'mode' property from MW

Part of upstreaming visual/source switching.

Change-Id: I9d501cb77c714fbd299b5816d302b0bdde7833cd
---
M src/init/ve.init.Target.js
1 file changed, 44 insertions(+), 0 deletions(-)

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



diff --git a/src/init/ve.init.Target.js b/src/init/ve.init.Target.js
index c3327c2..d31e9be 100644
--- a/src/init/ve.init.Target.js
+++ b/src/init/ve.init.Target.js
@@ -15,6 +15,8 @@
  * @constructor
  * @param {Object} [config] Configuration options
  * @cfg {Object} [toolbarConfig] Configuration options for the toolbar
+ * @cfg {Object} [modes] Available editing modes. Defaults to static.modes
+ * @cfg {Object} [mode] Initial editing mode. Must be in this.modes and 
defaults to first item.
  */
 ve.init.Target = function VeInitTarget( config ) {
config = config || {};
@@ -36,6 +38,9 @@
this.toolbarConfig = config.toolbarConfig;
this.$scrollContainer = this.getScrollContainer();
this.toolbarScrollOffset = 0;
+
+   this.modes = config.modes || this.constructor.static.modes;
+   this.setMode( config.mode );
 
this.setupTriggerListeners();
 
@@ -66,6 +71,17 @@
 OO.mixinClass( ve.init.Target, OO.EventEmitter );
 
 /* Static Properties */
+
+/**
+ * Editing modes available in the target.
+ *
+ * Must contain at least one mode. Overridden if the #modes config option is 
used.
+ *
+ * @static
+ * @property {string[]}
+ * @inheritable
+ */
+ve.init.Target.static.modes = [ 'visual' ];
 
 ve.init.Target.static.toolbarGroups = [
// History
@@ -178,6 +194,34 @@
 /* Methods */
 
 /**
+ * Set editing mode
+ *
+ * @param {string} mode Editing mode, see static.modes
+ */
+ve.init.Target.prototype.setMode = function ( mode ) {
+   // Mode is not available
+   if ( this.modes.indexOf( mode ) === -1 ) {
+   if ( !this.mode ) {
+   // Use default mode if nothing has been set
+   mode = this.modes[ 0 ];
+   } else {
+   // Fail if we already have a valid mode
+   return;
+   }
+   }
+   if ( mode !== this.mode ) {
+   // The follow classes are used here:
+   // * ve-init-target-visual
+   // * ve-init-target-[modename]
+   if ( this.mode ) {
+   this.$element.removeClass( 've-init-target-' + 
this.mode );
+   }
+   this.$element.addClass( 've-init-target-' + mode );
+   this.mode = mode;
+   }
+};
+
+/**
  * Bind event handlers to target and document
  */
 ve.init.Target.prototype.bindHandlers = function () {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.28.0-wmf.23]: Disable hash update temporarily, to avoid polluting browser ...

2016-10-27 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: Disable hash update temporarily, to avoid polluting browser 
history
..

Disable hash update temporarily, to avoid polluting browser history

Bug: T144880
Change-Id: Id98f23a83edfe3ec2d517e3b7905ea758a34322f
(cherry picked from commit e6f63a123f4a26c0934b570875a8f19c53803cfd)
---
M modules/dialog/dialog.js
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/57/318457/1

diff --git a/modules/dialog/dialog.js b/modules/dialog/dialog.js
index fbbdc6b..e58a1cd 100644
--- a/modules/dialog/dialog.js
+++ b/modules/dialog/dialog.js
@@ -185,10 +185,6 @@
return;
}
this.map.doWhenReady( function ( ) {
-
-   if ( this.map.useRouter ) {
-   this.map.on( 'moveend', 
this.onMapMove, this );
-   }
mw.hook( 'wikipage.maps' ).fire( 
this.map, true /* isFullScreen */ );
}, this );
}, this );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id98f23a83edfe3ec2d517e3b7905ea758a34322f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: wmf/1.28.0-wmf.23
Gerrit-Owner: Yurik 
Gerrit-Reviewer: JGirault 

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Make subpage ToC still show a name for projects without a di...

2016-10-27 Thread Isarra (Code Review)
Isarra has uploaded a new change for review.

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

Change subject: Make subpage ToC still show a name for projects without a 
displayname
..

Make subpage ToC still show a name for projects without a displayname

Bug: T149033
Change-Id: I3f2c9307b2b2050dad249a97a569b0b2a6845eb7
---
M includes/content/CollaborationHubTOC.php
1 file changed, 16 insertions(+), 16 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/56/318456/1

diff --git a/includes/content/CollaborationHubTOC.php 
b/includes/content/CollaborationHubTOC.php
index e4d296c..0f018f1 100644
--- a/includes/content/CollaborationHubTOC.php
+++ b/includes/content/CollaborationHubTOC.php
@@ -38,11 +38,11 @@
 * @param $colour string variable from collaborationhub content
 * @return string html
 */
-   public function renderToC( $content, $colour ) {
-   $html = Html::openElement( 'div', [ 'class' => 
'wp-toc-container' ] );
+   public function renderToC( $content ) {
+   $html = Html::openElement( 'div', [ 'class' => 
'mw-ck-toc-container' ] );
$html .= Html::rawElement(
'div',
-   [ 'class' => 'toc-label' ],
+   [ 'class' => 'mw-ck-toc-label' ],
wfMessage( 'collaborationkit-hub-toc-label' 
)->inContentLanguage()->text()
);
$html .= Html::openElement( 'ul' );
@@ -60,11 +60,11 @@
$linkTarget = Title::newFromText( '#' . 
$this->getToCLinkID( $displayTitle ) );
$image = isset( $item['image'] ) ? $item['image'] : 
$displayTitle;
 
-   $link = $this->renderItem( $linkTarget, $displayTitle, 
$image, $colour, 50 );
+   $link = $this->renderItem( $linkTarget, $displayTitle, 
$image, 50 );
 
$html .= Html::rawElement(
'li',
-   [ 'class' => 'wp-toc-item' ],
+   [ 'class' => 'mw-ck-toc-item' ],
$link
);
}
@@ -88,13 +88,13 @@
$colour = $content->getThemeColour();
$image = $content->getImage();
 
-   $html = Html::openElement( 'div', [ 'class' => 
"mw-cktheme-$colour" ] );
-   $html .= Html::openElement( 'div', [ 'class' => 
"wp-subpage-toc" ] );
+   $html = Html::openElement( 'div', [ 'class' => 
"mw-ck-theme-$colour" ] );
+   $html .= Html::openElement( 'div', [ 'class' => 
"mw-ck-subpage-toc" ] );
 
// ToC label
$html .= Html::rawElement(
'div',
-   [ 'class' => 'toc-label' ],
+   [ 'class' => 'mw-ck-toc-label' ],
Html::rawElement(
'span',
[],
@@ -103,15 +103,16 @@
);
 
// hubpage
-   $link = $this->renderItem( $title, $content->getDisplayName(), 
$image, $colour, 16 );
+   $name = $content->getDisplayName() == '' ? $title->getText() : 
$content->getDisplayName();
+   $link = $this->renderItem( $title, $name, $image, 16 );
$html .= Html::rawElement(
'div',
-   [ 'class' => 'toc-subpage-hub' ],
+   [ 'class' => 'mw-ck-toc-subpage-hub' ],
$link
);
 
// Contents
-   $html .= Html::openElement( 'ul', [ 'class' => 'toc-contents' ] 
);
+   $html .= Html::openElement( 'ul', [ 'class' => 
'mw-ck-toc-contents' ] );
 
foreach ( $content->getContent() as $item ) {
$itemTitle = Title::newFromText( $item['title'] );
@@ -127,7 +128,7 @@
 
$html .= Html::rawElement(
'li',
-   [ 'class' => 'wp-toc-item' ],
+   [ 'class' => 'mw-ck-toc-item' ],
$itemLink
);
}
@@ -143,19 +144,18 @@
 * @param $title Title for target
 * @param $text string diplay text for title
 * @param $image string seed for makeIconOrImage
-* @param $imageColour string colour id
 * @param $imageSize int size
 * @return string html
 */
-   protected function renderItem( Title $title, $text, $image, 
$imageColour, $imageSize ) {
+   protected function renderItem( Title $title, $text, $image, $imageSize 
) {
$linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
 
-   $icon = CollaborationKitI

[MediaWiki-commits] [Gerrit] operations/dns[master]: delete virt1000.wikimedia.org

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

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

Change subject: delete virt1000.wikimedia.org
..

delete virt1000.wikimedia.org

Change-Id: Ia90fd14c8d522b0c06cdcf6ca2eceec0ca05bc3e
---
M templates/154.80.208.in-addr.arpa
M templates/wikimedia.org
2 files changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/55/318455/1

diff --git a/templates/154.80.208.in-addr.arpa 
b/templates/154.80.208.in-addr.arpa
index 4f853f4..a170a6d 100644
--- a/templates/154.80.208.in-addr.arpa
+++ b/templates/154.80.208.in-addr.arpa
@@ -26,7 +26,7 @@
 15  1H  IN PTR  sodium.wikimedia.org.
 16  1H  IN PTR  ms1001.wikimedia.org.
 17  1H  IN PTR  contint1001.wikimedia.org.
-18  1H  IN PTR  virt1000.wikimedia.org.
+
 20  1H  IN PTR  labs-recursor1.wikimedia.org.
 39  1H  IN PTR  radium.wikimedia.org.
 
diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index 7fdba7c..4768ebb 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -199,7 +199,6 @@
 ununpentium 1H  IN A208.80.154.84
 uranium 1H  IN A208.80.154.53
 1H  IN  2620:0:861:1:208:80:154:53
-virt10001H  IN A208.80.154.18
 
 
 ; Service aliases

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia90fd14c8d522b0c06cdcf6ca2eceec0ca05bc3e
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Dzahn 

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: API: Use ::class PHP feature

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

Change subject: API: Use ::class PHP feature
..


API: Use ::class PHP feature

Change-Id: Ic57cde6098b2a04e76186c75d621ade75de04180
---
M ApiVisualEditor.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index ad19fe7..63b374c 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -40,7 +40,7 @@
// the params array to create the service object with
$params = [];
// the VRS class to use, defaults to Parsoid
-   $class = 'ParsoidVirtualRESTService';
+   $class = ParsoidVirtualRESTService::class;
$config = $this->veConfig;
// the global virtual rest service config object, if any
$vrs = $this->getConfig()->get( 'VirtualRestConfig' );
@@ -48,7 +48,7 @@
// if restbase is available, use it
$params = $vrs['modules']['restbase'];
$params['parsoidCompat'] = false; // backward 
compatibility
-   $class = 'RestbaseVirtualRESTService';
+   $class = RestbaseVirtualRESTService::class;
} elseif ( isset( $vrs['modules'] ) && isset( 
$vrs['modules']['parsoid'] ) ) {
// there's a global parsoid config, use it next
$params = $vrs['modules']['parsoid'];

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

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

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


[MediaWiki-commits] [Gerrit] operations/dns[master]: repeat hostname for AAAA (tegmen, einsteinium, uranium)

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

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

Change subject: repeat hostname for  (tegmen,einsteinium,uranium)
..

repeat hostname for  (tegmen,einsteinium,uranium)

Change-Id: I534b3c51c438dab2fc7291827df0a26fa4a7e2a4
---
M templates/wikimedia.org
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/54/318454/1

diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index 7fdba7c..f2005b3 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -120,7 +120,7 @@
 eeden   1H  IN A91.198.174.121
 1H  IN  2620:0:862:1:91:198:174:121
 einsteinium 1H  IN A208.80.155.119
-1H  IN  2620:0:861:4:208:80:155:119
+einsteinium 1H  IN  2620:0:861:4:208:80:155:119
 fermium 1H  IN A208.80.154.74 ; VM on the ganeti01.svc.eqiad.wmnet 
cluster
 fermium 1H  IN  2620:0:861:3:208:80:154:74
 frdata-eqiad  1H  IN A208.80.155.10
@@ -194,11 +194,11 @@
 silver  1H  IN A208.80.154.136
 silver  1H  IN  2620:0:861:2:208:80:154:136
 tegmen  1H  IN A208.80.153.74
-1H  IN  2620:0:860:3:208:80:153:74
+tegmen  1H  IN  2620:0:860:3:208:80:153:74
 tellurium   1H  IN A208.80.155.9
 ununpentium 1H  IN A208.80.154.84
 uranium 1H  IN A208.80.154.53
-1H  IN  2620:0:861:1:208:80:154:53
+uranium 1H  IN  2620:0:861:1:208:80:154:53
 virt10001H  IN A208.80.154.18
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I534b3c51c438dab2fc7291827df0a26fa4a7e2a4
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Dzahn 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Change .tocnumber to use grey text for section numbers in Ta...

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

Change subject: Change .tocnumber to use grey text for section numbers in Table 
of Contents boxes
..


Change .tocnumber to use grey text for section numbers in Table of Contents 
boxes

Bug: T125317
Change-Id: I67297648e6c29d34cc4d76365f4b14d9869dead4
---
M resources/src/mediawiki.skinning/content.css
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/resources/src/mediawiki.skinning/content.css 
b/resources/src/mediawiki.skinning/content.css
index e6f92a5..b123562 100644
--- a/resources/src/mediawiki.skinning/content.css
+++ b/resources/src/mediawiki.skinning/content.css
@@ -99,8 +99,8 @@
 .tocnumber {
padding-left: 0;
padding-right: 0.5em;
+   color: #222;
 }
-
 /* @noflip */
 .mw-content-ltr .tocnumber {
padding-left: 0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I67297648e6c29d34cc4d76365f4b14d9869dead4
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Devirk 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Aklapper 
Gerrit-Reviewer: Edokter 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Praveenraj 
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...Kartographer[master]: Disable hash update temporarily, to avoid polluting browser ...

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

Change subject: Disable hash update temporarily, to avoid polluting browser 
history
..


Disable hash update temporarily, to avoid polluting browser history

Bug: T144880
Change-Id: Id98f23a83edfe3ec2d517e3b7905ea758a34322f
---
M modules/dialog/dialog.js
1 file changed, 0 insertions(+), 4 deletions(-)

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



diff --git a/modules/dialog/dialog.js b/modules/dialog/dialog.js
index fbbdc6b..e58a1cd 100644
--- a/modules/dialog/dialog.js
+++ b/modules/dialog/dialog.js
@@ -185,10 +185,6 @@
return;
}
this.map.doWhenReady( function ( ) {
-
-   if ( this.map.useRouter ) {
-   this.map.on( 'moveend', 
this.onMapMove, this );
-   }
mw.hook( 'wikipage.maps' ).fire( 
this.map, true /* isFullScreen */ );
}, this );
}, this );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id98f23a83edfe3ec2d517e3b7905ea758a34322f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: JGirault 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix bug in Namespace to legacy string conversion

2016-10-27 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Fix bug in Namespace to legacy string conversion
..

Fix bug in Namespace to legacy string conversion

Fix capitalization bug in Namespace to legacy string conversion and add
test. When converting a non-main Namespace to a legacy string, the
expected result is sentence case with underscores. For example, "Talk"
or "Gadget_definition". Fix a state bug causing the result to be fully
capitalized like "TALK" or "GADGET_DEFINITION".

Change-Id: I383f5728cfb551181d0ba9e41657863ce7cda9f4
---
M app/src/main/java/org/wikipedia/page/Namespace.java
A app/src/test/java/org/wikipedia/page/NamespaceTest.java
2 files changed, 86 insertions(+), 1 deletion(-)


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

diff --git a/app/src/main/java/org/wikipedia/page/Namespace.java 
b/app/src/main/java/org/wikipedia/page/Namespace.java
index c8eacec..21ee1ba 100644
--- a/app/src/main/java/org/wikipedia/page/Namespace.java
+++ b/app/src/main/java/org/wikipedia/page/Namespace.java
@@ -78,7 +78,7 @@
 public String toLegacyString() {
 String string = this == MAIN ? null : this.name();
 if (string != null) {
-StringUtil.capitalizeFirstChar(string.toLowerCase());
+string = StringUtil.capitalizeFirstChar(string.toLowerCase());
 }
 return string;
 }
diff --git a/app/src/test/java/org/wikipedia/page/NamespaceTest.java 
b/app/src/test/java/org/wikipedia/page/NamespaceTest.java
new file mode 100644
index 000..06753f8
--- /dev/null
+++ b/app/src/test/java/org/wikipedia/page/NamespaceTest.java
@@ -0,0 +1,85 @@
+package org.wikipedia.page;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.wikipedia.dataclient.WikiSite;
+import org.wikipedia.test.TestRunner;
+
+import java.util.Locale;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.nullValue;
+import static org.wikipedia.page.Namespace.FILE;
+import static org.wikipedia.page.Namespace.MAIN;
+import static org.wikipedia.page.Namespace.MEDIA;
+import static org.wikipedia.page.Namespace.SPECIAL;
+import static org.wikipedia.page.Namespace.TALK;
+
+@RunWith(TestRunner.class) public class NamespaceTest {
+@BeforeClass public static void setUp() {
+Locale.setDefault(Locale.ENGLISH);
+}
+
+@Test public void testOf() {
+assertThat(Namespace.of(SPECIAL.code()), is(SPECIAL));
+}
+
+@Test public void testFromLegacyStringMain() {
+
assertThat(Namespace.fromLegacyString(WikiSite.forLanguageCode("test"), null), 
is(MAIN));
+}
+
+@Test public void testFromLegacyStringFile() {
+assertThat(Namespace.fromLegacyString(WikiSite.forLanguageCode("he"), 
"קובץ"), is(FILE));
+}
+
+@Test public void testFromLegacyStringSpecial() {
+assertThat(Namespace.fromLegacyString(WikiSite.forLanguageCode("lez"), 
"Служебная"), is(SPECIAL));
+}
+
+@Test public void testFromLegacyStringTalk() {
+assertThat(Namespace.fromLegacyString(WikiSite.forLanguageCode("en"), 
"stringTalk"), is(TALK));
+}
+
+@Test public void testCode() {
+assertThat(MAIN.code(), is(0));
+assertThat(TALK.code(), is(1));
+}
+
+@Test public void testSpecial() {
+assertThat(SPECIAL.special(), is(true));
+assertThat(MAIN.special(), is(false));
+}
+
+@Test public void testMain() {
+assertThat(MAIN.main(), is(true));
+assertThat(TALK.main(), is(false));
+}
+
+@Test public void testFile() {
+assertThat(FILE.file(), is(true));
+assertThat(MAIN.file(), is(false));
+}
+
+@Test public void testTalkNegative() {
+assertThat(MEDIA.talk(), is(false));
+assertThat(SPECIAL.talk(), is(false));
+}
+
+@Test public void testTalkZero() {
+assertThat(MAIN.talk(), is(false));
+}
+
+@Test public void testTalkOdd() {
+assertThat(TALK.talk(), is(true));
+}
+
+@Test public void testToLegacyStringMain() {
+assertThat(MAIN.toLegacyString(), nullValue());
+}
+
+@Test public void testToLegacyStringNonMain() {
+assertThat(TALK.toLegacyString(), is("Talk"));
+}
+}
\ No newline at end of file

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: osm: move files/osm/tuning.conf to module

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

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

Change subject: osm: move files/osm/tuning.conf to module
..

osm: move files/osm/tuning.conf to module

Change-Id: Ia8eddcacbea0c61baef39905b3b3457aea035eb3
---
R modules/osm/files/tuning.conf
M modules/role/manifests/osm/common.pp
2 files changed, 1 insertion(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/53/318453/1

diff --git a/files/osm/tuning.conf b/modules/osm/files/tuning.conf
similarity index 100%
rename from files/osm/tuning.conf
rename to modules/osm/files/tuning.conf
diff --git a/modules/role/manifests/osm/common.pp 
b/modules/role/manifests/osm/common.pp
index dfbb054..5349ee0 100644
--- a/modules/role/manifests/osm/common.pp
+++ b/modules/role/manifests/osm/common.pp
@@ -8,10 +8,7 @@
 owner  => 'root',
 group  => 'root',
 mode   => '0444',
-# move to a module?
-# lint:ignore:puppet_url_without_modules
-source => 'puppet:///files/osm/tuning.conf',
-# lint:endignore
+source => 'puppet:///modules/osm/tuning.conf',
 }
 
 sysctl::parameters { 'postgres_shmem':

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: delete keys in files/ppa/

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

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

Change subject: delete keys in files/ppa/
..

delete keys in files/ppa/

I don't see any of these key files used in manifests.
Or where are they used?

Change-Id: Ifff6244da8df28ad7edc22f14b8b44ec95a6aefc
---
D files/ppa/2085FE8D.key
D files/ppa/2A2356C9.key
D files/ppa/3D1B4472.key
D files/ppa/AA8F5DAB.key
4 files changed, 0 insertions(+), 50 deletions(-)


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

diff --git a/files/ppa/2085FE8D.key b/files/ppa/2085FE8D.key
deleted file mode 100644
index a64ae3b..000
--- a/files/ppa/2085FE8D.key
+++ /dev/null
@@ -1,12 +0,0 @@
--BEGIN PGP PUBLIC KEY BLOCK-
-Version: SKS 1.0.10
-
-mI0ETTQqsgEEAKw4CQlBUH/RBNJCxkDDRirYEJO2nccX49jYBF1MOMTNkVejMP6UbNzRksse
-IIjZMcriuQiqmjq1qYJ8JXx5vrakAUALZRIM851m3CD1w/2waoYZNmUlfdtfeME5ny50rGz5
-FXFfKZrXfg4IMQdTYC7lq+oL1JLjzjVdFnQ4iOrxABEBAAG0HUxhdW5jaHBhZCBQUEEgZm9y
-IEdsYW5jZSBDb3JliLgEEwECACIFAk00KrICGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheA
-AAoJEK3PShoghf6N/A4EAJG3VPu5JX9WXnM0Np6GtAv4k1T3W1DqpyxhsoVlzfAbqVOLvQN+
-vb7E4lOekvvB66YXOPr7HbKFETgaLmqo5o1NoGc1IYg1XTwlGFB1aLP0KLKxNCsnworDKMcF
-+X2fgZoWqR1voprXckB+fVIVFMb0lof+A9bqMANegEMtrhdl
-=DfOR
--END PGP PUBLIC KEY BLOCK-
diff --git a/files/ppa/2A2356C9.key b/files/ppa/2A2356C9.key
deleted file mode 100644
index a6e880f..000
--- a/files/ppa/2A2356C9.key
+++ /dev/null
@@ -1,12 +0,0 @@
--BEGIN PGP PUBLIC KEY BLOCK-
-Version: SKS 1.0.10
-
-mI0ETD/6ogEEAK8f9PI2Kbo5HVjECg90+mQTzflD6ApY5ahT9NE+G5LYjvNRYMUInZp9OB7G
-KwfFye3Cek5XxFG5QehTQfl5WPKgw+kyLqxGS82oPO1NbpAnDgY/+OeNJL+LzAZc+MkQJd4f
-FH9CUnVg3yGg8hR9sV05MtOrhqDU1qDVmXTQxCLJABEBAAG0F0xhdW5jaHBhZCBOb3ZhIFBh
-Y2thZ2VziLYEEwECACAFAkw/+qICGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRAeuj03
-KiNWyYQXBACQicvIZ25lsYR93QRBlc0siBoc6ZI7i8vD0BNEz760o4eYmtTIDYXjUqAIt4+l
-LKrJtIdYaxmHuEThLhkxnmwUTygkKwW+/i2mxNBLDhY6EwNHPKHUkR6qqgP/2uzHbqYmx1R+
-oyWH/V4z8J977xV/FJ37TraD3AJfnfeZRw71Gg==
-=+1Wm
--END PGP PUBLIC KEY BLOCK-
diff --git a/files/ppa/3D1B4472.key b/files/ppa/3D1B4472.key
deleted file mode 100644
index 979a04b..000
--- a/files/ppa/3D1B4472.key
+++ /dev/null
@@ -1,12 +0,0 @@
--BEGIN PGP PUBLIC KEY BLOCK-
-Version: SKS 1.0.10
-
-mI0ETe+FMQEEALsSsqhs28qhedNb46WOPe56cTcbd4Ozvq5w3a+CCP2YXpHpwPbRZJB4n/8u
-Xs9MI2oxP83DX65vfhMD+yFGh4aPMQNKO0tkTwoX3ouHw1F5IOvsk1kmeCHvxBkkgsOHpvYP
-psswT8VfmotVmMdzBunqeJmIkPCdw7op7VzCmMgnABEBAAG0KExhdW5jaHBhZCBQUEEgZm9y
-IE9wZW5TdGFjayByZWxlYXNlIHRlYW2IuAQTAQIAIgUCTe+FMQIbAwYLCQgHAwIGFQgCCQoL
-BBYCAwECHgECF4AACgkQfSHC7D0bRHIWGAP/WYXu6yZFmQLbV7Xl01YQH49jUkaKNn2Akc/X
-oGkHj4NZlS/byRqZC5p4lP58RgaQ5w7wZyFyjAe3q8UTK3Bq7uGnMDWOfvNNUApKsViOGkVE
-nJ747MA1MpHuJfx6VuNy7mcNRX+fhcscFQKaQQeBxj9leXYPr8clJAaqZ3Dnc5o=
-=RxF5
--END PGP PUBLIC KEY BLOCK-
diff --git a/files/ppa/AA8F5DAB.key b/files/ppa/AA8F5DAB.key
deleted file mode 100644
index 394eb9c..000
--- a/files/ppa/AA8F5DAB.key
+++ /dev/null
@@ -1,14 +0,0 @@
--BEGIN PGP PUBLIC KEY BLOCK-
-Version: GnuPG v1.4.11 (GNU/Linux)
-
-mI0ET0tiawEEAOBJv3hnX+BgdsRzSrbLbcIZ8/ViGE+hP+0znB40PNobJ1izPCah
-9dKAw88oAvSvYmu0s/4YARBbHDtpMiLuNFYD2yXT2Z44HI2VTXEjUpGsDdNLo20G
-l5JMG1F/azyyjRGlUL1UHBsfEi0LC2w29glKjUGxDL7//0Y/muZCwOd9ABEBAAG0
-K0xhdW5jaHBhZCBQUEEgZm9yIE9wZW5TdGFjayBQUEEgbWFpbnRhaW5lcnOIuAQT
-AQIAIgUCT0tiawIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQoYakrqqP
-XauHzgP/TNk+ztxixp7Gt/Me/2r9FJ+MSb4dTphuWHa8dQPTeBZokK7zjz406ux9
-TMmTUAJwaZ4UR4+a+p696YixRQqPW0Pi24zNxPYDJIqT8DB+x5JA8PnzXBSVVGsv
-s83hFmLjmg5y4Y3Ej27I7k/VhAbsRhTBV+Lh3OI9JSGZplyyOLU=
-=g6id
--END PGP PUBLIC KEY BLOCK-
-

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mv snaprotate.pl from files/backup/ to backup module

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

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

Change subject: mv snaprotate.pl from files/backup/ to backup module
..

mv snaprotate.pl from files/backup/ to backup module

Change-Id: I4eb808dc5d3706542196ac0ab84d41ce3036b2d4
---
R modules/backup/files/snaprotate.pl
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/files/backup/snaprotate.pl b/modules/backup/files/snaprotate.pl
similarity index 100%
rename from files/backup/snaprotate.pl
rename to modules/backup/files/snaprotate.pl

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Openstack: typo fix

2016-10-27 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Openstack:  typo fix
..


Openstack:  typo fix

Change-Id: Ie473088cc25c88763808e051da9916045bd0c711
---
M modules/openstack/manifests/horizon/service.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/openstack/manifests/horizon/service.pp 
b/modules/openstack/manifests/horizon/service.pp
index 0b7c18b..22245ea 100644
--- a/modules/openstack/manifests/horizon/service.pp
+++ b/modules/openstack/manifests/horizon/service.pp
@@ -144,7 +144,7 @@
 #  https://bugs.launchpad.net/django-openstack-auth/+bug/1562452
 # and also to implement the 'rememberme' checkbox
 file { '/usr/lib/python2.7/dist-packages/openstack_auth/backend.py':
-source  => 
"puppet:///modules/openstack/${openstack_version}/horizon/openstack_auth/backened.py",
+source  => 
"puppet:///modules/openstack/${openstack_version}/horizon/openstack_auth/backend.py",
 owner   => 'root',
 group   => 'root',
 require => Package['python-openstack-auth'],

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: SECURITY: Check that the loginwiki account is attached when ...

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

Change subject: SECURITY: Check that the loginwiki account is attached when 
logging in
..


SECURITY: Check that the loginwiki account is attached when logging in

For Special:CentralAutoLogin/checkLoggedIn, we make sure the loginwiki
user is attached. For good measure, the same is done in /validateSession
and /refreshCookies even though we shouldn't have gotten to this point
if it isn't. We don't do it for the edge wiki in /createSession or
/setCookies for reasons already explained in the comment on line 435.

For Special:CentralLogin/start, we now raise an error if the local
loginwiki account exists but isn't attached. If it doesn't exist
locally, we don't error because we assume it'll be auto-created later.

For Special:CentralLogin/complete, we check that the local edge wiki
account is attached too, even though we shouldn't have gotten to this
point if it isn't.

Bug: T137551
Change-Id: Ib2018d13ced726b6d7416fce0502d678a123f638
---
M includes/specials/SpecialCentralAutoLogin.php
M includes/specials/SpecialCentralLogin.php
2 files changed, 18 insertions(+), 2 deletions(-)

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



diff --git a/includes/specials/SpecialCentralAutoLogin.php 
b/includes/specials/SpecialCentralAutoLogin.php
index 4befd4c..ea65157 100644
--- a/includes/specials/SpecialCentralAutoLogin.php
+++ b/includes/specials/SpecialCentralAutoLogin.php
@@ -166,7 +166,7 @@
 
CentralAuthUtils::setP3P();
$centralUser = CentralAuthUser::getInstance( 
$this->getUser() );
-   if ( $centralUser && $centralUser->getId() ) {
+   if ( $centralUser && $centralUser->getId() && 
$centralUser->isAttached() ) {
$centralSession = $this->getCentralSession( 
$centralUser, $this->getUser() );
 
// Refresh 'remember me' preference
@@ -253,6 +253,15 @@
// We're pretty sure this user is logged in, so pass 
back
// headers to prevent caching, just in case
$this->getOutput()->enableClientCache( false );
+
+   // Sanity check: If the loginwiki account isn't 
attached, things are broken (T137551)
+   if ( !$centralUser->isAttached() ) {
+   $this->doFinalOutput( false,
+   'Account on central wiki is not 
attached (this shouldn\'t happen)',
+   self::getInlineScript( 'anon-set.js' )
+   );
+   return;
+   }
 
$memcData = array( 'gu_id' => $centralUser->getId() );
$token = MWCryptRand::generateHex( 32 );
@@ -365,6 +374,7 @@
$memcData['wikiid'] !== $wikiid ||
!$centralUser ||
!$centralUser->getId() ||
+   !$centralUser->isAttached() ||
$memcData['gu_id'] != $centralUser->getId()
) {
$this->doFinalOutput( false, 'Invalid 
parameters' );
diff --git a/includes/specials/SpecialCentralLogin.php 
b/includes/specials/SpecialCentralLogin.php
index 77ae66e..e5c9a88 100644
--- a/includes/specials/SpecialCentralLogin.php
+++ b/includes/specials/SpecialCentralLogin.php
@@ -74,11 +74,14 @@
return;
}
 
-   $centralUser = CentralAuthUser::getInstanceByName( 
$info['name'] );
+   $user = User::newFromName( $info['name'] );
+   $centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->exists() ) { // sanity
throw new Exception( "Global user '{$info['name']}' 
does not exist." );
} elseif ( $centralUser->getId() !== $info['guid'] ) { // sanity
throw new Exception( "Global user does not have ID 
'{$info['guid']}'." );
+   } elseif ( !$centralUser->isAttached() && !$user->isAnon() ) { 
// sanity
+   throw new Exception( "User '{$info['name']}' exists 
locally but is not attached." );
}
 
$session = CentralAuthUtils::getCentralSession();
@@ -201,6 +204,9 @@
}
$centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->getId() ) { // sanity
+   throw new Exception( "The central user account does not 
exist." );
+   }
+   if ( !$centralUser->isAttached() ) { // sanity
throw new Exception( "The user account is not 
attached." );
}
 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Openstack: typo fix

2016-10-27 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Openstack:  typo fix
..

Openstack:  typo fix

Change-Id: Ie473088cc25c88763808e051da9916045bd0c711
---
M modules/openstack/manifests/horizon/service.pp
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/openstack/manifests/horizon/service.pp 
b/modules/openstack/manifests/horizon/service.pp
index 0b7c18b..22245ea 100644
--- a/modules/openstack/manifests/horizon/service.pp
+++ b/modules/openstack/manifests/horizon/service.pp
@@ -144,7 +144,7 @@
 #  https://bugs.launchpad.net/django-openstack-auth/+bug/1562452
 # and also to implement the 'rememberme' checkbox
 file { '/usr/lib/python2.7/dist-packages/openstack_auth/backend.py':
-source  => 
"puppet:///modules/openstack/${openstack_version}/horizon/openstack_auth/backened.py",
+source  => 
"puppet:///modules/openstack/${openstack_version}/horizon/openstack_auth/backend.py",
 owner   => 'root',
 group   => 'root',
 require => Package['python-openstack-auth'],

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Use upstream Target#setMode functionality

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

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

Change subject: Use upstream Target#setMode functionality
..

Use upstream Target#setMode functionality

Change-Id: I2fcda6ca7d82d880101d9ba2a027d4ef066aa238
Depends-On: I9d501cb77c714fbd299b5816d302b0bdde7833cd
---
M modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
2 files changed, 13 insertions(+), 14 deletions(-)


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

diff --git a/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css 
b/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css
index 2c5b4e0..9065a74 100644
--- a/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css
+++ b/modules/ve-mw/init/styles/ve.init.mw.DesktopArticleTarget.css
@@ -51,7 +51,7 @@
text-decoration: none;
 }
 
-.ve-init-mw-articleTarget-source .catlinks {
+.ve-init-target-source .catlinks {
display: none;
 }
 
diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 
b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
index d7635d0..996f3d2 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
@@ -39,7 +39,6 @@
this.pageName = pageName;
this.pageExists = mw.config.get( 'wgRelevantArticleId', 0 ) !== 0;
this.toolbarScrollOffset = mw.config.get( 
'wgVisualEditorToolbarScrollOffset', 0 );
-   this.mode = config.mode || 'visual';
this.section = null;
 
// Sometimes we actually don't want to send a useful oldid
@@ -165,6 +164,11 @@
 /**
  * @inheritdoc
  */
+ve.init.mw.ArticleTarget.static.modes = [ 'visual', 'source' ];
+
+/**
+ * @inheritdoc
+ */
 ve.init.mw.ArticleTarget.static.name = 'article';
 
 /**
@@ -189,19 +193,14 @@
 /* Methods */
 
 /**
- * Set editing mode
- *
- * @param {string} mode Editing mode, 'visual' or 'source'
+ * @inheritdoc
  */
-ve.init.mw.ArticleTarget.prototype.setMode = function ( mode ) {
-   if ( mode !== this.mode ) {
-   // The follow classes are used here:
-   // * ve-init-mw-articleTarget-visual
-   // * ve-init-mw-articleTarget-source
-   this.$element
-   .removeClass( 've-init-mw-articleTarget-' + this.mode )
-   .addClass( 've-init-mw-articleTarget-' + mode );
-   this.mode = mode;
+ve.init.mw.ArticleTarget.prototype.setMode = function () {
+   var oldMode = this.mode;
+   // Parent method
+   ve.init.mw.ArticleTarget.super.prototype.setMode.apply( this, arguments 
);
+
+   if ( this.mode !== oldMode ) {
this.updateTabs( true );
}
 };

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fcda6ca7d82d880101d9ba2a027d4ef066aa238
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] VisualEditor/VisualEditor[master]: Bring in target 'mode' property from MW

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

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

Change subject: Bring in target 'mode' property from MW
..

Bring in target 'mode' property from MW

Part of upstreaming visual/source switching.

Change-Id: I9d501cb77c714fbd299b5816d302b0bdde7833cd
---
M src/init/ve.init.Target.js
1 file changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/47/318447/1

diff --git a/src/init/ve.init.Target.js b/src/init/ve.init.Target.js
index c3327c2..2db4778 100644
--- a/src/init/ve.init.Target.js
+++ b/src/init/ve.init.Target.js
@@ -15,6 +15,7 @@
  * @constructor
  * @param {Object} [config] Configuration options
  * @cfg {Object} [toolbarConfig] Configuration options for the toolbar
+ * @cfg {Object} [mode='visual'] Initial editing mode. Must be in static.modes.
  */
 ve.init.Target = function VeInitTarget( config ) {
config = config || {};
@@ -36,6 +37,8 @@
this.toolbarConfig = config.toolbarConfig;
this.$scrollContainer = this.getScrollContainer();
this.toolbarScrollOffset = 0;
+
+   this.setMode( config.mode || 'visual' );
 
this.setupTriggerListeners();
 
@@ -66,6 +69,15 @@
 OO.mixinClass( ve.init.Target, OO.EventEmitter );
 
 /* Static Properties */
+
+/**
+ * Editing modes available in the target
+ *
+ * @static
+ * @property {string[]}
+ * @inheritable
+ */
+ve.init.Target.static.modes = [ 'visual' ];
 
 ve.init.Target.static.toolbarGroups = [
// History
@@ -178,6 +190,27 @@
 /* Methods */
 
 /**
+ * Set editing mode
+ *
+ * @param {string} mode Editing mode, see static.modes
+ */
+ve.init.Target.prototype.setMode = function ( mode ) {
+   if ( this.constructor.static.modes.indexOf( mode ) === -1 ) {
+   return;
+   }
+   if ( mode !== this.mode ) {
+   // The follow classes are used here:
+   // * ve-init-target-visual
+   // * ve-init-target-[modename]
+   if ( this.mode ) {
+   this.$element.removeClass( 've-init-target-' + 
this.mode );
+   }
+   this.$element.addClass( 've-init-target-' + mode );
+   this.mode = mode;
+   }
+};
+
+/**
  * Bind event handlers to target and document
  */
 ve.init.Target.prototype.bindHandlers = function () {

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add user faidon to analytics-privatedata-users

2016-10-27 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has submitted this change and it was merged.

Change subject: Add user faidon to analytics-privatedata-users
..


Add user faidon to analytics-privatedata-users

Already a member of a higher-privileged group (root), and thus this
isn't an access elevation that requires approval. This is just to make
HDFS happy.

Change-Id: I42cc55d3d3b51fe80b96ad93c2940bac80a96645
---
M modules/admin/data/data.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Faidon Liambotis: Verified; Looks good to me, approved



diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 450a537..996b611 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -231,7 +231,7 @@
   dcausse, bd808, tjones, mobrovac, jgirault, jdrewniak, ejegg, 
jdcc, ori,
   bmansurov, atgomez, amire80, kartik, pcoombe, foks, mpany, 
hjiang, jsamra, bcohn,
   jdlrobson, chelsyx, ovasileva, mtizzoni, panisson, paolotti, 
ciro,
-  psinger, flemmerich, mkroetzsch, akrausetud, filippo, nschaaf, 
pmiazga]
+  psinger, flemmerich, mkroetzsch, akrausetud, filippo, nschaaf, 
pmiazga, faidon]
   analytics-admins:
 gid: 732
 description: Admin access to analytics cluster.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I42cc55d3d3b51fe80b96ad93c2940bac80a96645
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Faidon Liambotis 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Move CI scripts into version control

2016-10-27 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Move CI scripts into version control
..

Move CI scripts into version control

Copy over the shell commands from CI[0,1,2] to the Android repo. This
will allow us to version the scripts, easily change them without much CI
knowledge, and easily reference them without a Jenkins login. A
subsequent patch in the integration config repo will update the Jenkins
console commands to reference these scripts.

[0] 
https://integration.wikimedia.org/ci/job/apps-android-wikipedia-test/configure
[1] 
https://integration.wikimedia.org/ci/job/apps-android-wikipedia-periodic-test/configure
[2] 
https://integration.wikimedia.org/ci/job/apps-android-wikipedia-lint/configure

Change-Id: Id365caf945087f1a73107c36f95762881cea57fe
---
A scripts/apps-android-wikipedia-lint
A scripts/apps-android-wikipedia-periodic-test
A scripts/apps-android-wikipedia-test
3 files changed, 14 insertions(+), 0 deletions(-)


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

diff --git a/scripts/apps-android-wikipedia-lint 
b/scripts/apps-android-wikipedia-lint
new file mode 100755
index 000..58b4ca6
--- /dev/null
+++ b/scripts/apps-android-wikipedia-lint
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+./gradlew -q clean lintAlphaDebug
\ No newline at end of file
diff --git a/scripts/apps-android-wikipedia-periodic-test 
b/scripts/apps-android-wikipedia-periodic-test
new file mode 100755
index 000..e5d378e
--- /dev/null
+++ b/scripts/apps-android-wikipedia-periodic-test
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+./gradlew clean testAllAlphaRelease 
-Pandroid.testInstrumentationRunnerArguments.size=small
+scripts/diff-screenshots
\ No newline at end of file
diff --git a/scripts/apps-android-wikipedia-test 
b/scripts/apps-android-wikipedia-test
new file mode 100755
index 000..347e525
--- /dev/null
+++ b/scripts/apps-android-wikipedia-test
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+scripts/missing-qq.py
+./gradlew clean checkstyle assembleAlphaRelease testAlphaRelease 
compileAlphaReleaseAndroidTestSources
\ No newline at end of file

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add user faidon to analytics-privatedata-users

2016-10-27 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has uploaded a new change for review.

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

Change subject: Add user faidon to analytics-privatedata-users
..

Add user faidon to analytics-privatedata-users

Already a member of a higher-privileged group (root), and thus this
isn't an access elevation that requires approval. This is just to make
HDFS happy.

Change-Id: I42cc55d3d3b51fe80b96ad93c2940bac80a96645
---
M modules/admin/data/data.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 450a537..996b611 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -231,7 +231,7 @@
   dcausse, bd808, tjones, mobrovac, jgirault, jdrewniak, ejegg, 
jdcc, ori,
   bmansurov, atgomez, amire80, kartik, pcoombe, foks, mpany, 
hjiang, jsamra, bcohn,
   jdlrobson, chelsyx, ovasileva, mtizzoni, panisson, paolotti, 
ciro,
-  psinger, flemmerich, mkroetzsch, akrausetud, filippo, nschaaf, 
pmiazga]
+  psinger, flemmerich, mkroetzsch, akrausetud, filippo, nschaaf, 
pmiazga, faidon]
   analytics-admins:
 gid: 732
 description: Admin access to analytics cluster.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42cc55d3d3b51fe80b96ad93c2940bac80a96645
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis 

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


[MediaWiki-commits] [Gerrit] operations/dns[master]: remove neon.wikimedia.org, keep neon.mgmt

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

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

Change subject: remove neon.wikimedia.org, keep neon.mgmt
..

remove neon.wikimedia.org, keep neon.mgmt

Bug: T125023
Change-Id: Ifeccc283c98f74b526ce5391576487587ccbd751
---
M templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
M templates/154.80.208.in-addr.arpa
M templates/wikimedia.org
3 files changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/44/318444/1

diff --git a/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa 
b/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
index 2e241dd..5ed03e5 100644
--- a/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
+++ b/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
@@ -32,8 +32,6 @@
 
 1.1.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR   dataset1001.wikimedia.org.
 
-4.1.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR   neon.wikimedia.org.
-
 5.1.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR   sodium.wikimedia.org.
 
 6.1.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR   ms1001.wikimedia.org.
diff --git a/templates/154.80.208.in-addr.arpa 
b/templates/154.80.208.in-addr.arpa
index 4f853f4..e2be175 100644
--- a/templates/154.80.208.in-addr.arpa
+++ b/templates/154.80.208.in-addr.arpa
@@ -22,7 +22,7 @@
 10  1H  IN PTR  carbon.wikimedia.org.
 11  1H  IN PTR  dataset1001.wikimedia.org.
 12  1H  IN PTR  labservices1002.wikimedia.org.
-14  1H  IN PTR  neon.wikimedia.org.
+
 15  1H  IN PTR  sodium.wikimedia.org.
 16  1H  IN PTR  ms1001.wikimedia.org.
 17  1H  IN PTR  contint1001.wikimedia.org.
diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index 7fdba7c..293dbab 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -169,8 +169,6 @@
 1H  IN  2620:0:860:2:208:80:153:45
 nescio  1H  IN A91.198.174.106
 1H  IN  2620:0:862:1:91:198:174:106
-neon1H  IN A208.80.154.14
-neon1H  IN  2620:0:861:1:208:80:154:14
 netmon1001  1H  IN A208.80.154.159
 netmon1001  1H  IN  2620:0:861:2:208:80:154:159
 pay-lvs1001 1H  IN A208.80.155.2

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifeccc283c98f74b526ce5391576487587ccbd751
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Dzahn 

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: SECURITY: Check that the loginwiki account is attached when ...

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

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

Change subject: SECURITY: Check that the loginwiki account is attached when 
logging in
..

SECURITY: Check that the loginwiki account is attached when logging in

For Special:CentralAutoLogin/checkLoggedIn, we make sure the loginwiki
user is attached. For good measure, the same is done in /validateSession
and /refreshCookies even though we shouldn't have gotten to this point
if it isn't. We don't do it for the edge wiki in /createSession or
/setCookies for reasons already explained in the comment on line 435.

For Special:CentralLogin/start, we now raise an error if the local
loginwiki account exists but isn't attached. If it doesn't exist
locally, we don't error because we assume it'll be auto-created later.

For Special:CentralLogin/complete, we check that the local edge wiki
account is attached too, even though we shouldn't have gotten to this
point if it isn't.

Bug: T137551
Change-Id: Ib2018d13ced726b6d7416fce0502d678a123f638
---
M includes/specials/SpecialCentralAutoLogin.php
M includes/specials/SpecialCentralLogin.php
2 files changed, 18 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/43/318443/1

diff --git a/includes/specials/SpecialCentralAutoLogin.php 
b/includes/specials/SpecialCentralAutoLogin.php
index 4befd4c..ea65157 100644
--- a/includes/specials/SpecialCentralAutoLogin.php
+++ b/includes/specials/SpecialCentralAutoLogin.php
@@ -166,7 +166,7 @@
 
CentralAuthUtils::setP3P();
$centralUser = CentralAuthUser::getInstance( 
$this->getUser() );
-   if ( $centralUser && $centralUser->getId() ) {
+   if ( $centralUser && $centralUser->getId() && 
$centralUser->isAttached() ) {
$centralSession = $this->getCentralSession( 
$centralUser, $this->getUser() );
 
// Refresh 'remember me' preference
@@ -253,6 +253,15 @@
// We're pretty sure this user is logged in, so pass 
back
// headers to prevent caching, just in case
$this->getOutput()->enableClientCache( false );
+
+   // Sanity check: If the loginwiki account isn't 
attached, things are broken (T137551)
+   if ( !$centralUser->isAttached() ) {
+   $this->doFinalOutput( false,
+   'Account on central wiki is not 
attached (this shouldn\'t happen)',
+   self::getInlineScript( 'anon-set.js' )
+   );
+   return;
+   }
 
$memcData = array( 'gu_id' => $centralUser->getId() );
$token = MWCryptRand::generateHex( 32 );
@@ -365,6 +374,7 @@
$memcData['wikiid'] !== $wikiid ||
!$centralUser ||
!$centralUser->getId() ||
+   !$centralUser->isAttached() ||
$memcData['gu_id'] != $centralUser->getId()
) {
$this->doFinalOutput( false, 'Invalid 
parameters' );
diff --git a/includes/specials/SpecialCentralLogin.php 
b/includes/specials/SpecialCentralLogin.php
index 77ae66e..e5c9a88 100644
--- a/includes/specials/SpecialCentralLogin.php
+++ b/includes/specials/SpecialCentralLogin.php
@@ -74,11 +74,14 @@
return;
}
 
-   $centralUser = CentralAuthUser::getInstanceByName( 
$info['name'] );
+   $user = User::newFromName( $info['name'] );
+   $centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->exists() ) { // sanity
throw new Exception( "Global user '{$info['name']}' 
does not exist." );
} elseif ( $centralUser->getId() !== $info['guid'] ) { // sanity
throw new Exception( "Global user does not have ID 
'{$info['guid']}'." );
+   } elseif ( !$centralUser->isAttached() && !$user->isAnon() ) { 
// sanity
+   throw new Exception( "User '{$info['name']}' exists 
locally but is not attached." );
}
 
$session = CentralAuthUtils::getCentralSession();
@@ -201,6 +204,9 @@
}
$centralUser = CentralAuthUser::getInstance( $user );
if ( !$centralUser->getId() ) { // sanity
+   throw new Exception( "The central user account does not 
exist." );
+   }
+   if ( !$centralUser->isAttached() ) { // sanity
throw new Exception( "

[MediaWiki-commits] [Gerrit] operations/puppet[production]: icinga: remove pre-jessie conditional from monitoring::group

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

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

Change subject: icinga: remove pre-jessie conditional from monitoring::group
..

icinga: remove pre-jessie conditional from monitoring::group

As the comment says, this was supposed to be temporary until
neon has been decom'ed and we only have jessie icinga hosts,
which are now einsteinium and tegmen.

Bug: T125023
Change-Id: I869a88412362aa4411f4e30ba4e3af53ade67f59
---
M modules/monitoring/manifests/group.pp
1 file changed, 17 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/42/318442/1

diff --git a/modules/monitoring/manifests/group.pp 
b/modules/monitoring/manifests/group.pp
index fb5e7ea..f7659ff 100644
--- a/modules/monitoring/manifests/group.pp
+++ b/modules/monitoring/manifests/group.pp
@@ -15,39 +15,23 @@
 $ensure=present,
 $config_dir = '/etc/nagios'
 ) {
+
 # Nagios hostgroup instance
-# TODO: Temporary, undo when neon is finally decomissioned
-if os_version('Debian >= jessie') {
-nagios_hostgroup { $title:
-ensure => $ensure,
-target => "${config_dir}/puppet_hostgroups.cfg",
-hostgroup_name => $title,
-mode   => '0444',
-alias  => $description,
-}
-
-# Nagios servicegroup instance
-nagios_servicegroup { $title:
-ensure=> $ensure,
-target=> "${config_dir}/puppet_servicegroups.cfg",
-servicegroup_name => $title,
-mode  => '0444',
-alias => $description,
-}
-} else {
-nagios_hostgroup { $title:
-ensure => $ensure,
-target => "${config_dir}/puppet_hostgroups.cfg",
-hostgroup_name => $title,
-alias  => $description,
-}
-
-# Nagios servicegroup instance
-nagios_servicegroup { $title:
-ensure=> $ensure,
-target=> "${config_dir}/puppet_servicegroups.cfg",
-servicegroup_name => $title,
-alias => $description,
-}
+nagios_hostgroup { $title:
+ensure => $ensure,
+target => "${config_dir}/puppet_hostgroups.cfg",
+hostgroup_name => $title,
+mode   => '0444',
+alias  => $description,
 }
+
+# Nagios servicegroup instance
+nagios_servicegroup { $title:
+ensure=> $ensure,
+target=> "${config_dir}/puppet_servicegroups.cfg",
+servicegroup_name => $title,
+mode  => '0444',
+alias => $description,
+}
+
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Fix missing live groups in Wikivoyage mode

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

Change subject: Fix missing live groups in Wikivoyage mode
..


Fix missing live groups in Wikivoyage mode

Bug: T148971
Change-Id: I70a97bc861d0392cf1e3716846cfc54173c6550a
---
M includes/Tag/TagHandler.php
M tests/phpunit/KartographerTest.php
2 files changed, 30 insertions(+), 23 deletions(-)

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



diff --git a/includes/Tag/TagHandler.php b/includes/Tag/TagHandler.php
index 6996a41..12119fb 100644
--- a/includes/Tag/TagHandler.php
+++ b/includes/Tag/TagHandler.php
@@ -317,12 +317,12 @@
$liveData = array_intersect_key( (array)$data, 
$interact );
$requested = array_unique( $requested );
// Prevent pointless API requests for missing 
groups
-   foreach ( $requested as $group ) {
+   foreach ( array_keys( $requested ) as $group ) {
if ( !isset( $data->$group ) ) {
$liveData[$group] = [];
}
}
-   $output->addJsConfigVars( 
'wgKartographerLiveData', $liveData );
+   $output->addJsConfigVars( 
'wgKartographerLiveData', (object)$liveData );
}
}
}
diff --git a/tests/phpunit/KartographerTest.php 
b/tests/phpunit/KartographerTest.php
index d241c9b..3bd3a69 100644
--- a/tests/phpunit/KartographerTest.php
+++ b/tests/phpunit/KartographerTest.php
@@ -39,7 +39,8 @@
 * @param string $input
 * @param string $message
 */
-   public function testTagData( $expected, $input, $message ) {
+   public function testTagData( $expected, $input, $message, 
$wikivoyageMode = false ) {
+   $this->setMwGlobals( 'wgKartographerWikivoyageMode', 
$wikivoyageMode );
$output = $this->parse( $input );
$state = State::getState( $output );
 
@@ -134,6 +135,7 @@
// Bugs
[ '[]', "\t\r\n ", 'T127345: whitespace-only tag content, 
' ],
[ $xssJsonSanitized, "$xssJson", 'T134719: XSS via __proto__' ],
+   [ '[]', '', 'T148971 - weird LiveData', 
true ],
];
}
 
@@ -173,14 +175,28 @@
 
/**
 * @dataProvider provideLiveData
+* @param string $text
 * @param string[] $expected
 * @param bool $preview
 * @param bool $sectionPreview
 */
-   public function testLiveData( array $expected, $preview, 
$sectionPreview ) {
-   $text =
-<<
+   public function testLiveData( $text, array $expected, $preview, 
$sectionPreview, $wikivoyageMode ) {
+   $this->setMwGlobals( 'wgKartographerWikivoyageMode', 
$wikivoyageMode );
+   $output = $this->parse( $text,
+   function( ParserOptions $options ) use ( $preview, 
$sectionPreview ) {
+   $options->setIsPreview( $preview );
+   $options->setIsSectionPreview( $sectionPreview 
);
+   }
+   );
+   $vars = $output->getJsConfigVars();
+   $this->assertArrayHasKey( 'wgKartographerLiveData', $vars );
+   $this->assertArrayEquals( $expected, array_keys( 
(array)$vars['wgKartographerLiveData'] ) );
+   }
+
+   public function provideLiveData() {
+   $frameAndLink =
+   <<
 {
 "type": "Feature",
 "geometry": {
@@ -199,23 +215,14 @@
 }
 
 WIKITEXT;
-   $output = $this->parse( $text,
-   function( ParserOptions $options ) use ( $preview, 
$sectionPreview ) {
-   $options->setIsPreview( $preview );
-   $options->setIsSectionPreview( $sectionPreview 
);
-   }
-   );
-   $vars = $output->getJsConfigVars();
-   $this->assertArrayHasKey( 'wgKartographerLiveData', $vars );
-   $this->assertArrayEquals( $expected, array_keys( 
(array)$vars['wgKartographerLiveData'] ) );
-   }
-
-   public function provideLiveData() {
+   $wikivoyageMaps = '';
return [
-   [ [ '_5e4843908b3c3d3b11ac4321edadedde28882cc2' ], 
false, false ],
-   [ [ '_5e4843908b3c3d3b11ac4321edadedde28882cc2', 
'_2251fa240a210d2861cc9f44c48d7e3ba116ff2f' ], true, false ],
-   [ [ '_5e4843908b3c3d3b11ac4321edadedde28882cc2', 
'_2251fa240a210d2861cc9f44c48d7e3ba116ff2f' ], false, true ],
-   [ [ '_5e4843908b3c3d3b11ac4321edadedde28882c

[MediaWiki-commits] [Gerrit] mediawiki...MixedNamespaceSearchSuggestions[master]: Fix display of namespaces in Firefox

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

Change subject: Fix display of namespaces in Firefox
..


Fix display of namespaces in Firefox

In my testing, namespaces displayed properly in Chrome but appeared on a
separate line for Firefox. Miken32 on MediaWiki made a simple patch for
this.

Change-Id: I720e1921ea3eca3f26bb51b048b60c541efd35ba
---
M resources/ext.mnss.search.less
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/resources/ext.mnss.search.less b/resources/ext.mnss.search.less
index 7b08ccc..43472e6 100644
--- a/resources/ext.mnss.search.less
+++ b/resources/ext.mnss.search.less
@@ -8,3 +8,7 @@
float: right;
font-style: italic;
 }
+
+.suggestions-result {
+   white-space: inherit;
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I720e1921ea3eca3f26bb51b048b60c541efd35ba
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MixedNamespaceSearchSuggestions
Gerrit-Branch: master
Gerrit-Owner: Jkmartindale 
Gerrit-Reviewer: Nikerabbit 
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] apps...wikipedia[master]: Add PageTitleListCardItemViewTest

2016-10-27 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Add PageTitleListCardItemViewTest
..

Add PageTitleListCardItemViewTest

Bug: T144399
Change-Id: I29ea5621f6e0e175ea4b1bd32c6ea4ac5f1126b0
---
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testFocus-480dp-en-ltr-font1.0x-dark.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testFocus-480dp-en-ltr-font1.0x-light.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testLayoutDirection-480dp-en-ltr-font1.0x-light.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testLayoutDirection-480dp-en-rtl-font1.0x-light.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testTheme-480dp-en-ltr-font1.0x-dark.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testTheme-480dp-en-ltr-font1.0x-light.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-nonnull_image-long_title-long_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-nonnull_image-long_title-null_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-nonnull_image-long_title-short_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-nonnull_image-null_title-long_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-nonnull_image-null_title-null_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-nonnull_image-null_title-short_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-nonnull_image-short_title-long_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-nonnull_image-short_title-null_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-nonnull_image-short_title-short_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_image-long_title-long_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_image-long_title-null_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_image-long_title-short_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_image-null_title-long_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_image-null_title-null_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_image-null_title-short_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_image-short_title-long_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_image-short_title-null_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.0x-light-null_image-short_title-short_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.5x-light-nonnull_image-long_title-long_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.5x-light-nonnull_image-long_title-null_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.5x-light-nonnull_image-long_title-short_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.5x-light-nonnull_image-null_title-long_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.5x-light-nonnull_image-null_title-null_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.5x-light-nonnull_image-null_title-short_subtitle.png
A 
app/screenshots-ref/org.wikipedia.feed.view.PageTitleListCardItemViewTest.testWidth-320dp-en-ltr-font1.5x-light-nonnull_image-short_title-long_subtitle.png
A 
app/scr

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: add TestStr to String helper in ViewTest

2016-10-27 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Hygiene: add TestStr to String helper in ViewTest
..

Hygiene: add TestStr to String helper in ViewTest

Change-Id: Id55360e1911aa3d6ac412c03726ee9b397193cdf
---
M app/src/androidTest/java/org/wikipedia/feed/view/CardHeaderViewTest.java
M app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java
M app/src/androidTest/java/org/wikipedia/test/view/ViewTest.java
3 files changed, 7 insertions(+), 3 deletions(-)


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

diff --git 
a/app/src/androidTest/java/org/wikipedia/feed/view/CardHeaderViewTest.java 
b/app/src/androidTest/java/org/wikipedia/feed/view/CardHeaderViewTest.java
index 37836ce..4c03afd 100644
--- a/app/src/androidTest/java/org/wikipedia/feed/view/CardHeaderViewTest.java
+++ b/app/src/androidTest/java/org/wikipedia/feed/view/CardHeaderViewTest.java
@@ -152,7 +152,7 @@
 subject = new CardHeaderView(ctx())
 .setImage(image.id())
 .setImageCircleColor(circleColor)
-.setTitle(str(title.id()))
-.setSubtitle(str(subtitle.id()));
+.setTitle(str(title))
+.setSubtitle(str(subtitle));
 }
 }
\ No newline at end of file
diff --git 
a/app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java 
b/app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java
index 0bd1b6e..75cc747 100644
--- 
a/app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java
+++ 
b/app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java
@@ -90,6 +90,6 @@
 
 subject = new CardLargeHeaderView(ctx())
 .setImage(frescoUri(image.id()))
-.setTitle(str(title.id()));
+.setTitle(str(title));
 }
 }
\ No newline at end of file
diff --git a/app/src/androidTest/java/org/wikipedia/test/view/ViewTest.java 
b/app/src/androidTest/java/org/wikipedia/test/view/ViewTest.java
index 45e6240..3373afc 100644
--- a/app/src/androidTest/java/org/wikipedia/test/view/ViewTest.java
+++ b/app/src/androidTest/java/org/wikipedia/test/view/ViewTest.java
@@ -117,6 +117,10 @@
 .build();
 }
 
+protected String str(@NonNull TestStr str, Object... formatArgs) {
+return str(str.id(), formatArgs);
+}
+
 protected String str(@StringRes int id, Object... formatArgs) {
 return id == 0 ? null : ctx().getString(id, formatArgs);
 }

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

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

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


  1   2   3   4   >