[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Cache results for duration of override

2017-11-24 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393363 )

Change subject: Cache results for duration of override
..

Cache results for duration of override

Purging of cache on record change was introduced in 147b945 so it is
safe for us to cache a throttle override until its current expiration
time on successful lookup. The cache time for a negative lookup is kept
at one hour, not because a longer duration would be unsafe, but because
the key space is incredibly large (2^32 + 2^128).

Change-Id: I049d20f93b0d66f4109778e4e664d2f73c88ae24
---
M ThrottleOverride.hooks.php
1 file changed, 4 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ThrottleOverride 
refs/changes/63/393363/1

diff --git a/ThrottleOverride.hooks.php b/ThrottleOverride.hooks.php
index 9dcaa3d..e4cde1a 100644
--- a/ThrottleOverride.hooks.php
+++ b/ThrottleOverride.hooks.php
@@ -84,21 +84,12 @@
[ 'ORDER BY' => 'thr_expiry DESC' ]
);
 
-   // Its tempting to set the TTL to match the 
expiration we
-   // found in the DB, but since the record is 
editable and we do
-   // not purge every key in the range when it 
changes we will
-   // just leave the default cache time alone. The 
exception to
-   // this rule is when we are caching a row which 
will expire in
-   // less than the default TTL.
-   // NOTE: this means that changes to an existing 
record may not
-   // effect all IPs in the range equally until 
the default cache
-   // period has elapsed.
if ( $expiry !== false ) {
-   // An override exists; do not cache for 
more than the
-   // override's current-time-left
+   // An override exists; cache for the 
override's
+   // current-time-left. Cache will be 
purged via checkKey
+   // updates on record modification.
$nowUnix = time();
-   $overrideCTL = wfTimestamp( TS_UNIX, 
$expiry ) - $nowUnix;
-   $ttl = min( $ttl, max( $overrideCTL, 1 
) );
+   $ttl = wfTimestamp( TS_UNIX, $expiry ) 
- $nowUnix;
}
 
// If we return false the value will not be 
cached

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I049d20f93b0d66f4109778e4e664d2f73c88ae24
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ThrottleOverride
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: API: Allow querying linterrors by pageid

2017-11-24 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393236 )

Change subject: API: Allow querying linterrors by pageid
..


API: Allow querying linterrors by pageid

The pageid parameter limits lint errors to specific pages. Users can get
detailed lint error information of a certain page.

Bug: T181303
Change-Id: I164449254649caff29fcffa3bc7c923c20b8e837
---
M i18n/en.json
M i18n/qqq.json
M includes/ApiQueryLintErrors.php
3 files changed, 9 insertions(+), 0 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index a02e36b..4927537 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -63,6 +63,7 @@
"apihelp-query+linterrors-param-limit": "Number of results to query",
"apihelp-query+linterrors-param-from": "Lint ID to start querying from",
"apihelp-query+linterrors-param-namespace": "Only include lint errors 
from the specified namespaces",
+   "apihelp-query+linterrors-param-pageid": "Only include lint errors from 
the specified page IDs",
"apihelp-query+linterrors-example-1": "Get all lint errors of the 
obsolete-tag category",
"apihelp-record-lint-description": "Record a lint error in the 
database",
"apihelp-record-lint-summary": "Record a lint error in the database",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 92af23a..9162c24 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -67,6 +67,7 @@
"apihelp-query+linterrors-param-limit": 
"{{doc-apihelp-param|query+linterrors|limit}}",
"apihelp-query+linterrors-param-from": 
"{{doc-apihelp-param|query+linterrors|from}}",
"apihelp-query+linterrors-param-namespace": 
"{{doc-apihelp-param|query+linterrors|namespace}}",
+   "apihelp-query+linterrors-param-pageid": 
"{{doc-apihelp-param|query+linterrors|pageid}}",
"apihelp-query+linterrors-example-1": 
"{{doc-apihelp-example|query+linterrors}}",
"apihelp-record-lint-description": 
"{{doc-apihelp-description|record-lint}}",
"apihelp-record-lint-summary": "{{doc-apihelp-summary|record-lint}}",
diff --git a/includes/ApiQueryLintErrors.php b/includes/ApiQueryLintErrors.php
index adebc18..f057c0c 100644
--- a/includes/ApiQueryLintErrors.php
+++ b/includes/ApiQueryLintErrors.php
@@ -43,6 +43,9 @@
if ( $params['from'] !== null ) {
$this->addWhere( 'linter_id >= ' . $db->addQuotes( 
$params['from'] ) );
}
+   if ( $params['pageid'] !== null ) {
+   $this->addWhereFld( 'linter_page', $params['pageid'] );
+   }
if ( $params['namespace'] !== null ) {
$this->addWhereFld( 'page_namespace', 
$params['namespace'] );
}
@@ -114,6 +117,10 @@
ApiBase::PARAM_TYPE => 'namespace',
ApiBase::PARAM_ISMULTI => true,
],
+   'pageid' => [
+   ApiBase::PARAM_TYPE => 'integer',
+   ApiBase::PARAM_ISMULTI => true,
+   ],
'from' => [
ApiBase::PARAM_TYPE => 'integer',
],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I164449254649caff29fcffa3bc7c923c20b8e837
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Linter
Gerrit-Branch: master
Gerrit-Owner: MawaruNeko 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Rename typo "linker-" keys to proper "linter-"

2017-11-24 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393362 )

Change subject: Rename typo "linker-" keys to proper "linter-"
..

Rename typo "linker-" keys to proper "linter-"

I must have made a typo and prefixed the keys with "linker-" instead of
"linter-".

Change-Id: I041aa3341aaa2efa51d20c848cb19efb648209ac
---
M i18n/aeb-arab.json
M i18n/ar.json
M i18n/ast.json
M i18n/az.json
M i18n/be-tarask.json
M i18n/be.json
M i18n/bg.json
M i18n/bn.json
M i18n/ca.json
M i18n/ce.json
M i18n/cs.json
M i18n/de.json
M i18n/el.json
M i18n/en.json
M i18n/es.json
M i18n/et.json
M i18n/fa.json
M i18n/fi.json
M i18n/fr.json
M i18n/gl.json
M i18n/he.json
M i18n/hr.json
M i18n/hu.json
M i18n/hy.json
M i18n/it.json
M i18n/ja.json
M i18n/ko.json
M i18n/ku-latn.json
M i18n/lb.json
M i18n/lt.json
M i18n/mk.json
M i18n/nb.json
M i18n/nl.json
M i18n/nn.json
M i18n/pl.json
M i18n/pt-br.json
M i18n/pt.json
M i18n/qqq.json
M i18n/ru.json
M i18n/sl.json
M i18n/sr-ec.json
M i18n/su.json
M i18n/sv.json
M i18n/tay.json
M i18n/tcy.json
M i18n/th.json
M i18n/tr.json
M i18n/uk.json
M i18n/ur.json
M i18n/vi.json
M i18n/xmf.json
M i18n/yi.json
M i18n/zh-hans.json
M i18n/zh-hant.json
M includes/LintErrorsPager.php
55 files changed, 102 insertions(+), 102 deletions(-)


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

