[MediaWiki-commits] [Gerrit] 525 Integrate BlueSpice-Notifications with Mediawiki Echo-Ex... - change (mediawiki...BlueSpiceSkin)

2015-11-04 Thread Lilu (Code Review)
Lilu has uploaded a new change for review.

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

Change subject: 525 Integrate BlueSpice-Notifications with Mediawiki 
Echo-Extension
..

525 Integrate BlueSpice-Notifications with Mediawiki Echo-Extension

- removed Notification extension from BlueSpiceExtensions
- introduced BSNotification in BlueSpiceFoundation
- implemented EchoNotificationHandler as first NotificationHandler for 
BSNotification (supports web- and email-notifications over the Echo extension)
- reworked ShoutBox, Review and ResponsibleEditors to use BSNotifications and 
get rid of BsMailer and the old Notification logic
- reimplemented the notifications of the old extension into BlueSpiceFoundation
- implemented hook-callback in BlueSpiceSkin to handle the notifications flyout 
of the echo extension
- moved the email formatter and decorator into BlueSpiceFoundation

Change-Id: I969adbae9b90729c832e22e633a5dd28ac29d7e1
---
M BlueSpiceSkin.php
M includes/BlueSpiceSkinHooks.php
M resources/components/extension.notifications.less
3 files changed, 28 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSpiceSkin 
refs/changes/00/251200/1

diff --git a/BlueSpiceSkin.php b/BlueSpiceSkin.php
index 0dcc054..c06c57f 100644
--- a/BlueSpiceSkin.php
+++ b/BlueSpiceSkin.php
@@ -36,6 +36,7 @@
 $wgHooks['DoEditSectionLink'][] = "BlueSpiceSkinHooks::onDoEditSectionLink";
 $wgHooks['SkinBuildSidebar'][] = 'BlueSpiceSkinHooks::onSkinBuildSidebar';
 $wgHooks['SkinTemplateNavigation::Universal'][] = 
'BlueSpiceSkinHooks::onSkinTemplateNavigationUniversal';
+$wgHooks['SkinTemplateOutputPageBeforeExec'][] = 
'BlueSpiceSkinHooks::onSkinTemplateOutputPageBeforeExec';
 
 $wgAjaxExportList[] = 'BlueSpiceSkinHooks::ajaxGetDiscussionCount';
 
diff --git a/includes/BlueSpiceSkinHooks.php b/includes/BlueSpiceSkinHooks.php
index 11fb1d6..3135413 100644
--- a/includes/BlueSpiceSkinHooks.php
+++ b/includes/BlueSpiceSkinHooks.php
@@ -164,4 +164,23 @@
}
return true;
}
+
+   public function onSkinTemplateOutputPageBeforeExec(&$sktemplate, &$tpl){
+   if (!isset($tpl->data['personal_urls']['notifications']) || 
$tpl instanceof BsBaseTemplate != true) {
+   return true;
+   }
+
+   $tpl->data['bs_personal_info'][10] = array(
+   'id' => 'pt-notifications',
+   'class' => 'icon-bell2',
+   ) + $tpl->data['personal_urls']['notifications'];
+
+   if( isset( $tpl->data['personal_urls']['notifications']['text'] 
) && $tpl->data['personal_urls']['notifications']['text'] > 0 ) {
+   $tpl->data['bs_personal_info'][10]['active'] = true;
+   }
+
+   unset($tpl->data['personal_urls']['notifications']);
+
+   return true;
+   }
 }
diff --git a/resources/components/extension.notifications.less 
b/resources/components/extension.notifications.less
index 6ed2480..8141275 100644
--- a/resources/components/extension.notifications.less
+++ b/resources/components/extension.notifications.less
@@ -45,10 +45,14 @@
 }
 div.mw-echo-overlay{
left: auto;
-   position: relative;
-   margin-left: -400px;
-   top: 18px;
+   position: absolute;
width: 420px;
+}
+.mw-echo-overlay:before, .mw-echo-overlay::before {
+   left: 200px !important;
+}
+.mw-echo-overlay-title {
+   line-height: inherit !important;
 }
 #mw-echo-overlay-footer{
display: inline-block;
@@ -71,7 +75,7 @@
 }
 
 .mw-echo-date-section {
-   margin: 20px 0px 5px 0px;
+   margin: 20px 0 5px 0;
list-style-type: none;
list-style-image: none;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I969adbae9b90729c832e22e633a5dd28ac29d7e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSpiceSkin
Gerrit-Branch: master
Gerrit-Owner: Lilu 

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


[MediaWiki-commits] [Gerrit] Add basic print styles for fixing wiki title - change (mediawiki...Blueprint)

2015-11-04 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: Add basic print styles for fixing wiki title
..

Add basic print styles for fixing wiki title

Adding a few very basic print styles for fixing the top bar containing
the title of the wiki

Bug: T115449
Change-Id: I159b4074ecbd765c10e268c2c7718ed2f8ec7657
---
M resources/master.less
1 file changed, 27 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Blueprint 
refs/changes/99/251199/1

diff --git a/resources/master.less b/resources/master.less
index ff2e1ec..7ae48d4 100644
--- a/resources/master.less
+++ b/resources/master.less
@@ -213,8 +213,8 @@
text-transform: uppercase;
font-size: 0.9em;
font-weight: 500;
-   margin-left: -15px;
-   padding-left: 40px;
+   margin-left: -2px;
+   padding-left: 27px;
padding-right: 40px;
}
 
@@ -332,3 +332,28 @@
margin-top: 1em;
padding: 0.36em;
 }
+
+
+/**
+ * Print Style Refinements on top of MW's commonPrint.css
+ */
+@media print {
+   .navbar-header {
+   float: none;
+   }
+   .navbar.navbar-fixed-top .navbar-head {
+   border-bottom: 0;
+
+   & .navbar-brand {
+   margin-left: 0;
+   padding-top: 1em;
+   }
+   }
+
+   #navbar-collapse {
+   border-bottom: 1px solid #333;
+   }
+   #navbar-right {
+   display: none;
+   }
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I159b4074ecbd765c10e268c2c7718ed2f8ec7657
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Blueprint
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] T117566: Optimize insertion of transclusion shadow meta tags - change (mediawiki...parsoid)

2015-11-04 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review.

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

Change subject: T117566: Optimize insertion of transclusion shadow meta tags
..

T117566: Optimize insertion of transclusion shadow meta tags

* These are only required to detect fostered text content from
  transclusions. However since fostering is only a concern when
  we are inside tables, no need to add them if we are not in tables.

  This should reduce the DOM size on most pages and vastly reduce
  the DOM size in some pathological scenarios like the page in the
  bug report. That page now parses in 16 seconds on my lapto
  compared to 200 seconds before.

* Updated a parser test now that the text node in that test is no
  longer split across a newline.

Change-Id: I93cca417beea7df43605eecccf24634d94e2
---
M lib/wt2html/HTML5TreeBuilder.js
M lib/wt2html/pp/markFosteredContent.js
M tests/parserTests.txt
3 files changed, 13 insertions(+), 6 deletions(-)


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

diff --git a/lib/wt2html/HTML5TreeBuilder.js b/lib/wt2html/HTML5TreeBuilder.js
index 48bfd43..e404431 100644
--- a/lib/wt2html/HTML5TreeBuilder.js
+++ b/lib/wt2html/HTML5TreeBuilder.js
@@ -62,6 +62,7 @@
this.tagId = 1;  // Assigned to start/self-closing tags
this.inTransclusion = false;
this.precededByPre = false;
+   this.tableDepth = 0; // Crude tracking of whether we are in a table
 
if (!this._treeBuilder) {
// Set up a new tree builder
@@ -147,7 +148,10 @@
data = '\n' + data;
}
this.emit('token', { type: 'Characters', data: data });
-   if (this.inTransclusion) {
+   if (this.inTransclusion && this.tableDepth > 0) {
+   // If inside a table and a transclusion, add a 
meta tag
+   // after every text node so that we can detect
+   // fostered content that came from a 
transclusion.
this.env.log("debug/html", this.pipelineId, 
"Inserting shadow transclusion meta");
this.emit('token', {
type: 'StartTag',
@@ -159,6 +163,7 @@
case TagTk:
tName = token.name;
if (tName === "table") {
+   this.tableDepth++;
// Don't add foster box in transclusion
// Avoids unnecessary insertions, the case 
where a table
// doesn't have tsr info, and the messy 
unbalanced table case,
@@ -263,6 +268,9 @@
break;
case EndTagTk:
tName = token.name;
+   if (tName === 'table') {
+   this.tableDepth--;
+   }
this.emit('token', {type: 'EndTag', name: tName});
if (dataAttribs && !dataAttribs.autoInsertedEnd) {
attrs = this._att(attribs).concat([
diff --git a/lib/wt2html/pp/markFosteredContent.js 
b/lib/wt2html/pp/markFosteredContent.js
index 43e7053..cf047b2 100644
--- a/lib/wt2html/pp/markFosteredContent.js
+++ b/lib/wt2html/pp/markFosteredContent.js
@@ -63,8 +63,8 @@
var sibling = table.nextSibling;
var beforeText;
 
-   // skip pass the table end mw:shadow and any transclusions that
-   // start inside the table. there may be newlines and comments in
+   // Skip past the table end, mw:shadow and any transclusions that
+   // start inside the table. There may be newlines and comments in
// between so keep track of that, and backtrack when necessary.
while (sibling) {
if (!DU.isTplStartMarkerMeta(sibling) && (
@@ -85,7 +85,6 @@
}
 
table.parentNode.insertBefore(e, beforeText ? beforeText : sibling);
-
 }
 
 // Searches for FosterBoxes and does two things when it hits one:
@@ -154,7 +153,7 @@
// we have fostered transclusions
// wrap the whole thing in a transclusion
if (fosteredTransclusions) {
-   insertTransclusionMetas(env, c, sibling);
+   insertTransclusionMetas(env, c, table);
}
 
// remove the foster box
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index f3fe806..192815d 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -14470,7 +14470,7 @@
 * {{echo|a
 [[Category:Foo]]}}
 !! html/parsoid
- a
+ a
 
 !! end
 

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

[MediaWiki-commits] [Gerrit] move from any namespace to WLD namespace disabled - change (mediawiki...WikiLexicalData)

2015-11-04 Thread Hiong3-eng5 (Code Review)
Hiong3-eng5 has uploaded a new change for review.

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

Change subject: move from any namespace to WLD namespace disabled
..

move from any namespace to WLD namespace disabled

The original programmers have wisely created the hook to
disable moving WLD namespaces.  Via Purodha's suggestion,
any page move to WLD namespace are now also disabled.

Change-Id: Icd3fd8e23062c20cbbd396f276d01fa8f41164cd
---
M Wikidata.hooks.php
M i18n/lexicaldata/en.json
M i18n/lexicaldata/qqq.json
3 files changed, 9 insertions(+), 2 deletions(-)


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

diff --git a/Wikidata.hooks.php b/Wikidata.hooks.php
index 3a59f51..8d2c2c9 100644
--- a/Wikidata.hooks.php
+++ b/Wikidata.hooks.php
@@ -116,9 +116,9 @@
return true;
}
 
-   /** @brief the i18n message. Why the move was unsuccessful
+   /** @brief the i18n message and function to abort moving pages. Why the 
move was unsuccessful
 *
-*  In case anyone use the Special page to move the OmegaWiki 
namespaces,
+*  In case anyone use the Special page to move from/to the 
OmegaWiki namespaces,
 *  This hook, along with the onNamespaceIsMovable hook abort the 
move.
 */
public static function onAbortMove( $oldtitle, $newtitle, $user, 
&$error, $reason ) {
@@ -126,6 +126,10 @@
$error = wfMessage( 
'wikidata-handler-namespace-move-error' )->text();
return false;
}
+   if ( self::isWikidataNs( $newtitle ) ) {
+   $error = wfMessage( 
'wikidata-handler-namespace-move-to-error' )->text();
+   return false;
+   }
return true;
}
 
diff --git a/i18n/lexicaldata/en.json b/i18n/lexicaldata/en.json
index 08f98b6..61cf877 100644
--- a/i18n/lexicaldata/en.json
+++ b/i18n/lexicaldata/en.json
@@ -4,6 +4,7 @@
},
"wikidata-desc": "Adds wiki-like database for various types of content",
"wikidata-handler-namespace-move-error": "Pages in namespaces handled 
by the WikiLexicalData extension cannot be moved.",
+   "wikidata-handler-namespace-move-to-error": "No Pages can be moved to 
any namespaces handled by the WikiLexicalData extension.",
"languages": "Language manager",
"langman-desc": "Add and change language settings with 
[[Special:Languages]]",
"langman_title": "Language manager",
diff --git a/i18n/lexicaldata/qqq.json b/i18n/lexicaldata/qqq.json
index 61ed924..e231a98 100644
--- a/i18n/lexicaldata/qqq.json
+++ b/i18n/lexicaldata/qqq.json
@@ -18,6 +18,8 @@
]
},
"wikidata-desc": "{{desc|name=Wiki Lexical 
Data|url=https://www.mediawiki.org/wiki/Extension:WikiLexicalData}}";,
+   "wikidata-handler-namespace-move-error": "WikiLexical pages are 
immovable message ( move from WikiLexicalData )",
+   "wikidata-handler-namespace-move-to-error": "WikiLexical pages are 
immovable message ( move to WikiLexicalData )",
"languages": "{{doc-special|Languages}}\nSee example: 
[http://www.omegawiki.org/Special:Specialpages 
omegawiki.org/Special:SpecialPages]",
"langman-desc": "Shot description of [[Special:Languages]] (Language 
manager)",
"langman_title": "{{doc-special|Languages}}\nSee example: 
[http://www.omegawiki.org/Special:Languages 
http://www.omegawiki.org/Special:Languages]\n{{Identical|Language manager}}",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd3fd8e23062c20cbbd396f276d01fa8f41164cd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiLexicalData
Gerrit-Branch: master
Gerrit-Owner: Hiong3-eng5 

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


[MediaWiki-commits] [Gerrit] Fix getting username for the user menu button - change (mediawiki...Blueprint)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix getting username for the user menu button
..


Fix getting username for the user menu button

data['username'] is:
* Name for logged in users
* IP for anonymous users
* text "Anonymous user" for anonymous users when $wgShowIPinHeader is false

Bug: T116130
Change-Id: I503a21bf7e7d2cfd1f7a4a41d1cb32ee7a4d0579
---
M i18n/en.json
M i18n/qqq.json
M src/BlueprintSkinTemplate.php
M templates/Skin.mustache
4 files changed, 14 insertions(+), 4 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 59dceee..0f6712a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,5 +7,6 @@
},
"skinname-blueprint": "Blueprint",
"blueprint-skin-desc": "Blueprint combines page actions, site 
navigation, and the current page's Table of Contents into a navigation bar that 
is only shown on-demand",
-   "blueprint-left-nav": "* [[Main Page]]\n"
+   "blueprint-left-nav": "* [[Main Page]]\n",
+   "blueprint-anon-username": "Anonymous user"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 41123da..e407a06 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -8,5 +8,6 @@
},
"skinname-blueprint": "{{optional}}",
"blueprint-skin-desc": 
"{{desc|what=skin|name=Blueprint|url=https://www.mediawiki.org/wiki/Skin:Blueprint}}";,
-   "blueprint-left-nav": "List of links to show in the left navigation for 
the skin\n\nTo translate the Main Page link, add your translation like this: 
[[Main Page|Your Translation]]"
+   "blueprint-left-nav": "List of links to show in the left navigation for 
the skin\n\nTo translate the Main Page link, add your translation like this: 
[[Main Page|Your Translation]]",
+   "blueprint-anon-username": "Text of the user menu button for anonymous 
users when $wgShowIPinHeader is false"
 }
diff --git a/src/BlueprintSkinTemplate.php b/src/BlueprintSkinTemplate.php
index e368bdc..d1b6c5e 100644
--- a/src/BlueprintSkinTemplate.php
+++ b/src/BlueprintSkinTemplate.php
@@ -4,7 +4,15 @@
public function execute() {
$this->data['getdebughtml'] = MWDebug::getDebugHTML( 
$this->getSkin()->getContext() );
$this->data['left_nav_sections'] = $this->getLeftNav();
-   $this->data['username'] = 
$this->data['personal_urls']['userpage'];
+   // Get username for the user menu button
+   $personal_urls = $this->data['personal_urls'];
+   if ( isset( $personal_urls['userpage'] ) ) {
+   $this->data['username'] = 
$personal_urls['userpage']['text'];
+   } elseif ( isset( $personal_urls['anonuserpage'] ) ) {
+   $this->data['username'] = 
$personal_urls['anonuserpage']['text'];
+   } else {
+   $this->data['username'] = wfMessage( 
'blueprint-anon-username' )->text();
+   }
// Make HTML for page status indicators, copied from 
BaseTemplate::getIndicators().
$tmp = "\n";
foreach ( $this->data['indicators'] as $id => $content ) {
diff --git a/templates/Skin.mustache b/templates/Skin.mustache
index f260893..7fa4c9b 100644
--- a/templates/Skin.mustache
+++ b/templates/Skin.mustache
@@ -17,7 +17,7 @@



-   {{ username.text }}
+   {{username}}


{{#each personal_urls}}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I503a21bf7e7d2cfd1f7a4a41d1cb32ee7a4d0579
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/skins/Blueprint
Gerrit-Branch: master
Gerrit-Owner: Pastakhov 
Gerrit-Reviewer: Pastakhov 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: Spage 
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] Make FindOrphanedFiles handle bad file titles - change (mediawiki/core)

2015-11-04 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Make FindOrphanedFiles handle bad file titles
..

Make FindOrphanedFiles handle bad file titles

Change-Id: Idb926097b6159c9c442ee6f427f1da60c5c5d2eb
---
M maintenance/findOrphanedFiles.php
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/maintenance/findOrphanedFiles.php 
b/maintenance/findOrphanedFiles.php
index a1e274c..41650bd 100644
--- a/maintenance/findOrphanedFiles.php
+++ b/maintenance/findOrphanedFiles.php
@@ -136,7 +136,11 @@
foreach ( array_diff( $curNames, $curNamesFound ) as $name ) {
$file = $repo->newFile( $name );
// Print name and public URL to ease recovery
-   $this->output( $name . "\n" . $file->getCanonicalUrl() 
. "\n\n" );
+   if ( $file ) {
+   $this->output( $name . "\n" . 
$file->getCanonicalUrl() . "\n\n" );
+   } else {
+   $this->error( "Cannot get URL for bad file 
title '$name'" );
+   }
}
 
foreach ( array_diff( $oldNames, $oldNamesFound ) as $name ) {

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

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

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


[MediaWiki-commits] [Gerrit] Add srcset attribute if imageinfo supplies it - change (mediawiki...parsoid)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add srcset attribute if imageinfo supplies it
..


Add srcset attribute if imageinfo supplies it

Bug: T88827
Change-Id: I426a7ed528cedfc29f2be90d25d4a73c8894ce7f
---
M lib/wt2html/tt/LinkHandler.js
M lib/wt2html/tt/Sanitizer.js
2 files changed, 15 insertions(+), 1 deletion(-)

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



diff --git a/lib/wt2html/tt/LinkHandler.js b/lib/wt2html/tt/LinkHandler.js
index 4019bcc..cfe9a18 100644
--- a/lib/wt2html/tt/LinkHandler.js
+++ b/lib/wt2html/tt/LinkHandler.js
@@ -1093,6 +1093,20 @@
}
}
}
+
+   // Handle "responsive" images, i.e. srcset
+   if (info.responsiveUrls) {
+   var density;
+   var candidates = [];
+   for (density in info.responsiveUrls) {
+   candidates.push(
+   
info.responsiveUrls[density].replace(/^https?:\/\//, '//') +
+   ' ' + density + 'x');
+   }
+   if (candidates.length > 0) {
+   img.addAttribute('srcset', candidates.join(', 
'));
+   }
+   }
}
 
if (size.height) {
diff --git a/lib/wt2html/tt/Sanitizer.js b/lib/wt2html/tt/Sanitizer.js
index 5228641..2a658f9 100644
--- a/lib/wt2html/tt/Sanitizer.js
+++ b/lib/wt2html/tt/Sanitizer.js
@@ -497,7 +497,7 @@
// Not usually allowed, but may be used for 
extension-style hooks
// such as  when it is rasterized, or if 
wgAllowImageTag is
// true
-   'img': common.concat([ 'alt', 'src', 'width', 
'height' ]),
+   'img': common.concat([ 'alt', 'src', 'width', 
'height', 'srcset' ]),
 
// 15.2.1
'tt': common,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I426a7ed528cedfc29f2be90d25d4a73c8894ce7f
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Tim Starling 
Gerrit-Reviewer: Cscott 
Gerrit-Reviewer: Subramanya Sastry 
Gerrit-Reviewer: Tim Starling 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mw.UploadWizardDetails: Upload TitleBlacklist error handling... - change (mediawiki...UploadWizard)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mw.UploadWizardDetails: Upload TitleBlacklist error handling 
for T115258
..

mw.UploadWizardDetails: Upload TitleBlacklist error handling for T115258

'code' is always 'titleblacklist-forbidden' now, the specific error
message is returned in 'message'.

Change-Id: If25432c9972d8327fb9f1e985bfeed839d844db2
---
M resources/mw.UploadWizardDetails.js
1 file changed, 9 insertions(+), 4 deletions(-)


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

diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index a43d4e7..7e8e5f2 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -1784,13 +1784,15 @@
processError: function ( code, result ) {
var statusKey, comma,
statusLine = mw.message( 
'api-error-unclassified' ).text(),
-   titleErrorMap = {
-   senselessimagename: 
'senselessimagename',
-   'fileexists-shared-forbidden': 
'fileexists-shared-forbidden',
+   titleBlacklistMessageMap = {
+   senselessimagename: 
'senselessimagename', // TODO This is probably never hit?
'titleblacklist-custom-filename': 
'hosting',
'titleblacklist-custom-SVG-thumbnail': 
'thumbnail',
'titleblacklist-custom-thumbnail': 
'thumbnail',
-   
'titleblacklist-custom-double-apostrophe': 'double-apostrophe',
+   
'titleblacklist-custom-double-apostrophe': 'double-apostrophe'
+   },
+   titleErrorMap = {
+   'fileexists-shared-forbidden': 
'fileexists-shared-forbidden',
protectedpage: 'protected'
};
 
@@ -1806,6 +1808,9 @@
if ( titleErrorMap[ code ] ) {
this.recoverFromError( this.titleId, 
mw.message( 'mwe-upwiz-error-title-' + titleErrorMap[ code ] ).escaped(), 
'title-' + titleErrorMap[ code ] );
return;
+   } else if ( code === 'titleblacklist-forbidden' 
) {
+   this.recoverFromError( this.titleId, 
mw.message( 'mwe-upwiz-error-title-' + titleBlacklistMessageMap[ 
result.error.message ] ).escaped(), 'title-' + titleBlacklistMessageMap[ 
result.error.message ] );
+   return;
} else {
statusKey = 'api-error-' + code;
if ( code === 'filetype-banned' && 
result.error.blacklisted ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If25432c9972d8327fb9f1e985bfeed839d844db2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] WIP: Refactor WTS to be async - change (mediawiki...parsoid)

2015-11-04 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: WIP: Refactor WTS to be async
..

WIP: Refactor WTS to be async

Change-Id: Id68d24007229dcfa0bf6fb16c6ed3ecdaad0c2e5
---
M lib/html2wt/SelectiveSerializer.js
M lib/html2wt/SerializerState.js
M lib/html2wt/WTSUtils.js
M lib/html2wt/WikitextSerializer.js
M lib/utils/DOMUtils.js
5 files changed, 283 insertions(+), 312 deletions(-)


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

diff --git a/lib/html2wt/SelectiveSerializer.js 
b/lib/html2wt/SelectiveSerializer.js
index fb0fc8a..cfca657 100644
--- a/lib/html2wt/SelectiveSerializer.js
+++ b/lib/html2wt/SelectiveSerializer.js
@@ -41,10 +41,9 @@
  * Selectively serialize an HTML DOM document synchronously.
  * WARNING: You probably want to use DU.serializeDOM instead.
  */
-SSP.serializeDOMSync = function(body) {
+SSP.serializeDOM = Promise.method(function(body) {
console.assert(DU.isBody(body), 'Expected a body node.');
 
-   var out;
var startTimers = new Map();
 
if ((!this.env.page.dom && !this.env.page.domdiff) || this.env.page.src 
=== null) {
@@ -53,12 +52,12 @@
}
 
// If there's no old source, fall back to non-selective 
serialization.
-   out = this.wts.serializeDOMSync(body, false);
-
-   if (this.timer) {
-   this.timer.timing('html2wt.full.serialize', '',
-   (Date.now() - 
startTimers.get('html2wt.full.serialize')));
-   }
+   return this.wts.serializeDOM(body, false).tap(function() {
+   if (this.timer) {
+   this.timer.timing('html2wt.full.serialize', '',
+   (Date.now() - 
startTimers.get('html2wt.full.serialize')));
+   }
+   }.bind(this));
} else {
if (this.timer) {
startTimers.set('html2wt.selser.serialize', Date.now());
@@ -82,9 +81,10 @@
}
}
 
+   var p;
if (diff.isEmpty) {
// Nothing was modified, just re-use the original source
-   out = this.env.page.src;
+   p = Promise.resolve(this.env.page.src);
} else {
body = diff.dom;
this.env.page.editedDoc = body.ownerDocument;
@@ -96,16 +96,16 @@
}
 
// Call the WikitextSerializer to do our bidding
-   out = this.wts.serializeDOMSync(body, true);
+   p = this.wts.serializeDOM(body, true);
}
-
-   if (this.timer) {
-   this.timer.timing('html2wt.selser.serialize', '',
-   (Date.now() - 
startTimers.get('html2wt.selser.serialize')));
-   }
+   return p.tap(function() {
+   if (this.timer) {
+   this.timer.timing('html2wt.selser.serialize', 
'',
+   (Date.now() - 
startTimers.get('html2wt.selser.serialize')));
+   }
+   }.bind(this));
}
-   return out;
-};
+});
 
 
 if (typeof module === 'object') {
diff --git a/lib/html2wt/SerializerState.js b/lib/html2wt/SerializerState.js
index 2f5a1d3..ce81040 100644
--- a/lib/html2wt/SerializerState.js
+++ b/lib/html2wt/SerializerState.js
@@ -177,42 +177,27 @@
  * Serialize the children of a DOM node, sharing the global serializer state.
  * Typically called by a DOM-based handler to continue handling its children.
  */
-SSP.serializeChildren = function(node, wtEscaper) {
-   try {
-   // TODO gwicke: use nested WikitextSerializer instead?
+SSP.serializeChildren = Promise.method(function(node, wtEscaper) {
+   // SSS FIXME: Unsure if this is the right thing always
+   if (wtEscaper) { this.wteHandlerStack.push(wtEscaper); }
 
-   // SSS FIXME: Unsure if this is the right thing always
-   if (wtEscaper) {
-   this.wteHandlerStack.push(wtEscaper);
-   }
+   var serializeChildChain = Promise.method(function(child) {
+   if (child === null) { return; }
+   return 
this.serializer._serializeNode(child).then(function(next) {
+   if (next === node) { return; }  // Serialized all 
children
+   if (next === child) { next = next.nextSibling; }  // 
Advance
+   return serializeChildChain(next);
+   });
+   }).bind(this);
 
-   var child = node.firstChild;
-   var nextChild = null;
-
-   while (child) {
-  

[MediaWiki-commits] [Gerrit] ve.init.mw.Target: Update TitleBlacklist error code - change (mediawiki...VisualEditor)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: ve.init.mw.Target: Update TitleBlacklist error code
..

ve.init.mw.Target: Update TitleBlacklist error code

The error code has changed after T115258 and is now consistently
'titleblacklist-forbidden' for all TitleBlacklist errors.

The API now also provides information about the exact error message to
display (error.message) and the TitleBlacklist rule that matched
(error.line), but we probably don't have that message client-side, so
we're not trying to display it. Maybe when we can load it (T40280).

Bug: T116198
Change-Id: I32fccc7d0b2b66c739d59db05c568a56d9f07eec
---
M modules/ve-mw/init/ve.init.mw.Target.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/ve-mw/init/ve.init.mw.Target.js 
b/modules/ve-mw/init/ve.init.mw.Target.js
index 736cf8d..0c200fd 100644
--- a/modules/ve-mw/init/ve.init.mw.Target.js
+++ b/modules/ve-mw/init/ve.init.mw.Target.js
@@ -586,7 +586,7 @@
} else if ( data.error && data.error.code === 'pagedeleted' ) {
this.saveErrorPageDeleted();
return;
-   } else if ( data.error && data.error.code === 
'titleblacklist-forbidden-edit' ) {
+   } else if ( data.error && data.error.code === 
'titleblacklist-forbidden' ) {
this.saveErrorTitleBlacklist();
return;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32fccc7d0b2b66c739d59db05c568a56d9f07eec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] ApiVisualEditor: Return the correct notice when user is not ... - change (mediawiki...VisualEditor)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: ApiVisualEditor: Return the correct notice when user is not 
allowed to create page
..

ApiVisualEditor: Return the correct notice when user is not allowed to create 
page

'nocreatetext' is only the right error message when anonymous users
are generally not allowed to create pages on the wiki. But there are
other situations, for example a title might be blacklisted.

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


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

diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index b0e3388..366c268 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -430,10 +430,11 @@
}
 
// Permission notice
-   if ( !$title->userCan( 'create' ) && 
!$title->exists() ) {
+   $permErrors = $title->getUserPermissionsErrors( 
'create', $user );
+   if ( $permErrors && !$title->exists() ) {
$notices[] = $this->msg(

'permissionserrorstext-withaction', 1, $this->msg( 'action-createpage' )
-   ) . "" . $this->msg( 'nocreatetext' 
)->parse();
+   ) . "" . call_user_func_array( 
array( $this, 'msg' ), $permErrors[0] )->parse();
}
 
// Show notice when editing user / user talk 
page of a user that doesn't exist

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b8e83fa0bf98449e63e67705b709d227d9a379f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] Fix undo form for OO UI selection changes - change (mediawiki...Flow)

2015-11-04 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Fix undo form for OO UI selection changes
..

Fix undo form for OO UI selection changes

Activate editor after it's in DOM.

Bug: T117835
Change-Id: I925c022401fbd1db78328cb971c20e2e7ed52ffd
---
M modules/flow-initialize.js
M modules/mw.flow.Initializer.js
2 files changed, 13 insertions(+), 12 deletions(-)


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

diff --git a/modules/flow-initialize.js b/modules/flow-initialize.js
index 73a49e2..70ec772 100644
--- a/modules/flow-initialize.js
+++ b/modules/flow-initialize.js
@@ -44,7 +44,7 @@
// For reference and debugging
mw.flow.system = initializer.getDataModelSystem();
 
-   if ( initializer.isDiffPage() ) {
+   if ( initializer.isUndoForm() ) {
// Setup undo pages
initializer.setupUndoPage();
} else {
diff --git a/modules/mw.flow.Initializer.js b/modules/mw.flow.Initializer.js
index ab98443..d6a9927 100644
--- a/modules/mw.flow.Initializer.js
+++ b/modules/mw.flow.Initializer.js
@@ -690,6 +690,15 @@
// function, so make a forced connection
editor.error = error;
 
+   $wrapper = $( '' )
+   .append(
+   error.$element,
+   anonWarning.$element,
+   editor.$element
+   );
+
+   $domToReplace.replaceWith( $wrapper );
+
// Prepare the editor
editor.pushPending();
editor.activate();
@@ -726,23 +735,15 @@
// returnToBoard();
} );
 
-   $wrapper = $( '' )
-   .append(
-   error.$element,
-   anonWarning.$element,
-   editor.$element
-   );
-   $domToReplace.replaceWith( $wrapper );
-
return editor;
};
 
/**
-* Check whether we are on a diff page
+* Check whether we are on an undo form page
 *
-* @return {boolean} The page is a diff page
+* @return {boolean} The page is an in-progress undo form
 */
-   mw.flow.Initializer.prototype.isDiffPage = function () {
+   mw.flow.Initializer.prototype.isUndoForm = function () {
return !!( $( 'form[data-module="topic"]' ).length ||
$( 'form[data-module="header"]' ).length );
};

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

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

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


[MediaWiki-commits] [Gerrit] Add example of help for all query submodules - change (mediawiki/core)

2015-11-04 Thread Spage (Code Review)
Spage has uploaded a new change for review.

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

Change subject: Add example of help for all query submodules
..

Add example of help for all query submodules

It's useful and shows difference from recursivesubmodules.

Change-Id: I85cb5c89fde0063bbd9dfc86d00c14553035f053
---
M includes/api/ApiHelp.php
M includes/api/i18n/en.json
M includes/api/i18n/qqq.json
3 files changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php
index c33b27b..db7c149 100644
--- a/includes/api/ApiHelp.php
+++ b/includes/api/ApiHelp.php
@@ -759,6 +759,8 @@
return array(
'action=help'
=> 'apihelp-help-example-main',
+   'action=help&modules=query&submodules=1'
+   => 'apihelp-help-example-submodules',
'action=help&recursivesubmodules=1'
=> 'apihelp-help-example-recursive',
'action=help&modules=help'
diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index 450d83a..d4e5303 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -191,6 +191,7 @@
"apihelp-help-param-wrap": "Wrap the output in a standard API response 
structure.",
"apihelp-help-param-toc": "Include a table of contents in the HTML 
output.",
"apihelp-help-example-main": "Help for the main module.",
+   "apihelp-help-example-submodules": "Help for action=query 
and all its submodules.",
"apihelp-help-example-recursive": "All help in one page.",
"apihelp-help-example-help": "Help for the help module itself.",
"apihelp-help-example-query": "Help for two query submodules.",
diff --git a/includes/api/i18n/qqq.json b/includes/api/i18n/qqq.json
index 947c89b..05b19f1 100644
--- a/includes/api/i18n/qqq.json
+++ b/includes/api/i18n/qqq.json
@@ -184,6 +184,7 @@
"apihelp-help-param-wrap": "{{doc-apihelp-param|help|wrap}}",
"apihelp-help-param-toc": "{{doc-apihelp-param|help|toc}}",
"apihelp-help-example-main": "{{doc-apihelp-example|help}}",
+   "apihelp-help-example-submodules": "{{doc-apihelp-example|help}}",
"apihelp-help-example-recursive": "{{doc-apihelp-example|help}}",
"apihelp-help-example-help": "{{doc-apihelp-example|help}}",
"apihelp-help-example-query": "{{doc-apihelp-example|help}}",

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

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

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


[MediaWiki-commits] [Gerrit] Only set $wgDisableOutputCompression to 'true' on the scalers - change (operations/mediawiki-config)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Only set $wgDisableOutputCompression to 'true' on the scalers
..


Only set $wgDisableOutputCompression to 'true' on the scalers

Follows I7f9f7f3d8885f.

Change-Id: I3c397e892e1d6e3195539b3bfbc56309c65af0d2
---
M wmf-config/CommonSettings.php
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 0c12419..8cc91f0 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1347,7 +1347,10 @@
return true;
 };
 
-$wgDisableOutputCompression = true;
+if ( file_exists( '/etc/wikimedia-scaler' ) ) {
+   $wgDisableOutputCompression = true;
+}
+
 $wgMaxShellFileSize = 512 * 1024;
 $wgMaxShellMemory = 1024 * 1024;
 $wgMaxShellTime = 50;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c397e892e1d6e3195539b3bfbc56309c65af0d2
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Only set $wgDisableOutputCompression to 'true' on the scalers - change (operations/mediawiki-config)

2015-11-04 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Only set $wgDisableOutputCompression to 'true' on the scalers
..

Only set $wgDisableOutputCompression to 'true' on the scalers

Follows I7f9f7f3d8885f.

Change-Id: I3c397e892e1d6e3195539b3bfbc56309c65af0d2
---
M wmf-config/CommonSettings.php
1 file changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 0c12419..8cc91f0 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1347,7 +1347,10 @@
return true;
 };
 
-$wgDisableOutputCompression = true;
+if ( file_exists( '/etc/wikimedia-scaler' ) ) {
+   $wgDisableOutputCompression = true;
+}
+
 $wgMaxShellFileSize = 512 * 1024;
 $wgMaxShellMemory = 1024 * 1024;
 $wgMaxShellTime = 50;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c397e892e1d6e3195539b3bfbc56309c65af0d2
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Revert "Remove /etc/wikimedia-image-scaler" - change (operations/puppet)

2015-11-04 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Revert "Remove /etc/wikimedia-image-scaler"
..


Revert "Remove /etc/wikimedia-image-scaler"

This reverts commit 8a9257f41dd9. $wgDisableOutputCompression
Setting $wgDisableOutputCompression to 'true' across the fleet (in If792de0112)
was not a no-op, contrary to my expectation. So there is still a need to
differentiate the scalers from other app servers at the PHP configuration level
for now.

Change-Id: I7f9f7f3d8885fe0ca90b4628ed2257f3c5b965be
---
M manifests/role/mediawiki.pp
1 file changed, 16 insertions(+), 6 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/manifests/role/mediawiki.pp b/manifests/role/mediawiki.pp
index 1e3dd95..36c2aae 100644
--- a/manifests/role/mediawiki.pp
+++ b/manifests/role/mediawiki.pp
@@ -134,28 +134,38 @@
 }
 }
 
+class role::mediawiki::scaler {
+include ::role::mediawiki::common
+include ::mediawiki::multimedia
+
+file { '/etc/wikimedia-scaler':
+ensure => present,
+owner  => 'root',
+group  => 'root',
+mode   => '0444',
+}
+}
+
 class role::mediawiki::imagescaler {
 system::role { 'role::mediawiki::imagescaler': }
 
-include ::mediawiki::multimedia
+include ::role::mediawiki::scaler
 include ::role::mediawiki::webserver
-include base::firewall
+include ::base::firewall
 }
 
 class role::mediawiki::videoscaler {
 system::role { 'role::mediawiki::videoscaler': }
 
-include ::role::mediawiki::common
-include ::mediawiki::multimedia
+include ::role::mediawiki::scaler
 include ::mediawiki::jobrunner
-include base::firewall
+include ::base::firewall
 }
 
 class role::mediawiki::jobrunner {
 system::role { 'role::mediawiki::jobrunner': }
 
 include ::role::mediawiki::common
-
 include ::mediawiki::jobrunner
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f9f7f3d8885fe0ca90b4628ed2257f3c5b965be
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Revert "Remove /etc/wikimedia-image-scaler" - change (operations/puppet)

2015-11-04 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Revert "Remove /etc/wikimedia-image-scaler"
..

Revert "Remove /etc/wikimedia-image-scaler"

This reverts commit 8a9257f41dd9. $wgDisableOutputCompression
Setting $wgDisableOutputCompression to 'true' across the fleet (in If792de0112)
was not a no-op, contrary to my expectation. So there is still a need to
differentiate the scalers from other app servers at the PHP configuration level
for now.

Change-Id: I7f9f7f3d8885fe0ca90b4628ed2257f3c5b965be
---
M manifests/role/mediawiki.pp
1 file changed, 16 insertions(+), 6 deletions(-)


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

diff --git a/manifests/role/mediawiki.pp b/manifests/role/mediawiki.pp
index 1e3dd95..36c2aae 100644
--- a/manifests/role/mediawiki.pp
+++ b/manifests/role/mediawiki.pp
@@ -134,28 +134,38 @@
 }
 }
 
+class role::mediawiki::scaler {
+include ::role::mediawiki::common
+include ::mediawiki::multimedia
+
+file { '/etc/wikimedia-scaler':
+ensure => present,
+owner  => 'root',
+group  => 'root',
+mode   => '0444',
+}
+}
+
 class role::mediawiki::imagescaler {
 system::role { 'role::mediawiki::imagescaler': }
 
-include ::mediawiki::multimedia
+include ::role::mediawiki::scaler
 include ::role::mediawiki::webserver
-include base::firewall
+include ::base::firewall
 }
 
 class role::mediawiki::videoscaler {
 system::role { 'role::mediawiki::videoscaler': }
 
-include ::role::mediawiki::common
-include ::mediawiki::multimedia
+include ::role::mediawiki::scaler
 include ::mediawiki::jobrunner
-include base::firewall
+include ::base::firewall
 }
 
 class role::mediawiki::jobrunner {
 system::role { 'role::mediawiki::jobrunner': }
 
 include ::role::mediawiki::common
-
 include ::mediawiki::jobrunner
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f9f7f3d8885fe0ca90b4628ed2257f3c5b965be
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Add ids to footer lists and some sanitisation functions - change (mediawiki...Example)

2015-11-04 Thread Isarra (Code Review)
Isarra has uploaded a new change for review.

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

Change subject: Add ids to footer lists and some sanitisation functions
..

Add ids to footer lists and some sanitisation functions

Clear and relative the content
ids
ids
ids
Also use the same data[] thing for the content as vector so random changes will
be less dangerous maybe? I dunno. It just seems like vector is the most likely
skin to actually be supported in light of cataclysm.

Change-Id: I483a4f69c75ad1035c0e9968538ef3d5628599e4
---
M ExampleTemplate.php
M resources/screen-common.less
2 files changed, 45 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Example 
refs/changes/87/251187/1

diff --git a/ExampleTemplate.php b/ExampleTemplate.php
index caaf197..236e426 100644
--- a/ExampleTemplate.php
+++ b/ExampleTemplate.php
@@ -51,7 +51,15 @@

 
html( 'bodytext' );
+   $this->html( 'bodycontent' );
+   $this->clear();
+   if ( $this->data['printfooter'] ) {
+   ?>
+   
+   html( 
'printfooter' ); ?>
+   
+   html( 'catlinks' );
$this->html( 'dataAfterContent' );
?>
@@ -73,27 +81,11 @@

 

-   getFooterLinks() as $category 
=> $links ) {
-   ?>
-   
-   
-   html( 
$key ) ?>
-   
-   
-   
-
-   
+   
getFooterIcons( 
'icononly' ) as $blockName => $footerIcons ) {
?>
-   
+   
getSkin()->makeFooterIcon( $icon );
@@ -104,6 +96,22 @@
}
?>

+   getFooterLinks() as $category 
=> $links ) {
+   ?>
+   
+   
+   html( $key ) ?>
+   
+   
+   clear();
+   ?>


 
@@ -254,4 +262,8 @@
'content' => $this->getPersonalTools(),
) );
}
+
+   private function clear() {
+   echo '';
+   }
 }
diff --git a/resources/screen-common.less b/resources/screen-common.less
index 7216f6f..e8fb72d 100644
--- a/resources/screen-common.less
+++ b/resources/screen-common.less
@@ -28,6 +28,9 @@
background-position: 50% 50%;
}
 }
