[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Allow a wiki to use __NOINDEX__ and __INDEX__ in all namespaces

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

Change subject: Allow a wiki to use __NOINDEX__ and __INDEX__ in all namespaces
..


Allow a wiki to use __NOINDEX__ and __INDEX__ in all namespaces

Currently, __NOINDEX__ and __INDEX__ robot control keywords can be used
in all namespaces excepted:
  - the content ones (from $wgContentNamespaces)
  - the ones in $wmgExemptFromUserRobotsControlExtra

There is legitimate cases not to index pages from content namespaces
in specific cases, like non content wikis.

We so provide a mechanism to allow a wiki to use these keywords
everywhere to avoid direct robots.txt tweaking.

Change-Id: Iffb77a0401a8dda537c769b612613763d448a3cc
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 14 insertions(+), 1 deletion(-)

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



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 85dd884..d7054d9 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -3233,7 +3233,11 @@
return true;
 };
 
-$wgExemptFromUserRobotsControl = array_merge( $wgContentNamespaces, 
$wmgExemptFromUserRobotsControlExtra );
+if ( $wmgAllowRobotsControlInAllNamespaces ) {
+   $wgExemptFromUserRobotsControl = [];
+} else {
+   $wgExemptFromUserRobotsControl = array_merge( $wgContentNamespaces, 
$wmgExemptFromUserRobotsControlExtra );
+}
 
 // additional "language names", adding to Names.php data
 $wgExtraLanguageNames = $wmgExtraLanguageNames;
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 06e1430..26a74a0 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -11312,7 +11312,16 @@
'+plwiki' => [ NS_USER, 100, 102 ], // T133978; 100 -> Portal, 102 -> 
Wikiproject
 ],
 
+'wmgAllowRobotsControlInAllNamespaces' => [
+   // If true, allows to use __NOINDEX__ and __INDEX__ everywhere,
+   // even in content namespaces (see $wgContentNamespaces).
+   'default' => false,
+],
+
 'wmgExemptFromUserRobotsControlExtra' => [
+   // When wmgAllowRobotsControlInAllNamespaces is false (the default),
+   // __NOINDEX__ and __INDEX__ will be ignored for these namepaces,
+   // as well as for namespaces in $wgContentNamespaces.
'default' => [],
'enwiki' => [ 118, 119 ], // draft and draft talk
'hewiki' => [ 118, 119 ], // draft and draft talk - T86329

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iffb77a0401a8dda537c769b612613763d448a3cc
Gerrit-PatchSet: 3
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Dereckson 
Gerrit-Reviewer: Dereckson 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: MZMcBride 
Gerrit-Reviewer: MarcoAurelio 
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] operations/mediawiki-config[master]: Allow a wiki to use __NOINDEX__ and __INDEX__ in all namespaces

2016-11-15 Thread Dereckson (Code Review)
Dereckson has uploaded a new change for review.

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

Change subject: Allow a wiki to use __NOINDEX__ and __INDEX__ in all namespaces
..

Allow a wiki to use __NOINDEX__ and __INDEX__ in all namespaces

Currently, __NOINDEX__ and __INDEX__ robot control keywords can be used
in all namespaces excepted:
  - the content ones (from $wgContentNamespaces)
  - the ones in $wmgExemptFromUserRobotsControlExtra

There is legitimate cases not to index pages from content namespaces
in specific cases, like non content wikis.

We so provide a mechanism to allow a wiki to use these keywords
everywhere to avoid direct robots.txt tweaking.

Change-Id: Iffb77a0401a8dda537c769b612613763d448a3cc
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 13 insertions(+), 1 deletion(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 6477444..b2e47a5 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -3194,7 +3194,11 @@
return true;
 };
 
-$wgExemptFromUserRobotsControl = array_merge( $wgContentNamespaces, 
$wmgExemptFromUserRobotsControlExtra );
+if ( $wmgAllowRobotsControlInAllNamespaces ) {
+   $wgExemptFromUserRobotsControl = [];
+} else {
+   $wgExemptFromUserRobotsControl = array_merge( $wgContentNamespaces, 
$wmgExemptFromUserRobotsControlExtra );
+}
 
 // additional "language names", adding to Names.php data
 $wgExtraLanguageNames = $wmgExtraLanguageNames;
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index bb7f9e2..46cae6f 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -11282,7 +11282,15 @@
'+plwiki' => [ NS_USER, 100, 102 ], // T133978; 100 -> Portal, 102 -> 
Wikiproject
 ],
 
+'wmgAllowRobotsControlInAllNamespaces' => [
+   // If true, allows to use __NOINDEX__ and __INDEX__ everywhere, even in 
(main).
+   'default' => false,
+],
+
 'wmgExemptFromUserRobotsControlExtra' => [
+   // When wmgAllowRobotsControlInAllNamespaces is false (the default),
+   // __NOINDEX__ and __INDEX__ will be ignored for these namepaces,
+   // as well as for namespaces in $wgContentNamespaces.
'default' => [],
'enwiki' => [ 118, 119 ], // draft and draft talk
'hewiki' => [ 118, 119 ], // draft and draft talk - T86329

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

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

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