diff --git a/i18n/aeb-arab.json b/i18n/aeb-arab.json
index 66b5d49..c3b30ed 100644
--- a/i18n/aeb-arab.json
+++ b/i18n/aeb-arab.json
@@ -4,5 +4,5 @@
"Csisc"
]
},
-   "linker-page-edit": "بدّل"
+   "linter-page-edit": "بدّل"
 }
diff --git a/i18n/ar.json b/i18n/ar.json
index 24abbf6..ea4229a 100644
--- a/i18n/ar.json
+++ b/i18n/ar.json
@@ -12,8 +12,8 @@
"linter-pager-title": "عنوان الصفحة",
"linter-pager-template": "من خلال قالب؟",
"linter-numerrors": "({{PLURAL:$1|خطأ|خطآن|$1 أخطاء}})",
-   "linker-page-edit": "تعديل",
-   "linker-page-history": "تاريخ",
+   "linter-page-edit": "تعديل",
+   "linter-page-history": "تاريخ",
"linter-heading-high-priority": "أولوية عالية",
"linter-heading-medium-priority": "أولوية متوسطة",
"linter-heading-low-priority": "أولوية قليلة",
diff --git a/i18n/ast.json b/i18n/ast.json
index d9ecb39..b9c7d71 100644
--- a/i18n/ast.json
+++ b/i18n/ast.json
@@ -49,8 +49,8 @@
"linter-category-tidy-font-bug": "Error de Tidy qu'afeuta a les 
etiquetes font qu'envuelven enllaces",
"linter-category-tidy-font-bug-desc": "Tidy mueve estes etiquetes font 
dientro de los enllaces pa cambiar el color del enllaz",
"linter-numerrors": "($1 {{PLURAL:$1|error|errores}})",
-   "linker-page-edit": "editar",
-   "linker-page-history": "historial",
+   "linter-page-edit": "editar",
+   "linter-page-history": "historial",
"linter-heading-high-priority": "Prioridá alta",
"linter-heading-medium-priority": "Prioridá mediana",
"linter-heading-low-priority": "Prioridá baxa",
diff --git a/i18n/az.json b/i18n/az.json
index 2f65819..856803c 100644
--- a/i18n/az.json
+++ b/i18n/az.json
@@ -8,5 +8,5 @@
"linter-pager-self-closed-tag-details": "Self-qapalı tag",
"linter-category-self-closed-tag": "Self-qapalı tags",
"linter-category-self-closed-tag-desc": "Bu pages özünü qapalı tags 
var.",
-   "linker-page-edit": "redaktə"
+   "linter-page-edit": "redaktə"
 }
diff --git a/i18n/be-tarask.json b/i18n/be-tarask.json
index add71e3..e54793b 100644
--- a/i18n/be-tarask.json
+++ b/i18n/be-tarask.json
@@ -38,8 +38,8 @@
"linter-category-pwrap-bug-workaround": "Пазьбяганьне памылкі абгорткі 
параграфу",
"linter-category-pwrap-bug-workaround-desc": "Гэтыя старонкі маюць 
памылку абгорткі параграфу, якая можа быць пазьбегнутая.",
"linter-numerrors": "($1 {{PLURAL:$1|памылка|памылкі|памылак}})",
-   "linker-page-edit": "рэдагаваць",
-   "linker-page-history": "гісторыя",
+   "linter-page-edit": "рэдагаваць",
+   "linter-page-history": "гісторыя",
"linter-heading-high-priority": "Высокі прыярытэт",
"linter-heading-medium-priority": "Сярэдні прыярытэт",
"linter-heading-low-priority": "Нізкі прыярытэт",
diff --git a/i18n/be.json b/i18n/be.json
index 10dd6ad..b04f4c8 100644
--- a/i18n/be.json
+++ b/i18n/be.json
@@ -4,5 +4,5 @@
"Mechanizatar"
]
},
-   "linker-page-edit": "правіць"
+   "linter-page-edit": "правіць"
 }
diff --git a/i18n/bg.json b/i18n/bg.json
index 2aa5b02..92edc48 100644
--- a/i18n/bg.json
+++ b/i18n/bg.json
@@ -25,7 +25,7 @@
"linter-category-misnested-tag": "Грешно вложени тагове",
"linter-category-html5-misnesting": "Неправилно вложен таг с различно 
визуализиране в HTML5 и HTML4",
"linter-category-html5-misnesting-desc": "Следните неправилно 

[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Show edit and history links even if page is protected

2017-11-24 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393361 )

Change subject: Show edit and history links even if page is protected
..

Show edit and history links even if page is protected

If the user does not have permission to edit the page, still show a
"view source" and history link so they are able to figure out what the
error is.