+.mw-body {
+   position: relative;
+}
 
 /* Some content stuff */
 .firstHeading {
@@ -36,6 +39,9 @@
 .mw-indicators {
float: right;
margin: 1.5em 0 0 1em;
+}
+.visual-clear {
+   clear: both;
 }
 
 /* Splatter the menus and tools at the bottom */
@@ -64,7 +70,14 @@
 #mw-footer {
clear: both;
border-top: 1px solid @border;
-   padding-top: 1em;
+
+   ul {
+   margin-top: 1em;
+   }
+}
+#footer-icons {
+   float: right;
+   margin: 0 0 1em 1em;
 }
 
 /* hidden stuff */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I483a4f69c75ad1035c0e9968538ef3d5628599e4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Example
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] Hygiene: upgrade libraries and try to fix tests - change (apps...wikipedia)

2015-11-04 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Hygiene: upgrade libraries and try to fix tests
..

Hygiene: upgrade libraries and try to fix tests

* Upgrade build tools to v23.0.2.
* Upgrade Gson to v2.4.
* Upgrade OkHttp and MockWebServer to v2.5.0[0].
* Add Espresso and recommend Android instrumentation test
  dependencies[1]:
  * Upgrade Android JUnit Runner to v0.4.1.
  * Add JUnit Rules v0.4.1.
  * Add Espresso-core, Espresso-contrib[2], Espresso-idling-resource,
and Espresso-web v2.2.1.
* Upgrade Robolectric to v3.0.
* Rename SyntaxHighlightTests to SyntaxHighlighterTest since it tests
  SyntaxHighlighter.
* Change PageLoadPerformanceTests and SyntaxHighlightTests to
  @ActivityTestRule instead of ActivityInstrumentationTestCase2.

[0] https://github.com/square/okhttp/blob/master/CHANGELOG.md#version-250
[1] https://google.github.io/android-testing-support-library/downloads/
[2] The Google testing libraries often have dependency issues. I used
the workarounds mentioned here:

http://stackoverflow.com/questions/30578243/why-would-adding-espresso-contrib-cause-an-inflateexception

Change-Id: I6ce48b785097f0436208f14af67a54beee672bbd
---
M app/build.gradle
D app/src/androidTest/java/org/wikipedia/test/SyntaxHighlightTests.java
A app/src/androidTest/java/org/wikipedia/test/SyntaxHighlighterTest.java
M app/src/androidTest/java/org/wikipedia/test/perf/PageLoadPerformanceTests.java
4 files changed, 101 insertions(+), 75 deletions(-)


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

diff --git a/app/build.gradle b/app/build.gradle
index 476b82a..2787907 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -45,7 +45,7 @@
 
 android {
 compileSdkVersion 23
-buildToolsVersion '23.0.1'
+buildToolsVersion '23.0.2'
 compileOptions {
 sourceCompatibility = JAVA_VERSION
 targetCompatibility = JAVA_VERSION
@@ -155,9 +155,9 @@
 compile 'com.android.support:design:23.1.0'
 compile 'com.android.support:recyclerview-v7:23.1.0'
 compile 'com.android.support:percent:23.1.0'
-compile 'com.google.code.gson:gson:2.3.1'
+compile 'com.google.code.gson:gson:2.4'
 compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
-compile 'com.squareup.okhttp:okhttp:2.4.0'
+compile 'com.squareup.okhttp:okhttp:2.5.0'
 compile 'com.squareup:otto:1.3.6'
 compile 'com.squareup.picasso:picasso:2.5.0'
 compile 'com.squareup.retrofit:retrofit:1.9.0'
@@ -171,14 +171,32 @@
 }
 compile 'net.hockeyapp.android:HockeySDK:3.6.2'
 
-androidTestCompile('com.android.support.test:runner:0.4')
-// Required by com.android.support.test:runner.
-androidTestCompile 'com.android.support:support-annotations:23.1.0'
-
 testCompile 'junit:junit:4.12'
 testCompile 'org.mockito:mockito-core:1.9.5'
-testCompile 'org.robolectric:robolectric:3.0-rc3'
-testCompile 'com.squareup.okhttp:mockwebserver:2.4.0'
+testCompile 'org.robolectric:robolectric:3.0'
+testCompile 'com.squareup.okhttp:mockwebserver:2.5.0'
+
+// Required by Android JUnit Runner.
+androidTestCompile 'com.android.support:support-annotations:23.1.0'
+
+androidTestCompile 'com.android.support.test:rules:0.4.1' // JUnit Rules
+androidTestCompile 'com.android.support.test:runner:0.4.1' // Android 
JUnit Runner
+androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
+
+// Espresso-contrib for DatePicker, RecyclerView, Drawer actions, 
Accessibility checks,
+// CountingIdlingResource
+
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.1') {
+// 
http://stackoverflow.com/questions/30578243/why-would-adding-espresso-contrib-cause-an-inflateexception
+exclude group: 'com.android.support', module: 'appcompat'
+exclude group: 'com.android.support', module: 'support-v4'
+exclude module: 'recyclerview-v7'
+}
+
+// Espresso-web for WebView support
+androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2.1'
+
+// Espresso-idling-resource for synchronization with background jobs.
+androidTestCompile 
'com.android.support.test.espresso:espresso-idling-resource:2.2.1'
 }
 
 private setSigningConfigKey(config, Properties props) {
diff --git 
a/app/src/androidTest/java/org/wikipedia/test/SyntaxHighlightTests.java 
b/app/src/androidTest/java/org/wikipedia/test/SyntaxHighlightTests.java
deleted file mode 100644
index 694e7f4..000
--- a/app/src/androidTest/java/org/wikipedia/test/SyntaxHighlightTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.wikipedia.test;
-
-import android.test.ActivityInstrumentationTestCase2;
-import android.widget.EditText;
-
-import org.wikipedia.editing.richtext.ColorSpanEx;
-import org.wikipedia.editing.richtext.SpanExtents;
-import org.wikipedia.ed

[MediaWiki-commits] [Gerrit] mw.UploadWizardUploadInterface: Remove some dead code - change (mediawiki...UploadWizard)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mw.UploadWizardUploadInterface: Remove some dead code
..

mw.UploadWizardUploadInterface: Remove some dead code

Change-Id: I0ac0f6d640d694ff92037349434628a518a879fe
---
M resources/mw.UploadWizardUploadInterface.js
1 file changed, 0 insertions(+), 5 deletions(-)


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

diff --git a/resources/mw.UploadWizardUploadInterface.js 
b/resources/mw.UploadWizardUploadInterface.js
index 4fea0aa..bce5282 100644
--- a/resources/mw.UploadWizardUploadInterface.js
+++ b/resources/mw.UploadWizardUploadInterface.js
@@ -72,10 +72,6 @@
this.visibleFilenameDiv.find( '.mwe-upwiz-file-status-line' )
.append( this.removeCtrl.$element );
 
-   // Add show thumbnail control
-
-   // this.errorDiv = $('').get(0);
-
this.filenameCtrl = $( '' ).get( 0 );
 
// this file Ctrl container is placed over other interface 
elements, intercepts clicks and gives them to the file input control.
@@ -627,7 +623,6 @@
 */
mw.UploadWizardUploadInterface.prototype.clearErrors = function () {
$( this.div ).removeClass( 'mwe-upwiz-upload-error' );
-   $( this.errorDiv ).hide().empty();
};
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ac0f6d640d694ff92037349434628a518a879fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] mw.UploadWizardDetails: Remove unused method #error - change (mediawiki...UploadWizard)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mw.UploadWizardDetails: Remove unused method #error
..

mw.UploadWizardDetails: Remove unused method #error

I'm not sure if it was ever used at all. this.errorDiv, which it
refers to, doesn't seem to have ever existed.

Change-Id: I105e4b97ea91d69b5564296a0e538a1c8e6cc467
---
M resources/mw.UploadWizardDetails.js
1 file changed, 0 insertions(+), 16 deletions(-)


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

diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index a43d4e7..adbbaac 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -1149,22 +1149,6 @@
},
 
/**
-* Display an error with details
-* XXX this is a lot like upload ui's error -- should merge
-*/
-   error: function () {
-   // copies arguments into a real array
-   var args = Array.prototype.slice.call( arguments ),
-   msg = 'mwe-upwiz-upload-error-' + args[ 0 ];
-
-   $( this.errorDiv ).append( $( '' ).text( mw.message( msg, args.slice( 1 ) 
).text() ) );
-   // apply a error style to entire did
-   $( this.div ).addClass( 'mwe-upwiz-upload-error' );
-   $( this.dataDiv ).hide();
-   $( this.errorDiv ).show();
-   },
-
-   /**
 * Given the API result pull some info into the form ( for 
instance, extracted from EXIF, desired filename )
 *
 * @param {Object} result Upload API result object

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I105e4b97ea91d69b5564296a0e538a1c8e6cc467
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] Fix regression in edit post and edit topic summary due to OO... - change (mediawiki...Flow)

2015-11-04 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Fix regression in edit post and edit topic summary due to OO UI 
changes
..

Fix regression in edit post and edit topic summary due to OO UI changes

This was a regression in Firefox due to the nodes not being in the DOM.
It's solved by doing the phase that requires being in the DOM outside
of the constructor, when the initializer has put it in the DOM.

This was caused by Ie4f66b15f4f5ec9932d5fd72e12b4453724e3742 .
I believe the specific change was I4109d5ad6089035cf689e11667e6ec2bb007d6ce
which affects how OOjs UI handles text selection ranges.

Bug: T117698
Change-Id: I5de75d586594122eb634a219513f8d53dec4fd22
(cherry picked from commit 715e950bd33939d8ef984fa163b9ffd55e347993)
---
M modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
M modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
M modules/mw.flow.Initializer.js
3 files changed, 55 insertions(+), 41 deletions(-)


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

diff --git a/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js 
b/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
index 656d35b..1255341 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
@@ -50,15 +50,38 @@
this.editor.$element
);
 
-   // Load the editor
+   };
+
+   /* Initialization */
+
+   OO.inheritClass( mw.flow.ui.EditPostWidget, OO.ui.Widget );
+
+   /* Events */
+
+   /**
+* Save the content of the reply
+* @event saveContent
+* @param {string} workflow The workflow this reply was saved under
+* @param {string} content The content of the reply
+* @param {string} contentFormat The format of the content of this reply
+*/
+
+   /* Methods */
+
+   /**
+* Activate the widget.  These needs to be called when it's visible and 
in the body.
+*/
+   mw.flow.ui.EditPostWidget.prototype.activate = function () {
+   var widget, contentFormat;
+
this.editor.pushPending();
this.editor.activate();
 
// Get the post from the API
-   var widget = this,
-   contentFormat = this.editor.getContentFormat();
+   widget = this;
+   contentFormat = this.editor.getContentFormat();
 
-   this.api.getPost( topicId, postId, contentFormat ).then(
+   this.api.getPost( this.topicId, this.postId, contentFormat 
).then(
function ( post ) {
var content = OO.getProp( post, 'content', 
'content' ),
format = OO.getProp( post, 'content', 
'format' );
@@ -84,24 +107,7 @@
// Focus again: pending editors are disabled and can't 
be focused
widget.editor.focus();
} );
-
};
-
-   /* Initialization */
-
-   OO.inheritClass( mw.flow.ui.EditPostWidget, OO.ui.Widget );
-
-   /* Events */
-
-   /**
-* Save the content of the reply
-* @event saveContent
-* @param {string} workflow The workflow this reply was saved under
-* @param {string} content The content of the reply
-* @param {string} contentFormat The format of the content of this reply
-*/
-
-   /* Methods */
 
/**
 * Respond to editor cancel
diff --git a/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js 
b/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
index 123a233..a834e3b 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
@@ -50,16 +50,39 @@
this.error.$element,
this.editor.$element
);
+   };
+
+   /* Initialization */
+
+   OO.inheritClass( mw.flow.ui.EditTopicSummaryWidget, OO.ui.Widget );
+
+   /* Events */
+
+   /**
+* Save the content of the reply
+* @event saveContent
+* @param {string} workflow The workflow this reply was saved under
+* @param {string} content The content of the reply
+* @param {string} contentFormat The format of the content of this reply
+*/
+
+   /* Methods */
+
+   /**
+* Activate the widget.  These needs to be called when it's visible and 
in the body.
+*/
+   mw.flow.ui.EditTopicSummaryWidget.prototype.activate = function () {
+   var widget, contentFormat;
 
// Load the editor
this.editor.pushPending();
this.editor.activate();

[MediaWiki-commits] [Gerrit] Split off uw.TitleDetailsWidget from UploadWizardDetails (an... - change (mediawiki...UploadWizard)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Split off uw.TitleDetailsWidget from UploadWizardDetails (and 
OOUI-ize)
..

Split off uw.TitleDetailsWidget from UploadWizardDetails (and OOUI-ize)

This change converts the title field to use OOjs UI, moving the code to
uw.TitleDetailsWidget.

This one is a bit different:

* There are two kinds of errors we can't generate immediately:
  * Checks for duplicate titles in the form. We probably could do this one,
but it would require some thought to do nicely.
  * Checks that are only done by the action=upload API.

  The logic for them remains the same, the methods #setDuplicateTitleError
  and #recoverFromError were adapted to display errors using the new system.

* We finally make use of the asynchronous validity checking (title blacklist
  and title uniqueness). We're now using OOjs UI PendingElement functionality
  to display "spinners" while API requests are in flight.

Also note that with the new system, it's currently impossible to display the
full error message for title blacklist. The code is commented out right now;
I submitted Ia09131c2ffc1d149ca6b1c32dcd918a539c3a719 to add the necessary
functionality. I'll submit a follow-up here when it's merged.

UploadWizardUpload's 'title' property is no longer updated continuously, but
only when the form is being submitted. To get current title from user input,
use UploadWizardDetails's getTitle() method. If we get weird issues with files
being saved under wrong titles, it means I missed a spot when changing this.

jquery.validate.wmCommonsBlacklist has been changed not to rely on 
jquery.validate
and renamed to mw.QuickTitleChecker.

Bug: T96917
Change-Id: I867499d4f912240053a767f6e542aa29e9e787ad
---
M UploadWizardHooks.php
M resources/controller/uw.controller.Details.js
A resources/details/uw.TitleDetailsWidget.js
R resources/mw.QuickTitleChecker.js
M resources/mw.UploadWizardDetails.js
M resources/ui/uw.ui.Thanks.js
M resources/uw.DetailsWidget.js
M resources/uw.FieldLayout.js
8 files changed, 311 insertions(+), 322 deletions(-)


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

diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index d16ead6..314c699 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -69,6 +69,7 @@
// OOjs UI interface elements
'resources/uw.DetailsWidget.js',
'resources/uw.FieldLayout.js',
+   'resources/details/uw.TitleDetailsWidget.js',
'resources/details/uw.DateDetailsWidget.js',

'resources/details/uw.CategoriesDetailsWidget.js',

'resources/details/uw.DescriptionDetailsWidget.js',
@@ -80,11 +81,9 @@
'resources/mw.canvas.js',
'resources/mw.ErrorDialog.js',
 
-   // wikimedia-comons specific title checker
-   
'resources/jquery/jquery.validate.wmCommonsBlacklist.js',
-
-   // workhorse libraries
+   // title validity checks
'resources/mw.DestinationChecker.js',
+   'resources/mw.QuickTitleChecker.js',
 
// firefogg support libraries
'resources/mw.Firefogg.js',
diff --git a/resources/controller/uw.controller.Details.js 
b/resources/controller/uw.controller.Details.js
index 9f81103..51c8d37 100644
--- a/resources/controller/uw.controller.Details.js
+++ b/resources/controller/uw.controller.Details.js
@@ -138,14 +138,14 @@
}
}
 
-   upload.details.clearDuplicateTitleError();
// This also updates legacy error messages
if ( !upload.details.valid() ) {
hasErrors = true;
}
 
// Seen this title before?
-   title = upload.title.getName() + '.' + 
mw.Title.normalizeExtension( upload.title.getExtension() );
+   title = upload.details.getTitle();
+   title = title.getName() + '.' + 
mw.Title.normalizeExtension( title.getExtension() );
if ( titles[ title ] ) {
// Don't submit. Instead, set an error 
in details step.
upload.details.setDuplicateTitleError();
@@ -246,7 +246,7 @@
}
 
   

[MediaWiki-commits] [Gerrit] Split off uw.DescriptionsDetailsWidget from UploadWizardDeta... - change (mediawiki...UploadWizard)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Split off uw.DescriptionsDetailsWidget from UploadWizardDetails 
(and OOUI-ize)
..

Split off uw.DescriptionsDetailsWidget from UploadWizardDetails (and OOUI-ize)

This change converts the descriptions field to use OOjs UI, moving the
code to uw.DescriptionDetailsWidget and uw.DescriptionsDetailsWidget.
* uw.DescriptionDetailsWidget implements logic and UI for a single
  language and description pair. This code was previously scattered in
  mw.UploadWizardDescription, uw.model.Description and mw.LanguageUpWiz,
  all of which are removed now.
* uw.DescriptionsDetailsWidget implements logic for managing multiple
  descriptions and adding/removing them, which was mostly in
  UploadWizardDetails.

The dropdowns and text fields now use OOUI widgets and are aligned on one
line (as they used to be a long time ago, but this broke at some point).

Everything related to uw.model is also removed, since that attempt at
refactoring seems to have been aborted.

Some weird things that I noticed, but did not change:
* There is some questionably-looking logic changing some languages to
  others (now in uw.DescriptionDetailsWidget). I'm not sure how much
  of it is needed.
* 'descriptionlang' and 'description' URI query parameters are handled
  differently.

Bug: T96917
Change-Id: I9563ff3bf7acb24ab0df35930643df81aee89dba
---
M UploadWizardHooks.php
M i18n/en.json
M i18n/qqq.json
A resources/details/uw.DescriptionDetailsWidget.js
A resources/details/uw.DescriptionDetailsWidget.less
A resources/details/uw.DescriptionsDetailsWidget.js
A resources/details/uw.DescriptionsDetailsWidget.less
D resources/mw.LanguageUpWiz.js
D resources/mw.UploadWizardDescription.js
M resources/mw.UploadWizardDetails.js
M resources/ui/uw.ui.Thanks.js
M resources/uploadWizard.css
D resources/uw/model/uw.model.Description.js
D resources/uw/model/uw.model.base.js
D tests/qunit/mw.uw.model.Description.test.js
15 files changed, 447 insertions(+), 633 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/81/251181/1

diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index 058a125..d16ead6 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -51,7 +51,6 @@
'uw.controller.Thanks',
'uw.controller.Tutorial',
'uw.controller.Upload',
-   'uw.model.Description',
 
'oojs',
'oojs-ui',
@@ -72,6 +71,8 @@
'resources/uw.FieldLayout.js',
'resources/details/uw.DateDetailsWidget.js',

'resources/details/uw.CategoriesDetailsWidget.js',
+   
'resources/details/uw.DescriptionDetailsWidget.js',
+   
'resources/details/uw.DescriptionsDetailsWidget.js',
 
// common utilities
'resources/mw.fileApi.js',
@@ -81,9 +82,6 @@
 
// wikimedia-comons specific title checker

'resources/jquery/jquery.validate.wmCommonsBlacklist.js',
-
-   // language menus
-   'resources/mw.LanguageUpWiz.js',
 
// workhorse libraries
'resources/mw.DestinationChecker.js',
@@ -109,7 +107,6 @@
// main library components:
'resources/mw.UploadWizardUpload.js',
'resources/mw.UploadWizardDeed.js',
-   'resources/mw.UploadWizardDescription.js',
'resources/mw.UploadWizardDetails.js',
'resources/mw.UploadWizardUploadInterface.js',
),
@@ -119,6 +116,8 @@
// OOjs UI interface elements
'resources/details/uw.DateDetailsWidget.less',