Bug: T177289
Change-Id: I049d27d37073e452dc0c11128dab5204d110d81f
---
M i18n/en.json
M i18n/qqq.json
M includes/LintErrorsPager.php
3 files changed, 5 insertions(+), 4 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index a02e36b..c8ea69b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -51,6 +51,7 @@
"linter-numerrors": "($1 {{PLURAL:$1|error|errors}})",
"linker-page-title-edit": "$1 ($2)",
"linker-page-edit": "edit",
+   "linter-page-viewsource": "view source",
"linker-page-history": "history",
"linter-heading-high-priority": "High priority",
"linter-heading-medium-priority": "Medium priority",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 92af23a..bd2b4d9 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -55,6 +55,7 @@
"linter-numerrors": "Shown after a category link to indicate how many 
errors are in that category. $1 is the number of errors, and can be used for 
PLURAL.\n{{Identical|Error}}",
"linker-page-title-edit": "Used in a table cell. $1 is a link to the 
page, $2 is pipe separated links to the edit and history pages, the link text 
is {{msg-mw|linker-page-edit}} and {{msg-mw|linker-page-history}}",
"linker-page-edit": "Link text for edit link in 
{{msg-mw|linker-page-title-edit}}\n{{Identical|Edit}}",
+   "linter-page-viewsource": "Link text for view source link when user 
does not have permission to edit in {{msg-mw|linker-page-title-edit}}",
"linker-page-history": "Link text for history link in 
{{msg-mw|linker-page-title-edit}}\n{{Identical|History}}",
"linter-heading-high-priority": "Heading on [[Special:LintErrors]]",
"linter-heading-medium-priority": "Heading on [[Special:LintErrors]]",
diff --git a/includes/LintErrorsPager.php b/includes/LintErrorsPager.php
index 05b4813..4d187d6 100644
--- a/includes/LintErrorsPager.php
+++ b/includes/LintErrorsPager.php
@@ -116,12 +116,11 @@
case 'title':
$title = Title::makeTitle( 
$row->page_namespace, $row->page_title );
$viewLink = $this->linkRenderer->makeLink( 
$title );
-   if ( !$title->quickUserCan( 'edit', 
$this->getUser() ) ) {
-   return $viewLink;
-   }
+   $editMsgKey = $title->quickUserCan( 'edit', 
$this->getUser() ) ?
+   'linker-page-edit' : 
'linter-page-viewsource';
$editLink = $this->linkRenderer->makeLink(
$title,
-   $this->msg( 'linker-page-edit' 
)->text(),
+   $this->msg( $editMsgKey )->text(),
[],
[ 'action' => $editAction, 'lintid' => 
$lintError->lintId, ]
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I049d27d37073e452dc0c11128dab5204d110d81f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Linter
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] mediawiki...UniversalLanguageSelector[master]: Update eslint and stylelint and fixes

2017-11-24 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393359 )

Change subject: Update eslint and stylelint and fixes
..

Update eslint and stylelint and fixes

Change-Id: I02e615e0efa95b673702f1ce8c957a37397ced13
---
M package.json
M resources/js/ext.uls.common.js
M resources/js/ext.uls.inputsettings.js
3 files changed, 13 insertions(+), 13 deletions(-)


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

diff --git a/package.json b/package.json
index 7d53d98..e5a4f66 100644
--- a/package.json
+++ b/package.json
@@ -4,12 +4,12 @@
 "test": "grunt test"
   },
   "devDependencies": {
-"eslint-config-wikimedia": "0.4.0",
+"eslint-config-wikimedia": "0.5.0",
 "grunt": "1.0.1",
-"grunt-banana-checker": "0.5.0",
-"grunt-eslint": "19.0.0",
+"grunt-banana-checker": "0.6.0",
+"grunt-eslint": "20.0.0",
 "grunt-jsonlint": "1.1.0",
-"grunt-stylelint": "0.7.0",
+"grunt-stylelint": "0.8.0",
 "stylelint": "7.8.0",
 "stylelint-config-wikimedia": "0.4.1"
   }
diff --git a/resources/js/ext.uls.common.js b/resources/js/ext.uls.common.js
index 265e2ad..7aaecb8 100644
--- a/resources/js/ext.uls.common.js
+++ b/resources/js/ext.uls.common.js
@@ -59,14 +59,14 @@
 
api = new mw.Api();
api.saveOption( 'language', language )
-   .done( function () {
-   location.reload();
-   } )
-   .fail( function () {
-   // Set options failed. Maybe the user has 
logged off.
-   // Continue like anonymous user and set cookie.
-   changeLanguageAnon();
-   } );
+   .done( function () {
+   location.reload();
+   } )
+   .fail( function () {
+   // Set options failed. Maybe the user 
has logged off.
+   // Continue like anonymous user and set 
cookie.
+   changeLanguageAnon();
+   } );
} );
 
mw.hook( 'mw.uls.interface.language.change' ).fire( language, 
deferred );
diff --git a/resources/js/ext.uls.inputsettings.js 
b/resources/js/ext.uls.inputsettings.js
index bb1f653..e18eeab 100644
--- a/resources/js/ext.uls.inputsettings.js
+++ b/resources/js/ext.uls.inputsettings.js
@@ -178,7 +178,7 @@
id: imeId,
value: imeId
} )
-   .prop( 'checked', selected );
+   .prop( 'checked', selected );
 
if ( imeId === 'system' ) {
name = $.i18n( 'ext-uls-disable-input-method' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02e615e0efa95b673702f1ce8c957a37397ced13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: puppetmaster.erb: allow switching of puppetmaster_rack_path

2017-11-24 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393358 )

Change subject: puppetmaster.erb: allow switching of puppetmaster_rack_path
..

puppetmaster.erb: allow switching of puppetmaster_rack_path

Followup for e29625a220be120b4ba4a23d19fac4fc3f6a75b2

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


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

diff --git a/modules/puppetmaster/templates/puppetmaster.erb 
b/modules/puppetmaster/templates/puppetmaster.erb
index 9c3e3b5..4238348 100644
--- a/modules/puppetmaster/templates/puppetmaster.erb
+++ b/modules/puppetmaster/templates/puppetmaster.erb
@@ -25,8 +25,8 @@
 <%- end -%>
 
 
-DocumentRoot /usr/share/puppet/rack/puppetmasterd/public
-
+DocumentRoot <%= @puppetmaster_rack_path %>/public
+/>
 Options None
 AllowOverride None
 Require all granted

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a99e33869661f2b65f224b53a4f38fff305bc2b
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] operations/puppet[production]: role::puppetmaster::standalone: allow specification of pupp...

2017-11-24 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393357 )

Change subject: role::puppetmaster::standalone:  allow specification of 
puppet_major_version
..


role::puppetmaster::standalone:  allow specification of puppet_major_version

This is typically defined as a global but this class was ignoring it.

Change-Id: I80f6e9450c1230028175d0f0a39af831a6a21f35
---
M modules/role/manifests/puppetmaster/standalone.pp
1 file changed, 11 insertions(+), 6 deletions(-)

Approvals:
  Andrew Bogott: Verified; Looks good to me, approved



diff --git a/modules/role/manifests/puppetmaster/standalone.pp 
b/modules/role/manifests/puppetmaster/standalone.pp
index a597266..2b89432 100644
--- a/modules/role/manifests/puppetmaster/standalone.pp
+++ b/modules/role/manifests/puppetmaster/standalone.pp
@@ -33,6 +33,9 @@
 #  Hostname for the puppetmaster. Defaults to fqdn. Is used for SSL
 #  certificates, virtualhost routing, etc
 #
+# [*puppet_major_version*]
+#  Distinguishes version of puppet software e.g. 3 or 4
+#
 # filtertags: labs-common
 class role::puppetmaster::standalone(
 $autosign = false,
@@ -43,6 +46,7 @@
 $server_name = $::fqdn,
 $use_enc = true,
 $labs_puppet_master = hiera('labs_puppet_master'),
+$puppet_major_version = hiera('puppet_major_version', undef),
 ) {
 if ! $use_enc {
 fail('Ldap puppet node definitions are no longer supported.  The 
$use_enc param must be true.')
@@ -60,12 +64,13 @@
 }
 
 class { '::puppetmaster':
-server_name => $server_name,
-allow_from  => $allow_from,
-secure_private  => false,
-prevent_cherrypicks => $prevent_cherrypicks,
-extra_auth_rules=> $extra_auth_rules,
-config  => $config,
+server_name  => $server_name,
+allow_from   => $allow_from,
+secure_private   => false,
+prevent_cherrypicks  => $prevent_cherrypicks,
+extra_auth_rules => $extra_auth_rules,
+config   => $config,
+puppet_major_version => $puppet_major_version,
 }
 
 # Update git checkout

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I80f6e9450c1230028175d0f0a39af831a6a21f35
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: role::puppetmaster::standalone: allow specification of pupp...

2017-11-24 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393357 )

Change subject: role::puppetmaster::standalone:  allow specification of 
puppet_major_version
..

role::puppetmaster::standalone:  allow specification of puppet_major_version

This is typically defined as a global but this class was ignoring it.

Change-Id: I80f6e9450c1230028175d0f0a39af831a6a21f35
---
M modules/role/manifests/puppetmaster/standalone.pp
1 file changed, 11 insertions(+), 6 deletions(-)


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

diff --git a/modules/role/manifests/puppetmaster/standalone.pp 
b/modules/role/manifests/puppetmaster/standalone.pp
index a597266..2b89432 100644
--- a/modules/role/manifests/puppetmaster/standalone.pp
+++ b/modules/role/manifests/puppetmaster/standalone.pp
@@ -33,6 +33,9 @@
 #  Hostname for the puppetmaster. Defaults to fqdn. Is used for SSL
 #  certificates, virtualhost routing, etc
 #
+# [*puppet_major_version*]
+#  Distinguishes version of puppet software e.g. 3 or 4
+#
 # filtertags: labs-common
 class role::puppetmaster::standalone(
 $autosign = false,
@@ -43,6 +46,7 @@
 $server_name = $::fqdn,
 $use_enc = true,
 $labs_puppet_master = hiera('labs_puppet_master'),
+$puppet_major_version = hiera('puppet_major_version', undef),
 ) {
 if ! $use_enc {
 fail('Ldap puppet node definitions are no longer supported.  The 
$use_enc param must be true.')
@@ -60,12 +64,13 @@
 }
 
 class { '::puppetmaster':
-server_name => $server_name,
-allow_from  => $allow_from,
-secure_private  => false,
-prevent_cherrypicks => $prevent_cherrypicks,
-extra_auth_rules=> $extra_auth_rules,
-config  => $config,
+server_name  => $server_name,
+allow_from   => $allow_from,
+secure_private   => false,
+prevent_cherrypicks  => $prevent_cherrypicks,
+extra_auth_rules => $extra_auth_rules,
+config   => $config,
+puppet_major_version => $puppet_major_version,
 }
 
 # Update git checkout

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80f6e9450c1230028175d0f0a39af831a6a21f35
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] mediawiki...cxserver[master]: Add Dockerfile to .gitignore

2017-11-24 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393356 )

Change subject: Add Dockerfile to .gitignore
..

Add Dockerfile to .gitignore

Dockerfile is used in deployment of cxserver.

Change-Id: Ic869afdfe294f0598a792e9062cebec9f9e494f9
---
M .gitignore
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/56/393356/1

diff --git a/.gitignore b/.gitignore
index bcf2333..3ba945a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,6 @@
 docs
 node_modules
 log/
+
+# Dockerfile (used for deploy)
+Dockerfile

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic869afdfe294f0598a792e9062cebec9f9e494f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Collapse PHP_SAPI conditionals down into one

2017-11-24 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393355 )

Change subject: Collapse PHP_SAPI conditionals down into one
..

Collapse PHP_SAPI conditionals down into one

Change-Id: Id482e57956f42bd76688e94a1885dc619f8079a8
---
M wmf-config/CommonSettings.php
1 file changed, 10 insertions(+), 15 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 59c56e7..84715ff 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -27,8 +27,17 @@
 #
 # More modern PHP versions will send a 500 result code on fatal error,
 # at least sometimes, but what we're running will send a 200.
-if ( PHP_SAPI != 'cli' ) {
+if ( PHP_SAPI !== 'cli' ) {
header( "Cache-control: no-cache" );
+} else {
+   # Override for sanity's sake. Log errors to stderr.
+   ini_set( 'display_errors', 'stderr' );
+
+   $wgShowExceptionDetails = true;
+   $wgShowDBErrorBacktrace = true;
+
+   # APC not available in CLI mode
+   $wgLanguageConverterCacheType = CACHE_NONE;
 }
 
 // Clobber any value in $_SERVER['SERVER_SOFTWARE'] other than Apache, so that
@@ -39,10 +48,6 @@
$_SERVER['SERVER_SOFTWARE'] = 'Apache';
 }
 
-if ( PHP_SAPI === 'cli' ) {
-   # Override for sanity's sake. Log errors to stderr.
-   ini_set( 'display_errors', 'stderr' );
-}
 if ( isset( $_SERVER['SERVER_ADDR'] ) ) {
ini_set( 'error_append_string', ' (' . $_SERVER['SERVER_ADDR'] . ')' );
 }
@@ -479,11 +484,6 @@
 $wgEnableBotPasswords = $wmgEnableBotPasswords;
 $wgBotPasswordsCluster = $wmgBotPasswordsCluster;
 $wgBotPasswordsDatabase = $wmgBotPasswordsDatabase;