'resources/details/uw.CategoriesDetailsWidget.less',
+   
'resources/details/uw.DescriptionDetailsWidget.less',
+   
'resources/details/uw.DescriptionsDetailsWidget.less',
),
'messages' => array(
'comma-separator',
@@ -340,6 +339,7 @@
'mwe-upwiz-error-blank',
'mwe-upwiz-error-too-long',
'mwe-upwiz-error-too-short',
+   'mwe-upwiz-error-bad-descriptions',
'mwe-upwiz-error

[MediaWiki-commits] [Gerrit] Split off uw.CategoriesDetailsWidget from UploadWizardDetail... - change (mediawiki...UploadWizard)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Split off uw.CategoriesDetailsWidget from UploadWizardDetails 
(improve warnings)
..

Split off uw.CategoriesDetailsWidget from UploadWizardDetails (improve warnings)

This change converts the category fields to use uw.FieldLayout and
uw.DetailsWidget rather than custom code. As this field was already using
OOjs UI, there should be no user-visible changes.

It also generalizes the warning about submitting uploads with no
categories to use the warning system from uw.DetailsWidget.
* uw.controller.Details now knows about the warnings and displays the
  confirmation dialogs if there are any, rather than hardcoding the
  category check.
* Some code has been moved to UploadWizardDetails so that the controller
  doesn't have to know about individual fields anymore.

The warning message in the form is temporarily hidden with CSS, though,
to avoid changing the behavior in only some parts of the form until we
change other things to use similar warnings. I filed T117117 and T117119
to track this work.

Bug: T96917
Change-Id: Iee797ce14e2457759e40e08dcf16746e7041384c
---
M UploadWizardHooks.php
M i18n/en.json
M i18n/qqq.json
M resources/controller/uw.controller.Details.js
A resources/details/uw.CategoriesDetailsWidget.js
A resources/details/uw.CategoriesDetailsWidget.less
M resources/mw.UploadWizardDetails.js
7 files changed, 235 insertions(+), 134 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/80/251180/1

diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index 5b02dc9..058a125 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -71,6 +71,7 @@
'resources/uw.DetailsWidget.js',
'resources/uw.FieldLayout.js',
'resources/details/uw.DateDetailsWidget.js',
+   
'resources/details/uw.CategoriesDetailsWidget.js',
 
// common utilities
'resources/mw.fileApi.js',
@@ -117,6 +118,7 @@
'resources/jquery/jquery.showThumbCtrl.css',
// OOjs UI interface elements
'resources/details/uw.DateDetailsWidget.less',
+   
'resources/details/uw.CategoriesDetailsWidget.less',
),
'messages' => array(
'comma-separator',
@@ -352,6 +354,7 @@
'mwe-upwiz-error-license-wikitext-missing',
'mwe-upwiz-error-license-wikitext-too-short',
'mwe-upwiz-error-license-wikitext-too-long',
+   'mwe-upwiz-warning-categories-missing',
'mwe-upwiz-details-error-count',
'mwe-upwiz-license-cc-by-sa-4.0',
'mwe-upwiz-license-cc-by-sa-3.0',
diff --git a/i18n/en.json b/i18n/en.json
index 52df3ab..ceafee3 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -218,6 +218,7 @@
"mwe-upwiz-error-license-wikitext-missing": "You selected an option 
which requires you to enter wikitext.",
"mwe-upwiz-error-license-wikitext-too-short": "The wikitext here is too 
short to be a license",
"mwe-upwiz-error-license-wikitext-too-long": "The wikitext you entered 
is too long.",
+   "mwe-upwiz-warning-categories-missing": "It is recommended that you 
fill in some categories for your uploads.",
"mwe-upwiz-details-error-count": "There {{PLURAL:$1|is one error|are $1 
errors}} with the {{PLURAL:$2|form|forms}} above. Correct the 
{{PLURAL:$1|error|errors}}, and try submitting again.",
"mwe-upwiz-too-many-files-text": "You can only upload $1 
{{PLURAL:$1|file|files}} at once but you tried to upload $2 
{{PLURAL:$2|file|files}} in total. Please try again with fewer files!",
"mwe-upwiz-too-many-files": "Too many files.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b96b97f..c44252b 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -241,12 +241,13 @@
"mwe-upwiz-error-license-wikitext-missing": "Informs the user that they 
must input wikitext before the form can be submitted.",
"mwe-upwiz-error-license-wikitext-too-short": "Message for a failed 
minimum length validation on the license form.",
"mwe-upwiz-error-license-wikitext-too-long": "Message for a failed 
maximum length validation on the license form.",
+   "mwe-upwiz-warning-categories-missing": "Warning message displayed when 
the user has not selected any categories.\n\nThis should use the same wording 
as {{msg-mw|mwe-upwiz-necessary-confirm}}.",
"mwe-upwiz-details-error-count": "Used as error