-
-if ( PHP_SAPI === 'cli' ) {
-   $wgShowExceptionDetails = true;
-   $wgShowDBErrorBacktrace = true;
-}
 
 $wgUseImageResize   = true;
 $wgUseImageMagick   = true;
@@ -2384,11 +2384,6 @@
 
 if ( $wmgUseCLDR ) {
wfLoadExtension( 'cldr' );
-}
-
-# APC not available in CLI mode
-if ( PHP_SAPI === 'cli' ) {
-   $wgLanguageConverterCacheType = CACHE_NONE;
 }
 
 # Style version appendix

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Kill off $wgStyleVersion

2017-11-24 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393354 )

Change subject: Kill off $wgStyleVersion
..

Kill off $wgStyleVersion

Bug: T181318
Change-Id: Ib5dce1c8d39a821aab0f96133780c18c827bde03
---
M includes/DefaultSettings.php
M includes/OutputPage.php
M includes/skins/Skin.php
3 files changed, 5 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/393354/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 3cd7ef1..d51878c 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2549,15 +2549,6 @@
 $wgGitInfoCacheDirectory = false;
 
 /**
- * Bump this number when changing the global style sheets and JavaScript.
- *
- * It should be appended in the query string of static CSS and JS includes,
- * to ensure that client-side caches do not keep obsolete copies of global
- * styles.
- */
-$wgStyleVersion = '303';
-
-/**
  * This will cache static pages for non-logged-in users to reduce
  * database traffic on public sites. ResourceLoader requests to default
  * language and skins are cached as well as single module requests.
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index a5f9c18..8bb32c3 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -494,19 +494,15 @@
 *
 * @param string $file Filename in skins/common or complete on-server 
path
 *  (/foo/bar.js)
-* @param string $version Style version of the file. Defaults to 
$wgStyleVersion
 */
-   public function addScriptFile( $file, $version = null ) {
+   public function addScriptFile( $file ) {
// See if $file parameter is an absolute URL or begins with a 
slash
if ( substr( $file, 0, 1 ) == '/' || preg_match( 
'#^[a-z]*://#i', $file ) ) {
$path = $file;
} else {
$path = $this->getConfig()->get( 'StylePath' ) . 
"/common/{$file}";
}
-   if ( is_null( $version ) ) {
-   $version = $this->getConfig()->get( 'StyleVersion' );
-   }
-   $this->addScript( Html::linkedScript( wfAppendQuery( $path, 
$version ) ) );
+   $this->addScript( Html::linkedScript( $path ) );
}
 
/**
@@ -3739,8 +3735,7 @@
$url = $style;
} else {
$config = $this->getConfig();
-   $url = $config->get( 'StylePath' ) . '/' . $style . '?' 
.
-   $config->get( 'StyleVersion' );
+   $url = $config->get( 'StylePath' ) . '/' . $style;
}
 
$link = Html::linkedStyle( $url, $media );
diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php
index 07964a4..94405fc 100644
--- a/includes/skins/Skin.php
+++ b/includes/skins/Skin.php
@@ -1089,14 +1089,14 @@
 * @throws MWException
 */
function getSkinStylePath( $name ) {
-   global $wgStylePath, $wgStyleVersion;
+   global $wgStylePath;
 
if ( $this->stylename === null ) {
$class = static::class;
throw new MWException( "$class::\$stylename must be set 
to use getSkinStylePath()" );
}
 
-   return "$wgStylePath/{$this->stylename}/$name?$wgStyleVersion";
+   return "$wgStylePath/{$this->stylename}/$name";
}
 
/* these are used extensively in SkinTemplate, but also some other 
places */

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Remove $wgStyleVersion appending in CommonSettings

2017-11-24 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393353 )

Change subject: Remove $wgStyleVersion appending in CommonSettings
..

Remove $wgStyleVersion appending in CommonSettings

Bug: T181318
Change-Id: I94ec13326eb19c5bde96e50a6f787a24c2d23192
---
M wmf-config/CommonSettings.php
1 file changed, 0 insertions(+), 4 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 59c56e7..cc34d9a 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2391,10 +2391,6 @@
$wgLanguageConverterCacheType = CACHE_NONE;
 }
 
-# Style version appendix
-# Shouldn't be needed much in 1.17 due to ResourceLoader, but some legacy 
things still need it
-$wgStyleVersion .= '-4';
-
 // DO NOT DISABLE WITHOUT CONTACTING PHILIPPE / LEGAL!
 // Installed by Andrew, 2011-04-26
 if ( $wmgUseDisableAccount ) {

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

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

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: DropdownInputWidget: Remove duplicate TitledElement mixin

2017-11-24 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393351 )

Change subject: DropdownInputWidget: Remove duplicate TitledElement mixin
..

DropdownInputWidget: Remove duplicate TitledElement mixin

The parent class InputWidget already mixes it in.

Change-Id: I814016700c73d33f6f91f14aa14e7bedbc74b597
---
M src/widgets/DropdownInputWidget.js
1 file changed, 0 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/51/393351/1

diff --git a/src/widgets/DropdownInputWidget.js 
b/src/widgets/DropdownInputWidget.js
index 124beac..63de460 100644
--- a/src/widgets/DropdownInputWidget.js
+++ b/src/widgets/DropdownInputWidget.js
@@ -25,7 +25,6 @@
  *
  * @class
  * @extends OO.ui.InputWidget
- * @mixins OO.ui.mixin.TitledElement
  *
  * @constructor
  * @param {Object} [config] Configuration options
@@ -47,9 +46,6 @@
// Parent constructor
OO.ui.DropdownInputWidget.parent.call( this, config );
 
-   // Mixin constructors
-   OO.ui.mixin.TitledElement.call( this, config );
-
// Events
this.dropdownWidget.getMenu().connect( this, { select: 'onMenuSelect' } 
);
 
@@ -67,7 +63,6 @@
 /* Setup */
 
 OO.inheritClass( OO.ui.DropdownInputWidget, OO.ui.InputWidget );
-OO.mixinClass( OO.ui.DropdownInputWidget, OO.ui.mixin.TitledElement );
 
 /* Methods */
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I814016700c73d33f6f91f14aa14e7bedbc74b597
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
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] oojs/ui[master]: DropdownInputWidget: Generate a hidden `` in JS

2017-11-24 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393352 )

Change subject: DropdownInputWidget: Generate a hidden `` in JS
..

DropdownInputWidget: Generate a hidden `` in JS

This removes a big inconsistency between normal DropdownInputWidget
and infused DropdownInputWidget (where we kept the PHP ``).