[MediaWiki-commits] [Gerrit] Split off uw.DateDetailsWidget from UploadWizardDetails (int... - change (mediawiki...UploadWizard)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Split off uw.DateDetailsWidget from UploadWizardDetails 
(introduce uw.DetailsWidget)
..

Split off uw.DateDetailsWidget from UploadWizardDetails (introduce 
uw.DetailsWidget)

This change adds uw.DetailsWidget and uw.FieldLayout.
* uw.DetailsWidget represents a single logical field in the "Details" step.
  It can be composed of multiple smaller widgets (e.g. a "location" field
  could be composed of "latitude" and "longitude" inputs).
* uw.FieldLayout is a small extension of OO.ui.FieldLayout to magically
  display error and warnings messages about user input in uw.DetailsWidget.

With these we should be able to move away from jquery.validate, which has
been causing no end of trouble.
* uw.ui.Details has a small hack added to know about new-style error
  messages.
* uw.controller.Details refactored to validate both old-style and
  new-style fields before submitting the form.

As a first step of migration towards the new system, I converted the date
field, which was already using OOjs UI. The only user-visible change is
that the error message about the field being required looks different.
* uw.DateDetailsWidget is a new class implementing the UI (code moved from
  UploadWizardDetails), the validation rules, the copying rules and
  getting wikitext from user input.
* UploadWizardDetails only has to create the field, put it in the form,
  and get the value back. (And prefill the initial one from EXIF.)

This change does not touch the hint system, using jquery.tipsy. While
OOjs UI has the code for this in place, I think it would be confusing
to users to have two very different-looking tooltip systems side-by-side.
We'll change this later.

Bug: T96917
Change-Id: I446b5b3e8ddb07fc31bbad77ca57ba50b7f96082
---
M UploadWizardHooks.php
M resources/controller/uw.controller.Details.js
A resources/details/uw.DateDetailsWidget.js
A resources/details/uw.DateDetailsWidget.less
M resources/mw.UploadWizardDetails.js
M resources/ui/uw.ui.Details.js
M resources/uploadWizard.css
A resources/uw.DetailsWidget.js
A resources/uw.FieldLayout.js
9 files changed, 381 insertions(+), 137 deletions(-)


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

diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index 89e3fde..5b02dc9 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -67,6 +67,11 @@
'resources/jquery/jquery.showThumbCtrl.js',
'resources/jquery/jquery.lazyload.js',
 
+   // OOjs UI interface elements
+   'resources/uw.DetailsWidget.js',
+   'resources/uw.FieldLayout.js',
+   'resources/details/uw.DateDetailsWidget.js',
+
// common utilities
'resources/mw.fileApi.js',
'resources/mw.units.js',
@@ -110,6 +115,8 @@
'styles' => array(
'resources/uploadWizard.css',
'resources/jquery/jquery.showThumbCtrl.css',
+   // OOjs UI interface elements
+   'resources/details/uw.DateDetailsWidget.less',
),
'messages' => array(
'comma-separator',
diff --git a/resources/controller/uw.controller.Details.js 
b/resources/controller/uw.controller.Details.js
index d1ac4ca..b864e3d 100644
--- a/resources/controller/uw.controller.Details.js
+++ b/resources/controller/uw.controller.Details.js
@@ -105,8 +105,8 @@
 * @return {jQuery.Promise}
 */
uw.controller.Details.prototype.valid = function () {
-   var windowManager, confirmationDialog, title,
-   valid = 0,
+   var
+   validityPromises = [],
necessary = 0,
total = 0,
titles = {};
@@ -116,38 +116,66 @@
return;
}
 
-   total += 1;
+   // Update any error/warning messages about all 
DetailsWidgets
+   upload.details.dateDetailsField.checkValidity();
 
-   if ( upload.details.clearDuplicateTitleError().valid() 
) {
-   title = upload.title.getName() + '.' + 
mw.Title.normalizeExtension( upload.title.getExtension() );
+   validityPromises.push( $.when(
+   upload.details.dateDetails.getErrors()
+   // Other DetailsWidgets errors go here...
+   ).then(

[MediaWiki-commits] [Gerrit] Initial commit of "an almost smart enough JSON diff tool" - change (wikimedia...relevancylab)

2015-11-04 Thread EBernhardson (Code Review)
EBernhardson has submitted this change and it was merged.

Change subject: Initial commit of "an almost smart enough JSON diff tool"
..


Initial commit of "an almost smart enough JSON diff tool"

Reads two files with one JSON blob per line and produces side-by-side
HTML color-coded diff files, one per pair of diffed lines,  in the
specified directory. Remove some highlighting markup from runSearch
and add some highlighting to help with diffing by eye.

Bug: T116870
Change-Id: Idf9ba9eace767d11e53d230f67443cc45d5d6259
---
A jsondiff.py
1 file changed, 86 insertions(+), 0 deletions(-)

Approvals:
  Smalyshev: Looks good to me, but someone else must approve
  EBernhardson: Verified; Looks good to me, approved



diff --git a/jsondiff.py b/jsondiff.py
new file mode 100755
index 000..7fff696
--- /dev/null
+++ b/jsondiff.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+
+# jsondiff.py - an almost smart enough JSON diff tool
+#
+# This program does line-by-line diffs of two files with one JSON blob
+# per line, outputting one color-coded HTML diff per line into a target
+# directory. It performs a text diff on alphabetized, pretty printed
+# JSON. That's good enough for JSON blobs that have similar structure,
+# or dissimilar values (arrays of single digit numbers, for example, can
+# cause confusion, because one 7 looks like every other 7).
+#
+# A smarter (future) version would intelligently diff the structure of
+# the JSON, but the goal here was to put something reasonable together
+# as quickly as possible.
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
+
+import argparse
+import difflib
+import getopt
+import json
+import os
+import re
+import sys
+from itertools import izip_longest
+
+def main():
+parser = argparse.ArgumentParser(description='line-by-line diff of JSON 
blobs',
+ prog=sys.argv[0])
+parser.add_argument('file', nargs=2, help='files to diff')
+parser.add_argument('-d', '--dir', dest='dir', default='./diffs/',
+help='output directory, default is ./diffs/')
+args = parser.parse_args()
+
+(file1, file2) = args.file
+target_dir = args.dir + '/'
+
+diff_count = 0
+
+if not os.path.exists(target_dir):
+os.makedirs(os.path.dirname(target_dir))
+
+with open(file1) as a, open(file2) as b:
+for tuple in izip_longest(a, b, fillvalue='{}'):
+(aline, bline) = tuple
+aline = aline.strip(' \t\n')
+bline = bline.strip(' \t\n')
+if aline == '': aline = '{}'
+if bline == '': bline = '{}'
+diff_count += 1
+diff_file = open(target_dir + 'diff' + `diff_count` + '.html', 'w')
+
+# remove searchmatch markup
+aline = re.sub(r'(.*?)<\\/span>',
+   '\\1', aline)
+bline = re.sub(r'(.*?)<\\/span>',
+   '\\1', bline)
+
+
+aline = json.dumps(json.loads(aline), sort_keys=True, indent=2)
+bline = json.dumps(json.loads(bline), sort_keys=True, indent=2)
+output = 
difflib.HtmlDiff(wrapcolumn=50).make_file(aline.split('\n'),
+   
bline.split('\n'),
+   file1, file2)
+# highlight key fields
+output = re.sub(r'("(title|query|totalHits)": .*?)',
+'\\1', 
output)
+diff_file.writelines(output)
+diff_file.close()
+
+if __name__ == "__main__":
+main()
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idf9ba9eace767d11e53d230f67443cc45d5d6259
Gerrit-PatchSet: 3
Gerrit-Project: wikimedia/discovery/relevancylab
Gerrit-Branch: master
Gerrit-Owner: Tjones 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: Tjones 

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

[MediaWiki-commits] [Gerrit] Pass token parameter (if provided) to S3Client::factory(). - change (mediawiki...AWS)

2015-11-04 Thread Edward Chernenko (Code Review)
Edward Chernenko has uploaded a new change for review.

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

Change subject: Pass token parameter (if provided) to S3Client::factory().
..

Pass token parameter (if provided) to S3Client::factory().

This is needed when temporary IAM credentials are used.
(when Amazon EC2 instance has associated Role that allows S3 access,
and fresh credentials are downloaded from instance metadata).

If temporary IAM credentials are used, URLs created by createPresignedUrl()
in getFileHttpUrl() won't work without the token.

Change-Id: I21c428cf263b2078321aac385c186f2d049b9f58
---
M s3/AmazonS3FileBackend.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/s3/AmazonS3FileBackend.php b/s3/AmazonS3FileBackend.php
index 4002544..3614e15 100644
--- a/s3/AmazonS3FileBackend.php
+++ b/s3/AmazonS3FileBackend.php
@@ -94,6 +94,7 @@
$this->client = S3Client::factory( array(
'key' => isset( $config['awsKey'] ) ? $config['awsKey'] 
: $wgAWSCredentials['key'],
'secret' => isset( $config['awsSecret'] ) ? 
$config['awsSecret'] : $wgAWSCredentials['secret'],
+   'token' => isset( $config['awsToken'] ) ? 
$config['awsToken'] : $wgAWSCredentials['token'],
'region' => isset( $config['awsRegion'] ) ? 
$config['awsRegion'] : $wgAWSRegion,
'scheme' => $this->useHTTPS ? 'https' : 'http',
'ssl.certificate_authority' => $this->useHTTPS ?: null

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21c428cf263b2078321aac385c186f2d049b9f58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AWS
Gerrit-Branch: master
Gerrit-Owner: Edward Chernenko 

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


[MediaWiki-commits] [Gerrit] Relevancy runner in python - change (wikimedia...relevancylab)

2015-11-04 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: Relevancy runner in python
..

Relevancy runner in python

Bug: T116872
Change-Id: I2bb85deb9ec0443cbebf22d01c417f09e29ca609
---
A relevance.ini
A relevancyRunner.py
2 files changed, 93 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/relevancylab 
refs/changes/77/251177/1

diff --git a/relevance.ini b/relevance.ini
new file mode 100644
index 000..033af2c
--- /dev/null
+++ b/relevance.ini
@@ -0,0 +1,23 @@
+; Example config file
+[settings]
+; Host to run queries on
+labHost = suggesty.eqiad.wmflabs
+; Command to run a query
+searchCommand = sudo -u vagrant mwscript 
extensions/CirrusSearch/maintenance/runSearch.php 
+; Working directory
+workDir = /tmp/relevance
+; JSON Diff tool
+jsonDiffTool = python jsondiff.py -d 
+; Metric reporting tool
+metricTool = echo metric
+
+[test1]
+name = Test 1
+queries = test1.q
+;config = test1.json
+
+[test2]
+name = Test 2
+queries = test2.q
+config = test2.json
+
diff --git a/relevancyRunner.py b/relevancyRunner.py
new file mode 100755
index 000..d2d7c4c
--- /dev/null
+++ b/relevancyRunner.py
@@ -0,0 +1,70 @@
+#!/usr/bin/env python  
+# relevancyRunner.py - Run relevance lab queries
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
+
+import os
+import sys
+import argparse
+import ConfigParser
+import pipes
+import subprocess
+import re
+
+def getSafeName(name):
+return re.sub(r'[^a-zA-Z0-9]', '-', name)
+
+def ensureDir(dirname):
+if not os.path.exists(dirname):
+os.makedirs(dirname)
+
+def runSearch(config, section):
+qname = getSafeName(config.get(section, 'name'))
+qdir = config.get('settings', 'workDir') + "/queries/" + qname
+ensureDir(qdir)
+cmdline = config.get('settings', 'searchCommand')
+if config.has_option(section, 'config'):
+cmdline += " --options " + pipes.quote(open(config.get(section, 
'config')).read())
+runCommand("cat %s | ssh %s %s > %s" % (config.get(section, 'queries'), 
config.get('settings', 'labHost'), pipes.quote(cmdline), qdir + "/results"))
+return qdir + "/results"
+
+def checkSettings(config, section, settings):
+for s in settings:
+if not config.has_option(section, s):
+raise ValueError("Section [%s] missing configuration %s" % 
(section, s))
+pass
+
+def runCommand(cmd):
+print "RUNNING "+cmd
+subprocess.check_call(cmd, shell=True) 
+
+parser = argparse.ArgumentParser(description='Run relevance lab queries',
+prog=sys.argv[0])
+parser.add_argument('-c', '--config', dest='config', help='Configuration file 
name', required=True)
+args = parser.parse_args()
+
+config = ConfigParser.ConfigParser()
+config.readfp(open(args.config))
+checkSettings(config, 'settings', ['labHost', 'workDir', 'jsonDiffTool', 
'metricTool', 'searchCommand'])
+checkSettings(config, 'test1', [ 'name', 'queries'])
+checkSettings(config, 'test2', [ 'name', 'queries'])
+
+res1 = runSearch(config, 'test1')
+res2 = runSearch(config, 'test2')
+comparisonDir =  config.get('settings', 
'workDir')+"/comparisons/"+getSafeName(config.get('test1', 
'name'))+"_"+getSafeName(config.get('test2', 'name'))
+ensureDir(comparisonDir)
+
+runCommand("%s %s %s %s" % (config.get('settings', 'jsonDiffTool'), 
comparisonDir + "/diffs", res1, res2))
+runCommand("%s %s %s %s" % (config.get('settings', 'metricTool'), 
comparisonDir, res1, res2))
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2bb85deb9ec0443cbebf22d01c417f09e29ca609
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/relevancylab
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] Fix regression in edit post and edit topic summary due to OO... - change (mediawiki...Flow)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix regression in edit post and edit topic summary due to OO UI 
changes
..


Fix regression in edit post and edit topic summary due to OO UI changes

This was a regression in Firefox due to the nodes not being in the DOM.
It's solved by doing the phase that requires being in the DOM outside
of the constructor, when the initializer has put it in the DOM.

This was caused by Ie4f66b15f4f5ec9932d5fd72e12b4453724e3742 .
I believe the specific change was I4109d5ad6089035cf689e11667e6ec2bb007d6ce
which affects how OOjs UI handles text selection ranges.

Bug: T117698
Change-Id: I5de75d586594122eb634a219513f8d53dec4fd22
---
M modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
M modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
M modules/mw.flow.Initializer.js
3 files changed, 55 insertions(+), 41 deletions(-)

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



diff --git a/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js 
b/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
index 656d35b..1255341 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
@@ -50,15 +50,38 @@
this.editor.$element
);
 
-   // Load the editor
+   };
+
+   /* Initialization */
+
+   OO.inheritClass( mw.flow.ui.EditPostWidget, OO.ui.Widget );
+
+   /* Events */
+
+   /**
+* Save the content of the reply
+* @event saveContent
+* @param {string} workflow The workflow this reply was saved under
+* @param {string} content The content of the reply
+* @param {string} contentFormat The format of the content of this reply
+*/
+
+   /* Methods */
+
+   /**
+* Activate the widget.  These needs to be called when it's visible and 
in the body.
+*/
+   mw.flow.ui.EditPostWidget.prototype.activate = function () {
+   var widget, contentFormat;
+
this.editor.pushPending();
this.editor.activate();
 
// Get the post from the API
-   var widget = this,
-   contentFormat = this.editor.getContentFormat();
+   widget = this;
+   contentFormat = this.editor.getContentFormat();
 
-   this.api.getPost( topicId, postId, contentFormat ).then(
+   this.api.getPost( this.topicId, this.postId, contentFormat 
).then(
function ( post ) {
var content = OO.getProp( post, 'content', 
'content' ),
format = OO.getProp( post, 'content', 
'format' );
@@ -84,24 +107,7 @@
// Focus again: pending editors are disabled and can't 
be focused
widget.editor.focus();
} );
-
};
-
-   /* Initialization */
-
-   OO.inheritClass( mw.flow.ui.EditPostWidget, OO.ui.Widget );
-
-   /* Events */
-
-   /**
-* Save the content of the reply
-* @event saveContent
-* @param {string} workflow The workflow this reply was saved under
-* @param {string} content The content of the reply
-* @param {string} contentFormat The format of the content of this reply
-*/
-
-   /* Methods */
 
/**
 * Respond to editor cancel
diff --git a/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js 
b/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
index 123a233..a834e3b 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
@@ -50,16 +50,39 @@
this.error.$element,
this.editor.$element
);
+   };
+
+   /* Initialization */
+
+   OO.inheritClass( mw.flow.ui.EditTopicSummaryWidget, OO.ui.Widget );
+
+   /* Events */
+
+   /**
+* Save the content of the reply
+* @event saveContent
+* @param {string} workflow The workflow this reply was saved under
+* @param {string} content The content of the reply
+* @param {string} contentFormat The format of the content of this reply
+*/
+
+   /* Methods */
+
+   /**
+* Activate the widget.  These needs to be called when it's visible and 
in the body.
+*/
+   mw.flow.ui.EditTopicSummaryWidget.prototype.activate = function () {
+   var widget, contentFormat;
 
// Load the editor
this.editor.pushPending();
this.editor.activate();
 
// Get the post from the API
-   var widget = this,
-   contentFormat = th

[MediaWiki-commits] [Gerrit] Update keystone policy.json to allow the 'observer' role to ... - change (operations/puppet)

2015-11-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Update keystone policy.json to allow the 'observer' role to 
observe.
..


Update keystone policy.json to allow the 'observer' role to observe.

Bug: T104588
Change-Id: Icebee3a5868864c4e967d8ccd9c3a922a983ffe2
---
M modules/openstack/files/kilo/keystone/policy.json
1 file changed, 5 insertions(+), 3 deletions(-)

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



diff --git a/modules/openstack/files/kilo/keystone/policy.json 
b/modules/openstack/files/kilo/keystone/policy.json
index daba0ec..38cf350 100644
--- a/modules/openstack/files/kilo/keystone/policy.json
+++ b/modules/openstack/files/kilo/keystone/policy.json
@@ -1,9 +1,11 @@
 {
 "admin_required": "role:admin or is_admin:1",
 "service_role": "role:service",
+"observer_role": "role:observer",
 "service_or_admin": "rule:admin_required or rule:service_role",
 "owner" : "user_id:%(user_id)s",
 "admin_or_owner": "rule:admin_required or rule:owner",
+"admin_or_observer": "rule:admin_required or rule:observer_role",
 "token_subject": "user_id:%(target.token.user_id)s",
 "admin_or_token_subject": "rule:admin_required or rule:token_subject",
  
@@ -33,9 +35,9 @@
 "identity:update_domain": "rule:admin_required",
 "identity:delete_domain": "rule:admin_required",
  
-"identity:get_project": "rule:admin_required",
-"identity:list_projects": "rule:admin_required",
-"identity:list_user_projects": "rule:admin_or_owner",
+"identity:get_project": "rule:admin_or_observer",
+"identity:list_projects": "rule:admin_or_observer",
+"identity:list_user_projects": "rule:admin_or_observer",
 "identity:create_project": "rule:admin_required",
 "identity:update_project": "rule:admin_required",
 "identity:delete_project": "rule:admin_required",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icebee3a5868864c4e967d8ccd9c3a922a983ffe2
Gerrit-PatchSet: 3
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] dynamicproxy: Move invisible-unicorn into puppet - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: dynamicproxy: Move invisible-unicorn into puppet
..

dynamicproxy: Move invisible-unicorn into puppet

Was just one file, no point in it being in a separate deb

Change-Id: I8f6be94adab53625a9e8d607beb66b530c30276e
---
A modules/dynamicproxy/files/invisible-unicorn.py
M modules/dynamicproxy/manifests/api.pp
D modules/dynamicproxy/templates/api.conf
3 files changed, 261 insertions(+), 18 deletions(-)


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

diff --git a/modules/dynamicproxy/files/invisible-unicorn.py 
b/modules/dynamicproxy/files/invisible-unicorn.py
new file mode 100644
index 000..892e052
--- /dev/null
+++ b/modules/dynamicproxy/files/invisible-unicorn.py
@@ -0,0 +1,241 @@
+#   Copyright 2013 Yuvi Panda 
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+"""Simple HTTP server that implements the API for controlling a dynamic HTTP 
Proxy
+
+Stores canonical information about the proxying rules in a database.
+Proxying rules are also replicated to a Redis instance, from where the actual
+dynamic proxy will read them & route requests coming to it appropriately.
+
+The db is the canonical information source, and hence we do not put anything in
+Redis until the data has been commited to the database. Hence it is possible
+for the db call to succeed and the redis call to fail, causing the db and
+redis to be out of sync. Currently this is not really handled by the API.
+
+This service is considered 'internal' - it will run on the same server as
+the dynamic http proxy, and access a local database & redis instance. This
+API is meant to be used by Wikitech only, and nothing else"""
+import flask
+import redis
+import re
+from flask.ext.sqlalchemy import SQLAlchemy
+
+
+app = flask.Flask(__name__)
+app.config['SQLALCHEMY_DATABASE_URI'] = 
'sqlite:etc/dynamicproxy-api/data.db' # FIXME: move out to a config file
+
+db = SQLAlchemy(app)
+
+class Project(db.Model):
+"""Represents a Wikitech Project.
+Primary unit of access control.
+Note: No access control implemented yet :P
+
+Not represented at the Redis level at all"""
+id = db.Column(db.Integer, primary_key=True)
+name = db.Column(db.String(256), unique=True)
+
+def __init__(self, name):
+self.name = name
+
+class Route(db.Model):
+"""Represents a route that has one matching rule & multiple backends
+
+Currently the only supported rule is to match entire domains"""
+id = db.Column(db.Integer, primary_key=True)
+domain = db.Column(db.String(256), unique=True)
+project_id = db.Column(db.Integer, db.ForeignKey('project.id'))
+project = db.relationship('Project',
+  backref=db.backref('routes', lazy='dynamic'))
+
+def __init__(self, domain):
+self.domain = domain
+
+class Backend(db.Model):
+"""Represents a backend that can have HTTP requests routed to it
+
+Usually has a URL that is of the form ://:"""
+id = db.Column(db.Integer, primary_key=True)
+url = db.Column(db.String(256))
+route_id = db.Column(db.Integer, db.ForeignKey('route.id'))
+route = db.relationship('Route',
+backref=db.backref('backends', lazy='dynamic'))
+
+def __init__(self, url):
+self.url = url
+
+class RedisStore(object):
+"""Represents a redis instance that has routing info that the proxy 
reads"""
+def __init__(self, redis):
+self.redis = redis
+
+def delete_route(self, route):
+self.redis.delete('frontend:' + route.domain)
+
+# Create this route if it does not already exist.
+def refresh_route(self, route):
+key = 'frontend:' + route.domain
+   if not (self.redis.exists(key)):
+   print "Adding new key: %s " % key
+   self.update_route(route)
+
+def update_route(self, route, old_domain=None):
+key = 'frontend:' + route.domain
+backends = [backend.url for backend in route.backends]
+
+pipeline = self.redis.pipeline()
+if old_domain:
+pipeline.delete('frontend:' + old_domain) #When domains get 
renamed, kill old one too
+pipeline.delete(key).sadd(key, *backends).execute()
+
+redis_store = RedisStore(redis.Redis())
+
+def is_valid_domain(hostname):
+"""
+Credit for

[MediaWiki-commits] [Gerrit] Fix regression in edit post and edit topic summary due to OO... - change (mediawiki...Flow)

2015-11-04 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

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

Change subject: Fix regression in edit post and edit topic summary due to OO UI 
changes
..

Fix regression in edit post and edit topic summary due to OO UI changes

This was a regression in Firefox due to the nodes not being in the DOM.
It's solved by doing the phase that requires being in the DOM outside
of the constructor, when the initializer has put it in the DOM.

This was caused by Ie4f66b15f4f5ec9932d5fd72e12b4453724e3742 .
I believe the specific change was I4109d5ad6089035cf689e11667e6ec2bb007d6ce
which affects how OOjs UI handles text selection ranges.

Bug: T117698
Change-Id: I5de75d586594122eb634a219513f8d53dec4fd22
---
M modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
M modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
M modules/mw.flow.Initializer.js
3 files changed, 55 insertions(+), 41 deletions(-)


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

diff --git a/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js 
b/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
index 656d35b..1255341 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.EditPostWidget.js
@@ -50,15 +50,38 @@
this.editor.$element
);
 
-   // Load the editor
+   };
+
+   /* Initialization */
+
+   OO.inheritClass( mw.flow.ui.EditPostWidget, OO.ui.Widget );
+
+   /* Events */
+
+   /**
+* Save the content of the reply
+* @event saveContent
+* @param {string} workflow The workflow this reply was saved under
+* @param {string} content The content of the reply
+* @param {string} contentFormat The format of the content of this reply
+*/
+
+   /* Methods */
+
+   /**
+* Activate the widget.  These needs to be called when it's visible and 
in the body.
+*/
+   mw.flow.ui.EditPostWidget.prototype.activate = function () {
+   var widget, contentFormat;
+
this.editor.pushPending();
this.editor.activate();
 
// Get the post from the API
-   var widget = this,
-   contentFormat = this.editor.getContentFormat();
+   widget = this;
+   contentFormat = this.editor.getContentFormat();
 
-   this.api.getPost( topicId, postId, contentFormat ).then(
+   this.api.getPost( this.topicId, this.postId, contentFormat 
).then(
function ( post ) {
var content = OO.getProp( post, 'content', 
'content' ),
format = OO.getProp( post, 'content', 
'format' );
@@ -84,24 +107,7 @@
// Focus again: pending editors are disabled and can't 
be focused
widget.editor.focus();
} );
-
};
-
-   /* Initialization */
-
-   OO.inheritClass( mw.flow.ui.EditPostWidget, OO.ui.Widget );
-
-   /* Events */
-
-   /**
-* Save the content of the reply
-* @event saveContent
-* @param {string} workflow The workflow this reply was saved under
-* @param {string} content The content of the reply
-* @param {string} contentFormat The format of the content of this reply
-*/
-
-   /* Methods */
 
/**
 * Respond to editor cancel
diff --git a/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js 
b/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
index 123a233..a834e3b 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.EditTopicSummaryWidget.js
@@ -50,16 +50,39 @@
this.error.$element,
this.editor.$element
);
+   };
+
+   /* Initialization */
+
+   OO.inheritClass( mw.flow.ui.EditTopicSummaryWidget, OO.ui.Widget );
+
+   /* Events */
+
+   /**
+* Save the content of the reply
+* @event saveContent
+* @param {string} workflow The workflow this reply was saved under
+* @param {string} content The content of the reply
+* @param {string} contentFormat The format of the content of this reply
+*/
+
+   /* Methods */
+
+   /**
+* Activate the widget.  These needs to be called when it's visible and 
in the body.
+*/
+   mw.flow.ui.EditTopicSummaryWidget.prototype.activate = function () {
+   var widget, contentFormat;
 
// Load the editor
this.editor.pushPending();
this.editor.activate();
 
// Get the post from the API
-   var w

[MediaWiki-commits] [Gerrit] Add time frame selection (preset + custom) > Added an opti... - change (wikimedia...rainbow)

2015-11-04 Thread Bearloga (Code Review)
Bearloga has uploaded a new change for review.

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

Change subject: Add time frame selection (preset + custom)   > Added an option 
to view last 7/30/90 days or have a custom range   > Uses global setting by 
default with ability to override for "local" plot   > This is independent of 
the KPI date range stuff because that g
..

Add time frame selection (preset + custom)
  > Added an option to view last 7/30/90 days or have a custom range
  > Uses global setting by default with ability to override for "local" plot
  > This is independent of the KPI date range stuff because that gets 2x range
in order to compute a % change, so letting the user specify a "custom" range
would take a lot of work and would be wonky. So the new selector (specific
to KPI tabset) only has presets: Yesterday and  Last 7/30/90 days.
+ Moved smoothing into a 'Global Settings' menu where time frame also lives
+ Fixes the KPI date range selection
  > It relied on unstable data, so that got fixed.
  > It used "safe_tail" which is bad because it relies on n rather than dates
  > Switched over to subsetting by dates

! Note: This relies on polloi 0.0.5 to be CR'd and merged.

Bug: T116782
Change-Id: I72a90a00235c536da35a893e03a68f9a23caa62d
---
M CHANGELOG.md
M server.R
M tab_documentation/kpis_summary.md
M ui.R
M utils.R
5 files changed, 314 insertions(+), 202 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/rainbow 
refs/changes/74/251174/1

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3628ba9..12412a7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,14 @@
 # Change Log (Patch Notes)
 All notable changes to this project will be documented in this file.
 
+## 2015/11/05
+- Added time frame selection
+- Fixed KPI date range selection (more robust, correct)
+
+## 2015/11/04
+- Began the move to 'date'-named datasets (as opposed to 'timestamp'-named 
datasets)
+- Removed moving average as a smoothing option
+
 ## 2015/09/30
 - Added a change log
 - Added a contributor code of conduct
diff --git a/server.R b/server.R
index a17775e..287487c 100644
--- a/server.R
+++ b/server.R
@@ -1,4 +1,4 @@
-## Version 0.2.0
+## Version 0.3.0
 source("utils.R")
 
 existing_date <- Sys.Date() - 1
@@ -14,6 +14,24 @@
 read_augmented_clickthrough()
 read_lethal_dose()
 existing_date <<- Sys.Date()
+  }
+
+  # This is used to subset for getting the bounds for 
polloi::subset_by_date_range():
+  time_frame_range <- function(tf_selector) {
+tf_setting <- input[[tf_selector]]
+if ( tf_setting == 'global' ) {
+  if ( input$timeframe_global == 'custom' ) {
+return(input$daterange_global)
+  } else {
+tf_setting <- input$timeframe_global
+  }
+}
+return(switch(tf_setting,
+  all = c(as.Date("2015-04-14"), Sys.Date()-1),
+  week = c(Sys.Date()-8, Sys.Date()-1),
+  month = c(Sys.Date()-31, Sys.Date()-1),
+  quarter = c(Sys.Date()-91, Sys.Date()-1),
+  custom = input[[paste(tf_selector, "daterange", sep = 
"_")]]))
   }
 
   ## Desktop value boxes
@@ -46,18 +64,17 @@
 
   ## The dynamic graphs of events on desktop
   output$desktop_event_plot <- renderDygraph({
-polloi::make_dygraph(data = polloi::smoother(desktop_dygraph_set,
- smooth_level = 
polloi::smooth_switch(input$smoothing_global,
-  
input$smoothing_desktop_event)),
- xlab = "Date", ylab = "Events", title = "Desktop 
search events, by day")
+desktop_dygraph_set %>%
+  polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_desktop_event)) 
%>%
+  
polloi::subset_by_date_range(time_frame_range("desktop_event_timeframe")) %>%
+  polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Desktop 
search events, by day")
   })
 
   output$desktop_load_plot <- renderDygraph({
-polloi::make_dygraph(data = polloi::smoother(desktop_load_data,
- smooth_level = 
polloi::smooth_switch(input$smoothing_global,
-  
input$smoothing_desktop_load)),
- xlab = "Date", ylab = "Load time (ms)", title = 
"Desktop load times, by day",
- use_si = FALSE)
+desktop_load_data %>%
+  polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_desktop_load)) %>%
+  polloi::subset_by_date_range(time_frame_range("desktop_load_timeframe")) 
%>%
+  polloi::make_dygraph(xlab = "Date", ylab = "Load time (ms)", title = 
"Desktop load times, by day", use_si = FALSE)
   })
 
   ## Mobile value boxes
@@ -90,18 +107,17 @@
 
   ## Mobile plots
   output

[MediaWiki-commits] [Gerrit] Release Poem under CC0 1.0 public domain dedication - change (mediawiki...Poem)

2015-11-04 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Release Poem under CC0 1.0 public domain dedication
..

Release Poem under CC0 1.0 public domain dedication

Bug: T109963
Change-Id: Ic82c5cc4203fc238ff4f99f9e091a2c158d7ea81
---
A LICENSE
M extension.json
2 files changed, 122 insertions(+), 0 deletions(-)


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

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..0e259d4
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,121 @@
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+  i. the right to reproduce, adapt, distribute, perform, display,
+ communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+ likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+ subject to the limitations in paragraph 4(a), below;
+  v. rights protecting the extraction, dissemination, use and reuse of data
+ in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+ European Parliament and of the Council of 11 March 1996 on the legal
+ protection of databases, and under any national implementation
+ thereof, including any amended or successor version of such
+ directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+ world based on applicable law or treaty, and any national
+ implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrup

[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 3b6ee5c..3716682 - change (mediawiki/extensions)

2015-11-04 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: 3b6ee5c..3716682
..


Syncronize VisualEditor: 3b6ee5c..3716682

Change-Id: I66bff84e9cc14798c72aab9d6cb8aeec4adb7269
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index 3b6ee5c..3716682 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 3b6ee5ca682f05df00cef262c217506d4b00f9aa
+Subproject commit 3716682570aacb9b7caf9c5c419c56a02579f658

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I66bff84e9cc14798c72aab9d6cb8aeec4adb7269
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 
Gerrit-Reviewer: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] CommandHelpDialog: Move registrations to where sequences are... - change (mediawiki...VisualEditor)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: CommandHelpDialog: Move registrations to where sequences are 
defined
..


CommandHelpDialog: Move registrations to where sequences are defined

Change-Id: I031575bbf40cd789252ac5e082bb5fa435eab257
---
M modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js
M modules/ve-mw/ui/tools/ve.ui.MWLinkInspectorTool.js
M modules/ve-mw/ui/tools/ve.ui.MWReferenceDialogTool.js
M modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js
M modules/ve-mw/ui/ve.ui.MWSequenceRegistry.js
5 files changed, 39 insertions(+), 27 deletions(-)

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



diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js
index 3618915..413fa8a 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js
@@ -41,30 +41,6 @@
var accessKeyPrefix = 
$.fn.updateTooltipAccessKeys.getAccessKeyPrefix().toUpperCase().replace( /-/g, 
' + ' ),
save = ve.msg( 'accesskey-save' );
 
-   ve.ui.commandHelpRegistry.register( 'textStyle', 'link', { sequence: [ 
'wikitextLink' ] } );
-   ve.ui.commandHelpRegistry.register( 'formatting', 'blockquote', { 
sequence: [ 'wikitextDescription' ] } );
-   ve.ui.commandHelpRegistry.register( 'formatting', 'listNumber', { 
sequence: [ 'numberHash' ] } );
-   ve.ui.commandHelpRegistry.register( 'formatting', 'heading2', {
-   sequence: [ 'wikitextHeading' ],
-   msg: 'visualeditor-formatdropdown-format-heading2'
-   } );
-   ve.ui.commandHelpRegistry.register( 'insert', 'template', {
-   sequence: [ 'wikitextTemplate' ],
-   msg: 'visualeditor-dialog-template-title'
-   } );
-   ve.ui.commandHelpRegistry.register( 'insert', 'ref', {
-   sequence: [ 'wikitextRef' ],
-   msg: 'visualeditor-dialog-reference-title'
-   } );
-   ve.ui.commandHelpRegistry.register( 'insert', 'table', {
-   sequence: [ 'wikitextTable' ],
-   msg: 'visualeditor-table-insert-table'
-   } );
-   ve.ui.commandHelpRegistry.register( 'insert', 'comment', {
-   sequence: [ 'wikitextComment' ],
-   msg: 'visualeditor-commentinspector-title'
-   } );
-
if ( save !== '-' && save !== '' ) {
ve.ui.commandHelpRegistry.register( 'other', 'save', {
shortcuts: [ accessKeyPrefix + save.toUpperCase() ],
diff --git a/modules/ve-mw/ui/tools/ve.ui.MWLinkInspectorTool.js 
b/modules/ve-mw/ui/tools/ve.ui.MWLinkInspectorTool.js
index 1d6c9e7..36a5c23 100644
--- a/modules/ve-mw/ui/tools/ve.ui.MWLinkInspectorTool.js
+++ b/modules/ve-mw/ui/tools/ve.ui.MWLinkInspectorTool.js
@@ -78,3 +78,5 @@
 ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextLink', 'link', '[[', 2 )
 );
+
+ve.ui.commandHelpRegistry.register( 'textStyle', 'link', { sequence: [ 
'wikitextLink' ] } );
diff --git a/modules/ve-mw/ui/tools/ve.ui.MWReferenceDialogTool.js 
b/modules/ve-mw/ui/tools/ve.ui.MWReferenceDialogTool.js
index df50f4e..e81e85f 100644
--- a/modules/ve-mw/ui/tools/ve.ui.MWReferenceDialogTool.js
+++ b/modules/ve-mw/ui/tools/ve.ui.MWReferenceDialogTool.js
@@ -59,11 +59,16 @@
)
 );
 
-/* If Citoid is installed this will be overridden */
+/* If Citoid is installed these will be overridden */
 ve.ui.sequenceRegistry.register(
new ve.ui.Sequence( 'wikitextRef', 'reference', 'https://gerrit.wikimedia.org/r/250665
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I031575bbf40cd789252ac5e082bb5fa435eab257
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 
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] Syncronize VisualEditor: 3b6ee5c..3716682 - change (mediawiki/extensions)

2015-11-04 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: 3b6ee5c..3716682
..

Syncronize VisualEditor: 3b6ee5c..3716682

Change-Id: I66bff84e9cc14798c72aab9d6cb8aeec4adb7269
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions 
refs/changes/72/251172/1

diff --git a/VisualEditor b/VisualEditor
index 3b6ee5c..3716682 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 3b6ee5ca682f05df00cef262c217506d4b00f9aa
+Subproject commit 3716682570aacb9b7caf9c5c419c56a02579f658

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66bff84e9cc14798c72aab9d6cb8aeec4adb7269
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Update VisualEditor sub-module - change (mediawiki/core)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update VisualEditor sub-module
..


Update VisualEditor sub-module

Once more, with feeling:

ec764bc Don't allow keeping changes when switching from wikitext *section* 
editing

Change-Id: Ia78d97a75e0a626bfb5009d47cf7185c34076fd1
---
M extensions/VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/extensions/VisualEditor b/extensions/VisualEditor
index 7a3f189..ec764bc 16
--- a/extensions/VisualEditor
+++ b/extensions/VisualEditor
-Subproject commit 7a3f189d1ae28b915bff38441d5326a16cc32e9e
+Subproject commit ec764bc8654463f789f063609c9b1c0fa6012513

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia78d97a75e0a626bfb5009d47cf7185c34076fd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.5
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] dnsrecursor: Fix permissions for config YAML file - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: dnsrecursor: Fix permissions for config YAML file
..


dnsrecursor: Fix permissions for config YAML file

Change-Id: Ie851537fcf917343006968e9d0ea961e712134f8
---
M modules/dnsrecursor/manifests/labsaliaser.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/dnsrecursor/manifests/labsaliaser.pp 
b/modules/dnsrecursor/manifests/labsaliaser.pp
index 086cb82..447948c 100644
--- a/modules/dnsrecursor/manifests/labsaliaser.pp
+++ b/modules/dnsrecursor/manifests/labsaliaser.pp
@@ -20,7 +20,7 @@
 ensure  => present,
 owner   => 'root',
 group   => 'root',
-mode=> '0550',
+mode=> '0440',
 content => ordered_yaml($config),
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] dnsrecursor: Fix permissions for config YAML file - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: dnsrecursor: Fix permissions for config YAML file
..

dnsrecursor: Fix permissions for config YAML file

Change-Id: Ie851537fcf917343006968e9d0ea961e712134f8
---
M modules/dnsrecursor/manifests/labsaliaser.pp
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/dnsrecursor/manifests/labsaliaser.pp 
b/modules/dnsrecursor/manifests/labsaliaser.pp
index 086cb82..447948c 100644
--- a/modules/dnsrecursor/manifests/labsaliaser.pp
+++ b/modules/dnsrecursor/manifests/labsaliaser.pp
@@ -20,7 +20,7 @@
 ensure  => present,
 owner   => 'root',
 group   => 'root',
-mode=> '0550',
+mode=> '0440',
 content => ordered_yaml($config),
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] Resolve rare bug - change (wikimedia...polloi)

2015-11-04 Thread Bearloga (Code Review)
Bearloga has uploaded a new change for review.

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

Change subject: Resolve rare bug
..

Resolve rare bug

Sometimes lubridate::month/week(dataset[, 1]) yields:
Error in as.POSIXlt.default(x, tz = tz(x)) :
  do not know how to convert 'x' to class “POSIXlt”

This is meant to address that.

Change-Id: Iff01c7289191e4594a571232783ea90f70f1d440
---
M DESCRIPTION
M NEWS.md
M R/smoothing.R
3 files changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/polloi 
refs/changes/70/251170/1

diff --git a/DESCRIPTION b/DESCRIPTION
index 2d6e95e..5292f5a 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
 Package: polloi
 Type: Package
 Title: Common Functionality for Wikimedia Dashboards
-Version: 0.0.4
-Date: 2015-09-30
+Version: 0.0.5
+Date: 2015-11-04
 Author: Oliver Keyes [aut, cre], Mikhail Popov [aut]
 Maintainer: Oliver Keyes 
 Description: This package (which I can say because BDR is nowhere in sight) 
contains common functionality
diff --git a/NEWS.md b/NEWS.md
index c6d9914..da1a980 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,7 @@
+polloi 0.0.5
+=
+- Added subsetting by date range
+
 polloi 0.0.4
 =
 - Added a change log
diff --git a/R/smoothing.R b/R/smoothing.R
index 30194d6..c0b3c74 100644
--- a/R/smoothing.R
+++ b/R/smoothing.R
@@ -40,13 +40,13 @@
   # whatsoever, and so the original dataset is returned.
   switch(smooth_level,
  week = {
-   dataset$filter_1 <- lubridate::week(dataset[, 1])
-   dataset$filter_2 <- lubridate::year(dataset[, 1])
+   dataset$filter_1 <- lubridate::week(dataset[[1]])
+   dataset$filter_2 <- lubridate::year(dataset[[1]])
name_append <- ifelse(rename, " (Weekly average)", "")
  },
  month = {
-   dataset$filter_1 <- lubridate::month(dataset[, 1])
-   dataset$filter_2 <- lubridate::year(dataset[, 1])
+   dataset$filter_1 <- lubridate::month(dataset[[1]])
+   dataset$filter_2 <- lubridate::year(dataset[[1]])
name_append <- ifelse(rename, " (Monthly average)", "")
  },
  {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff01c7289191e4594a571232783ea90f70f1d440
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/polloi
Gerrit-Branch: master
Gerrit-Owner: Bearloga 

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


[MediaWiki-commits] [Gerrit] labs: Open up nova API access to other DNS host too - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: labs: Open up nova API access to other DNS host too
..


labs: Open up nova API access to other DNS host too

Change-Id: I2c76cfb3f241f3e651b6ee32802e4fdea54c44ef
---
M hieradata/eqiad.yaml
M modules/openstack/manifests/controller_firewall.pp
2 files changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml
index 2ba8f48..bedae66 100644
--- a/hieradata/eqiad.yaml
+++ b/hieradata/eqiad.yaml
@@ -44,6 +44,7 @@
 labs_dns_host: "labs-ns2.wikimedia.org"
 labs_recursor: "labs-recursor0.wikimedia.org"
 labs_designate_hostname: "holmium.wikimedia.org"
+labs_designate_hostname_secondary: "labservices1001.wikimedia.org"
 
 labs_nova_network_host: "labnet1002"
 labs_nova_network_ip: "10.64.20.25"
diff --git a/modules/openstack/manifests/controller_firewall.pp 
b/modules/openstack/manifests/controller_firewall.pp
index 89c0bbf..e594203 100644
--- a/modules/openstack/manifests/controller_firewall.pp
+++ b/modules/openstack/manifests/controller_firewall.pp
@@ -8,6 +8,8 @@
 $other_master = ipresolve(hiera('labs_nova_controller_other'),4)
 $spare_master = ipresolve(hiera('labs_nova_controller_spare'),4)
 $designate = ipresolve(hiera('labs_designate_hostname'),4)
+$designate_secondary = 
ipresolve(hiera('labs_designate_hostname_secondary'))
+
 $monitoring = '208.80.154.14'
 if ($::site == 'codfw') {
 # TODO!  codfw will need something
@@ -51,7 +53,7 @@
 
 # internal services to Labs virt servers
 ferm::rule { 'keystone':
-rule => "saddr (${other_master} ${labs_nodes} ${spare_master} 
${api_host} ${designate}) proto tcp dport (5000 35357) ACCEPT;",
+rule => "saddr (${other_master} ${labs_nodes} ${spare_master} 
${api_host} ${designate} ${designate_secondary}) proto tcp dport (5000 35357) 
ACCEPT;",
 }
 ferm::rule { 'mysql_nova':
 rule => "saddr ${labs_nodes} proto tcp dport (3306) ACCEPT;",

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

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

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


[MediaWiki-commits] [Gerrit] Merge branch 'master' into deploy - change (wikimedia...tools)

2015-11-04 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged.

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


Merge branch 'master' into deploy

6a09b09 tox integration to run the flake8 linter
821201f Rough YAML linter for *.yaml.example files
63305c5 Add unique constraint on SP export email column
195e45c Fix 'latest donation' logic

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

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I87105547e1b23b89f97a1fe20905fee6bd0a5981
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: deploy
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Ejegg 

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


[MediaWiki-commits] [Gerrit] Merge branch 'master' into deploy - change (wikimedia...tools)

2015-11-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

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

Merge branch 'master' into deploy

6a09b09 tox integration to run the flake8 linter
821201f Rough YAML linter for *.yaml.example files
63305c5 Add unique constraint on SP export email column
195e45c Fix 'latest donation' logic

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


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/69/251169/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87105547e1b23b89f97a1fe20905fee6bd0a5981
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: deploy
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] Fix 'latest donation' logic - change (wikimedia...tools)

2015-11-04 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged.

Change subject: Fix 'latest donation' logic
..


Fix 'latest donation' logic

Don't assume that the latest donation has the highest database ID -
donations can be imported with any receive date.

Bug: T107045
Change-Id: Ic2b3e0574156f5e2ccbc25a1bc289b32a6b9a61e
---
M silverpop_export/update_table.sql
1 file changed, 43 insertions(+), 16 deletions(-)

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



diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 3472cf9..9ca18df 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -3,6 +3,7 @@
 SET autocommit = 1;
 
 DROP TABLE IF EXISTS temp_silverpop_export;
+DROP TABLE IF EXISTS temp_silverpop_export_latest;
 DROP TABLE IF EXISTS temp_silverpop_export_dedupe_email;
 DROP TABLE IF EXISTS temp_silverpop_export_stat;
 
@@ -24,7 +25,6 @@
   donation_count int,
 
   -- Latest contribution statistics
-  last_ctid int unsigned,
   latest_currency varchar(3),
   latest_native_amount decimal(20,2),
   latest_usd_amount decimal(20,2),
@@ -43,6 +43,14 @@
   INDEX spex_opted_out (opted_out)
 ) COLLATE 'utf8_unicode_ci';
 
+CREATE TEMPORARY TABLE IF NOT EXISTS temp_silverpop_export_latest(
+  email varchar(255) PRIMARY KEY,
+  latest_currency varchar(3),
+  latest_native_amount decimal(20,2),
+  latest_usd_amount decimal(20,2),
+  latest_donation datetime
+) COLLATE 'utf8_unicode_ci';
+
 -- Populate, or append to, the storage table all contacts that
 -- have an email address. ID is civicrm_email.id.
 INSERT INTO temp_silverpop_export
@@ -57,6 +65,29 @@
   WHERE
 e.email IS NOT NULL AND e.email != ''
 AND c.is_deleted = 0;
+
+-- Find the latest donation for each email address.
+-- If there are multiple donations with the latest receive date,
+-- just pick one of them. The others will be ignored because
+-- email must be unique in this table.
+INSERT IGNORE INTO temp_silverpop_export_latest
+  SELECT
+e.email,
+ex.original_currency,
+ex.original_amount,
+ct.total_amount,
+ct.receive_date
+  FROM
+temp_silverpop_export e,
+civicrm.civicrm_contribution ct,
+civicrm.wmf_contribution_extra ex
+  WHERE
+e.contact_id = ct.contact_id AND
+ex.entity_id = ct.id
+  GROUP BY
+e.email
+  HAVING
+ct.receive_date = MAX(ct.receive_date);
 
 -- Populate data from contribution tracking; because that's fairly
 -- reliable. Do this before deduplication so we can attempt to make
@@ -139,10 +170,7 @@
   id INT PRIMARY KEY AUTO_INCREMENT,
   email varchar(255),
   exid INT, -- STEP 5
-  max_ctid INT, -- STEP 5
-  max_amount_ctid INT,  -- STEP 5
   max_amount_usd decimal(20,2), -- STEP 5
-  max_amount_currency varchar(3),   -- STEP 5
   has_recurred_donation tinyint(1),
   total_usd decimal(20,2),  -- STEP 5
   cnt_total int unsigned,
@@ -151,19 +179,19 @@
 ) COLLATE 'utf8_unicode_ci';
 
 INSERT INTO temp_silverpop_export_stat
-  (email, exid, max_ctid, max_amount_usd, total_usd, cnt_total, 
has_recurred_donation)
+  (email, exid, max_amount_usd, total_usd, cnt_total, has_recurred_donation)
   SELECT
-e.email, ex.id, MAX(ct.id), MAX(ct.total_amount), SUM(ct.total_amount),
+e.email, ex.id, MAX(ct.total_amount), SUM(ct.total_amount),
 count(*),
 MAX(IF(SUBSTRING(ct.trxn_id, 1, 9) = 'RECURRING', 1, 0))
   FROM civicrm.civicrm_email e FORCE INDEX(UI_email)
   JOIN temp_silverpop_export ex ON e.email=ex.email
   JOIN civicrm.civicrm_contribution ct ON e.contact_id=ct.contact_id
+  WHERE ct.total_amount IS NOT NULL
   GROUP BY e.email;
 
 UPDATE temp_silverpop_export ex, temp_silverpop_export_stat exs
   SET
-ex.last_ctid = exs.max_ctid,
 ex.highest_usd_amount = exs.max_amount_usd,
 ex.lifetime_usd_total = exs.total_usd,
 ex.donation_count = exs.cnt_total,
@@ -172,14 +200,14 @@
 ex.id = exs.exid;
 
 -- Populate information about the most recent contribution
-UPDATE temp_silverpop_export ex, civicrm.civicrm_contribution ct
-SET
-  latest_currency = SUBSTRING(ct.source, 1, 3),
-  latest_native_amount = CONVERT(SUBSTRING(ct.source, 5), decimal(20,2)),
-  latest_usd_amount = ct.total_amount,
-  latest_donation = ct.receive_date
-WHERE
-  ex.last_ctid = ct.id;
+UPDATE temp_silverpop_export ex, temp_silverpop_export_latest ct
+  SET
+ex.latest_currency = ct.latest_currency,
+ex.latest_native_amount = ct.latest_native_amount,
+ex.latest_usd_amount = ct.latest_usd_amount,
+ex.latest_donation = ct.latest_donation
+  WHERE
+ex.email = ct.email;
 
 -- Remove contacts who apparently have no contributions
 -- Leave opted out non-contributors so we don't spam anyone
@@ -232,7 +260,6 @@
 -- Normalize the data prior to final export
 UPDATE temp_silverpop_export SET preferred_language='en' WHERE 
preferred_language IS NULL;
 UPDATE temp_s

[MediaWiki-commits] [Gerrit] labs: Open up nova API access to other DNS host too - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: labs: Open up nova API access to other DNS host too
..

labs: Open up nova API access to other DNS host too

Change-Id: I2c76cfb3f241f3e651b6ee32802e4fdea54c44ef
---
M modules/openstack/manifests/controller_firewall.pp
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/67/251167/1

diff --git a/modules/openstack/manifests/controller_firewall.pp 
b/modules/openstack/manifests/controller_firewall.pp
index 89c0bbf..663f2e0 100644
--- a/modules/openstack/manifests/controller_firewall.pp
+++ b/modules/openstack/manifests/controller_firewall.pp
@@ -8,6 +8,8 @@
 $other_master = ipresolve(hiera('labs_nova_controller_other'),4)
 $spare_master = ipresolve(hiera('labs_nova_controller_spare'),4)
 $designate = ipresolve(hiera('labs_designate_hostname'),4)
+$labs_dns_secondary = ipresolve(hiera('labs_ldap_dns_secondary'))
+
 $monitoring = '208.80.154.14'
 if ($::site == 'codfw') {
 # TODO!  codfw will need something
@@ -51,7 +53,7 @@
 
 # internal services to Labs virt servers
 ferm::rule { 'keystone':
-rule => "saddr (${other_master} ${labs_nodes} ${spare_master} 
${api_host} ${designate}) proto tcp dport (5000 35357) ACCEPT;",
+rule => "saddr (${other_master} ${labs_nodes} ${spare_master} 
${api_host} ${designate} ${labs_dns_secondary}) proto tcp dport (5000 35357) 
ACCEPT;",
 }
 ferm::rule { 'mysql_nova':
 rule => "saddr ${labs_nodes} proto tcp dport (3306) ACCEPT;",

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

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

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


[MediaWiki-commits] [Gerrit] Update VisualEditor sub-module - change (mediawiki/core)

2015-11-04 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review.

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

Change subject: Update VisualEditor sub-module
..

Update VisualEditor sub-module

Once more, with feeling:

ec764bc Don't allow keeping changes when switching from wikitext *section* 
editing

Change-Id: Ia78d97a75e0a626bfb5009d47cf7185c34076fd1
---
M extensions/VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/251168/1

diff --git a/extensions/VisualEditor b/extensions/VisualEditor
index 7a3f189..ec764bc 16
--- a/extensions/VisualEditor
+++ b/extensions/VisualEditor
-Subproject commit 7a3f189d1ae28b915bff38441d5326a16cc32e9e
+Subproject commit ec764bc8654463f789f063609c9b1c0fa6012513

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia78d97a75e0a626bfb5009d47cf7185c34076fd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.5
Gerrit-Owner: Jforrester 

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


[MediaWiki-commits] [Gerrit] Don't allow keeping changes when switching from wikitext *se... - change (mediawiki...VisualEditor)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Don't allow keeping changes when switching from wikitext 
*section* editing
..


Don't allow keeping changes when switching from wikitext *section* editing

Bug: T117713
Change-Id: I16f17fa2aa4c9a1b74d8cde072c611e2685f5448
(cherry picked from commit 9c7a058b097afc02593306af96a9b5d9338b87f6)
---
M modules/ve-mw/init/ve.init.MWVESwitchConfirmDialog.js
1 file changed, 8 insertions(+), 1 deletion(-)

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



diff --git a/modules/ve-mw/init/ve.init.MWVESwitchConfirmDialog.js 
b/modules/ve-mw/init/ve.init.MWVESwitchConfirmDialog.js
index 9383cd4..8902932 100644
--- a/modules/ve-mw/init/ve.init.MWVESwitchConfirmDialog.js
+++ b/modules/ve-mw/init/ve.init.MWVESwitchConfirmDialog.js
@@ -69,7 +69,14 @@
 mw.libs.ve.SwitchConfirmDialog.prototype.getSetupProcess = function () {
return 
mw.libs.ve.SwitchConfirmDialog.super.prototype.getSetupProcess.apply( this, 
arguments )
.next( function () {
-   this.actions.setMode( mw.config.get( 
'wgVisualEditorConfig' ).fullRestbaseUrl ? 'restbase' : 'simple' );
+   if (
+   mw.config.get( 'wgVisualEditorConfig' 
).fullRestbaseUrl &&
+   !$( 'input[name=wpSection]' ).val()
+   ) {
+   this.actions.setMode( 'restbase' );
+   } else {
+   this.actions.setMode( 'simple' );
+   }
}, this );
 };
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I16f17fa2aa4c9a1b74d8cde072c611e2685f5448
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.27.0-wmf.5
Gerrit-Owner: Jforrester 
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] Removed raw HTML from tags-create-explanation message in Spe... - change (mediawiki/core)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Removed raw HTML from tags-create-explanation message in 
SpecialTags.php
..


Removed raw HTML from tags-create-explanation message in SpecialTags.php

Bug: T111754
Change-Id: I0d1e84fae279845d1fa4f273e7c718010230eb36
---
M includes/specials/SpecialTags.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/specials/SpecialTags.php 
b/includes/specials/SpecialTags.php
index 70eee9f..71f387b 100644
--- a/includes/specials/SpecialTags.php
+++ b/includes/specials/SpecialTags.php
@@ -100,7 +100,7 @@
$form = new HTMLForm( $fields, $this->getContext() );
$form->setAction( $this->getPageTitle( 'create' 
)->getLocalURL() );
$form->setWrapperLegendMsg( 'tags-create-heading' );
-   $form->setHeaderText( $this->msg( 
'tags-create-explanation' )->plain() );
+   $form->setHeaderText( $this->msg( 
'tags-create-explanation' )->parseAsBlock() );
$form->setSubmitCallback( array( $this, 
'processCreateTagForm' ) );
$form->setSubmitTextMsg( 'tags-create-submit' );
$form->show();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0d1e84fae279845d1fa4f273e7c718010230eb36
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Devirk 
Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com>
Gerrit-Reviewer: TTO 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Merge branch 'master' into deployment - change (wikimedia...crm)

2015-11-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

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

Merge branch 'master' into deployment

b61a728 Fix normalization when fee or net is present but empty
bba7424 Update CiviCRM submodule

Change-Id: I7e11831fb2a629b24c7ac2eb7637f7506a3f5f29
---
D sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
1 file changed, 0 insertions(+), 101 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/66/251166/1

diff --git 
a/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
deleted file mode 100644
index c02d5be..000
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<<< HEAD   (827faf Merge master into deployment)
-===
- 'WmfCivicrm message normalization',
-'group' => 'Pipeline',
-'description' => 'Checks for queue message normalization behavior',
-);
-}
-
-public function testDoubleNormalization() {
-// Start with a message already in normal form, to make comparison easy
-$original_msg = array(
-'anonymous' => 0,
-'check_number' => '',
-'city' => '',
-'comment' => '',
-'contact_id' => mt_rand(),
-'contact_groups' => array(),
-'contact_tags' => array(),
-'contribution_recur_id' => mt_rand(),
-'contribution_tags' => array(),
-'contribution_tracking_id' => mt_rand(),
-'contribution_tracking_update' => '1',
-'contribution_type' => 'cash', // FIXME
-'contribution_type_id' => '9', // FIXME
-'country' => 'IL',
-'create_date' => time() + 11,
-'currency' => 'USD',
-'date' => time() + 1,
-'effort_id' => '2',
-'email' => 'test...@localhost.net',
-'fee' => 0.5,
-'first_name' => 'test',
-'gateway' => 'paypal',
-'gateway_txn_id' => '1234AB1234-2',
-'gross' => 5.8,
-'last_name' => 'es',
-'letter_code' => '',
-'middle_name' => '',
-'net' => 5.29,
-'optout' => 0,
-'organization_name' => '',
-'original_currency' => 'ILS',
-'original_gross' => '20.00',
-'payment_date' => time(),
-'payment_instrument_id' => '25',
-'payment_instrument' => 'Paypal',
-'postal_code' => '',
-'postmark_date' => null,
-'recurring' => '1',
-'soft_credit_to' => null,
-'soft_credit_to_id' => null,
-'source_enqueued_time' => time() + 2,
-'source_host' => 'thulium',
-'source_name' => 'PayPal IPN (legacy)',
-'source_run_id' => mt_rand(),
-'source_type' => 'listener',
-'source_version' => 'legacy',
-'start_date' => time() + 10,
-'state_province' => '',
-'street_address' => '',
-'subscr_id' => 'TEST-S-1234567' . mt_rand(),
-'supplemental_address_1' => '',
-'supplemental_address_2' => '',
-'thankyou_date' => '',
-'txn_type' => 'subscr_payment',
-'utm_campaign' => '',
-);
-
-$msg = $original_msg;
-$normal_msg_1 = wmf_civicrm_normalize_msg( $msg );
-$this->assertEquals( $original_msg, $normal_msg_1 );
-$normal_msg_2 = wmf_civicrm_normalize_msg( $normal_msg_1 );
-$this->assertEquals( $original_msg, $normal_msg_2 );
-}
-
-   public function testEmptyNet() {
-   $msg = array(
-   'gateway' => 'adyen',
-   'payment_method' => 'cc',
-   'first_name' => 'blah',
-   'last_name' => 'wah',
-   'country' => 'US',
-   'currency' => 'USD',
-   'gross' => '1.00',
-   'net' => '',
-   'fee' => '0.21',
-   );
-   $normalized = wmf_civicrm_normalize_msg( $msg );
-   $this->assertEquals( 0.79, $normalized['net'] );
-   }
-}
->>> BRANCH (bba742 Update CiviCRM submodule)

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

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

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.or

[MediaWiki-commits] [Gerrit] Merge branch 'master' into deployment - change (wikimedia...crm)

2015-11-04 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged.

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


Merge branch 'master' into deployment

b61a728 Fix normalization when fee or net is present but empty
bba7424 Update CiviCRM submodule

Change-Id: I7e11831fb2a629b24c7ac2eb7637f7506a3f5f29
---
D sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
1 file changed, 0 insertions(+), 101 deletions(-)

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



diff --git 
a/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
deleted file mode 100644
index c02d5be..000
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<<< HEAD   (827faf Merge master into deployment)
-===
- 'WmfCivicrm message normalization',
-'group' => 'Pipeline',
-'description' => 'Checks for queue message normalization behavior',
-);
-}
-
-public function testDoubleNormalization() {
-// Start with a message already in normal form, to make comparison easy
-$original_msg = array(
-'anonymous' => 0,
-'check_number' => '',
-'city' => '',
-'comment' => '',
-'contact_id' => mt_rand(),
-'contact_groups' => array(),
-'contact_tags' => array(),
-'contribution_recur_id' => mt_rand(),
-'contribution_tags' => array(),
-'contribution_tracking_id' => mt_rand(),
-'contribution_tracking_update' => '1',
-'contribution_type' => 'cash', // FIXME
-'contribution_type_id' => '9', // FIXME
-'country' => 'IL',
-'create_date' => time() + 11,
-'currency' => 'USD',
-'date' => time() + 1,
-'effort_id' => '2',
-'email' => 'test...@localhost.net',
-'fee' => 0.5,
-'first_name' => 'test',
-'gateway' => 'paypal',
-'gateway_txn_id' => '1234AB1234-2',
-'gross' => 5.8,
-'last_name' => 'es',
-'letter_code' => '',
-'middle_name' => '',
-'net' => 5.29,
-'optout' => 0,
-'organization_name' => '',
-'original_currency' => 'ILS',
-'original_gross' => '20.00',
-'payment_date' => time(),
-'payment_instrument_id' => '25',
-'payment_instrument' => 'Paypal',
-'postal_code' => '',
-'postmark_date' => null,
-'recurring' => '1',
-'soft_credit_to' => null,
-'soft_credit_to_id' => null,
-'source_enqueued_time' => time() + 2,
-'source_host' => 'thulium',
-'source_name' => 'PayPal IPN (legacy)',
-'source_run_id' => mt_rand(),
-'source_type' => 'listener',
-'source_version' => 'legacy',
-'start_date' => time() + 10,
-'state_province' => '',
-'street_address' => '',
-'subscr_id' => 'TEST-S-1234567' . mt_rand(),
-'supplemental_address_1' => '',
-'supplemental_address_2' => '',
-'thankyou_date' => '',
-'txn_type' => 'subscr_payment',
-'utm_campaign' => '',
-);
-
-$msg = $original_msg;
-$normal_msg_1 = wmf_civicrm_normalize_msg( $msg );
-$this->assertEquals( $original_msg, $normal_msg_1 );
-$normal_msg_2 = wmf_civicrm_normalize_msg( $normal_msg_1 );
-$this->assertEquals( $original_msg, $normal_msg_2 );
-}
-
-   public function testEmptyNet() {
-   $msg = array(
-   'gateway' => 'adyen',
-   'payment_method' => 'cc',
-   'first_name' => 'blah',
-   'last_name' => 'wah',
-   'country' => 'US',
-   'currency' => 'USD',
-   'gross' => '1.00',
-   'net' => '',
-   'fee' => '0.21',
-   );
-   $normalized = wmf_civicrm_normalize_msg( $msg );
-   $this->assertEquals( 0.79, $normalized['net'] );
-   }
-}
->>> BRANCH (bba742 Update CiviCRM submodule)

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

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

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikime

[MediaWiki-commits] [Gerrit] mediawiki.jqueryMsg: Don't duplicate link contents if parse(... - change (mediawiki/core)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mediawiki.jqueryMsg: Don't duplicate link contents if parse() 
is called multiple times
..

mediawiki.jqueryMsg: Don't duplicate link contents if parse() is called 
multiple times

mw.messages.set( 'foo', '[$1 Link]' );
var msg = mw.message( 'foo', $( '' ).attr( 'href', 'http://example.com/' 
) );
msg.parse(); msg.parse(); msg.parse();
$( 'body ').append( msg.parse() ); // The link now says "LinkLinkLinkLink"

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/251164/1

diff --git a/resources/src/mediawiki/mediawiki.jqueryMsg.js 
b/resources/src/mediawiki/mediawiki.jqueryMsg.js
index 2e89f6b..bf0884b 100644
--- a/resources/src/mediawiki/mediawiki.jqueryMsg.js
+++ b/resources/src/mediawiki/mediawiki.jqueryMsg.js
@@ -1094,7 +1094,7 @@
$el.attr( 'href', textify( arg ) );
}
}
-   return appendWithoutParsing( $el, contents );
+   return appendWithoutParsing( $el.empty(), contents );
},
 
/**

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki.jqueryMsg: Extend mw.Message with new #parseDom me... - change (mediawiki/core)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mediawiki.jqueryMsg: Extend mw.Message with new #parseDom method
..

mediawiki.jqueryMsg: Extend mw.Message with new #parseDom method

Unlike #parse, this one returns a jQuery set of DOM nodes and not a
HTML string, for two benefits:

* Allows to skip unnecessary HTML serialization and reconstruction
  when we just want to insert the message contents somewhere.

  Old way:
$( '#foo' ).html( mw.message( 'foo' ).parse() );
  New way:
$( '#foo' ).append( mw.message( 'foo' ).parseDom() );

  This is roughly equivalent to the old alternative:
$( '#foo' ).msg( 'foo' );
  But that way can't be used if you start with a mw.Message object, or
  don't yet know where the elements will be inserted.

* Allows to preserve the event handlers when a function is passed as
  message parameter.

mw.messages.set( 'foo', '[$1 Click me!]' );
$( '#foo' ).append( mw.message( 'foo', function () {
  console.log( 'Button clicked!' );
} ).parseDom() );

Change-Id: Ia09131c2ffc1d149ca6b1c32dcd918a539c3a719
---
M resources/src/mediawiki/mediawiki.jqueryMsg.js
1 file changed, 16 insertions(+), 0 deletions(-)


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

diff --git a/resources/src/mediawiki/mediawiki.jqueryMsg.js 
b/resources/src/mediawiki/mediawiki.jqueryMsg.js
index bf0884b..c5733fe 100644
--- a/resources/src/mediawiki/mediawiki.jqueryMsg.js
+++ b/resources/src/mediawiki/mediawiki.jqueryMsg.js
@@ -1270,4 +1270,20 @@
return messageFunction( this.key, this.parameters );
};
 
+   /**
+* Parse the message to DOM nodes, rather than HTML string like #parse.
+*
+* This method is only available when jqueryMsg is loaded.
+*
+* @method parseDom
+* @member mw.Message
+* @return {jQuery}
+*/
+   mw.Message.prototype.parseDom = ( function () {
+   var reusableParent = $( '' );
+   return function () {
+   return reusableParent.msg( this.key, this.parameters 
).contents().detach();
+   };
+   } )();
+
 }( mediaWiki, jQuery ) );

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

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

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


[MediaWiki-commits] [Gerrit] Update CiviCRM submodule - change (wikimedia...crm)

2015-11-04 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged.

Change subject: Update CiviCRM submodule
..


Update CiviCRM submodule

Change-Id: Ifdb801cee8329fd1bf1e21fcde91d455d6ff9ad7
---
M civicrm
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/civicrm b/civicrm
index 58302c7..b8b152c 16
--- a/civicrm
+++ b/civicrm
-Subproject commit 58302c7fbf0faa108f264a0fa68965b2d7c9d33a
+Subproject commit b8b152c40a9fbc31bbf24cfda951984101503d15

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifdb801cee8329fd1bf1e21fcde91d455d6ff9ad7
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Ejegg 

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


[MediaWiki-commits] [Gerrit] Update CiviCRM submodule - change (wikimedia...crm)

2015-11-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Update CiviCRM submodule
..

Update CiviCRM submodule

Change-Id: Ifdb801cee8329fd1bf1e21fcde91d455d6ff9ad7
---
M civicrm
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/63/251163/1

diff --git a/civicrm b/civicrm
index 58302c7..b8b152c 16
--- a/civicrm
+++ b/civicrm
-Subproject commit 58302c7fbf0faa108f264a0fa68965b2d7c9d33a
+Subproject commit b8b152c40a9fbc31bbf24cfda951984101503d15

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

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

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


[MediaWiki-commits] [Gerrit] Fix slow search on email - remove wildcard - change (wikimedia...civicrm)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix slow search on email - remove wildcard
..


Fix slow search on email - remove wildcard

Note that this and the trxn_id commit are only intended as temporary 'wmf-only' 
fixes and
I intend to work with core on a more stable approach (which is probably about 
honouring an
existing search setting or adding a new one

Change-Id: Ib2867d16e133d71ceff39e5ee1901c09d605f35f
But: T114792
---
M CRM/Contact/BAO/Query.php
1 file changed, 0 insertions(+), 6 deletions(-)

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



diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php
index 6f1798a..e96a9a5 100644
--- a/CRM/Contact/BAO/Query.php
+++ b/CRM/Contact/BAO/Query.php
@@ -1634,12 +1634,6 @@
   $likeNames = array('sort_name', 'email', 'note', 'display_name');
 }
 
-// email comes in via advanced search
-// so use wildcard always
-if ($id == 'email') {
-  $wildcard = 1;
-}
-
 if (!$useEquals && in_array($id, $likeNames)) {
   $result = array($id, 'LIKE', $values, 0, 1);
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib2867d16e133d71ceff39e5ee1901c09d605f35f
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] A few more FindOrphanedFiles fixes for "!" files - change (mediawiki/core)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: A few more FindOrphanedFiles fixes for "!" files
..


A few more FindOrphanedFiles fixes for "!" files

Taken from https://gerrit.wikimedia.org/r/#/c/251147/2

Change-Id: Icc0a977b9a908963448d6686a7b0063ec8ac3b64
---
M maintenance/findOrphanedFiles.php
1 file changed, 22 insertions(+), 14 deletions(-)

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



diff --git a/maintenance/findOrphanedFiles.php 
b/maintenance/findOrphanedFiles.php
index 65834c8..a1e274c 100644
--- a/maintenance/findOrphanedFiles.php
+++ b/maintenance/findOrphanedFiles.php
@@ -77,17 +77,18 @@
 
$dbr = $repo->getSlaveDB();
 
-   $names = array();
+   $curNames = array();
+   $oldNames = array();
$imgIN = array();
$oiWheres = array();
foreach ( $paths as $path ) {
$name = basename( $path );
-   $names[] = $name;
if ( preg_match( '#^archive/#', $path ) ) {
if ( $verbose ) {
$this->output( "Checking old file 
$name\n" );
}
 
+   $oldNames[] = $name;
list( , $base ) = explode( '!', $name, 2 ); // 
!
$oiWheres[] = $dbr->makeList(
array( 'oi_name' => $base, 
'oi_archive_name' => $name ),
@@ -98,6 +99,7 @@
$this->output( "Checking current file 
$name\n" );
}
 
+   $curNames[] = $name;
$imgIN[] = $name;
}
}
@@ -107,12 +109,12 @@
array(
$dbr->selectSQLText(
'image',
-   array( 'name' => 'img_name' ),
+   array( 'name' => 'img_name', 
'old' => 0 ),
$imgIN ? array( 'img_name' => 
$imgIN ) : '1=0'
),
$dbr->selectSQLText(
'oldimage',
-   array( 'name' => 
'oi_archive_name' ),
+   array( 'name' => 
'oi_archive_name', 'old' => 1 ),
$oiWheres ? $dbr->makeList( 
$oiWheres, LIST_OR ) : '1=0'
)
),
@@ -121,20 +123,26 @@
__METHOD__
);
 
-   $namesFound = array();
+   $curNamesFound = array();
+   $oldNamesFound = array();
foreach ( $res as $row ) {
-   $namesFound[] = $row->name;
+   if ( $row->old ) {
+   $oldNamesFound[] = $row->name;
+   } else {
+   $curNamesFound[] = $row->name;
+   }
}
 
-   $namesOrphans = array_diff( $names, $namesFound );
-   foreach ( $namesOrphans as $name ) {
+   foreach ( array_diff( $curNames, $curNamesFound ) as $name ) {
+   $file = $repo->newFile( $name );
// Print name and public URL to ease recovery
-   if ( strpos( $name, '!' ) !== false ) {
-   list( , $base ) = explode( '!', $name ); // 
!
-   $file = $repo->newFromArchiveName( 
Title::makeTitle( NS_FILE, $base ), $name );
-   } else {
-   $file = $repo->newFile( $name );
-   }
+   $this->output( $name . "\n" . $file->getCanonicalUrl() 
. "\n\n" );
+   }
+
+   foreach ( array_diff( $oldNames, $oldNamesFound ) as $name ) {
+   list( , $base ) = explode( '!', $name, 2 ); // 
!
+   $file = $repo->newFromArchiveName( Title::makeTitle( 
NS_FILE, $base ), $name );
+   // Print name and public URL to ease recovery
$this->output( $name . "\n" . $file->getCanonicalUrl() 
. "\n\n" );
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc0a977b9a908963448d6686a7b0063ec8ac3b64
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wm

[MediaWiki-commits] [Gerrit] Update packages - change (mediawiki...ORES)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update packages
..


Update packages

Update grunt-banana-checker to 0.4.0

Update grunt-jscs to 2.2.0

Update grunt-jsonlint to 1.0.5

Change-Id: Id5e0b5f2664eb88a0a1712a13c55e6f4dd661bcb
---
M package.json
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/package.json b/package.json
index 2717c89..b34053c 100644
--- a/package.json
+++ b/package.json
@@ -6,8 +6,8 @@
 "grunt": "0.4.5",
 "grunt-cli": "0.1.13",
 "grunt-contrib-jshint": "0.11.3",
-"grunt-banana-checker": "0.2.2",
-"grunt-jscs": "2.1.0",
-"grunt-jsonlint": "1.0.4"
+"grunt-banana-checker": "0.4.0",
+"grunt-jscs": "2.2.0",
+"grunt-jsonlint": "1.0.5"
   }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id5e0b5f2664eb88a0a1712a13c55e6f4dd661bcb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] build: Updating development dependencies - change (mediawiki...ORES)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: build: Updating development dependencies
..


build: Updating development dependencies

* mediawiki/mediawiki-codesniffer: 0.3.0 → 0.5.0

Change-Id: I269932cfde8bc74c4961ae298caa55961417cf61
---
M composer.json
M maintenance/CheckModelVersions.php
2 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/composer.json b/composer.json
index 534f8fb..4421418 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.*",
-   "mediawiki/mediawiki-codesniffer": "0.3.0"
+   "mediawiki/mediawiki-codesniffer": "0.5.0"
},
"scripts": {
"test": [
diff --git a/maintenance/CheckModelVersions.php 
b/maintenance/CheckModelVersions.php
index 59ff694..3925101 100644
--- a/maintenance/CheckModelVersions.php
+++ b/maintenance/CheckModelVersions.php
@@ -2,7 +2,7 @@
 
 require_once ( getenv( 'MW_INSTALL_PATH' ) !== false
? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
-   : dirname( __FILE__ ) . '/../../../maintenance/Maintenance.php' );
+   : __DIR__ . '/../../../maintenance/Maintenance.php' );
 
 /**
  * @ingroup Maintenance

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I269932cfde8bc74c4961ae298caa55961417cf61
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fix slow search on transaction ID (remove wildcard) - change (wikimedia...civicrm)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix slow search on transaction ID (remove wildcard)
..


Fix slow search on transaction ID (remove wildcard)

Bug: T117492
Change-Id: Ie4ea1295205e8dd57ffb8aca1cfc9cfbb7160869
---
M CRM/Contact/Form/Search/Advanced.php
M CRM/Contribute/Form/Search.php
2 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/CRM/Contact/Form/Search/Advanced.php 
b/CRM/Contact/Form/Search/Advanced.php
index 297d274..ce207e2 100644
--- a/CRM/Contact/Form/Search/Advanced.php
+++ b/CRM/Contact/Form/Search/Advanced.php
@@ -372,7 +372,7 @@
   'contribution_source',
   'membership_status_id',
   'participant_status_id',
-  'contribution_trxn_id',
+  // 'contribution_trxn_id',
   'activity_type_id',
   'status_id',
   'activity_subject',
diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php
index d1ca3d5..829d1ba 100644
--- a/CRM/Contribute/Form/Search.php
+++ b/CRM/Contribute/Form/Search.php
@@ -269,7 +269,7 @@
 'contribution_soft_credit_type_id',
 'contribution_status_id',
 'contribution_source',
-'contribution_trxn_id',
+//'contribution_trxn_id',
 'invoice_id',
   );
   foreach ($specialParams as $element) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie4ea1295205e8dd57ffb8aca1cfc9cfbb7160869
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] A few more FindOrphanedFiles fixes for "!" files - change (mediawiki/core)

2015-11-04 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: A few more FindOrphanedFiles fixes for "!" files
..

A few more FindOrphanedFiles fixes for "!" files

Taken from https://gerrit.wikimedia.org/r/#/c/251147/2

Change-Id: Icc0a977b9a908963448d6686a7b0063ec8ac3b64
---
M maintenance/findOrphanedFiles.php
1 file changed, 22 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/251162/1

diff --git a/maintenance/findOrphanedFiles.php 
b/maintenance/findOrphanedFiles.php
index 65834c8..a1e274c 100644
--- a/maintenance/findOrphanedFiles.php
+++ b/maintenance/findOrphanedFiles.php
@@ -77,17 +77,18 @@
 
$dbr = $repo->getSlaveDB();
 
-   $names = array();
+   $curNames = array();
+   $oldNames = array();
$imgIN = array();
$oiWheres = array();
foreach ( $paths as $path ) {
$name = basename( $path );
-   $names[] = $name;
if ( preg_match( '#^archive/#', $path ) ) {
if ( $verbose ) {
$this->output( "Checking old file 
$name\n" );
}
 
+   $oldNames[] = $name;
list( , $base ) = explode( '!', $name, 2 ); // 
!
$oiWheres[] = $dbr->makeList(
array( 'oi_name' => $base, 
'oi_archive_name' => $name ),
@@ -98,6 +99,7 @@
$this->output( "Checking current file 
$name\n" );
}
 
+   $curNames[] = $name;
$imgIN[] = $name;
}
}
@@ -107,12 +109,12 @@
array(
$dbr->selectSQLText(
'image',
-   array( 'name' => 'img_name' ),
+   array( 'name' => 'img_name', 
'old' => 0 ),
$imgIN ? array( 'img_name' => 
$imgIN ) : '1=0'
),
$dbr->selectSQLText(
'oldimage',
-   array( 'name' => 
'oi_archive_name' ),
+   array( 'name' => 
'oi_archive_name', 'old' => 1 ),
$oiWheres ? $dbr->makeList( 
$oiWheres, LIST_OR ) : '1=0'
)
),
@@ -121,20 +123,26 @@
__METHOD__
);
 
-   $namesFound = array();
+   $curNamesFound = array();
+   $oldNamesFound = array();
foreach ( $res as $row ) {
-   $namesFound[] = $row->name;
+   if ( $row->old ) {
+   $oldNamesFound[] = $row->name;
+   } else {
+   $curNamesFound[] = $row->name;
+   }
}
 
-   $namesOrphans = array_diff( $names, $namesFound );
-   foreach ( $namesOrphans as $name ) {
+   foreach ( array_diff( $curNames, $curNamesFound ) as $name ) {
+   $file = $repo->newFile( $name );
// Print name and public URL to ease recovery
-   if ( strpos( $name, '!' ) !== false ) {
-   list( , $base ) = explode( '!', $name ); // 
!
-   $file = $repo->newFromArchiveName( 
Title::makeTitle( NS_FILE, $base ), $name );
-   } else {
-   $file = $repo->newFile( $name );
-   }
+   $this->output( $name . "\n" . $file->getCanonicalUrl() 
. "\n\n" );
+   }
+
+   foreach ( array_diff( $oldNames, $oldNamesFound ) as $name ) {
+   list( , $base ) = explode( '!', $name, 2 ); // 
!
+   $file = $repo->newFromArchiveName( Title::makeTitle( 
NS_FILE, $base ), $name );
+   // Print name and public URL to ease recovery
$this->output( $name . "\n" . $file->getCanonicalUrl() 
. "\n\n" );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc0a977b9a908963448d6686a7b0063ec8ac3b64
Gerrit-PatchSet: 1
Gerri

[MediaWiki-commits] [Gerrit] Establish IPv6 for labs-support1-b-codfw - change (operations/dns)

2015-11-04 Thread Rush (Code Review)
Rush has submitted this change and it was merged.

Change subject: Establish IPv6 for labs-support1-b-codfw
..


Establish IPv6 for labs-support1-b-codfw

Specify the vrrp gateway

Bug: T115491
Change-Id: I381dbeac1ed6d604061d84d124fd50f7bde7683e
---
M templates/0.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/templates/0.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa 
b/templates/0.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
index e8ef1b8..e2e737e 100644
--- a/templates/0.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
+++ b/templates/0.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
@@ -127,8 +127,11 @@
 ; labs-support1-a-codfw (2620:0:860:121::/64) - RESERVED
 $ORIGIN 1.2.1.0.{{ zonename }}.
 
-; labs-hosts1-b-codfw (2620:0:860:118::/64) - RESERVED
+; labs-hosts1-b-codfw (2620:0:860:118::/64)
 $ORIGIN 8.1.1.0.{{ zonename }}.
+1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 1H IN PTR   vrrp-gw-2118.codfw.wmnet.
+1.0.0.0.0.0.0.0.0.0.0.0.0.0.e.f 1H IN PTR   ae2-2118.cr1-codfw.wikimedia.org.
+2.0.0.0.0.0.0.0.0.0.0.0.0.0.e.f 1H IN PTR   ae2-2118.cr2-codfw.wikimedia.org.
 
 ; labs-support1-b-codfw (2620:0:860:122::/64)
 $ORIGIN 2.2.1.0.{{ zonename }}.

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

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

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


[MediaWiki-commits] [Gerrit] New message classes for fredge queues - change (wikimedia...SmashPig)

2015-11-04 Thread Awight (Code Review)
Awight has uploaded a new change for review.

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

Change subject: New message classes for fredge queues
..

New message classes for fredge queues

Change-Id: Ib9bf80e397ab382a15944a041702d13e5f5f3053
---
A CrmLink/Messages/DonationInterfaceAntifraud.php
A CrmLink/Messages/DonationInterfaceFinalStatus.php
2 files changed, 42 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/61/251161/1

diff --git a/CrmLink/Messages/DonationInterfaceAntifraud.php 
b/CrmLink/Messages/DonationInterfaceAntifraud.php
new file mode 100644
index 000..4dc0973
--- /dev/null
+++ b/CrmLink/Messages/DonationInterfaceAntifraud.php
@@ -0,0 +1,20 @@
+https://gerrit.wikimedia.org/r/251161
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] Use Parsoid for new mobile-html-section routes - change (mediawiki...mobileapps)

2015-11-04 Thread Mobrovac (Code Review)
Mobrovac has submitted this change and it was merged.

Change subject: Use Parsoid for new mobile-html-section routes
..


Use Parsoid for new mobile-html-section routes

Instead of using mobileview for the page content, the
mobile-html-section* routes use Parsoid content.

Parsoid HTML is split into sections manually by looking for h2-h6 tags.
The anchors of those h[2-6] tags are built using an own implementation
of anchorencode since I wasn't able to find one online.
To help this implementation I added a dependency to the phpjs npm module.
See anchorencode in
https://www.mediawiki.org/wiki/Manual:PAGENAMEE_encoding#Encodings_compared

It still uses some of the old mobileview data, but just for some
of the metadata, not the content anymore. The mobileview call
has been changed to remove the sections and section text.

These routes now have an option path parameter "revision",
since Parsoid can return a specific revision of the page content.
Note that this is only true for the data we get from Parsoid,
meaning the page content, but currently not for the metadata.
So, some of the metadata is currently always showing the latest values.
Over time we'll try get more metadata from Parsoid.

This patch is pulling the revision and the lastmodified time stamp
from the Parsoid output. The revision is currently derived from the etag,
but I think we could also get it from the html tag about attribute.

We should look to see which pieces of metadata we can pull
out of Parsoid content. We can also add more Parsoid-specific
transformations.

Redirects:
Code was added to follow redirects from both RESTBase and Parsoid.
The redirects from Parsoid have a link tag in the payload.
The redirects coming from RESTBase have a 301 (potentially 302?) status code
(https://github.com/wikimedia/restbase/pull/365).

Step back:
* Instead of full URLs to the spokenWikipedia audio files
  we only have the "File:" names of the audio files.
  Renamed spoken.urls[] to spoken.files[] to indicate this restriction.
  I hope in the future the service could resolve the urls to the audio files 
automatically
  through subsequent requests. Alternatively, I think it would be cool to have 
an
  endpoint which provides an .m3u file of the audio files. This endpoint could 
resolve
  the actual audio files only when they are actually used.
  Then the client would only have one file to deal with, and we could pass this 
to an
  external audio player Android app.
* srcset attributes in  tags are not provided by Parsoid yet;
  hopefully soon. (T88827)
* Section header anchor ids had to be manually created. I hope Parsoid will 
provide
  them in the future: https://phabricator.wikimedia.org/T116876

Bug: T108777
Bug: T116200
Change-Id: I8cd54212f8aef6af2bc241d790221a7be9b4c199
---
A lib/anchorencode.js
M lib/mwapi.js
A lib/parsoid-access.js
M lib/transforms.js
M package.json
M routes/mobile-html-sections.js
M routes/mobile-html.js
M spec.yaml
M test/features/mobile-html-sections-lead/pagecontent.js
A test/lib/anchorencode/anchorencode-test.js
A test/lib/parsoid/parsoid-access-test.js
M test/lib/transforms/transforms-test.js
M test/utils/assert.js
13 files changed, 656 insertions(+), 91 deletions(-)

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



diff --git a/lib/anchorencode.js b/lib/anchorencode.js
new file mode 100644
index 000..47b6304
--- /dev/null
+++ b/lib/anchorencode.js
@@ -0,0 +1,31 @@
+'use strict';
+/**
+
+ JS implementation of anchorencode.
+
+ */
+
+var php = require('phpjs');
+
+/**
+ * Encodes an input string so that it can be used as an HTML anchor id (e.g. 
for a section in a page: ).
+ *
+ * See 
https://www.mediawiki.org/wiki/Manual:PAGENAMEE_encoding#Encodings_compared
+ * https://www.mediawiki.org/wiki/Special:Code/MediaWiki/16279
+ * core/include/parser/CoreParserFunctions.php
+ * https://phabricator.wikimedia.org/T9059
+ * https://gerrit.wikimedia.org/r/#/c/226032/
+ *
+ * @param input the input string (usually the heading text of a section 
heading)
+ * @return the sanitized version of the input string so it can be used as an 
anchor.
+ */
+function anchorencode(input) {
+var id = input.replace(/\s+/g, '_');
+return php.urlencode(id)
+.replace(/%3A/g, ':')
+.replace(/%/g, '.');
+}
+
+module.exports = {
+anchorencode: anchorencode
+};
diff --git a/lib/mwapi.js b/lib/mwapi.js
index 2bfe6d7..a330d58 100644
--- a/lib/mwapi.js
+++ b/lib/mwapi.js
@@ -17,12 +17,12 @@
  * @param response the response received from the API
  */
 function checkResponseStatus(response) {
-if (response.status < 200 || response.status > 299) {
-// there was an error in the MW API, propagate that
+if (response.status < 200 || response.status > 399) {
+// there was an error when calling the upstream service, propagate that
 throw new HTTPError({
 status: response.status,
 type: 'ap

[MediaWiki-commits] [Gerrit] Revert "Publish scap docs without $ZUUL_UUID" - change (integration/config)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Publish scap docs without $ZUUL_UUID"
..


Revert "Publish scap docs without $ZUUL_UUID"

This reverts commit 017288a14b719afd6c5cb7e406bd91e50ac9c979.

Change-Id: Ibd53de7639b5f5312495e7507bf016b9e16af66e
---
M jjb/mediawiki-tools.yaml
M jjb/publish.yaml
2 files changed, 19 insertions(+), 39 deletions(-)

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



diff --git a/jjb/mediawiki-tools.yaml b/jjb/mediawiki-tools.yaml
index dfdceb3..deb8285 100644
--- a/jjb/mediawiki-tools.yaml
+++ b/jjb/mediawiki-tools.yaml
@@ -5,24 +5,12 @@
 docsrc: 'html'
 docdest: 'mw-tools-releng'
 
-# Job that updates scap docs on doc.wikimedia.org hourly
-- job:
-name: 'mw-tools-scap-tox-doc-publish'
-node: contintLabsSlave && UbuntuPrecise
-triggers:
-  - pollscm: '@hourly'
-scm:
-  - git:
-  url: 'https://phabricator.wikimedia.org/diffusion/MSCA/scap'
-  branches:
-- 'origin/master'
-  wipe-workspace: true
-builders:
-  - tox:
-  venv: doc
-  - doc-publish:
-  docsrc: 'docs/_build/html'
-  docdest: 'mw-tools-scap'
+- project:
+name: 'mw-tools-scap'
+jobs:
+ - '{name}-tox-doc-publish':
+docsrc: 'docs/_build/html'
+docdest: 'mw-tools-scap'
 
 # Job to run MW-CS patchsets against
 # mediwiki/core's includes/ directory for easier
diff --git a/jjb/publish.yaml b/jjb/publish.yaml
index 3a93f6b..86dd5b3 100644
--- a/jjb/publish.yaml
+++ b/jjb/publish.yaml
@@ -14,9 +14,8 @@
  - shell: |
  set -u
  echo "Making sure that destination does not contain unset variables 
(like DOC_SUBPATH, see zuul/doc_functions.py): {docdest}"
- UUID=$(cat /proc/sys/kernel/random/uuid)
- [ $UUID ]
- rsync --recursive "{docsrc}/" "rsync://10.68.16.255/doc/$UUID"
+ [ $ZUUL_UUID ]
+ rsync --recursive "{docsrc}/" "rsync://10.68.16.255/doc/$ZUUL_UUID"
  echo
  echo "Publishing to https://doc.wikimedia.org/{docdest}/";
  - trigger-builds:
@@ -26,7 +25,6 @@
  predefined-parameters: |
WMF_CI_PUB_DOCROOT=org/wikimedia/doc
WMF_CI_PUB_DEST={docdest}
-   UUID=$UUID
 
 # Sync files from a Jenkins slave in labs to a central rsync server from which
 # another job (executing on gallium) can pull in the files and publish them
@@ -44,9 +42,8 @@
  - shell: |
  set -u
  echo "Making sure that destination does not contain unset variables 
(like DOC_SUBPATH, see zuul/doc_functions.py): {dest}"
- UUID=$(cat /proc/sys/kernel/random/uuid)
- [ $UUID ]
- rsync --recursive "{src}/" "rsync://10.68.16.255/doc/$UUID"
+ [ $ZUUL_UUID ]
+ rsync --recursive "{src}/" "rsync://10.68.16.255/doc/$ZUUL_UUID"
  echo
  echo "Publishing to https://integration.wikimedia.org/cover/{dest}/";
  - trigger-builds:
@@ -56,7 +53,6 @@
  predefined-parameters: |
WMF_CI_PUB_DOCROOT=org/wikimedia/integration
WMF_CI_PUB_DEST=cover/{dest}
-   UUID=$UUID
 
 # rsync a directory from integration-publisher.eqiad.wmflabs to a website on 
gallium.
 #
@@ -70,7 +66,7 @@
 #   * docroot: org/wikimedia/integration
 #   * dest: cover/PROJECT
 #
-# Uses $UUID as a unique identifier.
+# Uses $ZUUL_UUID as a unique identifier.
 - job:
 name: publish-on-gallium
 node: gallium
@@ -88,21 +84,17 @@
  # WILL be auto-created if non-existent.
  name: 'WMF_CI_PUB_DEST'
  description: 'Sub directory path under the chosen document root, such 
as "mediawiki-core/DOC_SUBPATH/js"'
- - string:
- # Passed from upstream jobs
- name: 'UUID'
- description: 'Directory on integration-publisher/doc rsync server 
from which generated documentation is fetched'
 
 triggers:
  - zuul
 builders:
  - shell: |
  set -u
- echo "Publishing $WMF_CI_PUB_DEST from labs to prod"
- echo "UUID: $UUID"
+ echo "Publishing $ZUUL_PROJECT from labs to prod"
+ echo "Zuul UUID: $ZUUL_UUID"
  echo "..."
 
- [ $UUID ]
+ [ $ZUUL_UUID ]
  LOCAL_DOCROOT="/srv/$WMF_CI_PUB_DOCROOT"
  if [ ! -d $LOCAL_DOCROOT ]; then
 echo "Error: Invalid docroot. Directory $LOCAL_DOCROOT must exist, 
aborting."
@@ -110,7 +102,7 @@
  fi
  LOCAL_DEST="$LOCAL_DOCROOT/$WMF_CI_PUB_DEST"
  mkdir -p "$LOCAL_DEST"
- rsync --recursive --delete-after "rsync://10.68.16.255/doc/$UUID"/ 
"$LOCAL_DEST"
+ rsync --recursive --delete-after 
"rsync://10.68.16.255/doc/$ZUUL_UUID"/ "$LOCAL_DEST"
 
  LOCAL_VHOST=$(echo $WMF_CI_PUB_DOCROOT | awk -F'/' '{ print 
$3"."$2"."$1 }')
  echo
@@ -120,18 +112,18 @@
  builders:
   - shell: |

[MediaWiki-commits] [Gerrit] Fix normalization when fee or net is present but empty - change (wikimedia...crm)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix normalization when fee or net is present but empty
..


Fix normalization when fee or net is present but empty

Change-Id: I74b68a2add574bb9ecf6c7e9c130df99d81f9cab
---
M sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
2 files changed, 21 insertions(+), 3 deletions(-)

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



diff --git 
a/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
index f232a92..5264b96 100644
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/NormalizeMessageTest.php
@@ -79,4 +79,20 @@
 $normal_msg_2 = wmf_civicrm_normalize_msg( $normal_msg_1 );
 $this->assertEquals( $original_msg, $normal_msg_2 );
 }
+
+   public function testEmptyNet() {
+   $msg = array(
+   'gateway' => 'adyen',
+   'payment_method' => 'cc',
+   'first_name' => 'blah',
+   'last_name' => 'wah',
+   'country' => 'US',
+   'currency' => 'USD',
+   'gross' => '1.00',
+   'net' => '',
+   'fee' => '0.21',
+   );
+   $normalized = wmf_civicrm_normalize_msg( $msg );
+   $this->assertEquals( 0.79, $normalized['net'] );
+   }
 }
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 0e6b8cb..4b43d50 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -735,12 +735,14 @@
 $msg['original_gross'] = $msg['gross'];
 }
 
-if ( !array_key_exists('fee', $msg) && !array_key_exists('net', $msg) ) {
+$validFee = array_key_exists( 'fee', $msg ) && is_numeric( $msg['fee'] );
+$validNet = array_key_exists( 'net', $msg ) && is_numeric( $msg['net'] );
+if ( !$validFee && !$validNet ) {
 $msg['fee'] = '0.00';
 $msg['net'] = $msg['gross'];
-} elseif ( !array_key_exists('fee', $msg) && array_key_exists('net', $msg) 
) {
+} elseif ( $validNet && !$validFee ) {
 $msg['fee'] = $msg['gross'] - $msg['net'];
-} elseif ( array_key_exists('fee', $msg) && !array_key_exists('net', $msg) 
) {
+} elseif ( $validFee && !$validNet ) {
 $msg['net'] = $msg['gross'] - $msg['fee'];
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I74b68a2add574bb9ecf6c7e9c130df99d81f9cab
Gerrit-PatchSet: 5
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Revert "Publish scap docs without $ZUUL_UUID" - change (integration/config)

2015-11-04 Thread Thcipriani (Code Review)
Thcipriani has uploaded a new change for review.

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

Change subject: Revert "Publish scap docs without $ZUUL_UUID"
..

Revert "Publish scap docs without $ZUUL_UUID"

This reverts commit 017288a14b719afd6c5cb7e406bd91e50ac9c979.

Change-Id: Ibd53de7639b5f5312495e7507bf016b9e16af66e
---
M jjb/mediawiki-tools.yaml
M jjb/publish.yaml
2 files changed, 19 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/60/251160/1

diff --git a/jjb/mediawiki-tools.yaml b/jjb/mediawiki-tools.yaml
index dfdceb3..deb8285 100644
--- a/jjb/mediawiki-tools.yaml
+++ b/jjb/mediawiki-tools.yaml
@@ -5,24 +5,12 @@
 docsrc: 'html'
 docdest: 'mw-tools-releng'
 
-# Job that updates scap docs on doc.wikimedia.org hourly
-- job:
-name: 'mw-tools-scap-tox-doc-publish'
-node: contintLabsSlave && UbuntuPrecise
-triggers:
-  - pollscm: '@hourly'
-scm:
-  - git:
-  url: 'https://phabricator.wikimedia.org/diffusion/MSCA/scap'
-  branches:
-- 'origin/master'
-  wipe-workspace: true
-builders:
-  - tox:
-  venv: doc
-  - doc-publish:
-  docsrc: 'docs/_build/html'
-  docdest: 'mw-tools-scap'
+- project:
+name: 'mw-tools-scap'
+jobs:
+ - '{name}-tox-doc-publish':
+docsrc: 'docs/_build/html'
+docdest: 'mw-tools-scap'
 
 # Job to run MW-CS patchsets against
 # mediwiki/core's includes/ directory for easier
diff --git a/jjb/publish.yaml b/jjb/publish.yaml
index 3a93f6b..86dd5b3 100644
--- a/jjb/publish.yaml
+++ b/jjb/publish.yaml
@@ -14,9 +14,8 @@
  - shell: |
  set -u
  echo "Making sure that destination does not contain unset variables 
(like DOC_SUBPATH, see zuul/doc_functions.py): {docdest}"
- UUID=$(cat /proc/sys/kernel/random/uuid)
- [ $UUID ]
- rsync --recursive "{docsrc}/" "rsync://10.68.16.255/doc/$UUID"
+ [ $ZUUL_UUID ]
+ rsync --recursive "{docsrc}/" "rsync://10.68.16.255/doc/$ZUUL_UUID"
  echo
  echo "Publishing to https://doc.wikimedia.org/{docdest}/";
  - trigger-builds:
@@ -26,7 +25,6 @@
  predefined-parameters: |
WMF_CI_PUB_DOCROOT=org/wikimedia/doc
WMF_CI_PUB_DEST={docdest}
-   UUID=$UUID
 
 # Sync files from a Jenkins slave in labs to a central rsync server from which
 # another job (executing on gallium) can pull in the files and publish them
@@ -44,9 +42,8 @@
  - shell: |
  set -u
  echo "Making sure that destination does not contain unset variables 
(like DOC_SUBPATH, see zuul/doc_functions.py): {dest}"
- UUID=$(cat /proc/sys/kernel/random/uuid)
- [ $UUID ]
- rsync --recursive "{src}/" "rsync://10.68.16.255/doc/$UUID"
+ [ $ZUUL_UUID ]
+ rsync --recursive "{src}/" "rsync://10.68.16.255/doc/$ZUUL_UUID"
  echo
  echo "Publishing to https://integration.wikimedia.org/cover/{dest}/";
  - trigger-builds:
@@ -56,7 +53,6 @@
  predefined-parameters: |
WMF_CI_PUB_DOCROOT=org/wikimedia/integration
WMF_CI_PUB_DEST=cover/{dest}
-   UUID=$UUID
 
 # rsync a directory from integration-publisher.eqiad.wmflabs to a website on 
gallium.
 #
@@ -70,7 +66,7 @@
 #   * docroot: org/wikimedia/integration
 #   * dest: cover/PROJECT
 #
-# Uses $UUID as a unique identifier.
+# Uses $ZUUL_UUID as a unique identifier.
 - job:
 name: publish-on-gallium
 node: gallium
@@ -88,21 +84,17 @@
  # WILL be auto-created if non-existent.
  name: 'WMF_CI_PUB_DEST'
  description: 'Sub directory path under the chosen document root, such 
as "mediawiki-core/DOC_SUBPATH/js"'
- - string:
- # Passed from upstream jobs
- name: 'UUID'
- description: 'Directory on integration-publisher/doc rsync server 
from which generated documentation is fetched'
 
 triggers:
  - zuul
 builders:
  - shell: |
  set -u
- echo "Publishing $WMF_CI_PUB_DEST from labs to prod"
- echo "UUID: $UUID"
+ echo "Publishing $ZUUL_PROJECT from labs to prod"
+ echo "Zuul UUID: $ZUUL_UUID"
  echo "..."
 
- [ $UUID ]
+ [ $ZUUL_UUID ]
  LOCAL_DOCROOT="/srv/$WMF_CI_PUB_DOCROOT"
  if [ ! -d $LOCAL_DOCROOT ]; then
 echo "Error: Invalid docroot. Directory $LOCAL_DOCROOT must exist, 
aborting."
@@ -110,7 +102,7 @@
  fi
  LOCAL_DEST="$LOCAL_DOCROOT/$WMF_CI_PUB_DEST"
  mkdir -p "$LOCAL_DEST"
- rsync --recursive --delete-after "rsync://10.68.16.255/doc/$UUID"/ 
"$LOCAL_DEST"
+ rsync --recursive --delete-after 
"rsync://10.68.16.255/doc/$ZUUL_UUID"/ "$LOCAL_DEST"
 
  LOCAL_VHOST=$(echo $WMF_CI_PUB_DOCROOT | awk -F'/' '{ print 
$3"."$2"."$1 }')
  echo
@@ -120,18 +112,18 @@

[MediaWiki-commits] [Gerrit] Don't allow creation of invalid domains - change (labs/invisible-unicorn)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: Don't allow creation of invalid domains
..


Don't allow creation of invalid domains

Bug: T69927
Change-Id: I1b8fb8f075ce54e031bdb863155788205153cd86
---
M invisible_unicorn/api.py
1 file changed, 17 insertions(+), 0 deletions(-)

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



diff --git a/invisible_unicorn/api.py b/invisible_unicorn/api.py
index b185f4f..892e052 100644
--- a/invisible_unicorn/api.py
+++ b/invisible_unicorn/api.py
@@ -28,6 +28,7 @@
 API is meant to be used by Wikitech only, and nothing else"""
 import flask
 import redis
+import re
 from flask.ext.sqlalchemy import SQLAlchemy
 
 
@@ -100,6 +101,18 @@
 
 redis_store = RedisStore(redis.Redis())
 
+def is_valid_domain(hostname):
+"""
+Credit for this function goes to Tim Pietzcker and other StackOverflow 
contributors
+See https://stackoverflow.com/a/2532344
+"""
+if len(hostname) > 255:
+return False
+if hostname[-1] == ".":
+hostname = hostname[:-1] # strip exactly one dot from the right, if 
present
+allowed = re.compile("(?!-)[A-Z\d-]{1,63}(?/mapping', methods=['GET'])
 def all_mappings(project_name):
 project = Project.query.filter_by(name=project_name).first()
@@ -120,6 +133,8 @@
 if 'domain' not in data or 'backends' not in data or not 
isinstance(data['backends'], list):
 return "Valid JSON but invalid format. Needs domain string and 
backends array"
 domain = data['domain']
+if not is_valid_domain(domain):
+return "Invalid domain", 400
 backend_urls = data['backends']
 
 project = Project.query.filter_by(name=project_name).first()
@@ -193,6 +208,8 @@
 return "Valid JSON but invalid format. Needs domain string and 
backends array", 400
 
 new_domain = data['domain']
+if not is_valid_domain(new_domain):
+return "Invalid domain", 400
 backend_urls = data['backends']
 
 if route.domain != new_domain:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b8fb8f075ce54e031bdb863155788205153cd86
Gerrit-PatchSet: 1
Gerrit-Project: labs/invisible-unicorn
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Yuvipanda 

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


[MediaWiki-commits] [Gerrit] Add modern nova policy file. - change (operations/puppet)

2015-11-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Add modern nova policy file.
..


Add modern nova policy file.

Change-Id: Ia9c4ce11cc0530fba22b411369ec189933f14d40
---
M modules/openstack/files/kilo/nova/policy.json
1 file changed, 381 insertions(+), 108 deletions(-)

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



diff --git a/modules/openstack/files/kilo/nova/policy.json 
b/modules/openstack/files/kilo/nova/policy.json
index 4773b11..cd7145c 100644
--- a/modules/openstack/files/kilo/nova/policy.json
+++ b/modules/openstack/files/kilo/nova/policy.json
@@ -1,120 +1,393 @@
 {
-"context_is_admin":  [["role:admin"]],
-"admin_or_owner":  [["is_admin:True"], ["project_id:%(project_id)s"]],
-"default": [["rule:admin_or_owner"]],
+"context_is_admin":  "role:admin",
+"admin_or_owner":  "is_admin:True or project_id:%(project_id)s",
+"default": "rule:admin_or_owner",
 
+"cells_scheduler_filter:TargetCellFilter": "is_admin:True",
 
-"compute:create": [["role:projectadmin"]],
-"compute:create:attach_network": [["role:projectadmin"]],
-"compute:create:attach_volume": [["role:projectadmin"]],
-"compute:get_all": [],
+"compute:create": "rule:admin_or_owner",
+"compute:create:attach_network": "rule:admin_or_owner",
+"compute:create:attach_volume": "rule:admin_or_owner",
+"compute:create:forced_host": "is_admin:True",
+"compute:get_all": "",
+"compute:get_all_tenants": "",
+"compute:start": "rule:admin_or_owner",
+"compute:stop": "rule:admin_or_owner",
+"compute:unlock_override": "rule:admin_api",
 
+"compute:shelve": "rule:admin_or_owner",
+"compute:shelve_offload": "rule:admin_or_owner",
+"compute:unshelve": "rule:admin_or_owner",
+"compute:resize": "rule:admin_or_owner",
+"compute:confirm_resize": "rule:admin_or_owner",
+"compute:revert_resize": "rule:admin_or_owner",
+"compute:rebuild": "rule:admin_or_owner",
+"compute:reboot": "rule:admin_or_owner",
 
-"admin_api": [["is_admin:True"]],
-"compute_extension:accounts": [["rule:admin_api"]],
-"compute_extension:admin_actions": [["rule:admin_api"]],
-"compute_extension:admin_actions:pause": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:unpause": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:suspend": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:resume": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:lock": [["rule:admin_api"]],
-"compute_extension:admin_actions:unlock": [["rule:admin_api"]],
-"compute_extension:admin_actions:resetNetwork": [["rule:admin_api"]],
-"compute_extension:admin_actions:injectNetworkInfo": [["rule:admin_api"]],
-"compute_extension:admin_actions:createBackup": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:migrateLive": [["rule:admin_api"]],
-"compute_extension:admin_actions:resetState": [["rule:admin_api"]],
-"compute_extension:admin_actions:migrate": [["rule:admin_api"]],
-"compute_extension:aggregates": [["rule:admin_api"]],
-"compute_extension:certificates": [],
-"compute_extension:cloudpipe": [["rule:admin_api"]],
-"compute_extension:console_output": [["role:projectadmin"]],
-"compute_extension:consoles": [["role:projectadmin"]],
-"compute_extension:createserverext": [["role:projectadmin"]],
-"compute_extension:deferred_delete": [["role:projectadmin"]],
-"compute_extension:disk_config": [["role:projectadmin"]],
-"compute_extension:extended_server_attributes": [],
-"compute_extension:extended_status": [],
-"compute_extension:flavor_access": [],
-"compute_extension:flavor_disabled": [],
-"compute_extension:flavor_rxtx": [],
-"compute_extension:flavor_swap": [],
-"compute_extension:flavorextradata": [],
-"compute_extension:flavorextraspecs": [],
-"compute_extension:flavormanage": [["rule:admin_api"]],
-"compute_extension:floating_ip_dns": [["role:projectadmin"]],
-"compute_extension:floating_ip_pools": [["role:projectadmin"]],
-"compute_extension:floating_ips": [["role:projectadmin"]],
-"compute_extension:hosts": [["rule:admin_api"]],
-"compute_extension:hypervisors": [["rule:admin_api"]],
-"compute_extension:instance_usage_audit_log": [["rule:admin_api"]],
-"compute_extension:keypairs": [["role:projectadmin"]],
-"compute_extension:multinic": [["role:projectadmin"]],
-"compute_extension:networks": [],
-"compute_extension:networks:view": [],
-"compute_extension:quotas:show": [["role:projectadmin"]],
-"compute_extension:quotas:update": [["rule:admin_api"]],
-"compute_extension:quota_classes": [["role:projectadmin"]],
-"compute_extension:rescue": [["role:projectadmin"]],
-"compute_extension:security_groups": [["role:projectadmin"]],
-"compute_extensio

[MediaWiki-commits] [Gerrit] Publish scap docs without $ZUUL_UUID - change (integration/config)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Publish scap docs without $ZUUL_UUID
..


Publish scap docs without $ZUUL_UUID

Creates a new job for `mw-tools-scap-tox-doc-publish` so scap docs can
be generated from the canonical repo on diffusion.

Replaces the use of the `$ZUUL_UUID` in the doc publish docs with a uuid
from `/proc/kernel/random/uuid`

Bug: T117770
Change-Id: Ib4753ad493115682d902cf15136199fd2083b8e5
---
M jjb/mediawiki-tools.yaml
M jjb/publish.yaml
2 files changed, 39 insertions(+), 19 deletions(-)

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



diff --git a/jjb/mediawiki-tools.yaml b/jjb/mediawiki-tools.yaml
index deb8285..dfdceb3 100644
--- a/jjb/mediawiki-tools.yaml
+++ b/jjb/mediawiki-tools.yaml
@@ -5,12 +5,24 @@
 docsrc: 'html'
 docdest: 'mw-tools-releng'
 
-- project:
-name: 'mw-tools-scap'
-jobs:
- - '{name}-tox-doc-publish':
-docsrc: 'docs/_build/html'
-docdest: 'mw-tools-scap'
+# Job that updates scap docs on doc.wikimedia.org hourly
+- job:
+name: 'mw-tools-scap-tox-doc-publish'
+node: contintLabsSlave && UbuntuPrecise
+triggers:
+  - pollscm: '@hourly'
+scm:
+  - git:
+  url: 'https://phabricator.wikimedia.org/diffusion/MSCA/scap'
+  branches:
+- 'origin/master'
+  wipe-workspace: true
+builders:
+  - tox:
+  venv: doc
+  - doc-publish:
+  docsrc: 'docs/_build/html'
+  docdest: 'mw-tools-scap'
 
 # Job to run MW-CS patchsets against
 # mediwiki/core's includes/ directory for easier
diff --git a/jjb/publish.yaml b/jjb/publish.yaml
index 86dd5b3..3a93f6b 100644
--- a/jjb/publish.yaml
+++ b/jjb/publish.yaml
@@ -14,8 +14,9 @@
  - shell: |
  set -u
  echo "Making sure that destination does not contain unset variables 
(like DOC_SUBPATH, see zuul/doc_functions.py): {docdest}"
- [ $ZUUL_UUID ]
- rsync --recursive "{docsrc}/" "rsync://10.68.16.255/doc/$ZUUL_UUID"
+ UUID=$(cat /proc/sys/kernel/random/uuid)
+ [ $UUID ]
+ rsync --recursive "{docsrc}/" "rsync://10.68.16.255/doc/$UUID"
  echo
  echo "Publishing to https://doc.wikimedia.org/{docdest}/";
  - trigger-builds:
@@ -25,6 +26,7 @@
  predefined-parameters: |
WMF_CI_PUB_DOCROOT=org/wikimedia/doc
WMF_CI_PUB_DEST={docdest}
+   UUID=$UUID
 
 # Sync files from a Jenkins slave in labs to a central rsync server from which
 # another job (executing on gallium) can pull in the files and publish them
@@ -42,8 +44,9 @@
  - shell: |
  set -u
  echo "Making sure that destination does not contain unset variables 
(like DOC_SUBPATH, see zuul/doc_functions.py): {dest}"
- [ $ZUUL_UUID ]
- rsync --recursive "{src}/" "rsync://10.68.16.255/doc/$ZUUL_UUID"
+ UUID=$(cat /proc/sys/kernel/random/uuid)
+ [ $UUID ]
+ rsync --recursive "{src}/" "rsync://10.68.16.255/doc/$UUID"
  echo
  echo "Publishing to https://integration.wikimedia.org/cover/{dest}/";
  - trigger-builds:
@@ -53,6 +56,7 @@
  predefined-parameters: |
WMF_CI_PUB_DOCROOT=org/wikimedia/integration
WMF_CI_PUB_DEST=cover/{dest}
+   UUID=$UUID
 
 # rsync a directory from integration-publisher.eqiad.wmflabs to a website on 
gallium.
 #
@@ -66,7 +70,7 @@
 #   * docroot: org/wikimedia/integration
 #   * dest: cover/PROJECT
 #
-# Uses $ZUUL_UUID as a unique identifier.
+# Uses $UUID as a unique identifier.
 - job:
 name: publish-on-gallium
 node: gallium
@@ -84,17 +88,21 @@
  # WILL be auto-created if non-existent.
  name: 'WMF_CI_PUB_DEST'
  description: 'Sub directory path under the chosen document root, such 
as "mediawiki-core/DOC_SUBPATH/js"'
+ - string:
+ # Passed from upstream jobs
+ name: 'UUID'
+ description: 'Directory on integration-publisher/doc rsync server 
from which generated documentation is fetched'
 
 triggers:
  - zuul
 builders:
  - shell: |
  set -u
- echo "Publishing $ZUUL_PROJECT from labs to prod"
- echo "Zuul UUID: $ZUUL_UUID"
+ echo "Publishing $WMF_CI_PUB_DEST from labs to prod"
+ echo "UUID: $UUID"
  echo "..."
 
- [ $ZUUL_UUID ]
+ [ $UUID ]
  LOCAL_DOCROOT="/srv/$WMF_CI_PUB_DOCROOT"
  if [ ! -d $LOCAL_DOCROOT ]; then
 echo "Error: Invalid docroot. Directory $LOCAL_DOCROOT must exist, 
aborting."
@@ -102,7 +110,7 @@
  fi
  LOCAL_DEST="$LOCAL_DOCROOT/$WMF_CI_PUB_DEST"
  mkdir -p "$LOCAL_DEST"
- rsync --recursive --delete-after 
"rsync://10.68.16.255/doc/$ZUUL_UUID"/ "$LOCAL_DEST"
+ rsync --recursive --delete-after "rsync://10.68.16.255/doc/$UUID"/ 
"$LOCAL_DEST"
 
 

[MediaWiki-commits] [Gerrit] Suggestions: Wrap the personal and public collections - change (mediawiki...ContentTranslation)

2015-11-04 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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

Change subject: Suggestions: Wrap the personal and public collections
..

Suggestions: Wrap the personal and public collections

So that hide/show of tabs becomes more simple.

Change-Id: I60fa914dd8058a34553a287d80a1d926a0c8744e
---
M modules/dashboard/ext.cx.suggestionlist.js
1 file changed, 18 insertions(+), 25 deletions(-)


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

diff --git a/modules/dashboard/ext.cx.suggestionlist.js 
b/modules/dashboard/ext.cx.suggestionlist.js
index 9237093..b357c5b 100644
--- a/modules/dashboard/ext.cx.suggestionlist.js
+++ b/modules/dashboard/ext.cx.suggestionlist.js
@@ -40,11 +40,12 @@
sourceLanguage: null,
targetLanguage: null
};
+   this.$suggestionsContainer = null;
this.$personalCollection = null;
this.$publicCollection = null;
this.seed = null;
-   this.listen();
this.init();
+   this.listen();
}
 
CXSuggestionList.prototype.init = function () {
@@ -57,7 +58,10 @@
$publicCollectionTitle = $( '' )
.text( mw.msg( 'cx-suggestionlist-title' ) )
.addClass( 'cx-suggestionlist__public-title' );
-   this.$container.append( this.$personalCollection, 
$publicCollectionTitle, this.$publicCollection );
+   this.$suggestionsContainer = $( '' )
+   .addClass( 'cx-suggestionlist-container' )
+   .append( this.$personalCollection, 
$publicCollectionTitle, this.$publicCollection );
+   this.$container.append( this.$suggestionsContainer );
this.initLanguages();
};
 
@@ -213,11 +217,7 @@
 
CXSuggestionList.prototype.show = function () {
this.active = true;
-   $.each( this.lists, function ( index, list ) {
-   if ( list.$list ) {
-   list.$list.show();
-   }
-   } );
+   this.$suggestionsContainer.show();
if ( !Object.keys( this.lists ).length ) {
this.loadItems();
this.loadItems( {
@@ -228,11 +228,7 @@
 
CXSuggestionList.prototype.hide = function () {
this.active = false;
-   $.each( this.lists, function ( index, list ) {
-   if ( list.$list ) {
-   list.$list.hide();
-   }
-   } );
+   this.$suggestionsContainer.hide();
};
 
CXSuggestionList.prototype.applyFilters = function () {
@@ -252,6 +248,9 @@
} );
this.lists = {};
this.recommendtool = null;
+   this.$personalCollection.empty().show();
+   this.$publicCollection.empty().show();
+
this.loadItems();
this.loadItems( {
id: 'trex'
@@ -646,16 +645,10 @@
)
);
 
-   this.$container.append( this.lists[ listId ].$list );
+   this.$suggestionsContainer.append( this.lists[ listId 
].$list );
}
-
-   // Hide all other lists, if any.
-   $.each( this.lists, function ( index, list ) {
-   if ( list.$list ) {
-   list.$list.hide();
-   }
-   } );
-
+   this.$personalCollection.hide();
+   this.$publicCollection.hide();
this.lists[ listId ].$list.show();
};
 
@@ -681,7 +674,7 @@
 * Event handlers
 */
CXSuggestionList.prototype.listen = function () {
-   this.$container.on( 'click', '.cx-suggestionlist .cx-slitem', 
function () {
+   this.$suggestionsContainer.on( 'click', '.cx-suggestionlist 
.cx-slitem', function () {
var cxSelector, suggestion;
 
cxSelector = $( this ).data( 'cxsourceselector' );
@@ -805,7 +798,7 @@
 
if ( list.$list.is( '.cx-suggestionlist--collapsed' ) ) {
// Collapse all expended lists.
-   this.$container.find( '.cx-suggestionlist__collapse' 
).trigger( 'click' );
+   this.$suggestionsContainer.find( 
'.cx-suggestionlist__collapse' ).trigger( 'click' );
$trigger.text( mw.msg( 'cx-suggestionlist-collapse' ) );
} else {
$trigger.text( mw.msg( 'cx-suggestionlist-expand' ) );
@@ -821,11 +814,11 @@
CXSuggestionList

[MediaWiki-commits] [Gerrit] mariadb: 32 lint fixes - change (operations/puppet)

2015-11-04 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: mariadb: 32 lint fixes
..


mariadb: 32 lint fixes

puppet-lint mariadb.pp  | wc -l

before: 72after: 40

Change-Id: If7b7ea27ef3ce1b5d0a4260cb64289de4b0400c6
---
M manifests/role/mariadb.pp
1 file changed, 32 insertions(+), 32 deletions(-)

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



diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp
index 2d423c4..93f9a4e 100644
--- a/manifests/role/mariadb.pp
+++ b/manifests/role/mariadb.pp
@@ -35,7 +35,7 @@
 if $shard {
 $nodepool_pass = $passwords::nodepool::nodepooldb_pass
 
-file { "/etc/mysql/production-grants-shard.sql":
+file { '/etc/mysql/production-grants-shard.sql':
 ensure  => present,
 owner   => 'root',
 group   => 'root',
@@ -52,20 +52,20 @@
 # can grant additional access to other hosts
 
 ferm::service{ 'mariadb_internal':
-proto  => 'tcp',
-port   => 3306,
+proto   => 'tcp',
+port=> '3306',
 notrack => true,
-srange => '$INTERNAL',
+srange  => '$INTERNAL',
 }
 
 # tendril monitoring
 ferm::rule { 'mariabdb_monitoring':
-rule => "saddr @resolve((neon.wikimedia.org iron.wikimedia.org)) proto 
tcp dport (3306) ACCEPT;",
+rule => 'saddr @resolve((neon.wikimedia.org iron.wikimedia.org)) proto 
tcp dport (3306) ACCEPT;',
 }
 
 # for DBA purposes
 ferm::rule { 'mariabdb_dba':
-rule => "saddr @resolve((neon.wikimedia.org iron.wikimedia.org 
db1011.eqiad.wmnet)) proto tcp dport (3307) ACCEPT;",
+rule => 'saddr @resolve((neon.wikimedia.org iron.wikimedia.org 
db1011.eqiad.wmnet)) proto tcp dport (3307) ACCEPT;',
 }
 }
 
@@ -200,7 +200,7 @@
 ) {
 
 system::role { 'role::mariadb::misc':
-description => "Eventlogging Database",
+description => 'Eventlogging Database',
 }
 
 include standard
@@ -449,7 +449,7 @@
 $p_s = 'off',
 ) {
 
-system::role { "role::mariadb::core":
+system::role { 'role::mariadb::core':
 description => "Core DB Server ${shard}",
 }
 
@@ -480,8 +480,8 @@
 
 class role::mariadb::sanitarium {
 
-system::role { "role::mariadb::sanitarium":
-description => "Sanitarium DB Server",
+system::role { 'role::mariadb::sanitarium':
+description => 'Sanitarium DB Server',
 }
 
 include standard
@@ -493,7 +493,7 @@
 }
 
 class { 'mariadb::config':
-prompt   => "SANITARIUM",
+prompt   => 'SANITARIUM',
 config   => 'mariadb/sanitarium.my.cnf.erb',
 password => $passwords::misc::scripts::mysql_root_pass,
 }
@@ -519,20 +519,20 @@
 # One instance per shard using mysqld_multi.
 # This allows us to send separate replication channels downstream.
 $folders = [
-"/srv/sqldata.s1",
-"/srv/sqldata.s2",
-"/srv/sqldata.s3",
-"/srv/sqldata.s4",
-"/srv/sqldata.s5",
-"/srv/sqldata.s6",
-"/srv/sqldata.s7",
-"/srv/tmp.s1",
-"/srv/tmp.s2",
-"/srv/tmp.s3",
-"/srv/tmp.s4",
-"/srv/tmp.s5",
-"/srv/tmp.s6",
-"/srv/tmp.s7",
+'/srv/sqldata.s1',
+'/srv/sqldata.s2',
+'/srv/sqldata.s3',
+'/srv/sqldata.s4',
+'/srv/sqldata.s5',
+'/srv/sqldata.s6',
+'/srv/sqldata.s7',
+'/srv/tmp.s1',
+'/srv/tmp.s2',
+'/srv/tmp.s3',
+'/srv/tmp.s4',
+'/srv/tmp.s5',
+'/srv/tmp.s6',
+'/srv/tmp.s7',
 ]
 
 file { $folders:
@@ -585,7 +585,7 @@
 }
 
 class { 'mariadb::config':
-prompt   => "LABS",
+prompt   => 'LABS',
 config   => 'mariadb/labs.my.cnf.erb',
 password => $passwords::misc::scripts::mysql_root_pass,
 datadir  => '/srv/sqldata',
@@ -609,7 +609,7 @@
 # Required for TokuDB to start
 # See 
https://mariadb.com/kb/en/mariadb/enabling-tokudb/#check-for-transparent-hugepage-support-on-linux
 sysfs::parameters { 'disable-transparent-hugepages':
-values  => {
+values => {
 'kernel/mm/transparent_hugepage/enabled' => 'never',
 'kernel/mm/transparent_hugepage/defrag'  => 'never',
 }
@@ -620,7 +620,7 @@
 class role::mariadb::wikitech {
 
 system::role { 'role::mariadb::wikitech':
-description => "Wikitech Database",
+description => 'Wikitech Database',
 }
 
 include standard
@@ -634,7 +634,7 @@
 }
 
 class { 'mariadb::config':
-prompt   => "WIKITECH",
+prompt   => 'WIKITECH',
 config   => 'mariadb/wikitech.my.cnf.erb',
 password => $passwords::misc::scripts::mysql_root_pass,
 datadir  => '/srv/sqldata',
@@ -643,7 +643,7 @@
 
 # mysql monitoring access from tendril (db1011)
 ferm::rul

[MediaWiki-commits] [Gerrit] postgresl, sslcert: minimal lint fixes - change (operations/puppet)

2015-11-04 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: postgresl,sslcert: minimal lint fixes
..


postgresl,sslcert: minimal lint fixes

Change-Id: I9fe2f7e0628115ef2f507f68659264a3d2de1fe9
---
M modules/postgresql/manifests/master.pp
M modules/postgresql/manifests/slave.pp
M modules/postgresql/manifests/spatialdb.pp
M modules/postgresql/manifests/user.pp
M modules/sslcert/manifests/chainedcert.pp
5 files changed, 8 insertions(+), 8 deletions(-)

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



diff --git a/modules/postgresql/manifests/master.pp 
b/modules/postgresql/manifests/master.pp
index 3b5440c..1869fff 100644
--- a/modules/postgresql/manifests/master.pp
+++ b/modules/postgresql/manifests/master.pp
@@ -42,8 +42,8 @@
 ) {
 
 class { 'postgresql::server':
-pgversion => $pgversion,
 ensure=> $ensure,
+pgversion => $pgversion,
 includes  => [ $includes, 'master.conf'],
 datadir   => $datadir,
 }
diff --git a/modules/postgresql/manifests/slave.pp 
b/modules/postgresql/manifests/slave.pp
index 0c6fefe..329a0f9 100644
--- a/modules/postgresql/manifests/slave.pp
+++ b/modules/postgresql/manifests/slave.pp
@@ -34,8 +34,8 @@
 ) {
 
 class { 'postgresql::server':
-pgversion => $pgversion,
 ensure=> $ensure,
+pgversion => $pgversion,
 includes  => [ $includes, 'slave.conf'],
 datadir   => $datadir,
 }
diff --git a/modules/postgresql/manifests/spatialdb.pp 
b/modules/postgresql/manifests/spatialdb.pp
index ec2e9ee..4619108 100644
--- a/modules/postgresql/manifests/spatialdb.pp
+++ b/modules/postgresql/manifests/spatialdb.pp
@@ -87,12 +87,12 @@
 } elsif $ensure == 'absent' {
 exec { "drop_db-${name}":
 command => "/usr/bin/dropdb ${name}",
-user=> "postgres",
+user=> 'postgres',
 onlyif  => $db_exists,
 }
 exec { "drop_plpgsql_lang-${name}":
 command => "/usr/bin/droplang plpgsql ${name}",
-user=> "postgres",
+user=> 'postgres',
 onlyif  => $plpgsql_exists,
 }
 Exec["drop_plpgsql_lang-${name}"] -> Exec["drop_db-${name}"]
diff --git a/modules/postgresql/manifests/user.pp 
b/modules/postgresql/manifests/user.pp
index 83043e9..99ffa4b 100644
--- a/modules/postgresql/manifests/user.pp
+++ b/modules/postgresql/manifests/user.pp
@@ -60,9 +60,9 @@
 # listing tools like ps. Need to investigate better ways of setting the
 # password .e.g. hashed with md5 in the manifest
 exec { "pass_set-${name}":
-command => $pass_set,
-user=> 'postgres',
-onlyif  => $userexists,
+command => $pass_set,
+user=> 'postgres',
+onlyif  => $userexists,
 }
 
 $changes = [  "set 01/type \'${type}\'",
diff --git a/modules/sslcert/manifests/chainedcert.pp 
b/modules/sslcert/manifests/chainedcert.pp
index 5bb8d71..b55e679 100644
--- a/modules/sslcert/manifests/chainedcert.pp
+++ b/modules/sslcert/manifests/chainedcert.pp
@@ -42,7 +42,7 @@
 
 if $ensure == 'present' {
 $inpath = "/etc/ssl/localcerts/${title}.crt"
-$script = "/usr/local/sbin/x509-bundle"
+$script = '/usr/local/sbin/x509-bundle'
 exec { "x509-bundle ${title}-chained":
 path=> 'bin:/usr/bin',
 cwd => '/etc/ssl/localcerts',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9fe2f7e0628115ef2f507f68659264a3d2de1fe9
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: BBlack 
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] labsdns: Use the proper comment character for lua - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: labsdns: Use the proper comment character for lua
..


labsdns: Use the proper comment character for lua

WHY CAN WE NOT HAVE ONE THING THAT WE ALL AGREE ON!

Change-Id: Ifd47cdf5cda6eee838f8aa2c65eb56af156db05d
---
M modules/dnsrecursor/files/labs-ip-alias-dump.py
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/dnsrecursor/files/labs-ip-alias-dump.py 
b/modules/dnsrecursor/files/labs-ip-alias-dump.py
index 3aef129..ac368ae 100644
--- a/modules/dnsrecursor/files/labs-ip-alias-dump.py
+++ b/modules/dnsrecursor/files/labs-ip-alias-dump.py
@@ -20,7 +20,7 @@
 action='store_true'
 )
 
-LUA_LINE_TEMPLATE = 'aliasmapping["{public}"] = "{private}" # {name}\n'
+LUA_LINE_TEMPLATE = 'aliasmapping["{public}"] = "{private}" -- {name}\n'
 
 args = argparser.parse_args()
 config = yaml.safe_load(args.config_file)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd47cdf5cda6eee838f8aa2c65eb56af156db05d
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Yuvipanda 

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


[MediaWiki-commits] [Gerrit] labsdns: Use the proper comment character for lua - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: labsdns: Use the proper comment character for lua
..

labsdns: Use the proper comment character for lua

WHY CAN WE NOT HAVE ONE THING THAT WE ALL AGREE ON!

Change-Id: Ifd47cdf5cda6eee838f8aa2c65eb56af156db05d
---
M modules/dnsrecursor/files/labs-ip-alias-dump.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/58/251158/1

diff --git a/modules/dnsrecursor/files/labs-ip-alias-dump.py 
b/modules/dnsrecursor/files/labs-ip-alias-dump.py
index 3aef129..ac368ae 100644
--- a/modules/dnsrecursor/files/labs-ip-alias-dump.py
+++ b/modules/dnsrecursor/files/labs-ip-alias-dump.py
@@ -20,7 +20,7 @@
 action='store_true'
 )
 
-LUA_LINE_TEMPLATE = 'aliasmapping["{public}"] = "{private}" # {name}\n'
+LUA_LINE_TEMPLATE = 'aliasmapping["{public}"] = "{private}" -- {name}\n'
 
 args = argparser.parse_args()
 config = yaml.safe_load(args.config_file)

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

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

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


[MediaWiki-commits] [Gerrit] Make FindOrphanedFiles handle files with ! properly - change (mediawiki/core)

2015-11-04 Thread Aaron Schulz (Code Review)
Aaron Schulz has submitted this change and it was merged.

Change subject: Make FindOrphanedFiles handle files with ! properly
..


Make FindOrphanedFiles handle files with ! properly

Previously, the showed up in the "missing" list

Change-Id: Ia094d0c58f6d15671b0c25440ddcc6b51544368a
---
M maintenance/findOrphanedFiles.php
1 file changed, 14 insertions(+), 11 deletions(-)

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



diff --git a/maintenance/findOrphanedFiles.php 
b/maintenance/findOrphanedFiles.php
index eac277a..65834c8 100644
--- a/maintenance/findOrphanedFiles.php
+++ b/maintenance/findOrphanedFiles.php
@@ -55,37 +55,40 @@
$this->error( "Could not get file listing.", 1 );
}
 
-   $nameBatch = array();
+   $pathBatch = array();
foreach ( $list as $path ) {
if ( preg_match( '#^(thumb|deleted)/#', $path ) ) {
continue; // handle ugly nested containers on 
stock installs
}
 
-   $nameBatch[] = basename( $path );
-   if ( count( $nameBatch ) >= $this->mBatchSize ) {
-   $this->checkFiles( $repo, $nameBatch, $verbose 
);
-   $nameBatch = array();
+   $pathBatch[] = $path;
+   if ( count( $pathBatch ) >= $this->mBatchSize ) {
+   $this->checkFiles( $repo, $pathBatch, $verbose 
);
+   $pathBatch = array();
}
}
-   $this->checkFiles( $repo, $nameBatch, $verbose );
+   $this->checkFiles( $repo, $pathBatch, $verbose );
}
 
-   protected function checkFiles( LocalRepo $repo, array $names, $verbose 
) {
-   if ( !count( $names ) ) {
+   protected function checkFiles( LocalRepo $repo, array $paths, $verbose 
) {
+   if ( !count( $paths ) ) {
return;
}
 
$dbr = $repo->getSlaveDB();
 
+   $names = array();
$imgIN = array();
$oiWheres = array();
-   foreach ( $names as $name ) {
-   if ( strpos( $name, '!' ) !== false ) {
+   foreach ( $paths as $path ) {
+   $name = basename( $path );
+   $names[] = $name;
+   if ( preg_match( '#^archive/#', $path ) ) {
if ( $verbose ) {
$this->output( "Checking old file 
$name\n" );
}
 
-   list( , $base ) = explode( '!', $name ); // 
!
+   list( , $base ) = explode( '!', $name, 2 ); // 
!
$oiWheres[] = $dbr->makeList(
array( 'oi_name' => $base, 
'oi_archive_name' => $name ),
LIST_AND

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia094d0c58f6d15671b0c25440ddcc6b51544368a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.5
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Update novaenv for keystone v3 api - change (operations/puppet)

2015-11-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Update novaenv for keystone v3 api
..


Update novaenv for keystone v3 api

Change-Id: I0cb34b1f641ff5e3e1233c8b0f74c9d52ec5fcdb
---
M modules/openstack/templates/novaenv.sh.erb
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/modules/openstack/templates/novaenv.sh.erb 
b/modules/openstack/templates/novaenv.sh.erb
index 7adf2e1..d63f13b 100644
--- a/modules/openstack/templates/novaenv.sh.erb
+++ b/modules/openstack/templates/novaenv.sh.erb
@@ -1,6 +1,9 @@
 export OS_USERNAME="novaadmin"
+export OS_PROJECT_DOMAIN_ID="default"
+export OS_USER_DOMAIN_ID="default"
 export OS_PASSWORD="<%= @wikitech_nova_ldap_user_pass %>"
-export OS_AUTH_URL="http://<%= @nova_controller_hostname %>:35357/v2.0"
+export OS_AUTH_URL="http://<%= @nova_controller_hostname %>:35357/v3"
 export OS_REGION_NAME="<%= @nova_region %>"
 export OS_TENANT_NAME="testlabs"
 export OS_NO_CACHE=1
+export OS_IDENTITY_API_VERSION=3

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0cb34b1f641ff5e3e1233c8b0f74c9d52ec5fcdb
Gerrit-PatchSet: 4
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] labsdns: Fix typo in variable name - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: labsdns: Fix typo in variable name
..


labsdns: Fix typo in variable name

Change-Id: I150b5f61983cb919793f7539475a68284d2cff0e
---
M manifests/role/labsdns.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/manifests/role/labsdns.pp b/manifests/role/labsdns.pp
index ccdcb2c..fcef89c 100644
--- a/manifests/role/labsdns.pp
+++ b/manifests/role/labsdns.pp
@@ -98,7 +98,7 @@
 'project-proxy',
 ],
 nova_api_url => "http://${nova_controller_hostname}:35357/v2.0";,
-alias_file   => $alias_script,
+alias_file   => $alias_file,
 }
 
 # There are three replica servers (c1, c2, c3).  The mapping of

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I150b5f61983cb919793f7539475a68284d2cff0e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 
Gerrit-Reviewer: Yuvipanda 

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


[MediaWiki-commits] [Gerrit] labsdns: Fix typo in variable name - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: labsdns: Fix typo in variable name
..

labsdns: Fix typo in variable name

Change-Id: I150b5f61983cb919793f7539475a68284d2cff0e
---
M manifests/role/labsdns.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/57/251157/1

diff --git a/manifests/role/labsdns.pp b/manifests/role/labsdns.pp
index ccdcb2c..fcef89c 100644
--- a/manifests/role/labsdns.pp
+++ b/manifests/role/labsdns.pp
@@ -98,7 +98,7 @@
 'project-proxy',
 ],
 nova_api_url => "http://${nova_controller_hostname}:35357/v2.0";,
-alias_file   => $alias_script,
+alias_file   => $alias_file,
 }
 
 # There are three replica servers (c1, c2, c3).  The mapping of

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

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

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


[MediaWiki-commits] [Gerrit] labsdns: Include nova password class before using it - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: labsdns: Include nova password class before using it
..


labsdns: Include nova password class before using it

Change-Id: Id851ac91387d82a01440527ee05c24352f47de76
---
M manifests/role/labsdns.pp
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/manifests/role/labsdns.pp b/manifests/role/labsdns.pp
index 4cdc579..ccdcb2c 100644
--- a/manifests/role/labsdns.pp
+++ b/manifests/role/labsdns.pp
@@ -57,6 +57,7 @@
 # Eventually all labs instances will point to one of these in resolv.conf
 
 class role::labsdnsrecursor {
+include passwords::openstack::nova
 
 $recursor_ip = ipresolve(hiera('labs_recursor'),4)
 
@@ -68,7 +69,7 @@
 system::role { 'role::labsdnsrecursor': description => 'Recursive DNS 
server for Labs instances' }
 
 #  We need to alias some public IPs to their corresponding private IPs.
-$wikitech_nova_ldap_user_pass = 
$passwords::openstack::nova::nova_ldap_user_pass
+$wikitech_nova_ldap_user_pass = 
$::passwords::openstack::nova::nova_ldap_user_pass
 $nova_controller_hostname = hiera('labs_nova_controller')
 
 $listen_addresses = $::realm ? {

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

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

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


[MediaWiki-commits] [Gerrit] Remove grey horizontal line above the bottom buttons - change (mediawiki...UploadWizard)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Remove grey horizontal line above the bottom buttons
..

Remove grey horizontal line above the bottom buttons

This looks a bit weird, especially on the steps where the buttons
only appear after the users selects something, like "Release rights".

Change-Id: I2a7be720524e7754b24b0b651d965ca1c401932c
---
M resources/uploadWizard.css
1 file changed, 1 insertion(+), 3 deletions(-)


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

diff --git a/resources/uploadWizard.css b/resources/uploadWizard.css
index 49b0376..7baa60f 100644
--- a/resources/uploadWizard.css
+++ b/resources/uploadWizard.css
@@ -596,9 +596,7 @@
 
 .mwe-upwiz-buttons {
margin-top: 1em;
-   padding-top: 10px;
-   border-top: 1px solid #e0e0e0;
-   text-align: right;  /* works for now, only one 'next' button */
+   text-align: right;
 }
 
 a.mwe-upwiz-tooltip-link {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a7be720524e7754b24b0b651d965ca1c401932c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] Change label of preferences tab from "Uploads" to "Uploading" - change (mediawiki...UploadWizard)

2015-11-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Change label of preferences tab from "Uploads" to "Uploading"
..

Change label of preferences tab from "Uploads" to "Uploading"

I think "Uploads" is generally understood to mean "files that were
uploaded", and all the preferences are about the process of uploading
files.

Change-Id: I38f303a65c2d71c44e5cce07b2224c0f158f900b
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/55/251155/1

diff --git a/i18n/en.json b/i18n/en.json
index 52df3ab..f43cc5b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -312,7 +312,7 @@
"mwe-upwiz-custom-date": "Use custom date format",
"uploadcampaign-legend": "Upload campaign configuration",
"uploadcampaign-text": "You are modifying an Upload Wizard campaign.",
-   "prefs-uploads": "Uploads",
+   "prefs-uploads": "Uploading",
"prefs-upwiz-licensing": "Licensing",
"prefs-upwiz-experimental": "Experimental features",
"prefs-upwiz-interface": "User interface",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I38f303a65c2d71c44e5cce07b2224c0f158f900b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] labsdns: Include nova password class before using it - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: labsdns: Include nova password class before using it
..

labsdns: Include nova password class before using it

Change-Id: Id851ac91387d82a01440527ee05c24352f47de76
---
M manifests/role/labsdns.pp
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/54/251154/1

diff --git a/manifests/role/labsdns.pp b/manifests/role/labsdns.pp
index 4cdc579..ccdcb2c 100644
--- a/manifests/role/labsdns.pp
+++ b/manifests/role/labsdns.pp
@@ -57,6 +57,7 @@
 # Eventually all labs instances will point to one of these in resolv.conf
 
 class role::labsdnsrecursor {
+include passwords::openstack::nova
 
 $recursor_ip = ipresolve(hiera('labs_recursor'),4)
 
@@ -68,7 +69,7 @@
 system::role { 'role::labsdnsrecursor': description => 'Recursive DNS 
server for Labs instances' }
 
 #  We need to alias some public IPs to their corresponding private IPs.
-$wikitech_nova_ldap_user_pass = 
$passwords::openstack::nova::nova_ldap_user_pass
+$wikitech_nova_ldap_user_pass = 
$::passwords::openstack::nova::nova_ldap_user_pass
 $nova_controller_hostname = hiera('labs_nova_controller')
 
 $listen_addresses = $::realm ? {

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

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

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


[MediaWiki-commits] [Gerrit] Update novaenv for keystone v3 api - change (operations/puppet)

2015-11-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Update novaenv for keystone v3 api
..

Update novaenv for keystone v3 api

Change-Id: I0cb34b1f641ff5e3e1233c8b0f74c9d52ec5fcdb
---
M modules/openstack/templates/novaenv.sh.erb
1 file changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/modules/openstack/templates/novaenv.sh.erb 
b/modules/openstack/templates/novaenv.sh.erb
index 7adf2e1..d63f13b 100644
--- a/modules/openstack/templates/novaenv.sh.erb
+++ b/modules/openstack/templates/novaenv.sh.erb
@@ -1,6 +1,9 @@
 export OS_USERNAME="novaadmin"
+export OS_PROJECT_DOMAIN_ID="default"
+export OS_USER_DOMAIN_ID="default"
 export OS_PASSWORD="<%= @wikitech_nova_ldap_user_pass %>"
-export OS_AUTH_URL="http://<%= @nova_controller_hostname %>:35357/v2.0"
+export OS_AUTH_URL="http://<%= @nova_controller_hostname %>:35357/v3"
 export OS_REGION_NAME="<%= @nova_region %>"
 export OS_TENANT_NAME="testlabs"
 export OS_NO_CACHE=1
+export OS_IDENTITY_API_VERSION=3

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0cb34b1f641ff5e3e1233c8b0f74c9d52ec5fcdb
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] ssl_ciphersuite: add DHE+3DES option as well - change (operations/puppet)

2015-11-04 Thread BBlack (Code Review)
BBlack has uploaded a new change for review.

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

Change subject: ssl_ciphersuite: add DHE+3DES option as well
..

ssl_ciphersuite: add DHE+3DES option as well

This is similar in nature to I0dd877c3 aka 96e1b2d9 where we added
ECDHE+3DES options.  There's also a DHE+3DES option which is
confusingly named EDH by OpenSSL.  It should fit in where I've
placed it in this patch logically, and generally improve the
situation for some minority clients (giving them a Forward Secret
option where they may have chosen non-FS or failed handshake
completely before), and running tests over a sample corpus of our
live ClientHellos indicates such clients exist.

There are only two thing that makes me flinch a little on this
one:

1) Mozilla's https://wiki.mozilla.org/Security/Server_Side_TLS
explicitly disables this one in all of their sets, and I'm not
sure why.
2) In the ClientHello simulations, while a few of those choosing
this new option were previously failing handshake completely, most
would be upgrading from current working non-FS choices like
AES128-SHA, DES-CBC3-SHA, and similar.  It's possible that this
simulated "upgrade" causes some of those clients to fail handshake
completely due to DHE>1024-bit compatibility issues, whereas they
were at least functioning on the non-FS cipher choices before.
This only matters for "compat" of course - it would always be a
net win to include it at the bottom for a server using "mid" or
"high" compatibility mode.

Change-Id: I07715405b20e5021e5a1b0c2f4b842cefc25f78c
---
M modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb 
b/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
index 82293af..fb941fe 100644
--- a/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
+++ b/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
@@ -103,6 +103,7 @@
   'DHE-RSA-AES256-SHA',
   'DHE-RSA-CAMELLIA128-SHA',
   'DHE-RSA-CAMELLIA256-SHA',
+  'EDH-RSA-DES-CBC3-SHA', # EDH == DHE here, confusingly
 ],
 # not-forward-secret compat for ancient stuff
 'compat' => [

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

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

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


[MediaWiki-commits] [Gerrit] Update keystone policy.json to allow the 'observer' role to ... - change (operations/puppet)

2015-11-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Update keystone policy.json to allow the 'observer' role to 
observe.
..

Update keystone policy.json to allow the 'observer' role to observe.

Bug: T104588
Change-Id: Icebee3a5868864c4e967d8ccd9c3a922a983ffe2
---
M modules/openstack/files/kilo/keystone/policy.json
1 file changed, 5 insertions(+), 3 deletions(-)


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

diff --git a/modules/openstack/files/kilo/keystone/policy.json 
b/modules/openstack/files/kilo/keystone/policy.json
index daba0ec..38cf350 100644
--- a/modules/openstack/files/kilo/keystone/policy.json
+++ b/modules/openstack/files/kilo/keystone/policy.json
@@ -1,9 +1,11 @@
 {
 "admin_required": "role:admin or is_admin:1",
 "service_role": "role:service",
+"observer_role": "role:observer",
 "service_or_admin": "rule:admin_required or rule:service_role",
 "owner" : "user_id:%(user_id)s",
 "admin_or_owner": "rule:admin_required or rule:owner",
+"admin_or_observer": "rule:admin_required or rule:observer_role",
 "token_subject": "user_id:%(target.token.user_id)s",
 "admin_or_token_subject": "rule:admin_required or rule:token_subject",
  
@@ -33,9 +35,9 @@
 "identity:update_domain": "rule:admin_required",
 "identity:delete_domain": "rule:admin_required",
  
-"identity:get_project": "rule:admin_required",
-"identity:list_projects": "rule:admin_required",
-"identity:list_user_projects": "rule:admin_or_owner",
+"identity:get_project": "rule:admin_or_observer",
+"identity:list_projects": "rule:admin_or_observer",
+"identity:list_user_projects": "rule:admin_or_observer",
 "identity:create_project": "rule:admin_required",
 "identity:update_project": "rule:admin_required",
 "identity:delete_project": "rule:admin_required",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icebee3a5868864c4e967d8ccd9c3a922a983ffe2
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] Add modern nova policy file. - change (operations/puppet)

2015-11-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Add modern nova policy file.
..

Add modern nova policy file.

Change-Id: Ia9c4ce11cc0530fba22b411369ec189933f14d40
---
M modules/openstack/files/kilo/nova/policy.json
1 file changed, 381 insertions(+), 108 deletions(-)


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

diff --git a/modules/openstack/files/kilo/nova/policy.json 
b/modules/openstack/files/kilo/nova/policy.json
index 4773b11..cd7145c 100644
--- a/modules/openstack/files/kilo/nova/policy.json
+++ b/modules/openstack/files/kilo/nova/policy.json
@@ -1,120 +1,393 @@
 {
-"context_is_admin":  [["role:admin"]],
-"admin_or_owner":  [["is_admin:True"], ["project_id:%(project_id)s"]],
-"default": [["rule:admin_or_owner"]],
+"context_is_admin":  "role:admin",
+"admin_or_owner":  "is_admin:True or project_id:%(project_id)s",
+"default": "rule:admin_or_owner",
 
+"cells_scheduler_filter:TargetCellFilter": "is_admin:True",
 
-"compute:create": [["role:projectadmin"]],
-"compute:create:attach_network": [["role:projectadmin"]],
-"compute:create:attach_volume": [["role:projectadmin"]],
-"compute:get_all": [],
+"compute:create": "rule:admin_or_owner",
+"compute:create:attach_network": "rule:admin_or_owner",
+"compute:create:attach_volume": "rule:admin_or_owner",
+"compute:create:forced_host": "is_admin:True",
+"compute:get_all": "",
+"compute:get_all_tenants": "",
+"compute:start": "rule:admin_or_owner",
+"compute:stop": "rule:admin_or_owner",
+"compute:unlock_override": "rule:admin_api",
 
+"compute:shelve": "rule:admin_or_owner",
+"compute:shelve_offload": "rule:admin_or_owner",
+"compute:unshelve": "rule:admin_or_owner",
+"compute:resize": "rule:admin_or_owner",
+"compute:confirm_resize": "rule:admin_or_owner",
+"compute:revert_resize": "rule:admin_or_owner",
+"compute:rebuild": "rule:admin_or_owner",
+"compute:reboot": "rule:admin_or_owner",
 
-"admin_api": [["is_admin:True"]],
-"compute_extension:accounts": [["rule:admin_api"]],
-"compute_extension:admin_actions": [["rule:admin_api"]],
-"compute_extension:admin_actions:pause": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:unpause": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:suspend": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:resume": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:lock": [["rule:admin_api"]],
-"compute_extension:admin_actions:unlock": [["rule:admin_api"]],
-"compute_extension:admin_actions:resetNetwork": [["rule:admin_api"]],
-"compute_extension:admin_actions:injectNetworkInfo": [["rule:admin_api"]],
-"compute_extension:admin_actions:createBackup": [["rule:admin_or_owner"]],
-"compute_extension:admin_actions:migrateLive": [["rule:admin_api"]],
-"compute_extension:admin_actions:resetState": [["rule:admin_api"]],
-"compute_extension:admin_actions:migrate": [["rule:admin_api"]],
-"compute_extension:aggregates": [["rule:admin_api"]],
-"compute_extension:certificates": [],
-"compute_extension:cloudpipe": [["rule:admin_api"]],
-"compute_extension:console_output": [["role:projectadmin"]],
-"compute_extension:consoles": [["role:projectadmin"]],
-"compute_extension:createserverext": [["role:projectadmin"]],
-"compute_extension:deferred_delete": [["role:projectadmin"]],
-"compute_extension:disk_config": [["role:projectadmin"]],
-"compute_extension:extended_server_attributes": [],
-"compute_extension:extended_status": [],
-"compute_extension:flavor_access": [],
-"compute_extension:flavor_disabled": [],
-"compute_extension:flavor_rxtx": [],
-"compute_extension:flavor_swap": [],
-"compute_extension:flavorextradata": [],
-"compute_extension:flavorextraspecs": [],
-"compute_extension:flavormanage": [["rule:admin_api"]],
-"compute_extension:floating_ip_dns": [["role:projectadmin"]],
-"compute_extension:floating_ip_pools": [["role:projectadmin"]],
-"compute_extension:floating_ips": [["role:projectadmin"]],
-"compute_extension:hosts": [["rule:admin_api"]],
-"compute_extension:hypervisors": [["rule:admin_api"]],
-"compute_extension:instance_usage_audit_log": [["rule:admin_api"]],
-"compute_extension:keypairs": [["role:projectadmin"]],
-"compute_extension:multinic": [["role:projectadmin"]],
-"compute_extension:networks": [],
-"compute_extension:networks:view": [],
-"compute_extension:quotas:show": [["role:projectadmin"]],
-"compute_extension:quotas:update": [["rule:admin_api"]],
-"compute_extension:quota_classes": [["role:projectadmin"]],
-"compute_extension:rescue": [["role:projectadmin"]],
-"compute_extension:security_groups": [["rol

[MediaWiki-commits] [Gerrit] Make FindOrphanedFiles handle files with ! properly - change (mediawiki/core)

2015-11-04 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Make FindOrphanedFiles handle files with ! properly
..

Make FindOrphanedFiles handle files with ! properly

Previously, the showed up in the "missing" list

Change-Id: Ia094d0c58f6d15671b0c25440ddcc6b51544368a
---
M maintenance/findOrphanedFiles.php
1 file changed, 14 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/52/251152/1

diff --git a/maintenance/findOrphanedFiles.php 
b/maintenance/findOrphanedFiles.php
index eac277a..65834c8 100644
--- a/maintenance/findOrphanedFiles.php
+++ b/maintenance/findOrphanedFiles.php
@@ -55,37 +55,40 @@
$this->error( "Could not get file listing.", 1 );
}
 
-   $nameBatch = array();
+   $pathBatch = array();
foreach ( $list as $path ) {
if ( preg_match( '#^(thumb|deleted)/#', $path ) ) {
continue; // handle ugly nested containers on 
stock installs
}
 
-   $nameBatch[] = basename( $path );
-   if ( count( $nameBatch ) >= $this->mBatchSize ) {
-   $this->checkFiles( $repo, $nameBatch, $verbose 
);
-   $nameBatch = array();
+   $pathBatch[] = $path;
+   if ( count( $pathBatch ) >= $this->mBatchSize ) {
+   $this->checkFiles( $repo, $pathBatch, $verbose 
);
+   $pathBatch = array();
}
}
-   $this->checkFiles( $repo, $nameBatch, $verbose );
+   $this->checkFiles( $repo, $pathBatch, $verbose );
}
 
-   protected function checkFiles( LocalRepo $repo, array $names, $verbose 
) {
-   if ( !count( $names ) ) {
+   protected function checkFiles( LocalRepo $repo, array $paths, $verbose 
) {
+   if ( !count( $paths ) ) {
return;
}
 
$dbr = $repo->getSlaveDB();
 
+   $names = array();
$imgIN = array();
$oiWheres = array();
-   foreach ( $names as $name ) {
-   if ( strpos( $name, '!' ) !== false ) {
+   foreach ( $paths as $path ) {
+   $name = basename( $path );
+   $names[] = $name;
+   if ( preg_match( '#^archive/#', $path ) ) {
if ( $verbose ) {
$this->output( "Checking old file 
$name\n" );
}
 
-   list( , $base ) = explode( '!', $name ); // 
!
+   list( , $base ) = explode( '!', $name, 2 ); // 
!
$oiWheres[] = $dbr->makeList(
array( 'oi_name' => $base, 
'oi_archive_name' => $name ),
LIST_AND

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia094d0c58f6d15671b0c25440ddcc6b51544368a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.5
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] Fix normalization when fee or net is present but empty - change (wikimedia...crm)

2015-11-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Fix normalization when fee or net is present but empty
..

Fix normalization when fee or net is present but empty

Change-Id: I74b68a2add574bb9ecf6c7e9c130df99d81f9cab
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/48/251148/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 0e6b8cb..261aab5 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -735,12 +735,14 @@
 $msg['original_gross'] = $msg['gross'];
 }
 
-if ( !array_key_exists('fee', $msg) && !array_key_exists('net', $msg) ) {
+   validFee = array_key_exists( 'fee', $msg ) && is_numeric( $msg['fee'] );
+   validNet = array_key_exists( 'net', $msg ) && is_numeric( $msg['net'] );
+if ( !validFee || && !validNet ) {
 $msg['fee'] = '0.00';
 $msg['net'] = $msg['gross'];
-} elseif ( !array_key_exists('fee', $msg) && array_key_exists('net', $msg) 
) {
+} elseif ( validNet && !validFee ) {
 $msg['fee'] = $msg['gross'] - $msg['net'];
-} elseif ( array_key_exists('fee', $msg) && !array_key_exists('net', $msg) 
) {
+} elseif ( validFee && !validNet ) {
 $msg['net'] = $msg['gross'] - $msg['fee'];
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] LabsDNS: Stop hardcoding instance IPs in Puppet - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: LabsDNS: Stop hardcoding instance IPs in Puppet
..


LabsDNS: Stop hardcoding instance IPs in Puppet

Bug: T100990
Change-Id: I260f219cb477270f5f5b5f59d35c1f1abc7cd930
---
M manifests/role/labsdns.pp
A modules/dnsrecursor/files/labs-ip-alias-dump.py
M modules/dnsrecursor/manifests/init.pp
A modules/dnsrecursor/manifests/labsaliaser.pp
D modules/dnsrecursor/templates/ip-alias.lua.erb
M modules/dnsrecursor/templates/recursor.conf.erb
6 files changed, 153 insertions(+), 104 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, but someone else must approve
  Yuvipanda: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/labsdns.pp b/manifests/role/labsdns.pp
index 09e3bda..4cdc579 100644
--- a/manifests/role/labsdns.pp
+++ b/manifests/role/labsdns.pp
@@ -68,28 +68,8 @@
 system::role { 'role::labsdnsrecursor': description => 'Recursive DNS 
server for Labs instances' }
 
 #  We need to alias some public IPs to their corresponding private IPs.
-#   FIXME:  these should be automatically synced rather than hard-coded.
-$nova_floating_ip_aliases = {
-# eqiad
-'deployment-cache-text04'   => {public_ip  => '208.80.155.135',
-private_ip => '10.68.18.103' },
-'deployment-cache-upload04' => {public_ip  => '208.80.155.136',
-private_ip => '10.68.18.109' },
-'deployment-stream' => {public_ip  => '208.80.155.138',
-private_ip => '10.68.17.106' },
-'deployment-cache-mobile04' => {public_ip  => '208.80.155.139',
-private_ip => '10.68.18.110' },
-'relic' => {public_ip  => '208.80.155.197',
-private_ip => '10.68.16.162' },
-'tools-webproxy'=> {public_ip  => '208.80.155.131',
-private_ip => '10.68.21.81' },
-'udplog'=> {public_ip  => '208.80.155.191',
-private_ip => '10.68.16.58' },
-
-# A wide variety of hosts are reachable via a public web proxy.
-'labs_shared_proxy' => {public_ip  => '208.80.155.156',
-private_ip => '10.68.21.68'},
-}
+$wikitech_nova_ldap_user_pass = 
$passwords::openstack::nova::nova_ldap_user_pass
+$nova_controller_hostname = hiera('labs_nova_controller')
 
 $listen_addresses = $::realm ? {
 'labs'  => [$::ipaddress],
@@ -98,12 +78,26 @@
 
 $labs_auth_dns = ipresolve(hiera('labs_dns_host'),4)
 
+$alias_file = '/etc/powerdns/labs-ip-alias.lua'
 class { '::dnsrecursor':
 listen_addresses => $listen_addresses,
 allow_from   => $network::constants::all_networks,
-ip_aliases   => $nova_floating_ip_aliases,
 additional_forward_zones => "wmflabs=${labs_auth_dns}, 
68.10.in-addr.arpa=${labs_auth_dns}",
-auth_zones   => 'labsdb=/var/zones/labsdb'
+auth_zones   => 'labsdb=/var/zones/labsdb',
+lua_script   => $alias_file
+}
+
+class { '::dnsrecursor::labsaliaser':
+username   => 'novaadmin',
+password   => $wikitech_nova_ldap_user_pass,
+projects   => [
+'tools',
+'deployment-prep',
+'toolserver-legacy',
+'project-proxy',
+],
+nova_api_url => "http://${nova_controller_hostname}:35357/v2.0";,
+alias_file   => $alias_script,
 }
 
 # There are three replica servers (c1, c2, c3).  The mapping of
diff --git a/modules/dnsrecursor/files/labs-ip-alias-dump.py 
b/modules/dnsrecursor/files/labs-ip-alias-dump.py
new file mode 100644
index 000..3aef129
--- /dev/null
+++ b/modules/dnsrecursor/files/labs-ip-alias-dump.py
@@ -0,0 +1,86 @@
+#!/usr/bin/python
+import os
+import sys
+import yaml
+import argparse
+import itertools
+
+from novaclient import client as novaclient
+
+argparser = argparse.ArgumentParser()
+argparser.add_argument(
+'--config-file',
+help='Path to config file',
+default='/etc/labs-dns-alias.yaml',
+type=argparse.FileType('r')
+)
+argparser.add_argument(
+'--check-changes-only',
+help='Exit with 0 if there are no changes and 1 if there are changes. Do 
not write to file',
+action='store_true'
+)
+
+LUA_LINE_TEMPLATE = 'aliasmapping["{public}"] = "{private}" # {name}\n'
+
+args = argparser.parse_args()
+config = yaml.safe_load(args.config_file)
+
+aliases = {}
+for project in config['projects']:
+client = novaclient.Client(
+"1.1",
+config['username'],
+config['password'],
+project,
+config['nova_api_url']
+  

[MediaWiki-commits] [Gerrit] Make FindOrphanedFiles handle files with ! properly - change (mediawiki/core)

2015-11-04 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Make FindOrphanedFiles handle files with ! properly
..

Make FindOrphanedFiles handle files with ! properly

Previously, the showed up in the "missing" list

Change-Id: Ia094d0c58f6d15671b0c25440ddcc6b51544368a
---
M maintenance/findOrphanedFiles.php
1 file changed, 14 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/251147/1

diff --git a/maintenance/findOrphanedFiles.php 
b/maintenance/findOrphanedFiles.php
index eac277a..65834c8 100644
--- a/maintenance/findOrphanedFiles.php
+++ b/maintenance/findOrphanedFiles.php
@@ -55,37 +55,40 @@
$this->error( "Could not get file listing.", 1 );
}
 
-   $nameBatch = array();
+   $pathBatch = array();
foreach ( $list as $path ) {
if ( preg_match( '#^(thumb|deleted)/#', $path ) ) {
continue; // handle ugly nested containers on 
stock installs
}
 
-   $nameBatch[] = basename( $path );
-   if ( count( $nameBatch ) >= $this->mBatchSize ) {
-   $this->checkFiles( $repo, $nameBatch, $verbose 
);
-   $nameBatch = array();
+   $pathBatch[] = $path;
+   if ( count( $pathBatch ) >= $this->mBatchSize ) {
+   $this->checkFiles( $repo, $pathBatch, $verbose 
);
+   $pathBatch = array();
}
}
-   $this->checkFiles( $repo, $nameBatch, $verbose );
+   $this->checkFiles( $repo, $pathBatch, $verbose );
}
 
-   protected function checkFiles( LocalRepo $repo, array $names, $verbose 
) {
-   if ( !count( $names ) ) {
+   protected function checkFiles( LocalRepo $repo, array $paths, $verbose 
) {
+   if ( !count( $paths ) ) {
return;
}
 
$dbr = $repo->getSlaveDB();
 
+   $names = array();
$imgIN = array();
$oiWheres = array();
-   foreach ( $names as $name ) {
-   if ( strpos( $name, '!' ) !== false ) {
+   foreach ( $paths as $path ) {
+   $name = basename( $path );
+   $names[] = $name;
+   if ( preg_match( '#^archive/#', $path ) ) {
if ( $verbose ) {
$this->output( "Checking old file 
$name\n" );
}
 
-   list( , $base ) = explode( '!', $name ); // 
!
+   list( , $base ) = explode( '!', $name, 2 ); // 
!
$oiWheres[] = $dbr->makeList(
array( 'oi_name' => $base, 
'oi_archive_name' => $name ),
LIST_AND

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

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

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


[MediaWiki-commits] [Gerrit] openstack: Make designate use require_package - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: openstack: Make designate use require_package
..


openstack: Make designate use require_package

To prevent the package declarations from conflicting with the
next patch

Change-Id: I786ba5e26a8581e649d88714a68ac99ff6116edc
---
M modules/openstack/manifests/designate/service.pp
1 file changed, 14 insertions(+), 15 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, but someone else must approve
  Yuvipanda: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/openstack/manifests/designate/service.pp 
b/modules/openstack/manifests/designate/service.pp
index fb5894e..c943011 100644
--- a/modules/openstack/manifests/designate/service.pp
+++ b/modules/openstack/manifests/designate/service.pp
@@ -2,25 +2,24 @@
 # https://wiki.openstack.org/wiki/Designate
 class openstack::designate::service ($openstack_version=$::openstack::version, 
$designateconfig) {
 
-include openstack::repo
+require openstack::repo
 
 include passwords::openstack::nova
 $ldap_user_pass = $passwords::openstack::nova::nova_ldap_user_pass
 
-package { ['python-designateclient',
-'designate-sink',
-'designate-common',
-'designate',
-'designate-api',
-'designate-doc',
-'designate-central',
-'python-nova-ldap',
-'python-novaclient',
-'python-paramiko',
-'python-nova-fixed-multi' ]:
-ensure  => present,
-require => Class['openstack::repo'];
-}
+require_package(
+'python-designateclient',
+'designate-sink',
+'designate-common',
+'designate',
+'designate-api',
+'designate-doc',
+'designate-central',
+'python-nova-ldap',
+'python-novaclient',
+'python-paramiko',
+'python-nova-fixed-multi'
+)
 
 
 # This password is to allow designate to write to instance metadata

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

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

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


[MediaWiki-commits] [Gerrit] openstack: Make designate use require_package - change (operations/puppet)

2015-11-04 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: openstack: Make designate use require_package
..

openstack: Make designate use require_package

To prevent the package declarations from conflicting with the
next patch

Change-Id: I786ba5e26a8581e649d88714a68ac99ff6116edc
---
M modules/openstack/manifests/designate/service.pp
1 file changed, 14 insertions(+), 15 deletions(-)


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

diff --git a/modules/openstack/manifests/designate/service.pp 
b/modules/openstack/manifests/designate/service.pp
index fb5894e..c943011 100644
--- a/modules/openstack/manifests/designate/service.pp
+++ b/modules/openstack/manifests/designate/service.pp
@@ -2,25 +2,24 @@
 # https://wiki.openstack.org/wiki/Designate
 class openstack::designate::service ($openstack_version=$::openstack::version, 
$designateconfig) {
 
-include openstack::repo
+require openstack::repo
 
 include passwords::openstack::nova
 $ldap_user_pass = $passwords::openstack::nova::nova_ldap_user_pass
 
-package { ['python-designateclient',
-'designate-sink',
-'designate-common',
-'designate',
-'designate-api',
-'designate-doc',
-'designate-central',
-'python-nova-ldap',
-'python-novaclient',
-'python-paramiko',
-'python-nova-fixed-multi' ]:
-ensure  => present,
-require => Class['openstack::repo'];
-}
+require_package(
+'python-designateclient',
+'designate-sink',
+'designate-common',
+'designate',
+'designate-api',
+'designate-doc',
+'designate-central',
+'python-nova-ldap',
+'python-novaclient',
+'python-paramiko',
+'python-nova-fixed-multi'
+)
 
 
 # This password is to allow designate to write to instance metadata

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

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

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


[MediaWiki-commits] [Gerrit] Return better error information via the API - change (mediawiki...TitleBlacklist)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Return better error information via the API
..


Return better error information via the API

* Use only a single error code 'titleblacklist-forbidden'
  to allow API users to easily identify TitleBlacklist errors.
* Return the internal code ('message') and the matching entry's text
  ('line') in machine-readable format, same as action=titleblacklist
  (depends on I1334ba21a2862973a9d8ff5be2c9bec06a82698b in MediaWiki).

This bumps the version requirement to 1.27, as older MediaWiki
versions would ignore the error in new format entirely.

Example API output change, for action=edit:

Before:
  {
  "error": {
  "code": "custom-message",
  "info": "TitleBlacklist prevents this title from being created",
  "*": "See http://localhost/w/api.php for API usage"
  }
  }
After:
  {
  "error": {
  "code": "titleblacklist-forbidden",
  "info": "TitleBlacklist prevents this title from being created",
  "message": "custom-message",
  "line": ".*test.*  # test rule",
  "*": "See http://localhost/w/api.php for API usage"
  }
  }

Bug: T115258
Change-Id: I42a0c5b0ea7e61088dd609b764dd7d1396c60cd5
---
M TitleBlacklist.hooks.php
M extension.json
2 files changed, 18 insertions(+), 6 deletions(-)

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



diff --git a/TitleBlacklist.hooks.php b/TitleBlacklist.hooks.php
index e4b0503..554206e 100644
--- a/TitleBlacklist.hooks.php
+++ b/TitleBlacklist.hooks.php
@@ -33,13 +33,22 @@
$blacklisted = TitleBlacklist::singleton()->userCannot( 
$title, $user, $action );
if ( $blacklisted instanceof TitleBlacklistEntry ) {
$errmsg = $blacklisted->getErrorMessage( 'edit' 
);
-   ApiBase::$messageMap[$errmsg] = array(
-   'code' => $errmsg,
-   'info' => 'TitleBlacklist prevents this 
title from being created'
+   $result = ApiMessage::create(
+   wfMessage(
+   $errmsg,
+   htmlspecialchars( 
$blacklisted->getRaw() ),
+   $title->getFullText()
+   ),
+   'titleblacklist-forbidden',
+   array(
+   'message' => $errmsg,
+   'line' => 
$blacklisted->getRaw(),
+   // As $errmsg usually 
represents a non-default message here, and ApiBase uses
+   // ->inLanguage( 'en' 
)->useDatabase( false ) for all messages, it will never result in
+   // useful 'info' text in the 
API. Try this, extra data seems to override the default.
+   'info' => 'TitleBlacklist 
prevents this title from being created',
+   )
);
-   $result = array( $errmsg,
-   htmlspecialchars( 
$blacklisted->getRaw() ),
-   $title->getFullText() );
return false;
}
}
diff --git a/extension.json b/extension.json
index 3351583..d8babde 100644
--- a/extension.json
+++ b/extension.json
@@ -9,6 +9,9 @@
"descriptionmsg": "titleblacklist-desc",
"license-name": "GPL-2.0+",
"type": "antispam",
+   "requires": {
+   "MediaWiki": ">= 1.27.0"
+   },
"GroupPermissions": {
"sysop": {
"tboverride": true,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I42a0c5b0ea7e61088dd609b764dd7d1396c60cd5
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/TitleBlacklist
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] FindOrphanedFiles cleanups - change (mediawiki/core)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: FindOrphanedFiles cleanups
..


FindOrphanedFiles cleanups

* Avoid empty DB list errors for some batches
* Use more convenient cannonical URLs

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

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



diff --git a/maintenance/findOrphanedFiles.php 
b/maintenance/findOrphanedFiles.php
index 2ee406f..eac277a 100644
--- a/maintenance/findOrphanedFiles.php
+++ b/maintenance/findOrphanedFiles.php
@@ -105,12 +105,12 @@
$dbr->selectSQLText(
'image',
array( 'name' => 'img_name' ),
-   array( 'img_name' => $imgIN )
+   $imgIN ? array( 'img_name' => 
$imgIN ) : '1=0'
),
$dbr->selectSQLText(
'oldimage',
array( 'name' => 
'oi_archive_name' ),
-   $dbr->makeList( $oiWheres, 
LIST_OR )
+   $oiWheres ? $dbr->makeList( 
$oiWheres, LIST_OR ) : '1=0'
)
),
true // UNION ALL (performance)
@@ -132,7 +132,7 @@
} else {
$file = $repo->newFile( $name );
}
-   $this->output( $name . "\n" . $file->getUrl() . "\n\n" 
);
+   $this->output( $name . "\n" . $file->getCanonicalUrl() 
. "\n\n" );
}
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] update deploy-promote for dblist location change - change (mediawiki...release)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: update deploy-promote for dblist location change
..


update deploy-promote for dblist location change

also fixes the test urls for group0 and group3

Change-Id: I77fa9f2410176583feeb0908d0484d429a18a28c
---
M bin/deploy-promote
1 file changed, 8 insertions(+), 5 deletions(-)

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



diff --git a/bin/deploy-promote b/bin/deploy-promote
index 33e09b1..21a6e62 100755
--- a/bin/deploy-promote
+++ b/bin/deploy-promote
@@ -35,7 +35,7 @@
 NEWVERSION=`/srv/mediawiki-staging/multiversion/activeMWVersions|cut -d " " 
-f2`
 GRP=${1:-group1}
 export VERSION=${2:-$NEWVERSION}
-DBLIST="/srv/mediawiki-staging/$GRP.dblist"
+DBLIST="/srv/mediawiki-staging/dblists/$GRP.dblist"
 if [ ! -f "$DBLIST" ]; then
 echo "$DBLIST does not exist"
 exit 1
@@ -44,14 +44,14 @@
 /srv/mediawiki-staging/multiversion/updateWikiversions $GRP php-${VERSION}
 
 git add wikiversions.json
-git add docroot/bits/static-current/
 git add w/static/current
+git add docroot/bits/static
 git add php
 
 MSG="$GRP wikis to ${VERSION}"
 git commit -m "$MSG"
 
-git push gerrit HEAD:refs/for/master/${VERSION}
+git push origin HEAD:refs/for/master/${VERSION}
 
 git reset --hard HEAD^
 
@@ -75,8 +75,11 @@
 sync-wikiversions "$MSG"
 
 set +e
-[[ "$GRP" == "all" ]] && CHECK="wikipedia" || CHECK="wikinews"
-URLTOCHECK="https://en.$CHECK.org/wiki/Special:Version";
+[[ "$GRP" == "all" ]] || [[ "$GPP" == "wikipedia" ]] && 
CHECKDOMAIN="en.wikipedia.org"
+[[ "$GRP" == "group1" ]] && CHECKDOMAIN="en.wikinews.org"
+[[ "$GRP" == "group0" ]] && CHECKDOMAIN="www.mediawiki.org" || 
CHECKDOMAIN="test.wikipedia.org"
+
+URLTOCHECK="https://$CHECKDOMAIN/wiki/Special:Version";
 echo "-"
 echo "Checking version on $URLTOCHECK"
 echo "Expect: $VERSION"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I77fa9f2410176583feeb0908d0484d429a18a28c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/release
Gerrit-Branch: master
Gerrit-Owner: 20after4 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Greg Grossmeier 
Gerrit-Reviewer: Thcipriani 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Allow passing detailed permission errors data to API - change (mediawiki/core)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Allow passing detailed permission errors data to API
..


Allow passing detailed permission errors data to API

Using the new system introduced in
1c57794e371d74e1d88748de567a1c3358c3ad2e (see T47843).

This change allows Title::getUserPermissionsErrors() to include
MessageSpecifiers instead of string message keys in its return value.
This doesn't seem to have any bad effects, and should work seamlessly as
long as callers aren't trying to do anything stupid and just pass the
value to PermissionsError or OutputPage::showPermissionsErrorPage()
or wfMessage() or some such.

If the callers *are* trying something stupid, nothing worse than
duplicated or otherwise less-than-perfect error messages (in code
which tries to handle some message keys specially) should happen.
(I fixed wfMergeErrorArrays(), but who knows what else lurks in all
this code.) Any problems should only affect new-style errors using
MessageSpecifier, though.

Since MessageSpecifiers tend to be stringable, we probably won't get
fatals, but might get incorrect checks. Should we try to log this
happening somehow?

Goes with I42a0c5b0ea7e61088dd609b764dd7d1396c60cd5 in TitleBlacklist.

Bug: T115258
Change-Id: I1334ba21a2862973a9d8ff5be2c9bec06a82698b
---
M RELEASE-NOTES-1.27
M docs/hooks.txt
M includes/GlobalFunctions.php
M includes/Title.php
M includes/api/ApiBase.php
M includes/api/ApiUpload.php
6 files changed, 49 insertions(+), 11 deletions(-)

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



diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27
index 4275921..35fa887 100644
--- a/RELEASE-NOTES-1.27
+++ b/RELEASE-NOTES-1.27
@@ -64,6 +64,9 @@
   setting in the relevant section of $wgLBFactoryConf.
 * User::newSystemUser() may be used to simplify the creation of passwordless
   "system" users for logged actions from scripts and extensions.
+* Extensions can now return detailed error information via the API when
+  preventing user actions using 'getUserPermissionsErrors' and similar hooks
+  by using ApiMessage instances instead of strings for the $result value.
 
  External libraries 
 
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 427f35e..017416f 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -1521,7 +1521,9 @@
 'getUserPermissionsErrors': Add a permissions error when permissions errors are
 checked for. Use instead of userCan for most cases. Return false if the user
 can't do it, and populate $result with the reason in the form of
-array( messagename, param1, param2, ... ). For consistency, error messages
+array( messagename, param1, param2, ... ) or a MessageSpecifier instance (you
+might want to use ApiMessage to provide machine-readable details for the API).
+For consistency, error messages
 should be plain text with no special coloring, bolding, etc. to show that
 they're errors; presenting them properly to the user as errors is done by the
 caller.
@@ -1534,7 +1536,9 @@
 called only if expensive checks are enabled. Add a permissions error when
 permissions errors are checked for. Return false if the user can't do it, and
 populate $result with the reason in the form of array( messagename, param1,
-param2, ... ). For consistency, error messages should be plain text with no
+param2, ... ) or a MessageSpecifier instance (you might want to use ApiMessage
+to provide machine-readable details for the API). For consistency, error
+messages should be plain text with no
 special coloring, bolding, etc. to show that they're errors; presenting them
 properly to the user as errors is done by the caller.
 $title: Title object being checked against
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 791bf33..7c57207 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -308,10 +308,15 @@
$out = array();
foreach ( $args as $errors ) {
foreach ( $errors as $params ) {
+   $originalParams = $params;
+   if ( $params[0] instanceof MessageSpecifier ) {
+   $msg = $params[0];
+   $params = array_merge( array( $msg->getKey() ), 
$msg->getParams() );
+   }
# @todo FIXME: Sometimes get nested arrays for $params,
# which leads to E_NOTICEs
$spec = implode( "\t", $params );
-   $out[$spec] = $params;
+   $out[$spec] = $originalParams;
}
}
return array_values( $out );
diff --git a/includes/Title.php b/includes/Title.php
index 9ada4f3..13e7ffb 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -1944,7 +1944,7 @@
 *   - secure : does cheap and expensive checks, using 

[MediaWiki-commits] [Gerrit] Avoid in_array for performance reasons - change (mediawiki...codesniffer)

2015-11-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Avoid in_array for performance reasons
..


Avoid in_array for performance reasons

Change-Id: Idb4128ab8179376c7a85b64ac9c895ae858f7cd9
---
M MediaWiki/Sniffs/VariableAnalysis/UnusedGlobalVariablesSniff.php
1 file changed, 9 insertions(+), 6 deletions(-)

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



diff --git a/MediaWiki/Sniffs/VariableAnalysis/UnusedGlobalVariablesSniff.php 
b/MediaWiki/Sniffs/VariableAnalysis/UnusedGlobalVariablesSniff.php
index 03421aa..688dbb5 100644
--- a/MediaWiki/Sniffs/VariableAnalysis/UnusedGlobalVariablesSniff.php
+++ b/MediaWiki/Sniffs/VariableAnalysis/UnusedGlobalVariablesSniff.php
@@ -27,19 +27,21 @@
$strVariables = array();
 
for ( $i = $scopeOpener; $i < $scopeCloser; $i++ ) {
-   if ( in_array( $tokens[$i]['type'], 
PHP_CodeSniffer_Tokens::$emptyTokens ) ) {
+   if ( array_key_exists( $tokens[$i]['type'], 
PHP_CodeSniffer_Tokens::$emptyTokens ) ) {
continue;
}
if ( $tokens[$i]['type'] === 'T_GLOBAL' ) {
$globalLine = $tokens[$i]['line'];
}
if ( $tokens[$i]['type'] === 'T_VARIABLE' && 
$tokens[$i]['line'] == $globalLine ) {
-   $globalVariables[] = $tokens[$i]['content'] 
.'#'. $i;
+   $globalVariables[] = array( 
$tokens[$i]['content'], $i );
}
if ( $tokens[$i]['type'] === 'T_VARIABLE' && 
$tokens[$i]['line'] != $globalLine ) {
-   $otherVariables[] = $tokens[$i]['content'];
+   $otherVariables[$tokens[$i]['content']] = null;
}
-   if ( $tokens[$i]['type'] === 'T_DOUBLE_QUOTED_STRING' 
|| $tokens[$i]['type'] === "T_HEREDOC" ) {
+   if ( $tokens[$i]['type'] === 'T_DOUBLE_QUOTED_STRING'
+   || $tokens[$i]['type'] === 'T_HEREDOC'
+   ) {
preg_match_all( '/\$\w+/', 
$tokens[$i]['content'], $matches );
$strVariables = array_merge_recursive( 
$strVariables, $matches );
}
@@ -49,8 +51,9 @@
false
);
foreach ( $globalVariables as $global ) {
-   $global = explode( '#', $global );
-   if ( !in_array( $global[0], $otherVariables ) && 
!in_array( $global[0], $strVariables ) ) {
+   if ( !array_key_exists( $global[0], $otherVariables )
+   && !in_array( $global[0], $strVariables )
+   ) {
$phpcsFile->addWarning( 'Global ' . $global[0] 
.' is never used.', $global[1] );
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb4128ab8179376c7a85b64ac9c895ae858f7cd9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Phoenix303 
Gerrit-Reviewer: Polybuildr 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add unique constraint on SP export email column - change (wikimedia...tools)

2015-11-04 Thread Awight (Code Review)
Awight has submitted this change and it was merged.

Change subject: Add unique constraint on SP export email column
..


Add unique constraint on SP export email column

Dedupe logic shouldn't allow it anyway, but this is a nice safety net.

Bug:T107045
Change-Id: I72c6f3068a58b64c86897c9ade2ddee8d172da20
---
M silverpop_export/update_table.sql
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 591de2e..3472cf9 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -280,7 +280,8 @@
   INDEX rspex_city (city),
   INDEX rspex_country (country),
   INDEX rspex_postal (postal_code),
-  INDEX rspex_opted_out (opted_out)
+  INDEX rspex_opted_out (opted_out),
+  CONSTRAINT sp_email UNIQUE (email)
 ) COLLATE 'utf8_unicode_ci';
 
 -- Move the data from the temp table into the persistent one

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I72c6f3068a58b64c86897c9ade2ddee8d172da20
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Springle 
Gerrit-Reviewer: jenkins-bot <>

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


  1   2   3   4   >