The `` is currently always hidden, but we could easily decide
to display it; see T180730 for reasons to maybe do so.

The selected value of the `` and of our pretty DropdownWidget
is synchronised in both directions. This actually didn't require any
changes (InputWidget and DropdownInputWidget#setValue already do it),
but I'm hereby documenting it as a feature.

Unblacklist DropdownInputWidget for JS/PHP comparison tests.
Blacklist or ignore some specific stuff instead.

Bug: T180730
Change-Id: Ie616726c158af0aa2f90e794f8d2ed3fd1e35cb5
---
M bin/testsuitegenerator.rb
M src/styles/widgets/DropdownInputWidget.less
M src/widgets/DropdownInputWidget.js
M tests/QUnit.assert.equalDomElement.js
4 files changed, 62 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/52/393352/1

diff --git a/bin/testsuitegenerator.rb b/bin/testsuitegenerator.rb
index 5c7da37..c4ef5db 100644
--- a/bin/testsuitegenerator.rb
+++ b/bin/testsuitegenerator.rb
@@ -16,7 +16,7 @@
 
# classes with different PHP and JS implementations.
# we can still compare the PHP-infuse result to JS result, though.
-   infuse_only_classes = %w[DropdownInputWidget ComboBoxInputWidget
+   infuse_only_classes = %w[ComboBoxInputWidget
RadioSelectInputWidget CheckboxMultiselectInputWidget]
testable_classes = classes
.reject{|c| c[:abstract] } # can't test abstract classes
diff --git a/src/styles/widgets/DropdownInputWidget.less 
b/src/styles/widgets/DropdownInputWidget.less
index 72037df..979b56f 100644
--- a/src/styles/widgets/DropdownInputWidget.less
+++ b/src/styles/widgets/DropdownInputWidget.less
@@ -7,11 +7,12 @@
.oo-ui-box-sizing( border-box );
 
.oo-ui-dropdownWidget,
-   select {
+   &.oo-ui-dropdownInputWidget-php select {
display: block;
}
 
select {
+   display: none;
// Hide the `background-image` from `.oo-ui-indicator-down` –
// themes can override `background-position` to display it.
background-position: -em 0;
diff --git a/src/widgets/DropdownInputWidget.js 
b/src/widgets/DropdownInputWidget.js
index 63de460..398666f 100644
--- a/src/widgets/DropdownInputWidget.js
+++ b/src/widgets/DropdownInputWidget.js
@@ -35,11 +35,6 @@
// Configuration initialization
config = config || {};
 
-   // See InputWidget#reusePreInfuseDOM about config.$input
-   if ( config.$input ) {
-   config.$input.addClass( 'oo-ui-element-hidden' );
-   }
-
// Properties (must be done before parent constructor which calls 
#setDisabled)
this.dropdownWidget = new OO.ui.DropdownWidget( config.dropdown );
 
@@ -71,7 +66,7 @@
  * @protected
  */
 OO.ui.DropdownInputWidget.prototype.getInputElement = function () {
-   return $( '' ).attr( 'type', 'hidden' );
+   return $( '' );
 };
 
 /**
@@ -116,26 +111,44 @@
  */
 OO.ui.DropdownInputWidget.prototype.setOptions = function ( options ) {
var
+   optionWidgets = [],
value = this.getValue(),
+   $optionsContainer = this.$input,
widget = this;
 
-   // Rebuild the dropdown menu
-   this.dropdownWidget.getMenu()
-   .clearItems()
-   .addItems( options.map( function ( opt ) {
-   var optValue = widget.cleanUpValue( opt.data );
+   this.dropdownWidget.getMenu().clearItems();
+   this.$input.empty();
 
-   if ( opt.optgroup === undefined ) {
-   return new OO.ui.MenuOptionWidget( {
-   data: optValue,
-   label: opt.label !== undefined ? 
opt.label : optValue
-   } );
-   } else {
-   return new OO.ui.MenuSectionOptionWidget( {
-   label: opt.optgroup
-   } );
-   }
-   } ) );
+   // Rebuild the dropdown menu: our visible one and the hidden ``
+   options.forEach( function ( opt ) {
+   var optValue, $optionNode, optionWidget;
+
+   if ( opt.optgroup === undefined ) {
+   optValue = widget.cleanUpValue( opt.data );
+
+   $optionNode = $( '' )
+   .attr( 'value', optValue )
+   .text( opt.label !== undefined 

[MediaWiki-commits] [Gerrit] mediawiki...DisplayTitle[master]: Follow 1 level of redirect getting display title.

2017-11-24 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393350 )

Change subject: Follow 1 level of redirect getting display title.
..

Follow 1 level of redirect getting display title.

Change-Id: I9675c87d4dc2042fde643a2cd190b95ae8343aa6
---
M extension.json
M includes/DisplayTitleHooks.php
2 files changed, 17 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DisplayTitle 
refs/changes/50/393350/1

diff --git a/extension.json b/extension.json
index ff5bf23..3775ed5 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.5.2",
+   "version": "1.5.3",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index c7fb01f..4299a88 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -226,22 +226,23 @@
 */
private static function getDisplayTitle( Title $title, &$displaytitle,
$wrap = false ) {
-   $pagetitle = $title->getPrefixedText();
-   // remove fragment
-   $title = Title::newFromText( $pagetitle );
-   if ( $title instanceof Title ) {
-   $values = PageProps::getInstance()->getProperties( 
$title, 'displaytitle' );
-   $id = $title->getArticleID();
-   if ( array_key_exists( $id, $values ) ) {
-   $value = $values[$id];
-   if ( trim( str_replace( '', '', 
strip_tags( $value ) ) ) !== '' &&
-   $value !== $pagetitle ) {
-   $displaytitle = $value;
-   if ( $wrap ) {
-   $displaytitle = new HtmlArmor( 
$displaytitle );
-   }
-   return true;
+   $title = $title->createFragmentTarget('');
+   $wikipage = new WikiPage( $title );
+   $redirectTarget = $wikipage->getRedirectTarget();
+   if ( !is_null( $redirectTarget ) ) {
+   $title = $redirectTarget;
+   }
+   $id = $title->getArticleID();
+   $values = PageProps::getInstance()->getProperties( $title, 
'displaytitle' );
+   if ( array_key_exists( $id, $values ) ) {
+   $value = $values[$id];
+   if ( trim( str_replace( '', '', strip_tags( 
$value ) ) ) !== '' &&
+   $value !== $title->getPrefixedText() ) {
+   $displaytitle = $value;
+   if ( $wrap ) {
+   $displaytitle = new HtmlArmor( 
$displaytitle );
}
+   return true;
}
}
return false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9675c87d4dc2042fde643a2cd190b95ae8343aa6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: [WIP] puppet: redirect several wikis per LangCom decission

2017-11-24 Thread MarcoAurelio (Code Review)
MarcoAurelio has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393289 )

Change subject: [WIP] puppet: redirect several wikis per LangCom decission
..

[WIP] puppet: redirect several wikis per LangCom decission

Domains affected:

* mo.wikipedia.org   -> ro.wikipedia.org
* mo.wiktionary.org  -> ro.wiktionary.org
* als.wiktionary.org -> https://als.wikipedia.org/wiki/Wort:Houptsyte
* als.wikiquote.org  -> https://als.wikipedia.org/wiki/Spruch:Houptsyte
* als.wikibooks.org  -> https://als.wikipedia.org/wiki/Buech:Houptsyte

Bug: T169450
Change-Id: I23078c8fd643f0db171d607c1968b9bf7453fae7
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/89/393289/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23078c8fd643f0db171d607c1968b9bf7453fae7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: MarcoAurelio 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: Allow multiple mw-indicator side by side

2017-11-24 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393287 )

Change subject: Allow multiple mw-indicator side by side
..

Allow multiple mw-indicator side by side

Change-Id: I6ca0b1739ba8364ef64c92a6e05569a1da2c9c76
---
M resources/screen-common.less
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/resources/screen-common.less b/resources/screen-common.less
index 9b9b900..6cf9c6f 100644
--- a/resources/screen-common.less
+++ b/resources/screen-common.less
@@ -287,6 +287,9 @@
float: right;
margin: 0.75em 0 0 1em;
 }
+.mw-indicator {
+   display: inline-block;
+}
 /* Subtitle area
  * @see https://phabricator.wikimedia.org/T173951
  */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ca0b1739ba8364ef64c92a6e05569a1da2c9c76
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Transmit compact diff instead of suppressed diff

2017-11-24 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393286 )

Change subject: Transmit compact diff instead of suppressed diff
..

Transmit compact diff instead of suppressed diff

Bug: T113468
Change-Id: I83c611866750f646a0591f3d4d5c873615af0998
---
M client/includes/Changes/AffectedPagesFinder.php
M client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
M lib/includes/Changes/DiffChange.php
M lib/includes/Changes/EntityChange.php
M lib/includes/Changes/EntityChangeFactory.php
5 files changed, 46 insertions(+), 51 deletions(-)


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

diff --git a/client/includes/Changes/AffectedPagesFinder.php 
b/client/includes/Changes/AffectedPagesFinder.php
index 99632b5..4456545 100644
--- a/client/includes/Changes/AffectedPagesFinder.php
+++ b/client/includes/Changes/AffectedPagesFinder.php
@@ -115,21 +115,21 @@
}
 
/**
-* @param EntityChange|EntityDiffChangedAspects $change
+* @param EntityChange $change
 *
 * @return string[]
 */
-   public function getChangedAspects( $change ) {
+   public function getChangedAspects( EntityChange $change ) {
$aspects = [];
 
-   if ( $change instanceof EntityChange ) {
-   $diff = $change->getDiff();
-   $diffAspects = ( new EntityDiffChangedAspectsFactory() 
)->newFromEntityDiff( $diff );
-   } elseif ( $change instanceof EntityDiffChangedAspects ) {
-   $diffAspects = $change;
+   $info = $change->getInfo();
+   // We might unserialize old EntityChange which doesn't have 
getAspectsDiff method
+   if ( array_key_exists( 'compactDiff', $info ) ) {
+   $diffAspects = $change->getAspectsDiff();
} else {
-   throw  new InvalidArgumentException( 
'AffectedPagesFinder::getChangedAspects accepts ' .
-   'EntityChange or EntityDiffChangedAspects' );
+   $diffAspects = ( new EntityDiffChangedAspectsFactory() 
)->newFromEntityDiff(
+   $change->getDiff()
+   );
}
 
if ( $diffAspects->getSiteLinkChanges() !== [] ) {
diff --git a/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php 
b/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
index 59c9432..8997d85 100644
--- a/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
+++ b/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
@@ -223,24 +223,6 @@
$this->assertEquals( $expected, $actual );
}
 
-   /**
-* @dataProvider getChangedAspectsProvider
-*/
-   public function testGetChangedAspectsUsingEntityChangeAspects(
-   array $expected,
-   EntityChange $change,
-   $trackUsagesInAllLanguages = false
-   ) {
-   $referencedPagesFinder = $this->getAffectedPagesFinder( [], [], 
$trackUsagesInAllLanguages );
-
-   $aspects = ( new EntityDiffChangedAspectsFactory() 
)->newFromEntityDiff( $change->getDiff() );
-   $actual = $referencedPagesFinder->getChangedAspects( $aspects );
-
-   sort( $expected );
-   sort( $actual );
-   $this->assertEquals( $expected, $actual );
-   }
-
public function getAffectedUsagesByPageProvider() {
$labelUsageDe = EntityUsage::LABEL_USAGE . '.de';
$labelUsageEn = EntityUsage::LABEL_USAGE . '.en';
diff --git a/lib/includes/Changes/DiffChange.php 
b/lib/includes/Changes/DiffChange.php
index 7c651f6..3009050 100644
--- a/lib/includes/Changes/DiffChange.php
+++ b/lib/includes/Changes/DiffChange.php
@@ -3,6 +3,8 @@
 namespace Wikibase;
 
 use Diff\DiffOp\Diff\Diff;
+use Wikibase\Lib\Changes\EntityDiffChangedAspects;
+use Wikibase\Lib\Changes\EntityDiffChangedAspectsFactory;
 
 /**
  * Class for changes that can be represented as a Diff.
@@ -37,4 +39,28 @@
$this->setField( 'info', $info );
}
 
+   /**
+* @param string $cache set to 'cache' to cache the unserialized 
aspects diff.
+*
+* @return EntityDiffChangedAspects
+*/
+   public function getAspectsDiff( $cache = 'no' ) {
+   $info = $this->getInfo( $cache );
+
+   if ( !array_key_exists( 'compactDiff', $info ) ) {
+   // This shouldn't happen, but we should be robust 
against corrupt, incomplete
+   // obsolete instances in the database, etc.
+   wfLogWarning( 'Cannot get the diff when it has not been 
set yet.' );
+   return ( new EntityDiffChangedAspectsFactory() 

[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: LanguageConverter support for [[MediaWiki:Timeless-sitetitle]]

2017-11-24 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393221 )

Change subject: LanguageConverter support for [[MediaWiki:Timeless-sitetitle]]
..


LanguageConverter support for [[MediaWiki:Timeless-sitetitle]]

Bug: T181260
Change-Id: Ife63a96ad9b38345abff508cbdaeaf70a3663ac7
---
M TimelessTemplate.php
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/TimelessTemplate.php b/TimelessTemplate.php
index d035e3b..7f89511 100644
--- a/TimelessTemplate.php
+++ b/TimelessTemplate.php
@@ -250,6 +250,7 @@
 */
protected function getLogo( $id = 'p-logo', $part = 'both' ) {
$html = '';
+   $language = $this->getSkin()->getLanguage();
 
$html .= Html::openElement(
'div',
@@ -261,7 +262,11 @@
);
if ( $part !== 'image' ) {
$titleClass = '';
-   $siteTitle = $this->getMsg( 'timeless-sitetitle' 
)->escaped();
+   if ( $language->hasVariants() ) {
+   $siteTitle = $language->convert( $this->getMsg( 
'timeless-sitetitle' )->escaped() );
+   } else {
+   $siteTitle = $this->getMsg( 
'timeless-sitetitle' )->escaped();
+   }
// width is 11em; 13 characters will probably fit?
if ( mb_strlen( $siteTitle ) > 13 ) {
$titleClass = 'long';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ife63a96ad9b38345abff508cbdaeaf70a3663ac7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: Isarra 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: Pass the amount of hidden categories as a parameter to the h...

2017-11-24 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393099 )

Change subject: Pass the amount of hidden categories as a parameter to the 
hidden-categories i18n message
..


Pass the amount of hidden categories as a parameter to the hidden-categories 
i18n message

Bug: T178655
Change-Id: Iade5e2af18529b8ebd9e26f45819fd77f549db20
---
M TimelessTemplate.php
1 file changed, 6 insertions(+), 2 deletions(-)

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



diff --git a/TimelessTemplate.php b/TimelessTemplate.php
index d035e3b..ec12d45 100644
--- a/TimelessTemplate.php
+++ b/TimelessTemplate.php
@@ -771,7 +771,11 @@
$catList .= $this->getCatList( 
$normalCats, 'catlist-normal', 'categories' );
}
if ( $hiddenCount ) {
-   $catList .= $this->getCatList( 
$hiddenCats, 'catlist-hidden', 'hidden-categories' );
+   $catList .= $this->getCatList(
+   $hiddenCats,
+   'catlist-hidden',
+   [ 'hidden-categories', 
$hiddenCount ]
+   );
}
}
}
@@ -787,7 +791,7 @@
 *
 * @param array $list
 * @param string $id
-* @param string $message
+* @param string|array $message i18n message name or an array of [ 
message name, params ]
 *
 * @return string html
 */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iade5e2af18529b8ebd9e26f45819fd77f549db20
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: TheDJ 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...TemplateStyles[master]: Deduplicate embedded style rules

2017-11-24 Thread Anomie (Code Review)
Anomie has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393285 )

Change subject: Deduplicate embedded style rules
..

Deduplicate embedded style rules

Use the facility added in core change I055abdf4d to deduplicate the
embedded style rules.

Bug: T168333
Change-Id: I98c6d5ca4b474de8826b19355f15a5230aef5650
Depends-On: I055abdf4d73ec65771eaa4fe0999ec907c831568
---
M TemplateStylesHooks.php
M tests/phpunit/TemplateStylesHooksTest.php
2 files changed, 27 insertions(+), 12 deletions(-)


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

diff --git a/TemplateStylesHooks.php b/TemplateStylesHooks.php
index 4742cab..0a14b75 100644
--- a/TemplateStylesHooks.php
+++ b/TemplateStylesHooks.php
@@ -235,13 +235,15 @@
'';
}
 
-   // For the moment just output the styles inline.
-   // @todo: If T160563 happens, it would be good to convert this 
to use that.
+   $wrapClass = $parser->getOptions()->getWrapOutputClass();
+   if ( $wrapClass === false ) {
+   $wrapClass = 'mw-parser-output';
+   }
 
$status = $content->sanitize( [
'flip' => $parser->getTargetLanguage()->getDir() !== 
$wgContLang->getDir(),
'minify' => !ResourceLoader::inDebugMode(),
-   'class' => $parser->getOptions()->getWrapOutputClass(),
+   'class' => $wrapClass,
] );
$style = $status->isOk() ? $status->getValue() : '/* Fatal 
error, no CSS will be output */';
 
@@ -270,7 +272,13 @@
 
// Return the inline , which the Parser will wrap in a 
'general'
// strip marker.
-   return Html::inlineStyle( $marker );
+   $dedup = 'TemplateStyles:' . $rev->getId();
+   if ( $wrapClass !== 'mw-parser-output' ) {
+   $dedup .= '/' . $wrapClass;
+   }
+   return Html::inlineStyle( $marker, 'all', [
+   'mw-deduplicate' => $dedup,
+   ] );
}
 
 }
diff --git a/tests/phpunit/TemplateStylesHooksTest.php 
b/tests/phpunit/TemplateStylesHooksTest.php
index deb8b7d..468e25d 100644
--- a/tests/phpunit/TemplateStylesHooksTest.php
+++ b/tests/phpunit/TemplateStylesHooksTest.php
@@ -170,6 +170,9 @@
$out = $parser->parse( $wikitext, Title::newFromText( 'Test' ), 
$popt );
$parser->mPreprocessor = null; # Break the Parser <-> 
Preprocessor cycle
 
+   $expect = preg_replace_callback( '/\{\{REV:(.*?)\}\}/', 
function ( $m ) {
+   return Title::newFromText( 'Template:TemplateStyles 
test/' . $m[1] )->getLatestRevID();
+   }, $expect );
$this->assertEquals( $expect, $out->getText() );
}
 
@@ -227,20 +230,22 @@
$popt,
'',
// @codingStandardsIgnoreStart Ignore 
Generic.Files.LineLength.TooLong
-   "