[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: phabricator: use a separate database user

2018-01-18 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405244 )

Change subject: phabricator: use a separate database user
..

phabricator: use a separate database user

Use a user with rights limited to databases starting with "phabricator_"
for the Phabricator service.

Change-Id: Ic4371616d67006b27a8f08bd02f3bb452a9cf2aa
---
M puppet/hieradata/common.yaml
M puppet/modules/mysql/manifests/user.pp
M puppet/modules/phabricator/manifests/init.pp
3 files changed, 27 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/44/405244/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 2b53491..ab5c4b6 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -278,6 +278,8 @@
 phabricator::log_dir: "/vagrant/logs/phd"
 phabricator::vhost_name: "phabricator%{hiera('mwv::tld')}"
 phabricator::remote: https://secure.phabricator.com/diffusion/P/phabricator.git
+phabricator::dbuser: phabricator
+phabricator::dbpass: phabulous
 
 php::xhprof::profile_storage_dir: /vagrant/profiles
 
diff --git a/puppet/modules/mysql/manifests/user.pp 
b/puppet/modules/mysql/manifests/user.pp
index 9c69e2a..88c8ef5 100644
--- a/puppet/modules/mysql/manifests/user.pp
+++ b/puppet/modules/mysql/manifests/user.pp
@@ -44,7 +44,7 @@
 $password,
 $ensure   = present,
 $username = $title,
-$grant= 'usage on *.*',
+$grant= 'USAGE ON *.*',
 $hostname = $::mysql::grant_host_name,
 $socket   = false,
 ) {
@@ -57,8 +57,8 @@
 }
 
 if $ensure == 'absent' {
-mysql::sql { "drop user '${username}'":
-unless => "select not exists(select 1 from mysql.user where user = 
'${username}')",
+mysql::sql { "DROP USER '${username}'":
+unless => "SELECT NOT EXISTS(SELECT 1 FROM mysql.user WHERE user = 
'${username}')",
 }
 } else {
 $ident = $socket ? {
@@ -66,8 +66,8 @@
 default => "IDENTIFIED BY '${password}'",
 }
 mysql::sql { "create user ${username}":
-sql=> "grant ${grant} to '${username}'@'${hostname}' ${ident}",
-unless => "select exists(select 1 from mysql.user where user = 
'${username}')",
+sql=> "CREATE USER '${username}'@'${hostname}' ${ident}; GRANT 
${grant} to '${username}'@'${hostname}'",
+unless => "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = 
'${username}')",
 }
 }
 }
diff --git a/puppet/modules/phabricator/manifests/init.pp 
b/puppet/modules/phabricator/manifests/init.pp
index 152d584..8a9f55a 100644
--- a/puppet/modules/phabricator/manifests/init.pp
+++ b/puppet/modules/phabricator/manifests/init.pp
@@ -19,6 +19,12 @@
 # [*remote*]
 #   Phabricator git remote.
 #
+# [*dbuser*]
+#   Database user
+#
+# [*dbpass*]
+#   Database password
+#
 # [*branch*]
 #   Phabricator branch to check out. If left undefined the default HEAD of the
 #   remote will be used.
@@ -28,6 +34,8 @@
 $log_dir,
 $vhost_name,
 $remote,
+$dbuser,
+$dbpass,
 $branch = undef,
 $protocol = 'http',
 ){
@@ -70,6 +78,11 @@
 require  => Class['::apache::mod::rewrite'],
 }
 
+mysql::user { $dbuser:
+password => $dbpass,
+grant=> 'ALL ON \`phabricator\_%\`.*',
+}
+
 phabricator::config { 'mysql.host':
 value => '127.0.0.1',
 }
@@ -78,8 +91,12 @@
 value => 3306,
 }
 
+phabricator::config { 'mysql.user':
+value => $dbuser,
+}
+
 phabricator::config { 'mysql.pass':
-value => $::mysql::root_password,
+value => $dbpass,
 }
 
 phabricator::config { 'phabricator.base-uri':
@@ -181,8 +198,10 @@
 require => [
 Class['::mysql'],
 Phabricator::Config['mysql.host'],
+Phabricator::Config['mysql.user'],
 Phabricator::Config['mysql.pass'],
 Phabricator::Config['mysql.port'],
+Mysql::User[$dbuser],
 ],
 unless  => "${deploy_dir}/phabricator/bin/storage status > /dev/null",
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4371616d67006b27a8f08bd02f3bb452a9cf2aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
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...OAuth[master]: Move status to the start of the management screen

2018-01-17 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404909 )

Change subject: Move status to the start of the management screen
..

Move status to the start of the management screen

Make the current status easier to see by presenting it as the first
information in the management screen. I often read through a whole
application only to find out that it has already been approved by
another administrator, and I'm lazy so I'd like to have those 60 seconds
back.

Change-Id: I5355c2d9ebd5071c10e6ff6d744cc734721dfc6e
---
M frontend/specialpages/SpecialMWOAuthManageConsumers.php
1 file changed, 7 insertions(+), 7 deletions(-)


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

diff --git a/frontend/specialpages/SpecialMWOAuthManageConsumers.php 
b/frontend/specialpages/SpecialMWOAuthManageConsumers.php
index 73463e1..f305f6c 100644
--- a/frontend/specialpages/SpecialMWOAuthManageConsumers.php
+++ b/frontend/specialpages/SpecialMWOAuthManageConsumers.php
@@ -257,6 +257,13 @@
'type' => 'info',
'raw' => true,
'default' => 
MWOAuthUIUtils::generateInfoTable( [
+   // Messages: 
mwoauth-consumer-stage-proposed, mwoauth-consumer-stage-rejected,
+   // 
mwoauth-consumer-stage-expired, mwoauth-consumer-stage-approved,
+   // 
mwoauth-consumer-stage-disabled
+   'mwoauth-consumer-stage' => 
$cmr->get( 'deleted' )
+   ? $this->msg( 
'mwoauth-consumer-stage-suppressed' )
+   : $this->msg( 
'mwoauth-consumer-stage-' .
+   
MWOAuthConsumer::$stageNames[$cmr->get( 'stage' )] ),
'mwoauth-consumer-key' => 
$cmr->get( 'consumerKey' ),
'mwoauth-consumer-name' => new 
HtmlSnippet( $cmr->get( 'name', function ( $s ) {
$link = 
\Linker::linkKnown(
@@ -287,13 +294,6 @@

'mwoauth-consumer-restrictions-json' => $restrictions instanceof 
\MWRestrictions ?
$restrictions->toJson( 
true ) : $restrictions,
'mwoauth-consumer-rsakey' => 
$cmr->get( 'rsaKey' ),
-   // Messages: 
mwoauth-consumer-stage-proposed, mwoauth-consumer-stage-rejected,
-   // 
mwoauth-consumer-stage-expired, mwoauth-consumer-stage-approved,
-   // 
mwoauth-consumer-stage-disabled
-   'mwoauth-consumer-stage' => 
$cmr->get( 'deleted' )
-   ? $this->msg( 
'mwoauth-consumer-stage-suppressed' )
-   : $this->msg( 
'mwoauth-consumer-stage-' .
-   
MWOAuthConsumer::$stageNames[$cmr->get( 'stage' )] ),
], $this->getContext() ),
],
'action' => [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5355c2d9ebd5071c10e6ff6d744cc734721dfc6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
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/vagrant[master]: service::node: Use epp template for systemd service

2018-01-17 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404908 )

Change subject: service::node: Use epp template for systemd service
..

service::node: Use epp template for systemd service

Pass epp_template => true to systemd::service along with a collection of
template_variables so that local scope data can propagate to the final
systemd unit.

Bug: T185113
Change-Id: Ic610df4fe05f3cb832fd66bcc398d0b48917b919
---
M puppet/modules/service/manifests/node.pp
A puppet/modules/service/templates/systemd/node.epp
D puppet/modules/service/templates/systemd/node.erb
3 files changed, 34 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/08/404908/1

diff --git a/puppet/modules/service/manifests/node.pp 
b/puppet/modules/service/manifests/node.pp
index 7c95493..2658f2a 100644
--- a/puppet/modules/service/manifests/node.pp
+++ b/puppet/modules/service/manifests/node.pp
@@ -152,13 +152,21 @@
 
 # the service definition
 systemd::service { $title:
-template_name  => 'node',
-service_params => {
+template_name  => 'node',
+service_params => {
 subscribe => [
 File["${title}_config_yaml"],
 Npm::Install[$dir],
 ],
 },
-require=> Git::Clone[$title],
+epp_template   => true,
+template_variables => {
+title   => $title,
+uptitle => inline_template('<%= @title.gsub(/[^a-zA-Z0-9_]/, 
"_").upcase %>'),
+dir => $dir,
+port=> $port,
+script  => $script,
+},
+require=> Git::Clone[$title],
 }
 }
diff --git a/puppet/modules/service/templates/systemd/node.epp 
b/puppet/modules/service/templates/systemd/node.epp
new file mode 100644
index 000..f210308
--- /dev/null
+++ b/puppet/modules/service/templates/systemd/node.epp
@@ -0,0 +1,23 @@
+# NOTE: This file is managed by Puppet
+# Systemd unit for <%= $title %>
+[Unit]
+Description="<%= $title %> service"
+After=network.target
+
+[Service]
+# up ulimit -n a bit
+LimitNOFILE=1
+User=www-data
+Group=www-data
+Environment="NODE_PATH=<%= $dir %>/node_modules"
+Environment="<%= $uptitle %>_PORT=<%= $port %>"
+Restart=always
+RestartSec=2s
+# wait 60 seconds for a graceful restart before killing the master
+TimeoutStopSec=60
+WorkingDirectory=<%= $dir %>
+ExecStart=/usr/bin/nodejs <%= $script %> -c <%= $dir %>/config.vagrant.yaml
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/puppet/modules/service/templates/systemd/node.erb 
b/puppet/modules/service/templates/systemd/node.erb
deleted file mode 100644
index 009a85b..000
--- a/puppet/modules/service/templates/systemd/node.erb
+++ /dev/null
@@ -1,23 +0,0 @@
-# NOTE: This file is managed by Puppet
-# Systemd unit for <%= @title %>
-[Unit]
-Description="<%= @title %> service"
-After=network.target
-
-[Service]
-# up ulimit -n a bit
-LimitNOFILE=1
-User=www-data
-Group=www-data
-Environment="NODE_PATH=<%= @dir %>/node_modules"
-Environment="<%= @title.gsub(/[^a-zA-Z0-9_]/, '_').upcase %>_PORT=<%= @port %>"
-Restart=always
-RestartSec=2s
-# wait 60 seconds for a graceful restart before killing the master
-TimeoutStopSec=60
-WorkingDirectory=<%= @dir %>
-ExecStart=/usr/bin/nodejs <%= @script %> -c <%= @dir %>/config.vagrant.yaml
-
-[Install]
-WantedBy=multi-user.target
-

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic610df4fe05f3cb832fd66bcc398d0b48917b919
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
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/vagrant[master]: Replace Package[portmap] with Package[rpcbind]

2018-01-15 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404403 )

Change subject: Replace Package[portmap] with Package[rpcbind]
..

Replace Package[portmap] with Package[rpcbind]

The portmap package is a pure virtual package that is actually provided
by the rpcbind package.

Bug: T184497
Change-Id: Iec888b634627b9c17323016c4e7e4692251687da
---
M puppet/modules/mwv/manifests/packages.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/03/404403/1

diff --git a/puppet/modules/mwv/manifests/packages.pp 
b/puppet/modules/mwv/manifests/packages.pp
index f0b2eee..1bb6c4a 100644
--- a/puppet/modules/mwv/manifests/packages.pp
+++ b/puppet/modules/mwv/manifests/packages.pp
@@ -24,7 +24,7 @@
 # mess with the default apt cache location.
 require_package(
 'nfs-common',
-'portmap',
+'rpcbind',
 )
 
 # Cron resources need a cron provider installed

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec888b634627b9c17323016c4e7e4692251687da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
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/vagrant[master]: Merge remote-tracking branch 'origin/stretch-migration'

2018-01-15 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404399 )

Change subject: Merge remote-tracking branch 'origin/stretch-migration'
..

Merge remote-tracking branch 'origin/stretch-migration'

Merge the feature branch which has been used to perform the initial
migration from Debian Jessie to Debian Stretch to master.

Bug: T181353
Change-Id: Id44c34f25ad1ceb5a2b5fff0ee34f13eb8b6e539
---
M Gemfile.lock
M Rakefile
M puppet/hieradata/common.yaml
M puppet/modules/apt/files/wikimedia-pubkey.asc
M puppet/modules/crm/manifests/tools.pp
M puppet/modules/mediawiki/manifests/apache.pp
D puppet/modules/mediawiki/templates/mediawiki-php5-site.erb
M puppet/modules/mediawiki/templates/mwrepl/mwrepl.erb
M puppet/modules/mediawiki/templates/systemd/jobchron.erb
M puppet/modules/mediawiki/templates/systemd/jobrunner.erb
M puppet/modules/php/manifests/composer.pp
M puppet/modules/role/manifests/commons.pp
M puppet/modules/role/manifests/ldapauth.pp
M puppet/modules/role/manifests/ores.pp
M puppet/modules/role/manifests/wikidata.pp
D puppet/modules/role/manifests/zend.pp
M puppet/modules/role/templates/elk/apache.conf.erb
M puppet/modules/swift/manifests/init.pp
M puppet/modules/thumbor/manifests/init.pp
19 files changed, 3 insertions(+), 251 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/99/404399/1

diff --git a/Gemfile.lock b/Gemfile.lock
index a717be2..a600c41 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -193,12 +193,8 @@
   puppetlabs_spec_helper (< 2.0.0)
   rake (~> 10.4.2)
   rspec (~> 3.1, >= 3.1.0)
-<<< HEAD   (c9374b scholarships: Add OAuth provisioning)
-  rubocop (~> 0.51.0)
-===
   rspec-puppet (~> 2.6.5)
   rubocop (~> 0.51)
->>> BRANCH (256c4a analytics: remove cdh modules and roles)
   safe_yaml (~> 1.0.4)
   vagrant!
   yard (~> 0.8, >= 0.8.7.6)
diff --git a/Rakefile b/Rakefile
index fe4f012..6bb1eff 100644
--- a/Rakefile
+++ b/Rakefile
@@ -31,12 +31,8 @@
   }
   config.ignore_paths += ['puppet/modules/stdlib/**/*.pp']
   config.ignore_paths += ['tmp/**/*.pp']
-  config.log_format = '%{path}:%{linenumber} %{KIND}: %{message}'
+  config.log_format = '%{path}:%{line} %{KIND}: %{message}'
 end
-<<< HEAD   (c9374b scholarships: Add OAuth provisioning)
-Cucumber::Rake::Task.new(:cucumber)
-RSpec::Core::RakeTask.new(:spec)
-===
 Cucumber::Rake::Task.new(:cucumber) do |t|
   t.cucumber_opts = '-r tests/features tests/features'
 end
@@ -56,7 +52,6 @@
 desc 'Compile puppet catalogs'
 task compile: [:compile_host, :compile_roles]
 
->>> BRANCH (256c4a analytics: remove cdh modules and roles)
 RuboCop::RakeTask.new(:rubocop)
 
 task default: [:test]
diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index aeda12e..a01a531 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -148,12 +148,6 @@
 hhvm::logroot: /vagrant/logs
 hhvm::admin_site_name: "hhvm-admin%{hiera('mwv::tld')}"
 
-<<< HEAD   (c9374b scholarships: Add OAuth provisioning)
-kibana::deploy_dir: /usr/share/kibana
-kibana::default_route: /dashboard/elasticsearch/default
-
-===
->>> BRANCH (256c4a analytics: remove cdh modules and roles)
 logstash::heap_memory_mb: 192
 logstash::pipeline_workers: 1
 logstash::output::elasticsearch::host: 127.0.0.1
@@ -222,10 +216,6 @@
 mediawiki::branch: master
 
 mediawiki::apache::docroot: "%{hiera('apache::docroot')}"
-<<< HEAD   (c9374b scholarships: Add OAuth provisioning)
-mediawiki::apache::php5_site_name: "php5%{hiera('mwv::tld')}"
-===
->>> BRANCH (256c4a analytics: remove cdh modules and roles)
 
 mediawiki::jobrunner::enable: true
 mediawiki::jobrunner::dir: "%{hiera('mwv::services_dir')}/jobrunner"
diff --git a/puppet/modules/apt/files/wikimedia-pubkey.asc 
b/puppet/modules/apt/files/wikimedia-pubkey.asc
index 3e433b4..76d7aba 100644
--- a/puppet/modules/apt/files/wikimedia-pubkey.asc
+++ b/puppet/modules/apt/files/wikimedia-pubkey.asc
@@ -1,35 +1,6 @@
 -BEGIN PGP PUBLIC KEY BLOCK-
 Version: GnuPG v1.4.11 (GNU/Linux)
 
-<<< HEAD   (c9374b scholarships: Add OAuth provisioning)
-mQGiBEUtBY8RBACJTZdWEBZHlibArWM1HrX5rcPCb+o2nmeTfNrtMpmVbkmi9vBE
-VmIDnjc+VQlJNoiBOKMhAhRSO0rIwEbOTewiQSPERfsClGpv0ikb3kQVFls5HpfZ
-49u9EAERRez+P2VJUH7CBmigKdxtKRGM5aLI+eOLUl+lZUn4NU6BsQOUGwCgtLiL
-I+8DSNkoiV40UR3uFsS9KLMD/30Lth9A9JgwrDTFl8rlNxq3Eluulv0+2MYoDutW
-2p384vJ8Vil+x1GPzZXT1NVHCPdJMXqfnUl33XkPJEFSJ3B1WhwU3muItPoM+GKM
-cnJMn2rYJa6Fae7UZy8iRJwSuqSg4mGNa900m/izyYoijJzl1u4HtZhbV++lgubO
-j+YfA/4sz68H/ZQZwG+d8X/xTgZ3+9qekqGFgxdGTICtiD7IRPPaQ7EUWOBml6tn
-SHfd0TBkCKtfFkr6+rA3ZJ5pyo3OwO2yUAvlBOPeaX4ZKTl7+8lG9kqqGIBm/iZy
-bHC75DF506Zm4IiesAXRmRqfB8gReOHEJybZkaCg8FZqhdGErLQ8V2lraW1lZGlh
-IEFyY2hpdmUgQXV0b21hdGljIFNpZ25pbmcgS2V5IDxyb290QHdpa2ltZWRpYS5v
-cmc+iF8EExECACAFAkUtBY8CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRAJ
-29n5P2zUSmaGAJjipA+xkWInJJHCCcoJrf7rBzqEAJ9OEsJuxbBOvOJBovwpWtNh

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: scholarships: Add OAuth provisioning

2018-01-15 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404398 )

Change subject: scholarships: Add OAuth provisioning
..

scholarships: Add OAuth provisioning

Provision an OAuth consumer and configure Scholarships to use it.

When adding this functionality to an existing VM where Scholarships has
already been provisioned the user will need to delete their existing
/vagrant/srv/scholarships/.env file. The Puppet module does not modify
existing environment files to allow for easier local debugging.

Bug: T119534
Change-Id: I097b8784d050c0fb5e93f92ab25512d3b7d9fb4d
---
M puppet/hieradata/common.yaml
M puppet/modules/role/manifests/scholarships.pp
M puppet/modules/scholarships/manifests/init.pp
M puppet/modules/scholarships/templates/env.erb
4 files changed, 30 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/98/404398/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 700b8d5..2d78951 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -442,6 +442,9 @@
 role::phragile::install_dir: "%{hiera('mwv::services_dir')}/phragile"
 role::phragile::vhost_name: "phragile%{hiera('mwv::tld')}"
 
+role::scholarships::oauth_consumer_key: b7228f20b437989dbfc09178085df71a
+role::scholarships::oauth_secret_key: 3f01bf19915f3a56d9f6e5b5b7729593
+
 role::sentry::dsn: "%{hiera('sentry::dsn_file')}"
 
 role::wikidata::main_page: "Wiki:Main Page"
@@ -455,6 +458,9 @@
 scholarships::deploy_dir: "%{hiera('mwv::services_dir')}/scholarships"
 scholarships::cache_dir: /var/cache/scholarships
 scholarships::log_file: /vagrant/logs/scholarships.log
+scholarships::oauth_server: 
"http://dev.wiki.local.wmftest.net%{::port_fragment};
+scholarships::oauth_consumer_token: b7228f20b437989dbfc09178085df71a
+scholarships::oauth_secret_token: f7841ded67f3f290360c67d347f9a62c85f171e5
 
 sentry::db_name: sentry
 sentry::db_user: sentry
diff --git a/puppet/modules/role/manifests/scholarships.pp 
b/puppet/modules/role/manifests/scholarships.pp
index 5511bd0..b40b2fa 100644
--- a/puppet/modules/role/manifests/scholarships.pp
+++ b/puppet/modules/role/manifests/scholarships.pp
@@ -4,6 +4,18 @@
 # *Note*: The application is provisioned using an Apache named virtual host.
 # Once the role is enabled and provisioned use the URL
 # http://scholarships.local.wmftest.net:8080/ to access the site.
-class role::scholarships {
+class role::scholarships (
+$oauth_consumer_key,
+$oauth_secret_key,
+) {
+include ::mediawiki
 include ::scholarships
+
+role::oauth::consumer { 'Wikimania Scholarships':
+description  => 'Wikimania Scholarships',
+consumer_key => $oauth_consumer_key,
+secret_key   => $oauth_secret_key,
+callback_url => 
"http://${::scholarships::vhost_name}${::port_fragment}/;,
+grants   => ['authonlyprivate'],
+}
 }
diff --git a/puppet/modules/scholarships/manifests/init.pp 
b/puppet/modules/scholarships/manifests/init.pp
index 492a4e5..2f45a9c 100644
--- a/puppet/modules/scholarships/manifests/init.pp
+++ b/puppet/modules/scholarships/manifests/init.pp
@@ -37,6 +37,9 @@
 $vhost_name,
 $cache_dir,
 $log_file,
+$oauth_server,
+$oauth_consumer_token,
+$oauth_secret_token,
 ){
 include ::php
 include ::apache
diff --git a/puppet/modules/scholarships/templates/env.erb 
b/puppet/modules/scholarships/templates/env.erb
index 92c38a0..22eadc6 100644
--- a/puppet/modules/scholarships/templates/env.erb
+++ b/puppet/modules/scholarships/templates/env.erb
@@ -24,6 +24,14 @@
 ; Value should be compatible with PHP's strtotime() function
 APPLICATION_CLOSE=2038-01-01T00:00
 
+; OAuth settings
+USE_OAUTH=true
+OAUTH_CONSUMER_TOKEN=<%= @oauth_consumer_token %>
+OAUTH_SECRET_TOKEN=<%= @oauth_secret_token %>
+OAUTH_ENDPOINT="<%= @oauth_server %>/w/index.php?title=Special:OAuth"
+OAUTH_REDIR="<%= @oauth_server %>/wiki/Special:OAuth/authenticate?"
+OAUTH_CALLBACK=http://<%= @vhost_name %><%= scope['::port_fragment'] 
%>/oauth/callback
+
 ; This is a testing deployment
 MOCK=1
 SLIM_MODE=development

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I097b8784d050c0fb5e93f92ab25512d3b7d9fb4d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
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/vagrant[stretch-migration]: scholarships: Add OAuth provisioning

2018-01-15 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404397 )

Change subject: scholarships: Add OAuth provisioning
..

scholarships: Add OAuth provisioning

Provision an OAuth consumer and configure Scholarships to use it.

When adding this functionality to an existing VM where Scholarships has
already been provisioned the user will need to delete their existing
/vagrant/srv/scholarships/.env file. The Puppet module does not modify
existing environment files to allow for easier local debugging.

Bug: T119534
Change-Id: I097b8784d050c0fb5e93f92ab25512d3b7d9fb4d
---
M puppet/hieradata/common.yaml
M puppet/modules/role/manifests/scholarships.pp
M puppet/modules/scholarships/manifests/init.pp
M puppet/modules/scholarships/templates/env.erb
4 files changed, 30 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/97/404397/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 0ab34fe..2b53491 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -431,6 +431,9 @@
 role::phragile::install_dir: "%{hiera('mwv::services_dir')}/phragile"
 role::phragile::vhost_name: "phragile%{hiera('mwv::tld')}"
 
+role::scholarships::oauth_consumer_key: b7228f20b437989dbfc09178085df71a
+role::scholarships::oauth_secret_key: 3f01bf19915f3a56d9f6e5b5b7729593
+
 role::sentry::dsn: "%{hiera('sentry::dsn_file')}"
 
 role::wikidata::main_page: "Wiki:Main Page"
@@ -442,6 +445,9 @@
 scholarships::deploy_dir: "%{hiera('mwv::services_dir')}/scholarships"
 scholarships::cache_dir: /var/cache/scholarships
 scholarships::log_file: /vagrant/logs/scholarships.log
+scholarships::oauth_server: 
"http://dev.wiki.local.wmftest.net%{::port_fragment};
+scholarships::oauth_consumer_token: b7228f20b437989dbfc09178085df71a
+scholarships::oauth_secret_token: f7841ded67f3f290360c67d347f9a62c85f171e5
 
 sentry::db_name: sentry
 sentry::db_user: sentry
diff --git a/puppet/modules/role/manifests/scholarships.pp 
b/puppet/modules/role/manifests/scholarships.pp
index 5511bd0..b40b2fa 100644
--- a/puppet/modules/role/manifests/scholarships.pp
+++ b/puppet/modules/role/manifests/scholarships.pp
@@ -4,6 +4,18 @@
 # *Note*: The application is provisioned using an Apache named virtual host.
 # Once the role is enabled and provisioned use the URL
 # http://scholarships.local.wmftest.net:8080/ to access the site.
-class role::scholarships {
+class role::scholarships (
+$oauth_consumer_key,
+$oauth_secret_key,
+) {
+include ::mediawiki
 include ::scholarships
+
+role::oauth::consumer { 'Wikimania Scholarships':
+description  => 'Wikimania Scholarships',
+consumer_key => $oauth_consumer_key,
+secret_key   => $oauth_secret_key,
+callback_url => 
"http://${::scholarships::vhost_name}${::port_fragment}/;,
+grants   => ['authonlyprivate'],
+}
 }
diff --git a/puppet/modules/scholarships/manifests/init.pp 
b/puppet/modules/scholarships/manifests/init.pp
index 492a4e5..2f45a9c 100644
--- a/puppet/modules/scholarships/manifests/init.pp
+++ b/puppet/modules/scholarships/manifests/init.pp
@@ -37,6 +37,9 @@
 $vhost_name,
 $cache_dir,
 $log_file,
+$oauth_server,
+$oauth_consumer_token,
+$oauth_secret_token,
 ){
 include ::php
 include ::apache
diff --git a/puppet/modules/scholarships/templates/env.erb 
b/puppet/modules/scholarships/templates/env.erb
index 92c38a0..22eadc6 100644
--- a/puppet/modules/scholarships/templates/env.erb
+++ b/puppet/modules/scholarships/templates/env.erb
@@ -24,6 +24,14 @@
 ; Value should be compatible with PHP's strtotime() function
 APPLICATION_CLOSE=2038-01-01T00:00
 
+; OAuth settings
+USE_OAUTH=true
+OAUTH_CONSUMER_TOKEN=<%= @oauth_consumer_token %>
+OAUTH_SECRET_TOKEN=<%= @oauth_secret_token %>
+OAUTH_ENDPOINT="<%= @oauth_server %>/w/index.php?title=Special:OAuth"
+OAUTH_REDIR="<%= @oauth_server %>/wiki/Special:OAuth/authenticate?"
+OAUTH_CALLBACK=http://<%= @vhost_name %><%= scope['::port_fragment'] 
%>/oauth/callback
+
 ; This is a testing deployment
 MOCK=1
 SLIM_MODE=development

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I097b8784d050c0fb5e93f92ab25512d3b7d9fb4d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] integration/config[master]: scholarships: use composer-php56-jessie

2018-01-14 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404229 )

Change subject: scholarships: use composer-php56-jessie
..

scholarships: use composer-php56-jessie

Bug: T184885
Change-Id: If37202d169827c2f72d9c8adbabe6510185c9565
---
M zuul/layout.yaml
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/29/404229/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index fa9707b..90e1688 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2779,9 +2779,14 @@
   - name: composer-test
 
   - name: wikimedia/wikimania-scholarships
-template:
- - name: npm-docker
- - name: composer-test
+check:
+  - php56lint
+  - composer-validate
+test: 
+  - npm-node-6-docker
+  - php56lint
+  - composer-php56-jessie
+gate-and-submit: *wikimania-scholarships-test
 
   - name: wikimedia/textcat
 template:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If37202d169827c2f72d9c8adbabe6510185c9565
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
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] integration/config[master]: Add Neha Jha to trusted users

2018-01-14 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404230 )

Change subject: Add Neha Jha to trusted users
..

Add Neha Jha to trusted users

Neha Jha is an Outreachy round 15 participant working on the IEG Grants
and Wikimania Scholarships applications.

Bug: T10
Change-Id: Iedc2c4a27fd382475b4fbd261bd47e6120eac697
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/30/404230/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 90e1688..fcfffd2 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -540,7 +540,6 @@
- ^alangiderick@gmail\.com$ # D3r1ck01
- ^amrit\.sreekumar@gmail\.com$ # amritsreekumar
 
-
   # GCI students!
- ^bmp2558@gmail\.com$ # Georggi
- ^crazy4sb@gmail\.com$ # unicornisaurous
@@ -566,6 +565,7 @@
- ^samikshya\.chand\.ece15@iitbhu\.ac\.in$
- ^tekenoella94@gmail\.com$
- ^vinithacse@gmail\.com$ # Groovier1
+   - ^nj4710@gmail\.com$  # Neha Jha (Round 15)
 
 # Let whitelisted users the ability to reenqueue a change in the test
 # pipeline by simply commenting 'recheck' on a change.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iedc2c4a27fd382475b4fbd261bd47e6120eac697
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
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] wikimedia/wikimania-scholarships[master]: Update 2018 privacy statement

2018-01-10 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403544 )

Change subject: Update 2018 privacy statement
..

Update 2018 privacy statement

Bug: T184659
Change-Id: I8855f0b5be076a34ad31767ac922480710184eff
---
M data/i18n/en.json
M data/i18n/qqq.json
M data/templates/apply.html
3 files changed, 11 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships 
refs/changes/44/403544/1

diff --git a/data/i18n/en.json b/data/i18n/en.json
index c1a8974..8be766d 100644
--- a/data/i18n/en.json
+++ b/data/i18n/en.json
@@ -33,6 +33,7 @@
 
"form-intro": "This is the application for sponsorship to attend https://wikimania2018.wikimedia.org/wiki/Special:MyLanguage/Main_Page\;>Wikimania
 2018, the annual international conference centered on Wikimedia projects. 
Awardees will receive a scholarship which will cover conference registration 
fees, hotel, and roundtrip travel to Wikimania in Cape Town, South Africa, July 
18-22, 2018.\nApplications may be submitted in any language, but 
every applicant must provide evidence of English language abilities that 
are at a level which would enable them to participate in Wikimania, a 
conference which is primarily conducted in English. Sufficient English 
abilities could be demonstrated in the application itself or 
elsewhere.\nPlease carefully consider your financial needs before 
applying for a scholarship to attend Wikimania. There are limited funds 
available and many applicants do not have the financial means to attend 
Wikimania without this opportunity. Thank you.\nPlease note that 
if you need more then 10 minutes to complete this application, please 
draft your answers in a text editor, reload this page and then copy 
and paste your answers into corresponding fields before submitting. This 
application may give an error (\"Missing or invalid CSRF token\") if it is open 
for more then 15 minutes before submitting.\nThe deadline to apply is 
January 22, 2018, 23:59 UTC. ",
 
+   "form-intro-privacy": "For information about privacy and data-handling, 
please review the https://wikimediafoundation.org/wiki/Wikimania_2018_Application_Form_Privacy_Statement\;>application
 privacy statement.",
"form-intro-faq": "Frequently
 asked questions",
 
"form-scholarship-type": "Type of Scholarship",
@@ -150,17 +151,13 @@
"form-info-true": "I certify that all of the information provided with 
my application is true and accurate to the best of my knowledge and belief. The 
Wikimedia Foundation reserves the right to require me to pay back all or part 
of the grant if any of the information I provide is found to be untrue or 
inaccurate.",
 
"form-privacy": "Privacy",
-   "form-review": "All information contained in this application will be 
reviewed by the members of the https://wikimania2018.wikimedia.org/wiki/Special:MyLanguage/Scholarship_committee\;>Wikimania
 Scholarship Committee. All personal information will be held strictly 
confidential by the Committee, and the https://wikimediafoundation.org/\;>Wikimedia Foundation.",
+   "form-privacy1": "Please read the https://wikimediafoundation.org/wiki/Wikimania_2018_Application_Form_Privacy_Statement\;>application
 privacy statement for details about privacy and data-handling.",
+   "form-privacy2": "Wikimedia is a global organization committed to 
promoting free and open knowledge. By completing the survey, you agree to the 
collection, transfer, storage, processing and use of the collected information 
in the United States and other places as may be necessary to carry out the 
purposes and objectives discussed above. You also consent to the transfer of 
information from the U.S. to other countries, which may have different or less 
stringent data protection laws than your country, in order to carry out the 
aforementioned purposes and objectives.",
"form-chapteragree": "Wikimedia movement organizations (Chapters, 
Thematic organizations, and User Groups) also offer scholarships for Wikimania, 
separate from the Wikimedia Foundation Scholarship Program. While this 
application is submitted for a Wikimedia Foundation Scholarship, a Wikimedia 
movement organization may request access to applications that are relevant to 
their country or community, for the purpose of selecting and awarding their 
own, independently awarded scholarships. \n Please indicate whether or not 
you would like your information shared with other, independent Wikimedia 
movement organizations.",
"form-separatejury": "Do you intend to apply to any local Chapter / 
other movement organization(s) for scholarship funding to Wikimania 2018?",
"form-scholarorgs": "If so, please list the organizations below:",
 
-   "form-rights-heading": "Applicant Rights & Consent to Data Processing 
and Transfer",
-   "form-rights1": "I as an 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: mleb: Use existing roles for l10nupdate and interwiki

2018-01-09 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403356 )

Change subject: mleb: Use existing roles for l10nupdate and interwiki
..

mleb: Use existing roles for l10nupdate and interwiki

Change-Id: I658f7d09bdc7c48872755be41dbf83b95ecb1ce2
---
M puppet/modules/role/manifests/mleb.pp
1 file changed, 2 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/56/403356/1

diff --git a/puppet/modules/role/manifests/mleb.pp 
b/puppet/modules/role/manifests/mleb.pp
index 0cbc67e..a59588a 100644
--- a/puppet/modules/role/manifests/mleb.pp
+++ b/puppet/modules/role/manifests/mleb.pp
@@ -8,16 +8,10 @@
 class role::mleb {
 include ::role::babel
 include ::role::cldr
+include ::role::interwiki
+include ::role::l10nupdate
 include ::role::translate
 include ::role::uls
-
-mediawiki::extension { 'LocalisationUpdate':
-settings => { wgLocalisationUpdateDirectory => '$IP/cache' },
-}
-
-mediawiki::extension { 'Interwiki':
-settings => '$wgGroupPermissions["sysop"]["interwiki"] = true',
-}
 
 mediawiki::extension { 'CleanChanges':
 settings => '$wgDefaultUserOptions["usenewrc"] = 1',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I658f7d09bdc7c48872755be41dbf83b95ecb1ce2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Define ::port_fragment for Cloud VPS hosts

2018-01-09 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403348 )

Change subject: Define ::port_fragment for Cloud VPS hosts
..

Define ::port_fragment for Cloud VPS hosts

Avoid "Warning: Unknown variable: '::port_fragment'." complaints from
Puppet by defining an empty string port_fragment fact for Cloud VPS hosts.

Change-Id: I23949c646ffe5b2b0af6ac680f71691246aaded4
---
M Vagrantfile
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/48/403348/1

diff --git a/Vagrantfile b/Vagrantfile
index 76881d4..3c63f62 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -265,6 +265,8 @@
 
 if settings[:http_port] != 80 && ENV['MWV_ENVIRONMENT'] != 'labs'
   puppet.facter['port_fragment'] = ":#{settings[:http_port]}"
+else
+  puppet.facter['port_fragment'] = ""
 end
 
 if settings[:nfs_shares]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23949c646ffe5b2b0af6ac680f71691246aaded4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: analytics: remove cdh modules and roles

2018-01-09 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403341 )

Change subject: analytics: remove cdh modules and roles
..

analytics: remove cdh modules and roles

Bug: T184151
Change-Id: I1acab43b3e8d9b9fc860074e7cc3d0caa4e60f30
---
M .gitmodules
M .rubocop.yml
M puppet/hieradata/common.yaml
D puppet/modules/cdh
D puppet/modules/role/files/analytics/cdh5.apt-pin
D puppet/modules/role/manifests/analytics.pp
D puppet/modules/role/manifests/hadoop.pp
D puppet/modules/role/manifests/hive.pp
D puppet/modules/role/manifests/hue.pp
D puppet/modules/role/manifests/oozie.pp
D puppet/modules/role/manifests/spark.pp
11 files changed, 0 insertions(+), 251 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/41/403341/1

diff --git a/.gitmodules b/.gitmodules
index 117e3b4..2b59571 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
 [submodule "puppet/modules/nginx"]
path = puppet/modules/nginx
url = https://gerrit.wikimedia.org/r/operations/puppet/nginx
-[submodule "puppet/modules/cdh"]
-   path = puppet/modules/cdh
-   url = https://gerrit.wikimedia.org/r/operations/puppet/cdh
diff --git a/.rubocop.yml b/.rubocop.yml
index 6ff92d4..add6cd7 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -8,7 +8,6 @@
 - 'mediawiki/**/*'
 - 'mediawiki-*/**/*'
 - 'puppet/modules/activemq/**/*'
-- 'puppet/modules/cdh/**/*'
 - 'puppet/modules/nginx/**/*'
 - 'puppet/modules/stdlib/**/*'
 - 'puppet/modules/wmflib/**/*'
diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 81ee666..0ab34fe 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -11,12 +11,6 @@
 cassandra::new_size: "10M"
 cassandra::logdir: /vagrant/logs/cassandra
 
-cdh::hue::secret_key: vagrant
-cdh::hue::hive_server_host: "%{::fqdn}"
-
-cdh::oozie::server::db_root_password: "%{hiera('mysql::root_password')}"
-cdh::oozie::server::heapsize: 64
-
 citoid::port: 1970
 citoid::log_level: info
 
diff --git a/puppet/modules/cdh b/puppet/modules/cdh
deleted file mode 16
index 248216f..000
--- a/puppet/modules/cdh
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 248216fc71b974e99ffd8d235d8afe289703b976
diff --git a/puppet/modules/role/files/analytics/cdh5.apt-pin 
b/puppet/modules/role/files/analytics/cdh5.apt-pin
deleted file mode 100644
index dead664..000
--- a/puppet/modules/role/files/analytics/cdh5.apt-pin
+++ /dev/null
@@ -1,3 +0,0 @@
-Package: zookeeper
-Pin: version 3.4.5+cdh*
-Pin-Priority: 1001
diff --git a/puppet/modules/role/manifests/analytics.pp 
b/puppet/modules/role/manifests/analytics.pp
deleted file mode 100644
index f449f69..000
--- a/puppet/modules/role/manifests/analytics.pp
+++ /dev/null
@@ -1,54 +0,0 @@
-# == Class: role::analytics
-# Includes all analytics related roles:
-# - hadoop
-# - hive
-# - oozie
-# - pig
-# - sqoop
-# - hue
-#
-# NOTE!  To use this class, you must have the
-# puppet-cdh git submodule available.  Run this command on your
-# local machine make sure modules/cdh is cloned and up to date.
-#
-#git submodule update --init
-#
-# To use Hadoop GUIs, you'll want to set up some extra Vagrant
-# forwarded ports.  You'll also need more RAM allocated to Vagrant.
-# Edit your .settings.yaml file and add:
-#
-#   vagrant_ram: 2048
-#   forward_ports:
-# :  ,# Hue
-# 8088:  8088,# Hadoop Job GUI
-# 50070: 50070,   # Hadoop NameNode GUI
-# 11000: 11000# Oozie
-#
-# ALSO!  If you are not planning on using Mediawiki for this
-# vagrant instance, you should edit hieradata/common.yaml and
-# remove the   - '::role::mediawiki' line from classes to include
-# by default.
-#
-class role::analytics {
-include ::apt
-
-include ::role::hadoop
-include ::role::hive
-include ::role::oozie
-include ::role::hue
-include ::role::spark
-
-# cdh::mahout, cdh::pig and cdh::sqoop are not parameterized so they
-# do not need their own role classes.
-include ::cdh::mahout
-include ::cdh::pig
-include ::cdh::sqoop
-
-file { '/etc/apt/preferences.d/cdh5':
-source => 'puppet:///modules/role/analytics/cdh5.apt-pin',
-owner  => 'root',
-group  => 'root',
-mode   => '0444',
-before => Package['zookeeper'],
-}
-}
diff --git a/puppet/modules/role/manifests/hadoop.pp 
b/puppet/modules/role/manifests/hadoop.pp
deleted file mode 100644
index c0f5523..000
--- a/puppet/modules/role/manifests/hadoop.pp
+++ /dev/null
@@ -1,106 +0,0 @@
-# == Class: role::hadoop
-# Installs and runs all hadoop services.
-#
-class role::hadoop {
-require_package('openjdk-8-jdk')
-
-$namenode_hosts   = [$::fqdn]
-
-$hadoop_directory = '/var/lib/hadoop'
-$hadoop_name_directory= "${hadoop_directory}/name"
-$hadoop_data_directory= "${hadoop_directory}/data"
-
-file { 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: wmcs: Add s8.labsdb and move wikidatawiki

2018-01-09 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403315 )

Change subject: wmcs: Add s8.labsdb and move wikidatawiki
..

wmcs: Add s8.labsdb and move wikidatawiki

Bug: T184179
Change-Id: I1c0d9468e59682b1ceb061a58bc1defa6a9b7151
---
M modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/15/403315/1

diff --git a/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone 
b/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
index f19bcdf..35f98d3 100644
--- a/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
+++ b/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
@@ -910,7 +910,6 @@
 
 s5 1H  IN  CNAME   s5.analytics.db.svc.eqiad.wmflabs.
 dewiki 1H  IN  CNAME   s5.analytics.db.svc.eqiad.wmflabs.
-wikidatawiki   1H  IN  CNAME   s5.analytics.db.svc.eqiad.wmflabs.
 
 s6 1H  IN  CNAME   s6.analytics.db.svc.eqiad.wmflabs.
 frwiki 1H  IN  CNAME   s6.analytics.db.svc.eqiad.wmflabs.
@@ -932,3 +931,6 @@
 viwiki 1H  IN  CNAME   s7.analytics.db.svc.eqiad.wmflabs.
 centralauth1H  IN  CNAME   s7.analytics.db.svc.eqiad.wmflabs.
 meta   1H  IN  CNAME   s7.analytics.db.svc.eqiad.wmflabs.
+
+s8 1H  IN  CNAME   s8.analytics.db.svc.eqiad.wmflabs.
+wikidatawiki   1H  IN  CNAME   s8.analytics.db.svc.eqiad.wmflabs.

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: apt: Set consistent /etc/apt/sources.list

2018-01-08 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403108 )

Change subject: apt: Set consistent /etc/apt/sources.list
..

apt: Set consistent /etc/apt/sources.list

Set a default sources.list to smooth over differences caused by
different base images.

Bug: T175055
Change-Id: I181e07d9e5e9a49cd3768a15e0fce6e08773e7ff
---
M puppet/modules/apt/manifests/init.pp
A puppet/modules/apt/templates/sources.list.erb
2 files changed, 19 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/08/403108/1

diff --git a/puppet/modules/apt/manifests/init.pp 
b/puppet/modules/apt/manifests/init.pp
index 092b570..14e5ad9 100644
--- a/puppet/modules/apt/manifests/init.pp
+++ b/puppet/modules/apt/manifests/init.pp
@@ -55,6 +55,17 @@
 # Trigger before we add any repos that are using HTTPS
 Exec['ins-apt-transport-https'] -> Apt::Repository <| |>
 
+# T175055: Set a default sources.list to smooth over differences caused by
+# different base images
+file { '/etc/apt/sources.list':
+ensure  => 'present',
+owner   => 'root',
+group   => 'root',
+mode=> '0444',
+content => template('apt/sources.list.erb'),
+notify  => Exec['apt-get update'],
+}
+
 apt::repository { 'wikimedia':
 uri => 'https://apt.wikimedia.org/wikimedia',
 dist=> "${::lsbdistcodename}-wikimedia",
diff --git a/puppet/modules/apt/templates/sources.list.erb 
b/puppet/modules/apt/templates/sources.list.erb
new file mode 100644
index 000..5a9fe49
--- /dev/null
+++ b/puppet/modules/apt/templates/sources.list.erb
@@ -0,0 +1,8 @@
+# This file managed by Puppet
+# modules/apt/templates/sources.list.erb
+
+deb http://deb.debian.org/debian <%= scope['::lsbdistcodename'] %> main contrib
+deb-src http://deb.debian.org/debian  <%= scope['::lsbdistcodename'] %> main 
contrib
+
+deb http://security.debian.org/debian-security  <%= scope['::lsbdistcodename'] 
%>/updates main contrib
+deb-src http://security.debian.org/debian-security  <%= 
scope['::lsbdistcodename'] %>/updates main contrib

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I181e07d9e5e9a49cd3768a15e0fce6e08773e7ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: nfs: always provision NFS client

2018-01-08 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403102 )

Change subject: nfs: always provision NFS client
..

nfs: always provision NFS client

NFS client packages are needed to use NFS shares, and if they are not
already in the VM the auto-provisioning that Vagrant tries to do will
fail after our first Puppet run because of the things we do that mess
with the default apt cache location.

Bug: T184497
Change-Id: I975c920e7da200a40939a83f89eb3f297111a583
---
M puppet/modules/mwv/manifests/packages.pp
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/02/403102/1

diff --git a/puppet/modules/mwv/manifests/packages.pp 
b/puppet/modules/mwv/manifests/packages.pp
index b3a1c05..f0b2eee 100644
--- a/puppet/modules/mwv/manifests/packages.pp
+++ b/puppet/modules/mwv/manifests/packages.pp
@@ -18,6 +18,15 @@
 'tzdata',
 )
 
+# T184497: NFS client packages are needed to use NFS shares, and if they
+# are not already in the VM the auto-provisioning that Vagrant tries to do
+# will fail after our first Puppet run because of the things we do that
+# mess with the default apt cache location.
+require_package(
+'nfs-common',
+'portmap',
+)
+
 # Cron resources need a cron provider installed
 Package['anacron'] -> Cron <| |>
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I975c920e7da200a40939a83f89eb3f297111a583
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: [WIP] Revert "puppet: pin to version 3.*"

2018-01-08 Thread BryanDavis (Code Review)
Hello Dduvall, jenkins-bot,

I'd like you to do a code review.  Please visit

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

to review the following change.


Change subject: [WIP] Revert "puppet: pin to version 3.*"
..

[WIP] Revert "puppet: pin to version 3.*"

Undo Puppet3 pinning when we have merged the stretch-migration branch which 
migrates our Puppet tree to a Puppet4 compatible format.

This reverts commit 458e47cff5ae09695d724e801e3b1c5d2fb49226.

Change-Id: I3eb187c047efa37a23263d5eb60b9bccdc26d57c
---
M puppet/modules/puppet/manifests/agent.pp
M support/puppet-bootstrap.sh
2 files changed, 1 insertion(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/96/403096/1

diff --git a/puppet/modules/puppet/manifests/agent.pp 
b/puppet/modules/puppet/manifests/agent.pp
index a9c1cd1..82f6bab 100644
--- a/puppet/modules/puppet/manifests/agent.pp
+++ b/puppet/modules/puppet/manifests/agent.pp
@@ -18,11 +18,4 @@
 ensure => $ensure,
 enable => $enable,
 }
-
-# T184038: pin puppet to 3.x to prevent accidentally getting Puppet4
-apt::pin { 'puppet':
-package  => 'puppet',
-pin  => 'version 3.*',
-priority => 1001,
-}
 }
diff --git a/support/puppet-bootstrap.sh b/support/puppet-bootstrap.sh
index afec9e8..cf64fff 100755
--- a/support/puppet-bootstrap.sh
+++ b/support/puppet-bootstrap.sh
@@ -17,4 +17,4 @@
 -y \
 -o Dpkg::Options::="--force-confdef" \
 -o Dpkg::Options::="--force-confold" \
-install puppet=3.\* puppet-common=3.\* >/dev/null 2>&1
+install puppet >/dev/null 2>&1

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3eb187c047efa37a23263d5eb60b9bccdc26d57c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Dduvall 
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/vagrant[master]: puppet: pin to version 3.*

2018-01-08 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403076 )

Change subject: puppet: pin to version 3.*
..

puppet: pin to version 3.*

Prevent `apt-get update && apt-get upgrade` from picking Puppet4 as the
version to install by pinning to Puppet 3.x with apt.

Bug: T184038
Change-Id: I309b193596735d409978132e6784f4ad703151d3
---
M puppet/modules/puppet/manifests/agent.pp
M support/puppet-bootstrap.sh
2 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/76/403076/1

diff --git a/puppet/modules/puppet/manifests/agent.pp 
b/puppet/modules/puppet/manifests/agent.pp
index 82f6bab..a9c1cd1 100644
--- a/puppet/modules/puppet/manifests/agent.pp
+++ b/puppet/modules/puppet/manifests/agent.pp
@@ -18,4 +18,11 @@
 ensure => $ensure,
 enable => $enable,
 }
+
+# T184038: pin puppet to 3.x to prevent accidentally getting Puppet4
+apt::pin { 'puppet':
+package  => 'puppet',
+pin  => 'version 3.*',
+priority => 1001,
+}
 }
diff --git a/support/puppet-bootstrap.sh b/support/puppet-bootstrap.sh
index cf64fff..26138b0 100755
--- a/support/puppet-bootstrap.sh
+++ b/support/puppet-bootstrap.sh
@@ -17,4 +17,4 @@
 -y \
 -o Dpkg::Options::="--force-confdef" \
 -o Dpkg::Options::="--force-confold" \
-install puppet >/dev/null 2>&1
+install puppet=3.\* >/dev/null 2>&1

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I309b193596735d409978132e6784f4ad703151d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
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/vagrant[stretch-migration]: wikimetrics: remove role

2018-01-06 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402606 )

Change subject: wikimetrics: remove role
..

wikimetrics: remove role

Remove the wikimetrics role and related Puppet module. This module was
removed from Wikimedia's operations/puppet.git repo in its f79b155
revision. The code present here has not been updated for systemd, which
means that it does not work on the current Debian Jessie master branch
of MediaWiki-Vagrant or the Debian Stretch testing branch.

Bug: T184154
Change-Id: I5d315c0f0b6be94b5559f0d1afe21704104b1ce1
---
M .gitmodules
M .rubocop.yml
M puppet/hieradata/common.yaml
D puppet/modules/role/manifests/wikimetrics.pp
D puppet/modules/wikimetrics
5 files changed, 0 insertions(+), 116 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/06/402606/1

diff --git a/.gitmodules b/.gitmodules
index 5b6ae2b..117e3b4 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
-[submodule "puppet/modules/wikimetrics"]
-   path = puppet/modules/wikimetrics
-   url = https://gerrit.wikimedia.org/r/operations/puppet/wikimetrics
 [submodule "puppet/modules/nginx"]
path = puppet/modules/nginx
url = https://gerrit.wikimedia.org/r/operations/puppet/nginx
diff --git a/.rubocop.yml b/.rubocop.yml
index e8367dd..6ff92d4 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -11,7 +11,6 @@
 - 'puppet/modules/cdh/**/*'
 - 'puppet/modules/nginx/**/*'
 - 'puppet/modules/stdlib/**/*'
-- 'puppet/modules/wikimetrics/**/*'
 - 'puppet/modules/wmflib/**/*'
 - 'srv/**/*'
 - 'tmp/**/*'
diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index fabf5cf..81ee666 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -441,8 +441,6 @@
 
 role::wikidata::main_page: "Wiki:Main Page"
 
-role::wikimetrics::dir: "%{hiera('mwv::services_dir')}/wikimetrics"
-
 scholarships::vhost_name: "scholarships%{hiera('mwv::tld')}"
 scholarships::db_name: scholarships
 scholarships::db_user: scholarships
diff --git a/puppet/modules/role/manifests/wikimetrics.pp 
b/puppet/modules/role/manifests/wikimetrics.pp
deleted file mode 100644
index ce261f2..000
--- a/puppet/modules/role/manifests/wikimetrics.pp
+++ /dev/null
@@ -1,109 +0,0 @@
-# == Class: role::wikimetrics
-# Wikimetrics is a Wikimedia Foundation developed tool that provides
-# access to the Wikimedia API. It allows users to pull data about a
-# group of usernames (called cohorts) to discover retention rates for
-# those users, how many characters they have added, how many edits they
-# have made, how many pages they have created, etc, all within time
-# periods the Wikimetrics user sets.
-#
-# This role installs and hosts Wikimetrics at http://localhost:5000.
-# (both the guest and host)
-#
-# NOTE!  You will need the wikimetrics git submodule available.
-# Run this command on your local machine make sure modules/wikimetrics
-# is cloned and up to date:
-#
-#git submodule update --init
-#
-class role::wikimetrics(
-$dir,
-) {
-require ::role::mediawiki
-require ::role::centralauth
-require ::mysql::packages
-
-require_package('python-nose')
-
-# Should Wikimetrics run under Apache or using the development server?
-# Legal values are 'daemon' and 'apache'.
-$web_server_mode = 'daemon'
-
-# Make wikimetrics group 'www-data' if running in apache mode.
-# This allows for apache to write files to wikimetrics var directories
-$wikimetrics_group = $web_server_mode ? {
-'apache' => 'www-data',
-default  => 'wikimetrics',
-}
-
-class { '::wikimetrics':
-path=> $dir,
-group   => $wikimetrics_group,
-# Use the role::mediawiki MySQL database for
-# wikimetrics editor cohort analysis
-db_user_mediawiki   => $::mediawiki::multiwiki::db_user,
-db_pass_mediawiki   => $::mediawiki::multiwiki::db_pass,
-db_name_mediawiki   => $::mediawiki::db_name,
-db_host_mediawiki   => 'localhost',
-# Use the role::centralauth MySQL database for
-# wikimetrics cohort user expansion
-db_user_centralauth => $::mediawiki::multiwiki::db_user,
-db_pass_centralauth => $::mediawiki::multiwiki::db_pass,
-db_name_centralauth => $::role::centralauth::shared_db,
-db_host_centralauth => 'localhost',
-# clone wikimetrics as vagrant share user
-# so that it works properly in the shared
-# /vagrant directory
-repository_owner=> $::share_owner,
-# wikimetrics runs on the LabsDB usually,
-# where this table is called 'revision_userindex'.
-# The mediawiki database usually calls this 'revision'.
-revision_tablename  => 'revision',
-archive_tablename   => 'archive',
-# Since we are using the /vagrant shared 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: varnish: Fix ::forwarded_port references

2018-01-06 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402594 )

Change subject: varnish: Fix ::forwarded_port references
..

varnish: Fix ::forwarded_port references

Change-Id: I2cacfc98951542b32d6643b67831d3dc89aeaa7b
---
M puppet/modules/varnish/templates/default-subs.vcl.erb
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/94/402594/1

diff --git a/puppet/modules/varnish/templates/default-subs.vcl.erb 
b/puppet/modules/varnish/templates/default-subs.vcl.erb
index d164e41..7b8ef7d 100644
--- a/puppet/modules/varnish/templates/default-subs.vcl.erb
+++ b/puppet/modules/varnish/templates/default-subs.vcl.erb
@@ -7,8 +7,8 @@
 # Since we expose varnish on the default port (6081) we need to rewrite
 # requests that are generated using the default wiki port (8080)
 # This needs to be done early because it's needed for PURGE calls
-if (req.url ~ ":<%= scope[':forwarded_port'] %>") {
-set req.url = regsub(req.url, "(.*):<%= scope[':forwarded_port'] 
%>/(.*)", "\1:6081/\2");
+if (req.url ~ ":<%= scope['::forwarded_port'] %>") {
+set req.url = regsub(req.url, "(.*):<%= scope['::forwarded_port'] 
%>/(.*)", "\1:6081/\2");
 }
 
 # This uses the ACL action called "purge". Basically if a request to

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cacfc98951542b32d6643b67831d3dc89aeaa7b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: math: Install texlive-fonts-all

2018-01-06 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402593 )

Change subject: math: Install texlive-fonts-all
..

math: Install texlive-fonts-all

Install TEX fonts via the texlive-fonts-all omnibus package rather than
cherry-picking font packages which may change names from release to
release.

Change-Id: Iea87244fffd0ec7c1868692abb330a659b866a49
---
M puppet/modules/role/manifests/math.pp
1 file changed, 3 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/93/402593/1

diff --git a/puppet/modules/role/manifests/math.pp 
b/puppet/modules/role/manifests/math.pp
index 67b4b73..4d09ddc 100644
--- a/puppet/modules/role/manifests/math.pp
+++ b/puppet/modules/role/manifests/math.pp
@@ -13,40 +13,20 @@
 browser_tests => true,
 }
 
-package { [
+require_package(
 'ocaml-native-compilers',
 'texlive',
 'texlive-bibtex-extra',
 'texlive-font-utils',
 'texlive-fonts-extra',
-'texlive-lang-croatian',
-'texlive-lang-cyrillic',
-'texlive-lang-czechslovak',
-'texlive-lang-danish',
-'texlive-lang-dutch',
-'texlive-lang-finnish',
-'texlive-lang-french',
-'texlive-lang-german',
-'texlive-lang-greek',
-'texlive-lang-hungarian',
-'texlive-lang-italian',
-'texlive-lang-latin',
-'texlive-lang-mongolian',
-'texlive-lang-norwegian',
-'texlive-lang-other',
-'texlive-lang-polish',
-'texlive-lang-portuguese',
-'texlive-lang-spanish',
-'texlive-lang-swedish',
-'texlive-lang-vietnamese',
+'texlive-lang-all',
 'texlive-latex-extra',
 'texlive-math-extra',
 'texlive-pictures',
 'texlive-pstricks',
 'texlive-publishers',
 'texlive-generic-extra'
-]:
-}
+)
 
 exec { 'compile_texvc':
 command => 'make',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea87244fffd0ec7c1868692abb330a659b866a49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: nginx: define $::realm

2018-01-06 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402595 )

Change subject: nginx: define $::realm
..

nginx: define $::realm

Change-Id: I6373c10963d88e9434f84ee22c2ff6c5e52fa4ae
---
M puppet/manifests/site.pp
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/95/402595/1

diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp
index a71ba7f..14a1266 100644
--- a/puppet/manifests/site.pp
+++ b/puppet/manifests/site.pp
@@ -23,6 +23,10 @@
 $load_later  = 15
 $load_last   = 20
 
+# Declare global '$::realm' for modules that are shared with Wikimedia's
+# operations/puppet.git tree (e.g. nginx).
+$realm = 'vagrant'
+
 # Declares a default search path for executables, allowing the path to
 # be omitted from individual resources. Also configures Puppet to log
 # the command's output if it was unsuccessful. Finally, set timeout to

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6373c10963d88e9434f84ee22c2ff6c5e52fa4ae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Set timezone

2018-01-04 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402176 )

Change subject: Set timezone
..

Set timezone

Bug: T184215
Change-Id: I16067dba5dc586a77c8f70b28d8bb21b78cd964a
---
M puppet/hieradata/common.yaml
M puppet/modules/mwv/manifests/init.pp
M puppet/modules/mwv/manifests/packages.pp
3 files changed, 30 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/76/402176/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 2ef5d23..fabf5cf 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -259,6 +259,7 @@
 mwv::services_dir: /vagrant/srv
 mwv::vendor_dir: /srv
 mwv::tld: '.local.wmftest.net'
+mwv::timezone: Etc/UTC
 mwv::cachefilesd::enable: true
 
 nginx::variant: extras
diff --git a/puppet/modules/mwv/manifests/init.pp 
b/puppet/modules/mwv/manifests/init.pp
index 9c19aa1..6b55118 100644
--- a/puppet/modules/mwv/manifests/init.pp
+++ b/puppet/modules/mwv/manifests/init.pp
@@ -21,12 +21,16 @@
 #   Top level domain to use when creating hostnames. Value should include
 #   leading '.' (example: '.local.wmftest.net').
 #
+# [*timezone*]
+#   Timezone for the VM. (example: 'Etc/UTC')
+#
 class mwv (
 $files_dir,
 $etc_dir,
 $services_dir,
 $vendor_dir,
 $tld,
+$timezone,
 ) {
 include ::apt
 include ::env
@@ -65,4 +69,28 @@
 } -> File <| |>
 }
 
+# Why is this so hard?
+$tzparts = split($timezone, '/')
+$tzarea = $tzparts[0]
+$tzzone = $tzparts[1]
+exec { 'debconf tzarea':
+command => "/bin/echo tzdata tzdata/Areas select ${tzarea} | 
/usr/bin/debconf-set-selections",
+unless  => "/usr/bin/debconf-get-selections | /bin/grep -q -E 
\"^tzdata\\s+tzdata/Areas\\s+select\\s+${tzarea}\"",
+before  => Package['tzdata'],
+}
+exec { 'debconf tzzone':
+command => "/bin/echo tzdata tzdata/Zones/${tzarea} select ${timezone} 
| /usr/bin/debconf-set-selections",
+unless  => "/usr/bin/debconf-get-selections | /bin/grep -q -E 
\"^tzdata\\s+tzdata/Zones/${tzarea}\\s+select\\s+${timezone}\"",
+before  => Package['tzdata'],
+}
+file { '/etc/localtime':
+ensure  => 'link',
+target  => "/usr/share/zoneinfo/${timezone}",
+require => Package['tzdata'],
+}
+file { '/etc/timezone':
+ensure  => 'present',
+content => $timezone,
+require => Package['tzdata'],
+}
 }
diff --git a/puppet/modules/mwv/manifests/packages.pp 
b/puppet/modules/mwv/manifests/packages.pp
index f85d745..b3a1c05 100644
--- a/puppet/modules/mwv/manifests/packages.pp
+++ b/puppet/modules/mwv/manifests/packages.pp
@@ -15,6 +15,7 @@
 'gdb',
 'python-dev',
 'ruby-dev',
+'tzdata',
 )
 
 # Cron resources need a cron provider installed

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16067dba5dc586a77c8f70b28d8bb21b78cd964a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wmcs: Add database drop support to maintain-views

2018-01-04 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402137 )

Change subject: wmcs: Add database drop support to maintain-views
..

wmcs: Add database drop support to maintain-views

Add a new `--drop` argument to maintain-views that can be used to remove
the _p database for a Wiki Replica. This option requires that
`--database` also be given to explicitly name the databases to be
dropped.

Bug: T181925
Change-Id: I91f3b49cade4ccbd822d95a906dbe738ac0d370c
---
M modules/role/files/labs/db/views/maintain-views.py
1 file changed, 36 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/37/402137/1

diff --git a/modules/role/files/labs/db/views/maintain-views.py 
b/modules/role/files/labs/db/views/maintain-views.py
index 23a7dc9..71287bc 100644
--- a/modules/role/files/labs/db/views/maintain-views.py
+++ b/modules/role/files/labs/db/views/maintain-views.py
@@ -113,9 +113,10 @@
 if self.table_exists(view, self.db):
 # If it does, create or replace the view for it.
 logging.info("[{}] ".format(view))
-if (self.replace_all or not self.table_exists(view, self.db_p) or
-input('View already exists. Replace? [y/N] ').lower()
-in ['y', 'yes']):
+if (
+not self.table_exists(view, self.db_p) or
+self._confirm('View already exists. Replace?)
+):
 # Can't use pymysql to build this
 self.write_execute("""
 CREATE OR REPLACE
@@ -194,10 +195,10 @@
 
 if len(sources) == len(sources_checked):
 
-if (self.replace_all or
-not self.table_exists(view_name, self.db_p) or
-input('View already exists. Replace? [y/N] ').lower()
-in ['y', 'yes']):
+if (
+not self.table_exists(view_name, self.db_p) or
+self._confirm('View already exists. Replace?')
+):
 logging.info("[{}] ".format(view_name))
 self.create_customview(
 view_name,
@@ -275,6 +276,20 @@
 for view_name, view_details in customviews.items():
 self.do_customview(view_name, view_details)
 
+def drop_public_database(self):
+"""Drop a public database entirely."""
+if self.database_exists(self.db_p):
+if self._confirm('Drop {}?'.format(self.db_p):
+self.write_execute("DROP DATABASE `{}`;".format(self.db_p))
+else:
+logging.warning('DB {} does not exist'.format(self.db_p))
+
+def _confirm(self, msg):
+return (
+self.replace_all or
+input("{} [y/N] ".format(msg)).lower() in ['y', 'yes']
+)
+
 
 if __name__ == "__main__":
 
@@ -313,8 +328,12 @@
 )
 argparser.add_argument(
 "--clean",
-help=("Clean out views from _p varient that are no longer specified"
-  " make changes."),
+help="Clean out views from _p db that are no longer specified.",
+action="store_true"
+)
+argparser.add_argument(
+"--drop",
+help="Remove _p db entirely.",
 action="store_true"
 )
 argparser.add_argument(
@@ -347,6 +366,10 @@
 # argparse mutually exclusive is weird http://bugs.python.org/issue10984
 if args.table and args.clean:
 logging.critical("cannot specify a single table and cleanup")
+sys.exit(1)
+
+if args.drop and not args.databases:
+logging.critical("--drop must specify database names")
 sys.exit(1)
 
 with open(args.config_location, 'r') as stream:
@@ -449,6 +472,10 @@
 logging.critical("Definer has not been created")
 sys.exit(1)
 
+if args.drop:
+ops.drop_public_database()
+continue
+
 ops.execute(fullviews, customviews)
 
 if args.clean:

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: pcc: Python3 compatibility

2018-01-04 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402119 )

Change subject: pcc: Python3 compatibility
..

pcc: Python3 compatibility

Make pcc work with python3 (it's the future!) while still keeping
python2 support for those poor folks for whom `/usr/bin/env python` is
still python2.

Change-Id: Ic0df42ea526ae05b86f238597653496080b05a9e
---
M utils/pcc
1 file changed, 17 insertions(+), 8 deletions(-)


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

diff --git a/utils/pcc b/utils/pcc
index 6e77b47..1afd2a0 100755
--- a/utils/pcc
+++ b/utils/pcc
@@ -30,9 +30,14 @@
   Licensed under the Apache license.
 
 """
+from __future__ import print_function
+
 import sys
-reload(sys)
-sys.setdefaultencoding('utf-8')
+try:
+reload(sys)
+sys.setdefaultencoding('utf-8')
+except NameError:
+pass  # python3 FTW
 
 import argparse
 import json
@@ -41,7 +46,11 @@
 import subprocess
 import textwrap
 import time
-import urllib2
+
+try:
+import urllib2
+except ImportError:
+import urllib.request as urllib2
 
 try:
 import jenkinsapi
@@ -125,7 +134,7 @@
 password=args.api_token
 )
 
-print yellow('Compiling %(change)s on node(s) %(nodes)s...' % vars(args))
+print(yellow('Compiling %(change)s on node(s) %(nodes)s...' % vars(args)))
 
 job = jenkins.get_job('operations-puppet-catalog-compiler')
 build_params = {
@@ -145,7 +154,7 @@
 
 build = invocation.get_build()
 
-print 'Your build URL is %s' % white(build.baseurl)
+print('Your build URL is %s' % white(build.baseurl))
 
 running = True
 output = ''
@@ -153,7 +162,7 @@
 time.sleep(1)
 running = invocation.is_running()
 new_output = build.get_console().rstrip('\n')
-print format_console_output(new_output[len(output):]),
+print(format_console_output(new_output[len(output):]),)
 output = new_output
 
 # Puppet's exit code is not always meaningful, so we grep the output
@@ -161,8 +170,8 @@
 ok = ('Run finished' in output and not
   re.search(r'[1-9]\d* (ERROR|FAIL)', output))
 if ok:
-print green('SUCCESS')
+print(green('SUCCESS'))
 sys.exit(0)
 else:
-print red('FAIL')
+print(red('FAIL'))
 sys.exit(1)

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wmcs: maintain-meta_p missing python-requests

2018-01-04 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402117 )

Change subject: wmcs: maintain-meta_p missing python-requests
..

wmcs: maintain-meta_p missing python-requests

```
$ sudo /usr/local/sbin/maintain-meta_p --all-databases --purge
Traceback (most recent call last):
  File "/usr/local/sbin/maintain-meta_p", line 25, in 
import requests
ImportError: No module named requests
```

This package must have been installed as a side effect of something else
previously. Seems likely to have broken as a result of reimaging as
stretch.

Change-Id: I8e00605d0e41cc436fed5c2936ae16e11170d143
---
M modules/role/manifests/labs/db/views.pp
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/17/402117/1

diff --git a/modules/role/manifests/labs/db/views.pp 
b/modules/role/manifests/labs/db/views.pp
index 545209f..4c96fa6 100644
--- a/modules/role/manifests/labs/db/views.pp
+++ b/modules/role/manifests/labs/db/views.pp
@@ -1,7 +1,11 @@
 # deploy scripts and its dependencies to create replica views
 class role::labs::db::views {
 
-package { ['python-simplejson', 'python-pymysql']:
+package { [
+'python-pymysql',
+'python-requests',
+'python-simplejson',
+]:
 ensure => present,
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikireplica_dns: Add s8 shard

2018-01-04 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402086 )

Change subject: wikireplica_dns: Add s8 shard
..

wikireplica_dns: Add s8 shard

* Add validation and IP addresses for the new s8 shard.
* Add guard against missing dblists

Bug: T184179
Change-Id: I633b01e98e82fd7ebe57b90ab42e40d5e7075c62
---
M modules/openstack/files/util/wikireplica_dns.py
M modules/openstack/files/util/wikireplica_dns.yaml
2 files changed, 15 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/86/402086/1

diff --git a/modules/openstack/files/util/wikireplica_dns.py 
b/modules/openstack/files/util/wikireplica_dns.py
index e17fd29..fb0585b 100644
--- a/modules/openstack/files/util/wikireplica_dns.py
+++ b/modules/openstack/files/util/wikireplica_dns.py
@@ -221,7 +221,7 @@
 else:
 zones = all_zones
 
-all_shards = ['s1', 's2', 's3', 's4', 's5', 's6', 's7']
+all_shards = ['s1', 's2', 's3', 's4', 's5', 's6', 's7', 's8']
 if args.shard:
 if args.shard not in all_shards:
 parser.error(
@@ -250,12 +250,16 @@
 # Ensure that there are wikidb aliases for shards
 dblist = requests.get(
 'https://noc.wikimedia.org/conf/{}.dblist'.format(svc))
-dblist.raise_for_status()
-for wikidb in dblist.text.splitlines():
-db_fqdn = '{}.{}'.format(wikidb, zone)
-dns.ensure_recordset(zone_id, db_fqdn, 'CNAME', [fqdn])
-# Take a small break to be nicer to Designate
-time.sleep(0.25)
+try:
+dblist.raise_for_status()
+except requests.exceptions.HTTPError:
+logger.warning('DBList "%s" not found', svc)
+else:
+for wikidb in dblist.text.splitlines():
+db_fqdn = '{}.{}'.format(wikidb, zone)
+dns.ensure_recordset(zone_id, db_fqdn, 'CNAME', [fqdn])
+# Take a small break to be nicer to Designate
+time.sleep(0.25)
 
 if svc in config['cnames']:
 # Add additional aliases for this shard
diff --git a/modules/openstack/files/util/wikireplica_dns.yaml 
b/modules/openstack/files/util/wikireplica_dns.yaml
index 0258e4d..8ec501a 100644
--- a/modules/openstack/files/util/wikireplica_dns.yaml
+++ b/modules/openstack/files/util/wikireplica_dns.yaml
@@ -35,6 +35,8 @@
   - 10.64.37.14
 s7:
   - 10.64.37.14
+s8:
+  - 10.64.37.14
   web.db.svc.eqiad.wmflabs.:
 s1:
   - 10.64.37.15
@@ -50,6 +52,8 @@
   - 10.64.37.15
 s7:
   - 10.64.37.15
+s8:
+  - 10.64.37.15
 cnames:
   s7:
 - centralauth

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wmcs: Add s8 to maintain-meta_p

2018-01-04 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402087 )

Change subject: wmcs: Add s8 to maintain-meta_p
..

wmcs: Add s8 to maintain-meta_p

* Look for an s8 dblist.
* Guard against crashes caused by a missing dblist

Bug: T184179
Change-Id: Iddda0076fd063c9960545076efbf5bb8748286a1
---
M modules/role/files/labs/db/views/maintain-meta_p.py
1 file changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/87/402087/1

diff --git a/modules/role/files/labs/db/views/maintain-meta_p.py 
b/modules/role/files/labs/db/views/maintain-meta_p.py
index 5926b85..69c7ac8 100644
--- a/modules/role/files/labs/db/views/maintain-meta_p.py
+++ b/modules/role/files/labs/db/views/maintain-meta_p.py
@@ -205,11 +205,14 @@
 dbs = {k: v for k, v in dbs.iteritems() if k in args.databases}
 
 def read_list(fname, prop, val):
-fpath = os.path.join('{}/dblists/'.format(args.mediawiki_config),
- fname + '.dblist')
-for db in open(fpath).read().splitlines():
-if db in dbs:
-dbs[db][prop] = val
+fpath = os.path.join(
+args.mediawiki_config, 'dblists', '{}.dblist'.format(fname))
+if os.path.isfile(fpath):
+for db in open(fpath).read().splitlines():
+if db in dbs:
+dbs[db][prop] = val
+else:
+logging.warning('DBList "%s" not found', fpath)
 
 read_list("closed", "closed", True)
 read_list("deleted", "deleted", True)
@@ -223,7 +226,7 @@
 read_list("wikidataclient", "has_wikidata", True)
 
 # TODO: silver/labtestweb2001
-for slice in ['s1', 's2', 's3', 's4', 's5', 's6', 's7']:
+for slice in ['s1', 's2', 's3', 's4', 's5', 's6', 's7', 's8']:
 read_list(slice, "slice", slice)
 
 for family in [

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: wikimediaproduction: Remove duplicate declaration conflicts

2018-01-03 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401898 )

Change subject: wikimediaproduction: Remove duplicate declaration conflicts
..

wikimediaproduction: Remove duplicate declaration conflicts

Remove duplicate declaration errors caused by included roles that
attempted to install the same extensions.

* Include role::globalusage in role::commons
* Move some configuration from role::commons to role::globalusage
* Include role::labeledsectiontransclusion in role::proofreadpage

Bug: T184153
Change-Id: I3d18c2c5a75f84810769ba377bca122e41c8493d
---
M puppet/modules/role/manifests/commons.pp
M puppet/modules/role/manifests/globalusage.pp
M puppet/modules/role/manifests/proofreadpage.pp
3 files changed, 16 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/98/401898/1

diff --git a/puppet/modules/role/manifests/commons.pp 
b/puppet/modules/role/manifests/commons.pp
index 8f67e6b..6ae76ff 100644
--- a/puppet/modules/role/manifests/commons.pp
+++ b/puppet/modules/role/manifests/commons.pp
@@ -8,6 +8,7 @@
 class role::commons(
 $upload_dir,
 ) {
+include ::role::globalusage
 require ::role::mediawiki
 include ::role::multimedia
 include ::role::thumb_on_404
@@ -29,17 +30,9 @@
 values => template('role/commons/foreign_repo.php.erb'),
 }
 
-mediawiki::extension { 'GlobalUsage':
-needs_update => true,
-settings => {
+mediawiki::settings { 'commons_GlobalUsage':
+values => {
 wgGlobalUsageDatabase => 'commonswiki',
-},
-require  => Mediawiki::Wiki['commons'],
-}
-
-mediawiki::maintenance { 'refresh globalusage table':
-command => '/usr/local/bin/foreachwikiwithextension GlobalUsage 
extensions/GlobalUsage/refreshGlobalimagelinks.php --pages 
existing,nonexisting',
-cwd => $::mediawiki::dir,
-require => Mediawiki::Extension['GlobalUsage'],
+}
 }
 }
diff --git a/puppet/modules/role/manifests/globalusage.pp 
b/puppet/modules/role/manifests/globalusage.pp
index 9040f41..835a16e 100644
--- a/puppet/modules/role/manifests/globalusage.pp
+++ b/puppet/modules/role/manifests/globalusage.pp
@@ -2,5 +2,15 @@
 # Configures a MediaWiki instance with
 # GlobalUsage[https://www.mediawiki.org/wiki/Extension:GlobalUsage]
 class role::globalusage {
-mediawiki::extension { 'GlobalUsage': }
+require ::role::mediawiki
+
+mediawiki::extension { 'GlobalUsage':
+needs_update => true,
+}
+
+mediawiki::maintenance { 'refresh globalusage table':
+command => '/usr/local/bin/foreachwikiwithextension GlobalUsage 
extensions/GlobalUsage/refreshGlobalimagelinks.php --pages 
existing,nonexisting',
+cwd => $::mediawiki::dir,
+require => Mediawiki::Extension['GlobalUsage'],
+}
 }
diff --git a/puppet/modules/role/manifests/proofreadpage.pp 
b/puppet/modules/role/manifests/proofreadpage.pp
index 037fb76..57ff45d 100644
--- a/puppet/modules/role/manifests/proofreadpage.pp
+++ b/puppet/modules/role/manifests/proofreadpage.pp
@@ -3,6 +3,7 @@
 # a text in comparison with scanned images.
 class role::proofreadpage {
 include ::role::parserfunctions
+include ::role::labeledsectiontransclusion
 include ::role::cite
 
 require_package('djvulibre-bin')
@@ -15,8 +16,6 @@
 post_max_size   => '50M',
 },
 }
-
-mediawiki::extension { 'LabeledSectionTransclusion': }
 
 mediawiki::extension { 'ProofreadPage':
 needs_update => true,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d18c2c5a75f84810769ba377bca122e41c8493d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: thumbor: pass vars to systemd service template

2018-01-03 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401896 )

Change subject: thumbor: pass vars to systemd service template
..

thumbor: pass vars to systemd service template

Bug: T184152
Change-Id: Iab373e7c7f505af865144b7681cab26519567eee
---
M puppet/modules/thumbor/manifests/service.pp
R puppet/modules/thumbor/templates/systemd/thumbor.epp
2 files changed, 11 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/96/401896/1

diff --git a/puppet/modules/thumbor/manifests/service.pp 
b/puppet/modules/thumbor/manifests/service.pp
index 56c54b0..b8187c0 100644
--- a/puppet/modules/thumbor/manifests/service.pp
+++ b/puppet/modules/thumbor/manifests/service.pp
@@ -27,12 +27,12 @@
 $port = $name
 
 systemd::service { "thumbor-${port}":
-ensure => 'present',
-require=> [
+ensure => 'present',
+require=> [
 Package['python-thumbor-wikimedia'],
 File['/etc/firejail/thumbor.profile'],
 ],
-service_params => {
+service_params => {
 subscribe => [
 File[
 '/etc/tinyrgb.icc',
@@ -41,7 +41,13 @@
 $cfg_files,
 ],
 },
-template_name  => 'thumbor',
+template_name  => 'thumbor',
+epp_template   => true,
+template_variables => {
+'port'=> $port,
+'tmp_dir' => $tmp_dir,
+'cfg_dir' => $cfg_dir,
+},
 }
 
 file { "/usr/lib/tmpfiles.d/thumbor@${port}.conf":
diff --git a/puppet/modules/thumbor/templates/systemd/thumbor.erb 
b/puppet/modules/thumbor/templates/systemd/thumbor.epp
similarity index 66%
rename from puppet/modules/thumbor/templates/systemd/thumbor.erb
rename to puppet/modules/thumbor/templates/systemd/thumbor.epp
index 8de1750..0279833 100644
--- a/puppet/modules/thumbor/templates/systemd/thumbor.erb
+++ b/puppet/modules/thumbor/templates/systemd/thumbor.epp
@@ -9,7 +9,7 @@
 SyslogIdentifier=thumbor
 MemoryMax=1G
 # To assign CPU affinity we consider that the base port is 8889 (Thumbor's 
default + 1)
-ExecStart=/usr/bin/taskset -c <%= Integer(@port) - 8889 %> /usr/bin/firejail 
--profile=/etc/firejail/thumbor.profile --env=TMPDIR=<%= @tmp_dir 
%>/thumbor@<%= @port %> --env=MAGICK_TEMPORARY_PATH=<%= @tmp_dir %>/thumbor@<%= 
@port %> --env=MAGICK_DISK_LIMIT=900MB --env=MAGICK_MEMORY_LIMIT=900MB -- 
/usr/bin/thumbor -p <%= @port %> -c <%= @cfg_dir %>
+ExecStart=/usr/bin/taskset -c <%= Integer($port) - 8889 %> /usr/bin/firejail 
--profile=/etc/firejail/thumbor.profile --env=TMPDIR=<%= $tmp_dir 
%>/thumbor@<%= $port %> --env=MAGICK_TEMPORARY_PATH=<%= $tmp_dir %>/thumbor@<%= 
$port %> --env=MAGICK_DISK_LIMIT=900MB --env=MAGICK_MEMORY_LIMIT=900MB -- 
/usr/bin/thumbor -p <%= $port %> -c <%= $cfg_dir %>
 Restart=always
 
 [Install]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab373e7c7f505af865144b7681cab26519567eee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: wikitech: use existing roles

2018-01-03 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401895 )

Change subject: wikitech: use existing roles
..

wikitech: use existing roles

Bug: T184155
Change-Id: I8b3d4a25238baa87b6b370d368a743122c7257a5
---
M puppet/modules/role/manifests/wikitech.pp
1 file changed, 6 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/95/401895/1

diff --git a/puppet/modules/role/manifests/wikitech.pp 
b/puppet/modules/role/manifests/wikitech.pp
index c86a59b..4dea813 100644
--- a/puppet/modules/role/manifests/wikitech.pp
+++ b/puppet/modules/role/manifests/wikitech.pp
@@ -3,25 +3,20 @@
 # Provisions a MediaWiki instance similar to https://wikitech.wikimedia.org/.
 #
 class role::wikitech {
+include ::role::categorytree
+include ::role::checkuser
 include ::role::cite
 include ::role::codeeditor
 include ::role::echo
 include ::role::gadgets
+include ::role::nuke
+include ::role::oathauth
 include ::role::parserfunctions
+include ::role::renameuser
 include ::role::scribunto
+include ::role::titleblacklist
 include ::role::wikieditor
 include ::role::wikilove
-
-# Alas, if only SMW didn't require composer
-# mediawiki::extension { [ 'SemanticForms', 'SemanticResultFormats' ]:
-# needs_update  => true,
-# require   => Mediawiki::Extension[ 'SemanticMediaWiki' ],
-# }
-#
-# mediawiki::extension { 'SemanticMediaWiki':
-# needs_update  => true,
-# require   => Mediawiki::Extension['Validator'],
-# }
 
 mediawiki::extension { 'LdapAuthentication':
 needs_update => true,
@@ -44,15 +39,9 @@
 }
 
 mediawiki::extension { [
-'CategoryTree',
-'CheckUser',
 'Collection',
 'DynamicSidebar',
-'Nuke',
-'OATHAuth',
 'OpenStackManager',
-'Renameuser',
-'TitleBlacklist',
 ]:
 needs_update  => true,
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b3d4a25238baa87b6b370d368a743122c7257a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] labs...deploy[master]: Bump striker submodule and add ddl changes

2018-01-03 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401810 )

Change subject: Bump striker submodule and add ddl changes
..

Bump striker submodule and add ddl changes

* Update for diffusion.repository.search API change
* Enhance workflow for tool labs membership requests
* Add Referrer-Policy header

Bug: T182142
Bug: T168027
Change-Id: I80069242d69c98181897049e85a8ee1b9dcb5815
---
A ddl/20180103-01-T168027.sql
M striker
2 files changed, 28 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker/deploy 
refs/changes/10/401810/1

diff --git a/ddl/20180103-01-T168027.sql b/ddl/20180103-01-T168027.sql
new file mode 100644
index 000..f7836f7
--- /dev/null
+++ b/ddl/20180103-01-T168027.sql
@@ -0,0 +1,27 @@
+-- T168027: Enhance workflow for tool labs membership requests
+-- Generated with mysqldump and hand edited by bd808
+--
+-- NOTE: requires a server with innodb_large_prefix enabled to support UNIQUE
+-- indexes on varchar(255) columns with a utf8mb4. If innodb_large_prefix is
+-- not enabled you will receive errors mentioning "Specified key was too long;
+-- max key length is 767 bytes"
+
+CREATE TABLE `tools_accessrequestcomment` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `created_date` datetime NOT NULL,
   `comment` longtext COLLATE utf8mb4_bin NOT NULL, 
   `request_id` int(11) NOT NULL,   
   `user_id` int(11) NOT NULL,  
   PRIMARY KEY (`id`),  
   KEY `tools_accessrequestcomment_d5240003` (`created_date`),  
   KEY `tools_accessrequestcomment_f68d2c36` (`request_id`),
   KEY `tools_accessrequestcomment_e8701ad4` (`user_id`),   
   CONSTRAINT 
`tools_accessreq_user_id_11c3c61e2a34db92_fk_labsauth_labsuser_id` FOREIGN KEY 
(`user_id`) REFERENCES `labsauth_labsuser` (`id`),
CONSTRAINT `tools_acces_request_id_c7857228c268e3f_fk_tools_accessrequest_id` 
FOREIGN KEY (`request_id`) REFERENCES `tools_accessrequest` (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+
+LOCK TABLES `django_content_type` WRITE;
+INSERT INTO `django_content_type` VALUES
+(26,'tools','accessrequestcomment');
+UNLOCK TABLES;
+
+LOCK TABLES `auth_permission` WRITE;
+INSERT INTO `auth_permission` VALUES
+(76,'Can add access request comment',26,'add_accessrequestcomment'),
+(77,'Can change access request comment',26,'change_accessrequestcomment'),
+(78,'Can delete access request comment',26,'delete_accessrequestcomment');
+UNLOCK TABLES;
+
+LOCK TABLES `django_migrations` WRITE;
+INSERT INTO `django_migrations` VALUES
+(48,'tools','0010_T168027','2017-08-27 21:30:17');
+UNLOCK TABLES;
diff --git a/striker b/striker
index 6dfe25a..93f4600 16
--- a/striker
+++ b/striker
@@ -1 +1 @@
-Subproject commit 6dfe25ac4e85f5237bb666c5b1ebc27bb35556ff
+Subproject commit 93f46007e1c511b8efd6addb556bdc889a19af86

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80069242d69c98181897049e85a8ee1b9dcb5815
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker/deploy
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/vagrant[stretch-migration]: puppet-lint: Fix errors introduced while tests were broken

2018-01-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401671 )

Change subject: puppet-lint: Fix errors introduced while tests were broken
..

puppet-lint: Fix errors introduced while tests were broken

Our puppet-lint checks have not been running for an unknown amount of
time. We did pretty well actually, but a few issues have slipped through
that need to be cleaned up.

Change-Id: Ic90dceb7c333cc0b1f2f9cba90dbfe9bd5fbf15b
---
M .puppet-lint.rc
M Rakefile
M puppet/modules/role/manifests/ores.pp
M puppet/modules/systemd/manifests/service.pp
M puppet/modules/thumbor/manifests/init.pp
5 files changed, 11 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/71/401671/1

diff --git a/.puppet-lint.rc b/.puppet-lint.rc
index d6db438..f02862f 100644
--- a/.puppet-lint.rc
+++ b/.puppet-lint.rc
@@ -1,8 +1,8 @@
 # Long lines are common in Exec and various config blocks.
-# Using templates or lint:ignore:80chars comments to work around that is
+# Using templates or lint:ignore:140chars comments to work around that is
 # painful, so just ignore the automated check and rely on manual checks to see
 # that this is not abused.
---no-80chars-check
+--no-140chars-check
 
 # Be strict.
 --fail-on-warnings
diff --git a/Rakefile b/Rakefile
index b057e5a..99565b2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -29,6 +29,7 @@
   config.ignore_paths = IO.readlines(gitmodules).grep(/\s*path\s*=\s*(\S+)/) {
 "#{Regexp.last_match(1)}/**/*.pp"
   }
+  config.ignore_paths += ['puppet/modules/stdlib/**/*.pp']
   config.ignore_paths += ['tmp/**/*.pp']
   config.log_format = '%{path}:%{line} %{KIND}: %{message}'
 end
diff --git a/puppet/modules/role/manifests/ores.pp 
b/puppet/modules/role/manifests/ores.pp
index 8651e0e..338a8a2 100644
--- a/puppet/modules/role/manifests/ores.pp
+++ b/puppet/modules/role/manifests/ores.pp
@@ -35,6 +35,5 @@
 # when ORES is installed locally via role::ores_service.
 # This is pretty horrible but seems to be the only way of avoiding cycles.
 Systemd::Service<| title == 'ores-wsgi' or title == 'ores-celery' |>
-->
-Mediawiki::Maintenance['check ORES model versions']
+-> Mediawiki::Maintenance['check ORES model versions']
 }
diff --git a/puppet/modules/systemd/manifests/service.pp 
b/puppet/modules/systemd/manifests/service.pp
index cda8297..c5a6ba6 100644
--- a/puppet/modules/systemd/manifests/service.pp
+++ b/puppet/modules/systemd/manifests/service.pp
@@ -66,15 +66,16 @@
 }
 }
 
+$unit_content = $epp_template ? {
+true=> epp($unit_template, $template_variables),
+default => template($unit_template),
+}
 file { $unit_path:
 ensure  => $ensure,
 owner   => 'root',
 group   => 'root',
 mode=> '0444',
-content => $epp_template ? {
-true=> epp($unit_template, $template_variables),
-default => template($unit_template),
-},
+content => $unit_content,
 }
 
 exec { "systemd reload for ${name}":
diff --git a/puppet/modules/thumbor/manifests/init.pp 
b/puppet/modules/thumbor/manifests/init.pp
index 16d84a2..6edac72 100644
--- a/puppet/modules/thumbor/manifests/init.pp
+++ b/puppet/modules/thumbor/manifests/init.pp
@@ -37,8 +37,8 @@
 }
 
 package { 'python-thumbor-wikimedia':
-ensure  => 'present',
-notify  => Exec['stop-and-disable-default-thumbor-service'],
+ensure => 'present',
+notify => Exec['stop-and-disable-default-thumbor-service'],
 }
 
 exec { 'stop-and-disable-default-thumbor-service':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic90dceb7c333cc0b1f2f9cba90dbfe9bd5fbf15b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: tests: Fix premature exit after cucumber tests

2018-01-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401669 )

Change subject: tests: Fix premature exit after cucumber tests
..

tests: Fix premature exit after cucumber tests

Setting `fork = false` for Cucumber::Rake::Task is supposed to be
a performance boosting option. It seems however in our test suite to
cause Rake to exit before executing the tasks that follow Cucumber.

Bug: T184034
Change-Id: Iedfd61c022f39d32f6d803a39579bb5d121537ed
---
M Rakefile
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/69/401669/1

diff --git a/Rakefile b/Rakefile
index b057e5a..64dc301 100644
--- a/Rakefile
+++ b/Rakefile
@@ -34,7 +34,6 @@
 end
 Cucumber::Rake::Task.new(:cucumber) do |t|
   t.cucumber_opts = '-r tests/features tests/features'
-  t.fork = false
 end
 RSpec::Core::RakeTask.new(:spec) do |t|
   t.rspec_opts = '-I tests/spec --default-path tests'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iedfd61c022f39d32f6d803a39579bb5d121537ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: scribunto: install luasandbox from stretch-backports

2018-01-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401668 )

Change subject: scribunto: install luasandbox from stretch-backports
..

scribunto: install luasandbox from stretch-backports

Fix installation of php-luasandbox package by installing the upstream
package from Debian's stretch-backports's collection. This is
a temporary measure while the Wikimedia specific build for Stretch is
broken.

Bug: T183888
Change-Id: Ide04d213d62eb79163a209106607e0c4c632e49f
---
A puppet/modules/mediawiki/manifests/extension/scribunto.pp
M puppet/modules/role/manifests/scribunto.pp
2 files changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/68/401668/1

diff --git a/puppet/modules/mediawiki/manifests/extension/scribunto.pp 
b/puppet/modules/mediawiki/manifests/extension/scribunto.pp
new file mode 100644
index 000..2b5b837
--- /dev/null
+++ b/puppet/modules/mediawiki/manifests/extension/scribunto.pp
@@ -0,0 +1,9 @@
+# == Class mediawiki::extension::scribunto
+#
+class mediawiki::extension::scribunto {
+apt::pin { 'luasandbox':
+package  => 'php-luasandbox',
+pin  => 'release a=stretch-backports',
+priority => 1001,
+}
+}
diff --git a/puppet/modules/role/manifests/scribunto.pp 
b/puppet/modules/role/manifests/scribunto.pp
index e3df34d..50d0593 100644
--- a/puppet/modules/role/manifests/scribunto.pp
+++ b/puppet/modules/role/manifests/scribunto.pp
@@ -4,6 +4,7 @@
 class role::scribunto {
 include ::role::codeeditor
 include ::role::syntaxhighlight
+include ::mediawiki::extension::scribunto
 
 require_package('php-luasandbox')
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide04d213d62eb79163a209106607e0c4c632e49f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: wikidata: remove role::articleplaceholder conflict

2018-01-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401667 )

Change subject: wikidata: remove role::articleplaceholder conflict
..

wikidata: remove role::articleplaceholder conflict

Allow people to use the existing ArticlePlaceholder role instead of
automatically installing it in the wikidata role.

Bug: T181769
Change-Id: Ie1b4e3482333b7c380744be947416d558dd53b6f
---
M puppet/modules/role/manifests/articleplaceholder.pp
M puppet/modules/role/manifests/wikidata.pp
2 files changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/67/401667/1

diff --git a/puppet/modules/role/manifests/articleplaceholder.pp 
b/puppet/modules/role/manifests/articleplaceholder.pp
index 58cd876..edaf5d8 100644
--- a/puppet/modules/role/manifests/articleplaceholder.pp
+++ b/puppet/modules/role/manifests/articleplaceholder.pp
@@ -6,7 +6,7 @@
 include ::role::scribunto
 
 mediawiki::extension { 'ArticlePlaceholder':
-composer => true
+needs_update => true,
 }
 
 mediawiki::settings { 'Wikidata allowEntityImport':
diff --git a/puppet/modules/role/manifests/wikidata.pp 
b/puppet/modules/role/manifests/wikidata.pp
index 8bfcb87..2904533 100644
--- a/puppet/modules/role/manifests/wikidata.pp
+++ b/puppet/modules/role/manifests/wikidata.pp
@@ -63,10 +63,6 @@
 needs_update => true,
 }
 
-mediawiki::extension { 'ArticlePlaceholder':
-needs_update => true,
-}
-
 mediawiki::maintenance { 'wikidata-populate-site-tables':
 command => "/usr/local/bin/foreachwikiwithextension Wikibase 
extensions/Wikibase/lib/maintenance/populateSitesTable.php --load-from 
http://en${mediawiki::multiwiki::base_domain}${::port_fragment}/w/api.php;,
 refreshonly => true,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1b4e3482333b7c380744be947416d558dd53b6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: service::node: Fix RESTBase port

2018-01-01 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401400 )

Change subject: service::node: Fix RESTBase port
..

service::node: Fix RESTBase port

Bug: T183854
Change-Id: I1812c17222863268fc7a8d176b196f540a162e95
---
M puppet/modules/service/manifests/node.pp
M puppet/modules/service/templates/node/config.yaml.erb
2 files changed, 1 insertion(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/00/401400/1

diff --git a/puppet/modules/service/manifests/node.pp 
b/puppet/modules/service/manifests/node.pp
index d7d80da..9aaef8c 100644
--- a/puppet/modules/service/manifests/node.pp
+++ b/puppet/modules/service/manifests/node.pp
@@ -95,11 +95,6 @@
 undef   => $::service::log_level,
 default => $log_level
 }
-# ensure the RB port is defined for the config
-$restbase_port = $::restbase::port ? {
-undef   => 7231,
-default => $::restbase::port
-}
 
 # the repo
 git::clone { $title:
diff --git a/puppet/modules/service/templates/node/config.yaml.erb 
b/puppet/modules/service/templates/node/config.yaml.erb
index f46a576..c858429 100644
--- a/puppet/modules/service/templates/node/config.yaml.erb
+++ b/puppet/modules/service/templates/node/config.yaml.erb
@@ -55,7 +55,7 @@
   # the template used for contacting RESTBase
   restbase_req:
 method: '{{request.method}}'
-uri: http://localhost:<%= @restbase_port %>/{{domain}}/v1/{+path}
+uri: http://localhost:<%= scope['::restbase::port'] ? 
scope['::restbase::port'] : 7231 %>/{{domain}}/v1/{+path}
 query: '{{ default(request.query, {}) }}'
 headers: '{{request.headers}}'
 body: '{{request.body}}'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1812c17222863268fc7a8d176b196f540a162e95
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Mobrovac 

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


[MediaWiki-commits] [Gerrit] labs...stashbot[master]: Guard against degenerate messages in #wikimedia-cloud

2017-12-31 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401202 )

Change subject: Guard against degenerate messages in #wikimedia-cloud
..

Guard against degenerate messages in #wikimedia-cloud

Change-Id: I1a06d3bf807bda5772f328dc91c9d3f19448ee95
---
M stashbot/sal.py
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/stashbot 
refs/changes/02/401202/1

diff --git a/stashbot/sal.py b/stashbot/sal.py
index 850b5ce..8595040 100644
--- a/stashbot/sal.py
+++ b/stashbot/sal.py
@@ -91,7 +91,17 @@
 bang['nick'], bang['message'] = bang['message'].split(None, 1)
 
 if channel in ['#wikimedia-labs', '#wikimedia-cloud']:
-bang['project'], bang['message'] = bang['message'].split(None, 1)
+parts = bang['message'].split(None, 1)
+if len(parts) < 2:
+if respond_to_channel:
+self.irc.respond(
+conn, event,
+('%s: Missing project or message? '
+'Expected !log  ') % bang['nick']
+)
+return
+
+bang['project'], bang['message'] = parts
 if bang['project'] not in self._get_projects():
 self.logger.warning('Invalid project "%s"', bang['project'])
 if respond_to_channel:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a06d3bf807bda5772f328dc91c9d3f19448ee95
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/stashbot
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/vagrant[stretch-migration]: wikidata: Install wikibase using individual extensions

2017-12-29 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400999 )

Change subject: wikidata: Install wikibase using individual extensions
..

wikidata: Install wikibase using individual extensions

The wikidatabuild repo has been deprecated and is no longer being
updated. Change install method to provision individual extensions as is
now done in the Wikimedia production deployment.

Bug: T181769
Bug: T183307
Co-Authored-By: Bryan Davis 
Change-Id: I3e90b08e518505b0af1b57dda73b4b690627
---
M puppet/modules/role/manifests/wikidata.pp
M puppet/modules/role/templates/wikidata/init.php.erb
M puppet/modules/role/templates/wikidata/shared.php.erb
3 files changed, 114 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/99/400999/1

diff --git a/puppet/modules/role/manifests/wikidata.pp 
b/puppet/modules/role/manifests/wikidata.pp
index 9ef3ada..8bfcb87 100644
--- a/puppet/modules/role/manifests/wikidata.pp
+++ b/puppet/modules/role/manifests/wikidata.pp
@@ -12,7 +12,67 @@
 include ::role::sitematrix
 include ::role::langwikis
 
-mediawiki::wiki { 'wikidata': }
+mediawiki::wiki { 'wikidata':
+wgconf => {
+'wmvExtensions' => {
+  'ArticlePlaceholder' => false,
+},
+},
+}
+
+# Bootstrapping settings
+mediawiki::settings { 'WikiData-Init':
+priority => $::load_early,
+values   => template('role/wikidata/init.php.erb'),
+}
+
+# Note composer installing all of the extensions will run into duplicate
+# libs being installed. The first one that is loaded will actually be
+# used, in theory we could run into issues here but as long as each
+# extension is checked out at the same time / to the same version there
+# shouldnt be issues...
+
+# NOTE: there is always a wikibase_repo role, maybe we should use that?
+mediawiki::extension { 'Wikibase':
+composer => true,
+needs_update => true,
+settings => template('role/wikidata/shared.php.erb'),
+}
+
+mediawiki::extension { 'Wikidata.org':
+needs_update => true,
+wiki => 'wikidata',
+}
+
+mediawiki::extension { 'PropertySuggester':
+needs_update => true,
+wiki => 'wikidata',
+}
+
+mediawiki::extension { 'WikibaseQuality':
+needs_update => true,
+wiki => 'wikidata',
+}
+
+mediawiki::extension { 'WikibaseQualityConstraints':
+needs_update => true,
+wiki => 'wikidata',
+}
+
+mediawiki::extension { 'WikimediaBadges':
+needs_update => true,
+}
+
+mediawiki::extension { 'ArticlePlaceholder':
+needs_update => true,
+}
+
+mediawiki::maintenance { 'wikidata-populate-site-tables':
+command => "/usr/local/bin/foreachwikiwithextension Wikibase 
extensions/Wikibase/lib/maintenance/populateSitesTable.php --load-from 
http://en${mediawiki::multiwiki::base_domain}${::port_fragment}/w/api.php;,
+refreshonly => true,
+}
+
+Mediawiki::Wiki<| |> ~> 
Mediawiki::Maintenance['wikidata-populate-site-tables']
 
 # TODO: Going to http://wikidata.wiki.local.wmftest.net:8080/
 # will work, but if you explicitly visit Main_Page in the main
@@ -31,32 +91,4 @@
 wiki=> 'wikidata',
 db_name => 'wikidatawiki',
 }
-
-mediawiki::extension { 'WikidataBuildResources':
-remote   => 
'https://gerrit.wikimedia.org/r/wikidata/build-resources',
-entrypoint   => 'Wikidata.php',
-composer => true,
-needs_update => true,
-settings => template('role/wikidata/shared.php.erb'),
-}
-
-mediawiki::settings { 'WikiData-Init':
-priority => $::load_early,
-values   => template('role/wikidata/init.php.erb'),
-}
-
-exec { 'wikidata-update-git-remote':
-command => '/usr/bin/git remote set-url origin 
https://gerrit.wikimedia.org/r/wikidata/build-resources',
-unless  => "/usr/bin/git remote -v | grep -q 
'https://gerrit.wikimedia.org/r/wikidata/build-resources'",
-cwd => "${::mediawiki::dir}/extensions/WikidataBuildResources",
-require => Mediawiki::Extension['WikidataBuildResources'],
-}
-
-mediawiki::maintenance { 'wikidata-populate-site-tables':
-command => "/usr/local/bin/foreachwikiwithextension 
WikidataBuildResources 
extensions/WikidataBuildResources/extensions/Wikibase/lib/maintenance/populateSitesTable.php
 --load-from 
http://en${mediawiki::multiwiki::base_domain}${::port_fragment}/w/api.php;,
-refreshonly => true,
-}
-
-Mediawiki::Wiki<| |> ~> 
Mediawiki::Maintenance['wikidata-populate-site-tables']
-
 }
diff --git a/puppet/modules/role/templates/wikidata/init.php.erb 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: apache2: hard restart to release old ports

2017-12-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400207 )

Change subject: apache2: hard restart to release old ports
..

apache2: hard restart to release old ports

A `service apache2 restart` does not release any TCP ports which were
already bound by a running apache2 process. Forcing a hard restart via
`service apache2 stop && service apache2 start` will release the ports
and make them for use by other programs (e.g. nginx).

Bug: T183692
Change-Id: Iff25b359f4d5317b6762bad2ca9fe073e0edfa72
---
M puppet/modules/apache/manifests/init.pp
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/07/400207/1

diff --git a/puppet/modules/apache/manifests/init.pp 
b/puppet/modules/apache/manifests/init.pp
index bcbb314..2856915 100644
--- a/puppet/modules/apache/manifests/init.pp
+++ b/puppet/modules/apache/manifests/init.pp
@@ -20,7 +20,16 @@
 file { '/etc/apache2/ports.conf':
 content => template('apache/ports.conf.erb'),
 require => Package['apache2'],
-notify  => Service['apache2'],
+notify  => Exec['apache2 release ports'],
+}
+
+# T183692: A normal restart of Apache2 will not release bound ports. We
+# need to trigger a hard restart to fix that.
+exec { 'apache2 release ports':
+command => '/usr/sbin/service apache2 stop',
+onlyif  => '/usr/sbin/service apache2 status',
+refreshonly => true,
+notify  => Service['apache2'],
 }
 
 # Set EnableSendfile to 'Off' to work around a bug with Vagrant.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff25b359f4d5317b6762bad2ca9fe073e0edfa72
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: https: Add port number to reverse proxy

2017-12-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400206 )

Change subject: https: Add port number to reverse proxy
..

https: Add port number to reverse proxy

Bug: T183304
Change-Id: I464fd73c8183500f875364384b3deba15d3e1116
---
M puppet/modules/role/manifests/https.pp
R puppet/modules/role/templates/https/nginx.conf.erb
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/06/400206/1

diff --git a/puppet/modules/role/manifests/https.pp 
b/puppet/modules/role/manifests/https.pp
index a2fa2c7..551f580 100644
--- a/puppet/modules/role/manifests/https.pp
+++ b/puppet/modules/role/manifests/https.pp
@@ -11,8 +11,8 @@
 }
 
 nginx::site { 'devwiki':
-source => 'puppet:///modules/role/https/nginx.conf',
-notify => Service['nginx'],
+content => template('role/https/nginx.conf.erb'),
+notify  => Service['nginx'],
 }
 
 mediawiki::settings { 'SSL-related settings':
diff --git a/puppet/modules/role/files/https/nginx.conf 
b/puppet/modules/role/templates/https/nginx.conf.erb
similarity index 87%
rename from puppet/modules/role/files/https/nginx.conf
rename to puppet/modules/role/templates/https/nginx.conf.erb
index bdbfd32..44aa994 100644
--- a/puppet/modules/role/files/https/nginx.conf
+++ b/puppet/modules/role/templates/https/nginx.conf.erb
@@ -14,6 +14,6 @@
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 180s;
-   proxy_pass http://127.0.0.1;
+   proxy_pass http://127.0.0.1:<%= scope['::forwarded_port'] %>;
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I464fd73c8183500f875364384b3deba15d3e1116
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Mutate $wgServer after applying local settings

2017-12-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400204 )

Change subject: Mutate $wgServer after applying local settings
..

Mutate $wgServer after applying local settings

Move the block introduced in 8c7bf33 and updated in 990f03a which sets
$wgServer relative to current request headers and trims the protocol if
the deployment supports HTTP and HTTPS *after* the user and Puppet
managed local settings files are processed.

Bug: T183302
Change-Id: I381b9b1ea910c8b96cc4c4186e5f91ae64a5372c
---
M puppet/modules/mediawiki/templates/multiwiki/CommonSettings.php.erb
1 file changed, 10 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/04/400204/1

diff --git 
a/puppet/modules/mediawiki/templates/multiwiki/CommonSettings.php.erb 
b/puppet/modules/mediawiki/templates/multiwiki/CommonSettings.php.erb
index 6eaaa3c..3b61f12 100644
--- a/puppet/modules/mediawiki/templates/multiwiki/CommonSettings.php.erb
+++ b/puppet/modules/mediawiki/templates/multiwiki/CommonSettings.php.erb
@@ -54,15 +54,6 @@
),
 );
 
-if ( PHP_SAPI !== 'cli' ) {
-   // T68399: set wgServer from inbound request
-   $wgServer = WebRequest::detectServer();
-   if ( isset( $mwvSupportsHttps ) && $mwvSupportsHttps ) {
-   // Create protocol-relative URL when the HTTPS role is active
-   $wgServer = preg_replace( '#^https?:#', '', $wgServer );
-   }
-}
-
 /**
  * @var array $wmvActiveExtensions List of extensions enabled for the wiki
  * Populated by settings.d files generated by ::mediawiki::extension and
@@ -82,3 +73,13 @@
 ) {
include_once $conffile;
 }
+
+// T183302: Mutate $wgServer *after* local settings changes
+if ( PHP_SAPI !== 'cli' ) {
+   // T68399: set wgServer from inbound request
+   $wgServer = WebRequest::detectServer();
+   if ( isset( $mwvSupportsHttps ) && $mwvSupportsHttps ) {
+   // Create protocol-relative URL when the HTTPS role is active
+   $wgServer = preg_replace( '#^https?:#', '', $wgServer );
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I381b9b1ea910c8b96cc4c4186e5f91ae64a5372c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: rake: move gemspec to dotfile

2017-12-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400199 )

Change subject: rake: move gemspec to dotfile
..

rake: move gemspec to dotfile

Move the gemspec file used for testing the local Vagrant plugin to
a dotfile. This is merely a cosmetic change for directory listings.

Change-Id: I169c606906ea003c773a47e2eace69eeacba64c0
---
R .gemspec
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/99/400199/1

diff --git a/mediawiki-vagrant.gemspec b/.gemspec
similarity index 100%
rename from mediawiki-vagrant.gemspec
rename to .gemspec

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I169c606906ea003c773a47e2eace69eeacba64c0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: README: update minimum Vagrant version

2017-12-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400197 )

Change subject: README: update minimum Vagrant version
..

README: update minimum Vagrant version

We have been requiring Vagrant 1.7.0+ for quite a while. Minor
formatting updates are also made to the file (line wrapping, heading
style used).

Change-Id: I93d74f9bea4f76c9f407fc3b73eff56edb732c33
---
M README.md
1 file changed, 20 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/97/400197/1

diff --git a/README.md b/README.md
index 1989196..36e5926 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
-## MediaWiki-Vagrant
+MediaWiki-Vagrant
+=
 
 https://www.mediawiki.org/wiki/Mediawiki-vagrant
 
@@ -13,7 +14,8 @@
 and an interactive interpreter. Best of all, because the configuration is
 automated and contained in a virtual environment, mistakes are easy to undo.
 
-## Install
+Install
+---
 
 You'll need to install recent versions of Vagrant and VirtualBox.
 
@@ -23,8 +25,8 @@
 `support/README-parallels.md` for details on the former three.)
 
  * VirtualBox: https://www.virtualbox.org/wiki/Downloads
- * Vagrant: https://www.vagrantup.com/downloads-archive.html (the version must 
be
-   1.4.0 or higher). For NFS, use 1.5.4 or higher.
+ * Vagrant: https://www.vagrantup.com/downloads-archive.html (the version must
+   be 1.7.0 or higher).
 
To check your Vagrant version, run
 
@@ -77,7 +79,8 @@
 see the main page of your MediaWiki instance.
 
 
-## Use
+Use
+---
 
 To access a command shell on your virtual environment, run `vagrant ssh` from
 the root mediawiki-vagrant directory or any of its subdirectories.
@@ -89,7 +92,8 @@
 The admin account on MediaWiki is `admin` / `vagrant`.
 
 
-## Update
+Update
+--
 
 When the vagrant Virtual Machine is running, it will periodically run Puppet
 (an open source configuration management tool) to update its configuration,
@@ -102,7 +106,8 @@
 The latter will restart the VM.
 
 
-## Extend
+Extend
+--
 
 You can add roles to MediaWiki-Vagrant! A 'role' represents a set of software
 configurations required for giving this machine some special function.
@@ -115,11 +120,13 @@
 patch to the Mediawiki-Vagrant project.
 
 
-## Settings
+Settings
+
 
 For information about settings, see settings.d/README.
 
-## Testing
+Testing
+---
 
 Install dependencies:
 
@@ -130,7 +137,8 @@
 
 bundle exec rake
 
-## Troubleshoot
+Troubleshoot
+
 
 Stuck? Here's where to get help.
 
@@ -141,4 +149,5 @@
  * 
https://phabricator.wikimedia.org/maniphest/task/create/?projects=MediaWiki-Vagrant
 
 Patches and contributions are welcome!
-See  for 
details.
+See  for
+details.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I93d74f9bea4f76c9f407fc3b73eff56edb732c33
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: rake: move test definitions to tests directory

2017-12-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400201 )

Change subject: rake: move test definitions to tests directory
..

rake: move test definitions to tests directory

Clean up the root directly slightly by moving the Cucumber and RSpec
test files into a 'tests' directory.

Change-Id: I5847f5e122ea8497aeb7bbb33b8d024972ff6211
---
M Rakefile
R tests/features/config.feature
R tests/features/role_settings.feature
R tests/features/roles.feature
R tests/features/step_definitions/common_steps.rb
R tests/features/step_definitions/roles_steps.rb
R tests/features/step_definitions/settings_steps.rb
R tests/features/support/env.rb
R tests/features/support/hooks.rb
R tests/features/support/output_helper.rb
R tests/spec/mediawiki_vagrant/environment_spec.rb
R tests/spec/mediawiki_vagrant/setting_spec.rb
R tests/spec/mediawiki_vagrant/settings/definitions_spec.rb
R tests/spec/mediawiki_vagrant/settings_definer_spec.rb
R tests/spec/mediawiki_vagrant/settings_spec.rb
R tests/spec/spec_helper.rb
R tests/spec/support/mock_environment.rb
R tests/spec/support/string.rb
18 files changed, 10 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/01/400201/1

diff --git a/Rakefile b/Rakefile
index f7c978f..37e3391 100644
--- a/Rakefile
+++ b/Rakefile
@@ -33,9 +33,12 @@
   config.log_format = '%{path}:%{line} %{KIND}: %{message}'
 end
 Cucumber::Rake::Task.new(:cucumber) do |t|
+  t.cucumber_opts = '-r tests/features tests/features'
   t.fork = false
 end
-RSpec::Core::RakeTask.new(:spec)
+RSpec::Core::RakeTask.new(:spec) do |t|
+  t.pattern = 'tests/spec/**{,/*/**}/*_spec.rb'
+end
 RuboCop::RakeTask.new(:rubocop)
 
 task default: [:test]
diff --git a/features/config.feature b/tests/features/config.feature
similarity index 100%
rename from features/config.feature
rename to tests/features/config.feature
diff --git a/features/role_settings.feature 
b/tests/features/role_settings.feature
similarity index 100%
rename from features/role_settings.feature
rename to tests/features/role_settings.feature
diff --git a/features/roles.feature b/tests/features/roles.feature
similarity index 100%
rename from features/roles.feature
rename to tests/features/roles.feature
diff --git a/features/step_definitions/common_steps.rb 
b/tests/features/step_definitions/common_steps.rb
similarity index 100%
rename from features/step_definitions/common_steps.rb
rename to tests/features/step_definitions/common_steps.rb
diff --git a/features/step_definitions/roles_steps.rb 
b/tests/features/step_definitions/roles_steps.rb
similarity index 100%
rename from features/step_definitions/roles_steps.rb
rename to tests/features/step_definitions/roles_steps.rb
diff --git a/features/step_definitions/settings_steps.rb 
b/tests/features/step_definitions/settings_steps.rb
similarity index 100%
rename from features/step_definitions/settings_steps.rb
rename to tests/features/step_definitions/settings_steps.rb
diff --git a/features/support/env.rb b/tests/features/support/env.rb
similarity index 100%
rename from features/support/env.rb
rename to tests/features/support/env.rb
diff --git a/features/support/hooks.rb b/tests/features/support/hooks.rb
similarity index 100%
rename from features/support/hooks.rb
rename to tests/features/support/hooks.rb
diff --git a/features/support/output_helper.rb 
b/tests/features/support/output_helper.rb
similarity index 100%
rename from features/support/output_helper.rb
rename to tests/features/support/output_helper.rb
diff --git a/spec/mediawiki_vagrant/environment_spec.rb 
b/tests/spec/mediawiki_vagrant/environment_spec.rb
similarity index 99%
rename from spec/mediawiki_vagrant/environment_spec.rb
rename to tests/spec/mediawiki_vagrant/environment_spec.rb
index f48d922..555aa70 100644
--- a/spec/mediawiki_vagrant/environment_spec.rb
+++ b/tests/spec/mediawiki_vagrant/environment_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require_relative '../spec_helper'
 require 'mediawiki-vagrant/environment'
 
 module MediaWikiVagrant
@@ -473,7 +473,7 @@
   subject { environment.valid? }
 
   context 'when the environment directory is the project directory' do
-let(:environment) { Environment.new(File.expand_path('../../../', 
__FILE__)) }
+let(:environment) { Environment.new(File.expand_path('../../../../', 
__FILE__)) }
 
 it { is_expected.to be(true) }
   end
diff --git a/spec/mediawiki_vagrant/setting_spec.rb 
b/tests/spec/mediawiki_vagrant/setting_spec.rb
similarity index 98%
rename from spec/mediawiki_vagrant/setting_spec.rb
rename to tests/spec/mediawiki_vagrant/setting_spec.rb
index dd00602..f5ac90f 100644
--- a/spec/mediawiki_vagrant/setting_spec.rb
+++ b/tests/spec/mediawiki_vagrant/setting_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require_relative '../spec_helper'
 require 'mediawiki-vagrant/setting'
 
 module MediaWikiVagrant
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: rake: Make `rake test` reentrant

2017-12-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400200 )

Change subject: rake: Make `rake test` reentrant
..

rake: Make `rake test` reentrant

`rake test` leaves a bunch of files behind in tmp/testenv. If these
files are not removed before the next run of `rake test` the linter will
fail with a long list of duplication messages. Adding a :clean step to
the start of the test run will take care of this by ensuring that the
prior test run's files are removed. This should have no effect on CI
tests, but will make local testing easier.

Change-Id: Iaeb2df655f92943b91f8e2410ae82034d46c53de
---
M Rakefile
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/00/400200/1

diff --git a/Rakefile b/Rakefile
index 95c90bb..f7c978f 100644
--- a/Rakefile
+++ b/Rakefile
@@ -13,9 +13,13 @@
 require 'puppet-lint/tasks/puppet-lint'
 require 'puppet-syntax/tasks/puppet-syntax'
 require 'puppet-strings/tasks/generate'
+require 'rake/clean'
 require 'rspec/core/rake_task'
 require 'rubocop/rake_task'
 require 'yard'
+
+# Tell `rake clean` to get rid of generated test files
+CLEAN.include('tmp/testenv')
 
 # Work around bug in puppet-lint configuration
 # https://github.com/rodjek/puppet-lint/issues/331
@@ -37,7 +41,7 @@
 task default: [:test]
 
 desc 'Run all build/tests commands (CI entry point)'
-task test: [:syntax, :spec, :rubocop, :cucumber, :lint, :doc]
+task test: [:clean, :syntax, :spec, :rubocop, :cucumber, :lint, :doc]
 
 desc 'Generate all documentations'
 task :doc do

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaeb2df655f92943b91f8e2410ae82034d46c53de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: vagrant: Add plugin to set host file permissions

2017-12-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400198 )

Change subject: vagrant: Add plugin to set host file permissions
..

vagrant: Add plugin to set host file permissions

Git does not have a means to version permissions on files other than the
execute bit. The MediaWikiVagrant.FilePerms provisioner plugin lets us
add manipulation of local file system permissions to a `vagrant
{provision, up}` run. The initial use of this feature is making the
cache/apt/partial directory world writable so that Stretch's _apt user
can write downloaded files there.

Bug: T183150
Change-Id: I8d0c7ed9f1d055fb5dbcebfb62cf72eac722f7e1
---
M Vagrantfile
M lib/mediawiki-vagrant.rb
A lib/mediawiki-vagrant/file_perms.rb
3 files changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/98/400198/1

diff --git a/Vagrantfile b/Vagrantfile
index b26a372..76881d4 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -214,6 +214,8 @@
 
   config.vm.provision :mediawiki_reload if mwv.reload?
 
+  config.vm.provision :file_perms
+
   # Ensure that the VM has Puppet installed
   config.vm.provision :shell, path: 'support/puppet-bootstrap.sh'
 
diff --git a/lib/mediawiki-vagrant.rb b/lib/mediawiki-vagrant.rb
index 0efaf69..ae1ebf2 100644
--- a/lib/mediawiki-vagrant.rb
+++ b/lib/mediawiki-vagrant.rb
@@ -109,5 +109,10 @@
   LsbCheck::Provisioner
 end
 
+provisioner :file_perms do
+  require 'mediawiki-vagrant/file_perms'
+  FilePerms
+end
+
   end
 end
diff --git a/lib/mediawiki-vagrant/file_perms.rb 
b/lib/mediawiki-vagrant/file_perms.rb
new file mode 100644
index 000..5a1c4c4
--- /dev/null
+++ b/lib/mediawiki-vagrant/file_perms.rb
@@ -0,0 +1,14 @@
+require 'fileutils'
+
+require 'mediawiki-vagrant/plugin_environment'
+
+module MediaWikiVagrant
+  class FilePerms < Vagrant.plugin('2', :provisioner)
+include PluginEnvironment
+
+def configure(_root_config)
+  # T183150: Make cache/apt/partial world writable
+  FileUtils.chmod 'a=wrx', @mwv.path('cache/apt/partial')
+end
+  end
+end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d0c7ed9f1d055fb5dbcebfb62cf72eac722f7e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: elk: Fix kibana reverse proxy

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

Change subject: elk: Fix kibana reverse proxy
..

elk: Fix kibana reverse proxy

The apache config installed for the ELK role had not been updated for
the move to the nodejs Kibana service.

Exec['wait-for-elasticsearch'] has also been updated to stop leaving
index.html files in ~vagrant.

Change-Id: I7975605a5d6443cbf80f20e1576e18b80982095d
---
M puppet/hieradata/common.yaml
M puppet/modules/elasticsearch/manifests/init.pp
M puppet/modules/kibana/manifests/init.pp
M puppet/modules/role/templates/elk/VagrantRoleElk.wiki.erb
M puppet/modules/role/templates/elk/apache.conf.erb
5 files changed, 11 insertions(+), 57 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/55/400155/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index cd2685a..9889e3f 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -154,9 +154,6 @@
 hhvm::logroot: /vagrant/logs
 hhvm::admin_site_name: "hhvm-admin%{hiera('mwv::tld')}"
 
-kibana::deploy_dir: "%{hiera('mwv::vendor_dir')}/kibana"
-kibana::default_route: /dashboard/elasticsearch/default
-
 logstash::heap_memory_mb: 192
 logstash::pipeline_workers: 1
 logstash::output::elasticsearch::host: 127.0.0.1
diff --git a/puppet/modules/elasticsearch/manifests/init.pp 
b/puppet/modules/elasticsearch/manifests/init.pp
index e11bcd4..d570f1c 100644
--- a/puppet/modules/elasticsearch/manifests/init.pp
+++ b/puppet/modules/elasticsearch/manifests/init.pp
@@ -33,7 +33,7 @@
 
 exec { 'wait-for-elasticsearch':
 require => Service['elasticsearch'],
-command => '/usr/bin/wget --tries 20 --retry-connrefused 
http://localhost:9200/',
+command => '/usr/bin/wget --tries 20 --retry-connrefused 
http://127.0.0.1:9200/ -O - >/dev/null',
 }
 
 file { '/etc/default/elasticsearch':
diff --git a/puppet/modules/kibana/manifests/init.pp 
b/puppet/modules/kibana/manifests/init.pp
index abb4c2b..069e1d2 100644
--- a/puppet/modules/kibana/manifests/init.pp
+++ b/puppet/modules/kibana/manifests/init.pp
@@ -3,21 +3,7 @@
 # Kibana is a JavaScript web application for visualizing log data and other
 # types of time-stamped data. It integrates with ElasticSearch and LogStash.
 #
-# == Parameters:
-# - $deploy_dir: Directory to deploy kibana in.
-# - $default_route: Default landing page. You can specify files, scripts or
-# saved dashboards here.
-#
-# == Sample usage:
-#
-#   class { 'kibana':
-#   default_route => '/dashboard/elasticsearch/default',
-#   }
-#
-class kibana (
-$deploy_dir,
-$default_route,
-) {
+class kibana {
 package { 'kibana':
 ensure => latest,
 }
@@ -46,12 +32,12 @@
 
 exec { 'create-kibana-index':
 command => 'curl -XPUT localhost:9200/.kibana --data-binary 
@/vagrant/puppet/modules/kibana/files/kibana-mapping.json',
-unless  => 'curl -sf --head localhost:9200/.kibana',
+unless  => 'curl -sf --head 127.0.0.1:9200/.kibana',
 require => Exec['wait-for-elasticsearch'],
 }
 
 exec { 'preload-kibana-dashboard':
-command => 'curl -sf -X POST localhost:9200/.kibana/_bulk 
--data-binary @/vagrant/puppet/modules/kibana/files/kibana-dump.json > 
/dev/null',
+command => 'curl -sf -X POST 127.0.0.1:9200/.kibana/_bulk 
--data-binary @/vagrant/puppet/modules/kibana/files/kibana-dump.json > 
/dev/null',
 refreshonly => true,
 subscribe   => Exec['create-kibana-index'],
 require => Exec['wait-for-elasticsearch'],
diff --git a/puppet/modules/role/templates/elk/VagrantRoleElk.wiki.erb 
b/puppet/modules/role/templates/elk/VagrantRoleElk.wiki.erb
index 3b65829..e9ff257 100644
--- a/puppet/modules/role/templates/elk/VagrantRoleElk.wiki.erb
+++ b/puppet/modules/role/templates/elk/VagrantRoleElk.wiki.erb
@@ -1,4 +1,4 @@
 Provision an ELK stack ([https://www.elastic.co/products/elasticsearch 
ElasticSearch], [https://www.elastic.co/products/logstash Logstash], 
[https://www.elastic.co/products/kibana Kibana]) and send MediaWiki log 
messages there.
 
-Kibana GUI: [//<%= @vhost_name %><%= @port_fragment %> <%= @vhost_name %>]
+Kibana GUI: [//<%= @vhost_name %><%= @port_fragment %>/app/kibana <%= 
@vhost_name %>]
 
diff --git a/puppet/modules/role/templates/elk/apache.conf.erb 
b/puppet/modules/role/templates/elk/apache.conf.erb
index f437372..42e3ebc 100644
--- a/puppet/modules/role/templates/elk/apache.conf.erb
+++ b/puppet/modules/role/templates/elk/apache.conf.erb
@@ -1,6 +1,5 @@
 ServerName <%= @vhost_name %>
-
-DocumentRoot <%= scope['::kibana::deploy_dir'] %>/src
+DocumentRoot /var/www/html
 
 
   Options FollowSymLinks
@@ -8,41 +7,13 @@
   Require all denied
 
 
-
+
+  ProxyPass "http://localhost:5601/;
   Require all granted
-
-
-/src>
-  Require all granted
-
-
-alias /config.js /etc/kibana/config.js
+
 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: mysql: Provide default charset for MediaWiki tables

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

Change subject: mysql: Provide default charset for MediaWiki tables
..

mysql: Provide default charset for MediaWiki tables

Provide a default charset of 'binary' for auxiliary tables provisioned
for:
* centralauth
* contenttranslation
* externalstore
* globalblocking

The global default charset for the Stretch MariaDB install is utf8mb4
which causes issues for indexing when ROW_FORMAT=DYNAMIC is not provided
in the CREATE TABLE declaration. Globally setting ROW_FORMAT=DYNAMIC is
not possible in MariaDB <10.2.2.

Bug: T183679
Change-Id: Icbf3d397af465c1b09a43963dbe28af0f269b53f
---
M puppet/modules/contenttranslation/manifests/init.pp
M puppet/modules/role/manifests/centralauth.pp
M puppet/modules/role/manifests/externalstore.pp
M puppet/modules/role/manifests/globalblocking.pp
4 files changed, 12 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/45/400145/1

diff --git a/puppet/modules/contenttranslation/manifests/init.pp 
b/puppet/modules/contenttranslation/manifests/init.pp
index 538a530..31ac17e 100644
--- a/puppet/modules/contenttranslation/manifests/init.pp
+++ b/puppet/modules/contenttranslation/manifests/init.pp
@@ -108,7 +108,8 @@
 }
 
 mysql::db { $database:
-ensure => present,
+ensure  => present,
+options => 'DEFAULT CHARACTER SET binary',
 }
 
 mysql::sql { "${database_user}_full_priv_${database}":
diff --git a/puppet/modules/role/manifests/centralauth.pp 
b/puppet/modules/role/manifests/centralauth.pp
index 4b2382b..bc59317 100644
--- a/puppet/modules/role/manifests/centralauth.pp
+++ b/puppet/modules/role/manifests/centralauth.pp
@@ -67,12 +67,16 @@
 }
 
 mysql::db { $shared_db:
-ensure => present,
+ensure  => present,
+options => 'DEFAULT CHARACTER SET binary',
 }
 
 mysql::sql { "GRANT ALL PRIVILEGES ON ${shared_db}.* TO 
${db_user}@${db_host}":
 unless  => "SELECT 1 FROM INFORMATION_SCHEMA.SCHEMA_PRIVILEGES WHERE 
TABLE_SCHEMA = '${shared_db}' AND GRANTEE = \"'${db_user}'@'${db_host}'\" LIMIT 
1",
-require => Mysql::User[$db_user],
+require => [
+  Mysql::Db[$shared_db],
+  Mysql::User[$db_user],
+],
 }
 
 mysql::sql { 'Create CentralAuth tables':
diff --git a/puppet/modules/role/manifests/externalstore.pp 
b/puppet/modules/role/manifests/externalstore.pp
index c37168f..c31e23e 100644
--- a/puppet/modules/role/manifests/externalstore.pp
+++ b/puppet/modules/role/manifests/externalstore.pp
@@ -15,7 +15,8 @@
 include ::mediawiki
 
 mysql::db { 'external store db':
-dbname => 'external',
+dbname  => 'external',
+options => 'DEFAULT CHARACTER SET binary',
 }
 
 mysql::sql { "GRANT ALL PRIVILEGES ON ${db_name}.* TO 
${db_user}@${grant_db_host}":
diff --git a/puppet/modules/role/manifests/globalblocking.pp 
b/puppet/modules/role/manifests/globalblocking.pp
index d18c97d..73f3d08 100644
--- a/puppet/modules/role/manifests/globalblocking.pp
+++ b/puppet/modules/role/manifests/globalblocking.pp
@@ -25,7 +25,8 @@
 require ::role::mediawiki
 
 mysql::db { $db_name:
-ensure => present,
+ensure  => present,
+options => 'DEFAULT CHARACTER SET binary',
 }
 
 mysql::sql { "GRANT ALL PRIVILEGES ON ${db_name}.* TO 
${db_user}@${db_host}":

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbf3d397af465c1b09a43963dbe28af0f269b53f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: mysql: Fix service notification in mysql::large_prefix

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

Change subject: mysql: Fix service notification in mysql::large_prefix
..

mysql: Fix service notification in mysql::large_prefix

Follow up to 433ad81 where this was missed.

Change-Id: I822ddee98b008cc0c71ad1da97720c85c8556e5b
---
M puppet/modules/mysql/manifests/large_prefix.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/46/400146/1

diff --git a/puppet/modules/mysql/manifests/large_prefix.pp 
b/puppet/modules/mysql/manifests/large_prefix.pp
index 568d47b..9f230fd 100644
--- a/puppet/modules/mysql/manifests/large_prefix.pp
+++ b/puppet/modules/mysql/manifests/large_prefix.pp
@@ -12,6 +12,6 @@
 mode=> '0444',
 source  => 'puppet:///modules/mysql/innodb_large_prefix.cnf',
 require => Package['mariadb-server'],
-notify  => Service['mysql'],
+notify  => Service['mariadb'],
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I822ddee98b008cc0c71ad1da97720c85c8556e5b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: mysql: break Mysql::User['vagrant'] dependency cycle

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

Change subject: mysql: break Mysql::User['vagrant'] dependency cycle
..

mysql: break Mysql::User['vagrant'] dependency cycle

Exclude Mysql::User['vagrant'] from contract that Mysql::Db resources
must be created before Mysql::User resources. Because
Mysql::User['vagrant'] is included in Class['mysql'] it would otherwise
create a dependency cycle with any lass which requires Class['mysql']
(directly or indirectly) and also uses Mysql::Db.

Bug: T181918
Change-Id: Id054e18e97658bd08987e44e10c61157b09ab9a8
---
M puppet/modules/mysql/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/25/400125/1

diff --git a/puppet/modules/mysql/manifests/init.pp 
b/puppet/modules/mysql/manifests/init.pp
index f7b85da..929ed2c 100644
--- a/puppet/modules/mysql/manifests/init.pp
+++ b/puppet/modules/mysql/manifests/init.pp
@@ -50,5 +50,5 @@
 
 # Create databases before creating users. User resources sometime
 # depend on databases for GRANTs, but the reverse is never true.
-Mysql::Db <| |> -> Mysql::User <| |>
+Mysql::Db <| |> -> Mysql::User <| title != 'vagrant' |>
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id054e18e97658bd08987e44e10c61157b09ab9a8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: composer: fix oscillating file group

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

Change subject: composer: fix oscillating file group
..

composer: fix oscillating file group

Fixes this Puppet battle over file ownership:
Notice: /Stage[main]/Php::Composer/File[/usr/local/bin/composer]/group: group 
changed 'staff' to 'root

Change-Id: Ie710ec2481fd1042dade886e3b078e88c317a2fd
---
M puppet/modules/php/manifests/composer.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/21/400121/1

diff --git a/puppet/modules/php/manifests/composer.pp 
b/puppet/modules/php/manifests/composer.pp
index e8e9e9b..a8ecb21 100644
--- a/puppet/modules/php/manifests/composer.pp
+++ b/puppet/modules/php/manifests/composer.pp
@@ -26,7 +26,7 @@
 file { '/usr/local/bin/composer':
 ensure  => file,
 owner   => 'root',
-group   => 'root',
+group   => 'staff',
 mode=> '0755',
 require => Exec['download_composer'],
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie710ec2481fd1042dade886e3b078e88c317a2fd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: npm: Add guard for Exec['downgrade_npm']

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

Change subject: npm: Add guard for Exec['downgrade_npm']
..

npm: Add guard for Exec['downgrade_npm']

Add an "unless" guard condition to keep the Exec['downgrade_npm']
resource from firing unnecessarily.

Change-Id: Ic3fd9518254cae379092f9650e596e1ba8292dfe
---
M puppet/modules/npm/manifests/init.pp
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/17/400117/1

diff --git a/puppet/modules/npm/manifests/init.pp 
b/puppet/modules/npm/manifests/init.pp
index dde3fdd..61482a9 100644
--- a/puppet/modules/npm/manifests/init.pp
+++ b/puppet/modules/npm/manifests/init.pp
@@ -43,13 +43,13 @@
 
 # Node 6 brings in npm 3 that doesn't work in shared folders due to a bug.
 # See: https://github.com/npm/npm/issues/9953
-# Although the ticket is closed, the issue is still present, so downgrade 
to npm 2
+# Although the ticket is closed, the issue is still present, so downgrade
+# to the latest npm 2
 exec { 'downgrade_npm':
   command => '/usr/bin/npm install -g npm@latest-2',
   user=> 'root',
-  require => [
-  Package['nodejs'],
-  ],
+  unless  => '/usr/bin/npm --version | /bin/grep -qe ^2',
+  require => Package['nodejs'],
 }
 
 env::var { 'NPM_CONFIG_CACHE':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3fd9518254cae379092f9650e596e1ba8292dfe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: apt: better support for `apt-get update` refresh

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

Change subject: apt: better support for `apt-get update` refresh
..

apt: better support for `apt-get update` refresh

We have 3 use cases for running `apt-get update`:
* Run on initial provision before any packages are installed
* Run on `vagrant provision` if it has not run in the last day
* Run on any `vagrant provision` where an apt::pin or apt::repository
  resource has newly been added to the Puppet object graph

The first two use cases have long been handled for us by using
a "schedule => daily" attribute on the Exec['apt-get update'] resource.
This has a flaw however in that the schedule attribute swallows refresh
events triggered by apt:pin and apt:repository if local state shows that
Exec['apt-get update'] is not already due to run. This causes annoying
issues for users who are adding new roles to existing VMs where new apt
repos or pinning are needed to successfully provision.

To support the 3rd use case while not breaking the first 2, this patch
makes the apt-get update triggers a bit more complex. A new
File['/etc/apt/.update'] resource is added which will notify
Exec['apt-get update'] for the first use case. A new Exec['Daily
apt-get update'] resource is added which uses a "schedule => 'daily'"
attribute to support the second use case. Finally the "schedule"
attribute is removed from the existing Exec['apt-get update'] resource
and a "refreshonly" attribute is added so that the previously ignored
notifications needed by the 3rd use case are properly handled.

Change-Id: I5a02476af18580966a5fe57797dfb13c5ba27b9c
---
M puppet/modules/apt/manifests/init.pp
1 file changed, 28 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/16/400116/1

diff --git a/puppet/modules/apt/manifests/init.pp 
b/puppet/modules/apt/manifests/init.pp
index 7932f24..092b570 100644
--- a/puppet/modules/apt/manifests/init.pp
+++ b/puppet/modules/apt/manifests/init.pp
@@ -5,11 +5,35 @@
 # supplementary sources.
 #
 class apt {
+# Elaborate apt-get update trigger machanism ahead. We want apt-get update
+# to be run on initial provision of a new VM (easy), once a day
+# thereafter (not too hard with "schedule => daily"), AND any time that
+# a new apt::pin or apt::repository define shows up in the Puppet graph.
+# The first 2 can be handled simply via an Exec with the schedule 
attribure.
+# That setup however keeps the 3rd use case from working as desired.
+#
+# The more complex replacement is a state file (/etc/apt/.update),
+# a schedule=>daily exec to update that file, and a refreshonly
+# Exec['apt-get update'] resource.
+file { '/etc/apt/.update':
+ensure  => 'present',
+owner   => 'root',
+group   => 'root',
+mode=> '0444',
+content => '',
+replace => false,
+notify  => Exec['apt-get update'],
+}
+exec { 'Daily apt-get update':
+command  => '/bin/date > /etc/apt/.update',
+schedule => 'daily',
+}
 exec { 'apt-get update':
-command  => '/usr/bin/apt-get update',
-schedule => daily,
-timeout  => 240,
-returns  => [ 0, 100 ],
+command => '/usr/bin/apt-get update',
+timeout => 240,
+returns => [ 0, 100 ],
+refreshonly => true,
+subscribe   => File['/etc/apt/.update'],
 }
 
 # Directory used to store keys added with apt::repository

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a02476af18580966a5fe57797dfb13c5ba27b9c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: php7: remove remaining role::zend references

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

Change subject: php7: remove remaining role::zend references
..

php7: remove remaining role::zend references

Bug: T181915
Change-Id: Ie1eacf689a841269847e5ee75a3cc7ff9199fcff
---
M puppet/modules/role/manifests/ldapauth.pp
M puppet/modules/role/manifests/zero.pp
2 files changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/20/400120/1

diff --git a/puppet/modules/role/manifests/ldapauth.pp 
b/puppet/modules/role/manifests/ldapauth.pp
index 7d04350..2a7011c 100644
--- a/puppet/modules/role/manifests/ldapauth.pp
+++ b/puppet/modules/role/manifests/ldapauth.pp
@@ -17,7 +17,6 @@
 $writer_password,
 $admin_password,
 ) {
-# Needed for php maintenance scripts and if the VM is using role::zend
 require_package('php-ldap')
 
 # This is a lazy short cut so we don't have to pass a bazillion options to
diff --git a/puppet/modules/role/manifests/zero.pp 
b/puppet/modules/role/manifests/zero.pp
index cf209e0..0b85261 100644
--- a/puppet/modules/role/manifests/zero.pp
+++ b/puppet/modules/role/manifests/zero.pp
@@ -8,7 +8,6 @@
 include ::role::parserfunctions
 include ::role::scribunto
 include ::role::thumb_on_404
-include ::role::zend
 
 mediawiki::extension { 'ZeroBanner':
 priority => $::load_later, # Must be after JsonConfig & MobileFrontEnd

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1eacf689a841269847e5ee75a3cc7ff9199fcff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: mysql: remove unnecessary -p${mysql::root_password} usage

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

Change subject: mysql: remove unnecessary -p${mysql::root_password} usage
..

mysql: remove unnecessary -p${mysql::root_password} usage

The root user is setup to use unix auth rather than password auth, so
passing a password to /usr/bin/mysql is unnecessary.

Bug: T51652
Change-Id: Ibf27465c901efa341241f210d526eb10684eeb33
---
M puppet/modules/crm/manifests/dash.pp
M puppet/modules/role/manifests/ores.pp
M puppet/modules/smashpig/manifests/init.pp
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/19/400119/1

diff --git a/puppet/modules/crm/manifests/dash.pp 
b/puppet/modules/crm/manifests/dash.pp
index 30371c3..5070bab 100644
--- a/puppet/modules/crm/manifests/dash.pp
+++ b/puppet/modules/crm/manifests/dash.pp
@@ -34,7 +34,7 @@
 }
 
 exec { 'dash_schema':
-command => "cat ${fundraising_dash_dir}/schema/*.sql | /usr/bin/mysql 
-u root -p${mysql::root_password} fredge -qfsA",
+command => "cat ${fundraising_dash_dir}/schema/*.sql | /usr/bin/mysql 
fredge -qfsA",
 require => [
 File['dash_settings_js'],
 Mysql::Db['fredge'],
diff --git a/puppet/modules/role/manifests/ores.pp 
b/puppet/modules/role/manifests/ores.pp
index 8651e0e..de444c7 100644
--- a/puppet/modules/role/manifests/ores.pp
+++ b/puppet/modules/role/manifests/ores.pp
@@ -27,7 +27,7 @@
 
 mediawiki::maintenance { 'check ORES model versions':
 command => '/usr/local/bin/mwscript 
extensions/ORES/maintenance/CheckModelVersions.php --wiki=wiki',
-unless  => "/usr/bin/mysql -u root -p${::mysql::root_password} -e 
'select * from ores_model' wiki | /bin/grep -q 'damaging'",
+unless  => "/usr/bin/mysql -e 'select * from ores_model' wiki | 
/bin/grep -q 'damaging'",
 require => Mediawiki::Extension['ORES'],
 }
 
diff --git a/puppet/modules/smashpig/manifests/init.pp 
b/puppet/modules/smashpig/manifests/init.pp
index 62feda9..3cf65d8 100644
--- a/puppet/modules/smashpig/manifests/init.pp
+++ b/puppet/modules/smashpig/manifests/init.pp
@@ -64,7 +64,7 @@
 mysql::db { 'smashpig': }
 
 exec { 'smashpig_schema':
-command => "cat ${dir}/Schema/mysql/*.sql | /usr/bin/mysql -uroot 
-p${mysql::root_password} smashpig -qfsA",
+command => "cat ${dir}/Schema/mysql/*.sql | /usr/bin/mysql smashpig 
-qfsA",
 require => [
 Git::Clone['wikimedia/fundraising/SmashPig'],
 Mysql::Db['smashpig'],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf27465c901efa341241f210d526eb10684eeb33
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: mysql: Use mariadb-server package

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

Change subject: mysql: Use mariadb-server package
..

mysql: Use mariadb-server package

Change from the transitional "mysql-server" package to the
"mariadb-server" package. Also explicitly tell Puppet that the mariadb
service is managed via systemd.

Bug: T51652

Change-Id: If6bc65c1648fe6b5f323094cf2b2dcc9dbbac361
---
M puppet/modules/mediawiki/manifests/multiwiki.pp
M puppet/modules/mysql/manifests/init.pp
M puppet/modules/mysql/manifests/large_prefix.pp
M puppet/modules/mysql/manifests/packages.pp
4 files changed, 6 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/18/400118/1

diff --git a/puppet/modules/mediawiki/manifests/multiwiki.pp 
b/puppet/modules/mediawiki/manifests/multiwiki.pp
index a29bae8..6baf1d8 100644
--- a/puppet/modules/mediawiki/manifests/multiwiki.pp
+++ b/puppet/modules/mediawiki/manifests/multiwiki.pp
@@ -267,10 +267,6 @@
 file { '/usr/local/bin/sql':
 ensure  => link,
 target  => '/usr/bin/mysql',
-# /usr/bin/mysql is provided by the package
-# mysql-client-core-5.5, but that is only installed as an
-# implicit dependency of mysql-server required by
-# mysql::packages.
-require => Package['mysql-server'],
+require => Package['mariadb-server'],
 }
 }
diff --git a/puppet/modules/mysql/manifests/init.pp 
b/puppet/modules/mysql/manifests/init.pp
index 113ce1f..f7b85da 100644
--- a/puppet/modules/mysql/manifests/init.pp
+++ b/puppet/modules/mysql/manifests/init.pp
@@ -24,11 +24,12 @@
 ) {
 include ::mysql::packages
 
-service { 'mysql':
+service { 'mariadb':
 ensure => running,
 enable => true,
+provider   => 'systemd',
 hasrestart => true,
-require=> Package['mysql-server'],
+require=> Package['mariadb-server'],
 }
 
 # Setup password free auth for VM's vagrant user
diff --git a/puppet/modules/mysql/manifests/large_prefix.pp 
b/puppet/modules/mysql/manifests/large_prefix.pp
index 1bce93d..568d47b 100644
--- a/puppet/modules/mysql/manifests/large_prefix.pp
+++ b/puppet/modules/mysql/manifests/large_prefix.pp
@@ -11,7 +11,7 @@
 group   => 'root',
 mode=> '0444',
 source  => 'puppet:///modules/mysql/innodb_large_prefix.cnf',
-require => Package['mysql-server'],
+require => Package['mariadb-server'],
 notify  => Service['mysql'],
 }
 }
diff --git a/puppet/modules/mysql/manifests/packages.pp 
b/puppet/modules/mysql/manifests/packages.pp
index 73f0a65..46944ae 100644
--- a/puppet/modules/mysql/manifests/packages.pp
+++ b/puppet/modules/mysql/manifests/packages.pp
@@ -4,7 +4,7 @@
 # class so they can be included from multiple locations.
 #
 class mysql::packages {
-package { 'mysql-server':
+package { 'mariadb-server':
 ensure => present,
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6bc65c1648fe6b5f323094cf2b2dcc9dbbac361
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: labsdb: add missing CNAMEs for centralauth and meta

2017-12-23 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400088 )

Change subject: labsdb: add missing CNAMEs for centralauth and meta
..

labsdb: add missing CNAMEs for centralauth and meta

These databases live on the s7 slice, but are not represented in the
dblist files on noc.

Bug: T183651
Change-Id: I9d10ae22236ce7ea32aa637255caf4eac1dc9fd9
---
M modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone 
b/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
index bd12c1a..ce37faa 100644
--- a/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
+++ b/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
@@ -935,3 +935,6 @@
 rowiki 1H  IN  CNAME   s7.analytics.db.svc.eqiad.wmflabs.
 ukwiki 1H  IN  CNAME   s7.analytics.db.svc.eqiad.wmflabs.
 viwiki 1H  IN  CNAME   s7.analytics.db.svc.eqiad.wmflabs.
+centralauth1H  IN  CNAME   s7.analytics.db.svc.eqiad.wmflabs.
+meta   1H  IN  CNAME   s7.analytics.db.svc.eqiad.wmflabs.
+

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: kafka: Use custom apt repo

2017-12-23 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400085 )

Change subject: kafka: Use custom apt repo
..

kafka: Use custom apt repo

Bug: T183306
Change-Id: Ic6b4b09901176b20c9a1b31ff13c4aa98f3091ce
---
M puppet/modules/kafka/manifests/init.pp
A puppet/modules/kafka/manifests/repository.pp
2 files changed, 18 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/85/400085/1

diff --git a/puppet/modules/kafka/manifests/init.pp 
b/puppet/modules/kafka/manifests/init.pp
index 422fca5..c7e48d7 100644
--- a/puppet/modules/kafka/manifests/init.pp
+++ b/puppet/modules/kafka/manifests/init.pp
@@ -3,10 +3,12 @@
 class kafka {
 require ::service
 require ::mediawiki::ready_service
+require ::kafka::repository
 
+$kafka_package = 'confluent-kafka-2.11'
 require_package('openjdk-8-jdk')
 require_package('zookeeperd')
-require_package('confluent-kafka-2.11.7')
+require_package($kafka_package)
 require_package('kafkacat')
 
 $logdir = '/var/log/kafka'
@@ -14,7 +16,7 @@
 group { 'kafka':
 ensure  => 'present',
 system  => true,
-require => Package['confluent-kafka-2.11.7'],
+require => Package[$kafka_package],
 }
 # Kafka system user
 user { 'kafka':
@@ -44,14 +46,14 @@
 ensure  => 'present',
 source  => 'puppet:///modules/kafka/server.properties',
 mode=> '0444',
-require => Package['confluent-kafka-2.11.7'],
+require => Package[$kafka_package],
 }
 
 file { '/etc/kafka/log4j.properties':
   ensure  => 'present',
   content => template('kafka/log4j.properties.erb'),
   mode=> '0444',
-  require => Package['confluent-kafka-2.11.7'],
+  require => Package[$kafka_package],
 }
 
 file { [$logdir, '/var/lib/kafka']:
@@ -59,7 +61,7 @@
 owner   => 'kafka',
 group   => 'kafka',
 mode=> '0755',
-require => Package['confluent-kafka-2.11.7'],
+require => Package[$kafka_package],
 }
 
 service { 'zookeeper':
@@ -74,7 +76,7 @@
 require   => [
 User['kafka'],
 Service['zookeeper'],
-Package['confluent-kafka-2.11.7'],
+Package[$kafka_package],
 ],
 subscribe => [
 File['/etc/kafka/server.properties'],
diff --git a/puppet/modules/kafka/manifests/repository.pp 
b/puppet/modules/kafka/manifests/repository.pp
new file mode 100644
index 000..2ebb0c5
--- /dev/null
+++ b/puppet/modules/kafka/manifests/repository.pp
@@ -0,0 +1,10 @@
+# == Class: Kafka::Repository
+#
+# Configure an apt repository to fetch confluent packages from.
+class kafka::repository {
+apt::repository { 'thirdparty-confluent':
+uri=> 'http://apt.wikimedia.org/wikimedia',
+dist   => "${::lsbdistcodename}-wikimedia",
+components => 'thirdparty/confluent',
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6b4b09901176b20c9a1b31ff13c4aa98f3091ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: motd: Remove double motd display

2017-12-22 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399857 )

Change subject: motd: Remove double motd display
..

motd: Remove double motd display

Debian Stretch includes a pam_motd module which automatically runs
scripts from /etc/update-motd.d to update the motd on login. This allows
us to remove the script that we had to do this during the Puppet run.

Change-Id: Ie7ff5cc01230553c33f120280dd92180307a2ccc
---
M puppet/modules/motd/manifests/init.pp
M puppet/modules/motd/manifests/script.pp
2 files changed, 0 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/57/399857/1

diff --git a/puppet/modules/motd/manifests/init.pp 
b/puppet/modules/motd/manifests/init.pp
index 7fd9109..a6dc62d 100644
--- a/puppet/modules/motd/manifests/init.pp
+++ b/puppet/modules/motd/manifests/init.pp
@@ -8,11 +8,5 @@
 recurse => true,
 ignore  => '9*',
 purge   => true,
-notify  => Exec['update_motd'],
-}
-
-exec { 'update_motd':
-command => '/bin/run-parts --lsbsysinit /etc/update-motd.d > 
/etc/motd',
-refreshonly => true,
 }
 }
diff --git a/puppet/modules/motd/manifests/script.pp 
b/puppet/modules/motd/manifests/script.pp
index fd76142..4856206 100644
--- a/puppet/modules/motd/manifests/script.pp
+++ b/puppet/modules/motd/manifests/script.pp
@@ -48,6 +48,5 @@
 mode=> '0555',
 content => $content,
 source  => $source,
-notify  => Exec['update_motd'],
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie7ff5cc01230553c33f120280dd92180307a2ccc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: elasticsearch: Use custom apt repo

2017-12-21 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399773 )

Change subject: elasticsearch: Use custom apt repo
..

elasticsearch: Use custom apt repo

Bug: T183305
Bug: T183071
Change-Id: I72f3237d8a054df5b64bb8f1a727bfbd37074bcc
---
M puppet/modules/elasticsearch/manifests/init.pp
A puppet/modules/elasticsearch/manifests/repository.pp
M puppet/modules/role/manifests/cirrussearch.pp
3 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/73/399773/1

diff --git a/puppet/modules/elasticsearch/manifests/init.pp 
b/puppet/modules/elasticsearch/manifests/init.pp
index 3525d9a..e11bcd4 100644
--- a/puppet/modules/elasticsearch/manifests/init.pp
+++ b/puppet/modules/elasticsearch/manifests/init.pp
@@ -4,6 +4,8 @@
 # engine, much like Solr, but with a more user-friendly inteface.
 #
 class elasticsearch {
+require ::elasticsearch::repository
+
 require_package('openjdk-8-jre-headless')
 
 package { 'elasticsearch':
diff --git a/puppet/modules/elasticsearch/manifests/repository.pp 
b/puppet/modules/elasticsearch/manifests/repository.pp
new file mode 100644
index 000..610e49f
--- /dev/null
+++ b/puppet/modules/elasticsearch/manifests/repository.pp
@@ -0,0 +1,10 @@
+# == Class: Elasticsearch::Repository
+#
+# Configure an atp repository to fetch elasticsearch packages from.
+class elasticsearch::repository {
+apt::repository { 'wikimedia-elastic':
+uri=> 'http://apt.wikimedia.org/wikimedia',
+dist   => "${::lsbdistcodename}-wikimedia",
+components => 'component/elastic55 thirdparty/elastic55',
+}
+}
diff --git a/puppet/modules/role/manifests/cirrussearch.pp 
b/puppet/modules/role/manifests/cirrussearch.pp
index b56c510..3b1d2d3 100644
--- a/puppet/modules/role/manifests/cirrussearch.pp
+++ b/puppet/modules/role/manifests/cirrussearch.pp
@@ -17,13 +17,6 @@
 # necessary for CirrusSearch.php.erb to point to service root dir
 include ::service
 
-apt::repository { 'wikimedia-elastic':
-uri=> 'http://apt.wikimedia.org/wikimedia',
-dist   => "${::lsbdistcodename}-wikimedia",
-components => 'component/elastic55 thirdparty/elastic55',
-#before => Class['::elasticsearch'],
-}
-
 # Elasticsearch plugins (for search)
 package { 'wmf-elasticsearch-search-plugins':
 ensure => latest,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72f3237d8a054df5b64bb8f1a727bfbd37074bcc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: aptly: Update published repo distributions

2017-12-21 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399667 )

Change subject: aptly: Update published repo distributions
..

aptly: Update published repo distributions

* Precise is no longer available in Cloud VPS
* Stretch is now available in Cloud VPS

Bug: T183235
Change-Id: Id3551fbfe554fcb22ad6dbf3f56b7ffdfd0a8dcb
---
M modules/role/manifests/aptly/server.pp
1 file changed, 5 insertions(+), 5 deletions(-)


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

diff --git a/modules/role/manifests/aptly/server.pp 
b/modules/role/manifests/aptly/server.pp
index 194b3e2..b4c1af0 100644
--- a/modules/role/manifests/aptly/server.pp
+++ b/modules/role/manifests/aptly/server.pp
@@ -6,11 +6,7 @@
 class role::aptly::server {
 include ::aptly
 
-# Auto setup published repositories for all 3 available distros
-aptly::repo { "precise-${::labsproject}":
-publish  => true,
-}
-
+# Auto setup published repositories for all available distros
 aptly::repo { "trusty-${::labsproject}":
 publish  => true,
 }
@@ -19,6 +15,10 @@
 publish  => true,
 }
 
+aptly::repo { "stretch-${::labsproject}":
+publish  => true,
+}
+
 ferm::service { 'aptly':
 proto  => 'tcp',
 port   => '80',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: mariadb: setup unix_socket auth for vagrant user

2017-12-20 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399565 )

Change subject: mariadb: setup unix_socket auth for vagrant user
..

mariadb: setup unix_socket auth for vagrant user

Modern MariaDB packages setup unix_socket based auth for the root user
rather than password auth. Rather than undoing this protection by
switching the root account back to password auth, we will setup an `ALL
PRIVILEGES` grant for the vagrant shell user as well.

Bug: T181918
Change-Id: I299e05071efe919ad5c27e45519f4fe50f597f6d
---
M puppet/modules/mediawiki/manifests/init.pp
M puppet/modules/mysql/manifests/init.pp
M puppet/modules/mysql/manifests/sql.pp
M puppet/modules/mysql/manifests/user.pp
M puppet/modules/mysql/templates/my.cnf.erb
M puppet/modules/role/manifests/oozie.pp
6 files changed, 20 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/65/399565/1

diff --git a/puppet/modules/mediawiki/manifests/init.pp 
b/puppet/modules/mediawiki/manifests/init.pp
index 3bb641c..14eed0f 100644
--- a/puppet/modules/mediawiki/manifests/init.pp
+++ b/puppet/modules/mediawiki/manifests/init.pp
@@ -129,7 +129,6 @@
 server_url   => $server_url,
 primary_wiki => true,
 require  => [
-Exec['set_mysql_password'],
 Git::Clone['mediawiki/core'],
 Php::Composer::Install[$dir],
 ],
diff --git a/puppet/modules/mysql/manifests/init.pp 
b/puppet/modules/mysql/manifests/init.pp
index f503c34..113ce1f 100644
--- a/puppet/modules/mysql/manifests/init.pp
+++ b/puppet/modules/mysql/manifests/init.pp
@@ -5,9 +5,6 @@
 #
 # === Parameters
 #
-# [*root_password*]
-#   Password for the root MySQL account (default: 'vagrant').
-#
 # [*default_db_name*]
 #   If defined, the 'mysql' command-line client will be configured to
 #   use this database by default (default: undefined).
@@ -18,12 +15,10 @@
 # === Examples
 #
 #  class { 'mysql':
-#  root_password   => 'r00tp455w0rd',
 #  default_db_name => 'wiki',
 #  }
 #
 class mysql(
-$root_password = 'vagrant',
 $default_db_name = undef,
 $grant_host_name = undef,
 ) {
@@ -36,12 +31,14 @@
 require=> Package['mysql-server'],
 }
 
-exec { 'set_mysql_password':
-command => "/usr/bin/mysqladmin -u root password \"${root_password}\"",
-unless  => "/usr/bin/mysqladmin -u root -p\"${root_password}\" status",
-require => Service['mysql'],
+# Setup password free auth for VM's vagrant user
+mysql::user { 'vagrant':
+ensure   => present,
+password => 'ignored',
+grant=> 'ALL PRIVILEGES ON *.*',
+hostname => 'localhost',
+socket   => true,
 }
-
 file { '/home/vagrant/.my.cnf':
 ensure  => file,
 owner   => 'vagrant',
diff --git a/puppet/modules/mysql/manifests/sql.pp 
b/puppet/modules/mysql/manifests/sql.pp
index 19040ab..fae6094 100644
--- a/puppet/modules/mysql/manifests/sql.pp
+++ b/puppet/modules/mysql/manifests/sql.pp
@@ -34,8 +34,7 @@
 $quoted_unless = regsubst($unless, '"', '\\"', 'G')
 
 exec { $title:
-command => "/usr/bin/mysql -uroot -p${mysql::root_password} -qfsAe 
\"${quoted_sql}\"",
-unless  => "/usr/bin/mysql -uroot -p${mysql::root_password} -qfsANe 
\"${quoted_unless}\" | /usr/bin/tail -1 | /bin/grep -q 1",
-require => Exec['set_mysql_password'],
+command => "/usr/bin/mysql -qfsAe \"${quoted_sql}\"",
+unless  => "/usr/bin/mysql -qfsANe \"${quoted_unless}\" | 
/usr/bin/tail -1 | /bin/grep -q 1",
 }
 }
diff --git a/puppet/modules/mysql/manifests/user.pp 
b/puppet/modules/mysql/manifests/user.pp
index f0f98b3..9c69e2a 100644
--- a/puppet/modules/mysql/manifests/user.pp
+++ b/puppet/modules/mysql/manifests/user.pp
@@ -26,6 +26,11 @@
 #   Defaults to 'usage on *.*'. This allows combining user account
 #   creation with a database permission grant.
 #
+# [*socket*]
+#   Use unix_socket auth rather than a password to identify the user. When
+#   enabled the $password supplied will be ignored.
+#   Defaults to false.
+#
 # === Examples
 #
 # Creates an 'wikiadmin' user with full privileges on 'wiki':
@@ -41,6 +46,7 @@
 $username = $title,
 $grant= 'usage on *.*',
 $hostname = $::mysql::grant_host_name,
+$socket   = false,
 ) {
 if $ensure == 'absent' {
 $command = 'drop'
@@ -55,8 +61,12 @@
 unless => "select not exists(select 1 from mysql.user where user = 
'${username}')",
 }
 } else {
+$ident = $socket ? {
+true=> 'IDENTIFIED VIA unix_socket',
+default => "IDENTIFIED BY '${password}'",
+}
 mysql::sql { "create user ${username}":
-sql=> "grant ${grant} to '${username}'@'${hostname}' 
identified by '${password}'",
+sql=> "grant ${grant} to 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: bigbrother: rate limit emails

2017-12-19 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399338 )

Change subject: bigbrother: rate limit emails
..

bigbrother: rate limit emails

Add rate limiting so that bigbrother will send at most 1 email every
5 minutes and 5 emails per hour to maintainers of tools. Every error
message will still be written to the $HOME/bigbrother.log file.

Change-Id: I39aa1da4ac897d1477874dfd246f77e992c86668
---
M modules/toollabs/files/bigbrother.py
1 file changed, 34 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/38/399338/1

diff --git a/modules/toollabs/files/bigbrother.py 
b/modules/toollabs/files/bigbrother.py
index f296e2e..b8002fd 100755
--- a/modules/toollabs/files/bigbrother.py
+++ b/modules/toollabs/files/bigbrother.py
@@ -59,13 +59,33 @@
 with open(self.watchdb[tool]['logfile'], 'a') as log:
 print(event, file=log)
 
-email = MIMEText(event)
-email['Subject'] = '[bigbrother] %s: %s' % (etype, msg)
-email['To'] = '%s maintainers <%s>' % (tool, tool)
-email['From'] = 'Bigbrother <%s>' % tool
-mta = smtplib.SMTP('localhost')
-mta.sendmail(tool, [tool], email.as_string())
-mta.quit()
+if _email_allowed(tool):
+email = MIMEText(event)
+email['Subject'] = '[bigbrother] %s: %s' % (etype, msg)
+email['To'] = '%s maintainers <%s>' % (tool, tool)
+email['From'] = 'Bigbrother <%s>' % tool
+mta = smtplib.SMTP('localhost')
+mta.sendmail(tool, [tool], email.as_string())
+mta.quit()
+
+def _email_allowed(self, tool):
+"""Limit emails sent to 1 per 5 minutes & 5 per hour"""
+if not emails in self.watchdb[tool]:
+self.watchdb[tool]['emails'] = []
+
+sent = self.watchdb[tool]['emails']
+now = time.time()
+limit_minute = now - 300
+if sum(e < limit_minute for e in sent) >= 1:
+return False
+
+limit_max = now - 3600
+if sum(e < limit_max for e in sent) >= 5:
+return False
+
+self.watchdb[tool]['emails'] = [e for e in sent if e < limit_max]
+self.watchdb[tool]['emails'].append(now)
+return True
 
 def read_config(self, tool):
 now = time.time()
@@ -82,6 +102,7 @@
 'logfile': '%s/bigbrother.log' % pwnam.pw_dir,
 'mtime': 0,
 'refresh': now,
+'emails': [],
 }
 
 if now < self.watchdb[tool]['refresh']:
@@ -122,16 +143,18 @@
 cmd.extend(shlex.split(job_name))
 cmd.extend(shlex.split(m.group(2)))
 except ValueError as e:
-self.log_event(tool, 'error',
-   '%s:%d: invalid command: %s' % (rcfile, 
i + 1, str(e)))
+self.log_event(
+tool, 'error',
+'%s:%d: invalid command: %s' % (
+rcfile, i + 1, str(e)))
+continue
 
 else:
-# FIXME: throttle email sends! This will spam the heck out
-# of anyone who has bad commands in their .bigbrotherrc
 self.log_event(
 tool, 'error',
 '%s:%d: command not supported' % (rcfile, i + 1))
 continue
+
 if job_name in jobs:
 self.log_event(
 tool, 'warn',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: jobcron: fix variable scope resolution

2017-12-17 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398781 )

Change subject: jobcron: fix variable scope resolution
..

jobcron: fix variable scope resolution

The @dir variable is not being looked up correctly under Puppet4. Using
the `scope` resolution operator and the absolute variable name seems to
work correctly.

Change-Id: Ic5abb5d05daa789199ef538528747db7a9b24fcd
---
M puppet/modules/mediawiki/templates/systemd/jobchron.erb
M puppet/modules/mediawiki/templates/systemd/jobrunner.erb
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/81/398781/1

diff --git a/puppet/modules/mediawiki/templates/systemd/jobchron.erb 
b/puppet/modules/mediawiki/templates/systemd/jobchron.erb
index ba1f0df..f1de5dc 100644
--- a/puppet/modules/mediawiki/templates/systemd/jobchron.erb
+++ b/puppet/modules/mediawiki/templates/systemd/jobchron.erb
@@ -8,7 +8,7 @@
 User=www-data
 Group=www-data
 SyslogIdentifier=jobchron
-ExecStart=/usr/bin/php7.0 <%= @dir %>/redisJobChronService 
--config-file=/etc/jobrunner.json ${DAEMON_OPTS}
+ExecStart=/usr/bin/php7.0 <%= scope['::mediawiki::jobrunner::dir'] 
%>/redisJobChronService --config-file=/etc/jobrunner.json ${DAEMON_OPTS}
 Restart=always
 
 [Install]
diff --git a/puppet/modules/mediawiki/templates/systemd/jobrunner.erb 
b/puppet/modules/mediawiki/templates/systemd/jobrunner.erb
index 2e2c4b2..698d3f2 100644
--- a/puppet/modules/mediawiki/templates/systemd/jobrunner.erb
+++ b/puppet/modules/mediawiki/templates/systemd/jobrunner.erb
@@ -8,7 +8,7 @@
 User=www-data
 Group=www-data
 SyslogIdentifier=jobrunner
-ExecStart=/usr/bin/php7.0 <%= @dir %>/redisJobRunnerService 
--config-file=/etc/jobrunner.json ${DAEMON_OPTS}
+ExecStart=/usr/bin/php7.0 <%= scope['::mediawiki::jobrunner::dir'] 
%>/redisJobRunnerService --config-file=/etc/jobrunner.json ${DAEMON_OPTS}
 Restart=always
 
 [Install]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic5abb5d05daa789199ef538528747db7a9b24fcd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: bash-completion: Fix for modern deploys

2017-12-17 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398709 )

Change subject: bash-completion: Fix for modern deploys
..

bash-completion: Fix for modern deploys

Change-Id: Ibe0bc3c463ad601ba361584b2e29d98893b3264b
---
M lib/mediawiki-vagrant/settings/definitions.rb
1 file changed, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/09/398709/1

diff --git a/lib/mediawiki-vagrant/settings/definitions.rb 
b/lib/mediawiki-vagrant/settings/definitions.rb
index db8a2a7..687d33c 100644
--- a/lib/mediawiki-vagrant/settings/definitions.rb
+++ b/lib/mediawiki-vagrant/settings/definitions.rb
@@ -1,5 +1,19 @@
 require 'mediawiki-vagrant/settings'
-require 'vagrant/util'
+begin
+  require 'vagrant/util'
+rescue LoadError
+  # This stub module keeps settings :nfs_shares from blowing up when loaded
+  # outside of Vagrant (e.g. the bash-completion helper script)
+  module Vagrant
+module Util
+  class Platform
+def self.platform
+  RUBY_PLATFORM
+end
+  end
+end
+  end
+end
 
 module MediaWikiVagrant
   Settings.define do

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe0bc3c463ad601ba361584b2e29d98893b3264b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
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/vagrant[stretch-migration]: [WIP] Make PHP7 the default runtime

2017-12-17 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398707 )

Change subject: [WIP] Make PHP7 the default runtime
..

[WIP] Make PHP7 the default runtime

Move HHVM runtime to a role and make PHP7 the default runtime for the
wikis.

Bug: T181915
Change-Id: Ib1f2473597ecdaf48eb830aafd2606f271e26b48
---
M puppet/hieradata/common.yaml
M puppet/modules/hhvm/manifests/init.pp
M puppet/modules/mediawiki/manifests/apache.pp
M puppet/modules/mediawiki/manifests/init.pp
M puppet/modules/mediawiki/manifests/mwrepl.pp
M puppet/modules/mediawiki/manifests/ready_service.pp
M puppet/modules/mediawiki/templates/mediawiki-apache-site.erb
D puppet/modules/mediawiki/templates/mediawiki-php7-site.erb
M puppet/modules/mediawiki/templates/mwrepl/mwrepl.erb
M puppet/modules/mediawiki/templates/systemd/jobchron.erb
M puppet/modules/mediawiki/templates/systemd/jobrunner.erb
M puppet/modules/php/manifests/composer.pp
A puppet/modules/role/manifests/hhvm.pp
M puppet/modules/role/manifests/scribunto.pp
D puppet/modules/role/manifests/zend.pp
15 files changed, 21 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/07/398707/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 3eb1b97..d0640d8 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -225,7 +225,6 @@
 mediawiki::branch: master
 
 mediawiki::apache::docroot: "%{hiera('apache::docroot')}"
-mediawiki::apache::php7_site_name: "php7%{hiera('mwv::tld')}"
 
 mediawiki::jobrunner::enable: true
 mediawiki::jobrunner::dir: "%{hiera('mwv::services_dir')}/jobrunner"
diff --git a/puppet/modules/hhvm/manifests/init.pp 
b/puppet/modules/hhvm/manifests/init.pp
index 52846ec..403c74a 100644
--- a/puppet/modules/hhvm/manifests/init.pp
+++ b/puppet/modules/hhvm/manifests/init.pp
@@ -63,12 +63,6 @@
 require => Package['hhvm'],
 }
 
-env::alternative { 'hhvm_as_default_php':
-alternative => 'php',
-target  => '/usr/bin/hhvm',
-priority=> 20,
-}
-
 file { '/etc/hhvm':
 ensure => directory,
 owner  => 'root',
@@ -82,7 +76,6 @@
 group   => 'root',
 mode=> '0444',
 content => php_ini($common_settings),
-before  => Env::Alternative['hhvm_as_default_php'],
 }
 
 file { '/etc/hhvm/server.ini':
@@ -121,7 +114,6 @@
 owner  => 'www-data',
 group  => 'www-data',
 mode   => '0666',
-before => Env::Alternative['hhvm_as_default_php'],
 }
 
 file { $fcgi_settings['hhvm']['repo']['central']['path']:
diff --git a/puppet/modules/mediawiki/manifests/apache.pp 
b/puppet/modules/mediawiki/manifests/apache.pp
index ad698b0..fa71bca 100644
--- a/puppet/modules/mediawiki/manifests/apache.pp
+++ b/puppet/modules/mediawiki/manifests/apache.pp
@@ -7,12 +7,8 @@
 # [*docroot*]
 #   Document root for Apache vhost serving MediaWiki.
 #
-# [*php7_site_name*]
-#   Hostname for php7 runtime Apache vhost
-#
 class mediawiki::apache(
 $docroot,
-$php7_site_name,
 ) {
 include ::mediawiki
 include ::mediawiki::multiwiki
@@ -35,15 +31,6 @@
 Class['::apache::mod::alias'],
 Class['::apache::mod::rewrite'],
 Class['::apache::mod::proxy_fcgi'],
-],
-}
-
-apache::site { "php7-${mediawiki::wiki_name}":
-ensure  => present,
-content => template('mediawiki/mediawiki-php7-site.erb'),
-require => [
-Class['::apache::mod::alias'],
-Class['::apache::mod::rewrite'],
 ],
 }
 
diff --git a/puppet/modules/mediawiki/manifests/init.pp 
b/puppet/modules/mediawiki/manifests/init.pp
index 2dea2a3..3bb641c 100644
--- a/puppet/modules/mediawiki/manifests/init.pp
+++ b/puppet/modules/mediawiki/manifests/init.pp
@@ -69,8 +69,6 @@
 
 include ::mwv
 require ::php
-require ::hhvm
-include ::hhvm::fcgi
 
 require ::service
 
diff --git a/puppet/modules/mediawiki/manifests/mwrepl.pp 
b/puppet/modules/mediawiki/manifests/mwrepl.pp
index 8881a2a..caf416b 100644
--- a/puppet/modules/mediawiki/manifests/mwrepl.pp
+++ b/puppet/modules/mediawiki/manifests/mwrepl.pp
@@ -21,10 +21,4 @@
 group   => 'root',
 mode=> '0555',
 }
-
-# Backwards compatibility
-file { '/usr/local/bin/hhvmsh':
-ensure => 'link',
-target => '/usr/local/bin/mwrepl',
-}
 }
diff --git a/puppet/modules/mediawiki/manifests/ready_service.pp 
b/puppet/modules/mediawiki/manifests/ready_service.pp
index af64928..74bdcfd 100644
--- a/puppet/modules/mediawiki/manifests/ready_service.pp
+++ b/puppet/modules/mediawiki/manifests/ready_service.pp
@@ -16,7 +16,6 @@
 #
 class mediawiki::ready_service {
 include ::mediawiki
-include ::hhvm::fcgi
 
 file { '/usr/local/bin/wait-for-mediawiki.sh':
 ensure  => 'present',
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: bash-completion: Fix for modern deploys

2017-12-17 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398706 )

Change subject: bash-completion: Fix for modern deploys
..

bash-completion: Fix for modern deploys

Change-Id: Ibe0bc3c463ad601ba361584b2e29d98893b3264b
---
M lib/mediawiki-vagrant/settings/definitions.rb
1 file changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/06/398706/1

diff --git a/lib/mediawiki-vagrant/settings/definitions.rb 
b/lib/mediawiki-vagrant/settings/definitions.rb
index db8a2a7..6228ec4 100644
--- a/lib/mediawiki-vagrant/settings/definitions.rb
+++ b/lib/mediawiki-vagrant/settings/definitions.rb
@@ -1,5 +1,18 @@
 require 'mediawiki-vagrant/settings'
-require 'vagrant/util'
+begin
+require 'vagrant/util'
+rescue LoadError
+# Hack for bash-completion usage
+module Vagrant
+module Util
+class Platform
+def self.platform
+return RUBY_PLATFORM
+end
+end
+end
+end
+end
 
 module MediaWikiVagrant
   Settings.define do

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe0bc3c463ad601ba361584b2e29d98893b3264b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: horizon: Update logos and file naming

2017-12-15 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398605 )

Change subject: horizon: Update logos and file naming
..

horizon: Update logos and file naming

* Change the brand image used in the Horizon navbar to read "Wikimedia
  Cloud Services" rather than "Wikimedia Labs".
* Rename Puppet source files away from the old "labs" brand.

Bug: T168480
Change-Id: Ib85ce64a830c5ebfdb1da298ece3d4190f8f5930
---
A modules/openstack/files/horizon/125px-Cloud_VPS_dashboard_logo.png
R modules/openstack/files/horizon/180px-Cloud_VPS_dashboard_splash.png
D modules/openstack/files/horizon/216px-Wikimedia_labs_dashboard_logo.png
R modules/openstack/files/horizon/Cloud_VPS.ico
M modules/openstack/manifests/horizon/service.pp
5 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/05/398605/1

diff --git a/modules/openstack/files/horizon/125px-Cloud_VPS_dashboard_logo.png 
b/modules/openstack/files/horizon/125px-Cloud_VPS_dashboard_logo.png
new file mode 100644
index 000..3cac968
--- /dev/null
+++ b/modules/openstack/files/horizon/125px-Cloud_VPS_dashboard_logo.png
Binary files differ
diff --git 
a/modules/openstack/files/horizon/180px-Wikimedia_labs_dashboard_splash.png 
b/modules/openstack/files/horizon/180px-Cloud_VPS_dashboard_splash.png
similarity index 100%
rename from 
modules/openstack/files/horizon/180px-Wikimedia_labs_dashboard_splash.png
rename to modules/openstack/files/horizon/180px-Cloud_VPS_dashboard_splash.png
Binary files differ
diff --git 
a/modules/openstack/files/horizon/216px-Wikimedia_labs_dashboard_logo.png 
b/modules/openstack/files/horizon/216px-Wikimedia_labs_dashboard_logo.png
deleted file mode 100644
index 8125f16..000
--- a/modules/openstack/files/horizon/216px-Wikimedia_labs_dashboard_logo.png
+++ /dev/null
Binary files differ
diff --git a/modules/openstack/files/horizon/Wikimedia_labs.ico 
b/modules/openstack/files/horizon/Cloud_VPS.ico
similarity index 100%
rename from modules/openstack/files/horizon/Wikimedia_labs.ico
rename to modules/openstack/files/horizon/Cloud_VPS.ico
Binary files differ
diff --git a/modules/openstack/manifests/horizon/service.pp 
b/modules/openstack/manifests/horizon/service.pp
index 91241d9..a85a21d 100644
--- a/modules/openstack/manifests/horizon/service.pp
+++ b/modules/openstack/manifests/horizon/service.pp
@@ -107,7 +107,7 @@
 }
 
 file { 
'/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/img/logo.png':
-source  => 
'puppet:///modules/openstack/horizon/216px-Wikimedia_labs_dashboard_logo.png',
+source  => 
'puppet:///modules/openstack/horizon/125px-Cloud_VPS_dashboard_logo.png',
 owner   => 'horizon',
 group   => 'horizon',
 mode=> '0444',
@@ -115,7 +115,7 @@
 }
 
 file { 
'/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/img/logo-splash.png':
-source  => 
'puppet:///modules/openstack/horizon/180px-Wikimedia_labs_dashboard_splash.png',
+source  => 
'puppet:///modules/openstack/horizon/180px-Cloud_VPS_dashboard_splash.png',
 owner   => 'horizon',
 group   => 'horizon',
 mode=> '0444',
@@ -123,7 +123,7 @@
 }
 
 file { 
'/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/img/favicon.ico':
-source  => 'puppet:///modules/openstack/horizon/Wikimedia_labs.ico',
+source  => 'puppet:///modules/openstack/horizon/Cloud_VPS.ico',
 owner   => 'horizon',
 group   => 'horizon',
 mode=> '0444',

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wiki replicas: point *.labsdb to *.analytics.db.svc.eqiad.wm...

2017-12-15 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398551 )

Change subject: wiki replicas: point *.labsdb to 
*.analytics.db.svc.eqiad.wmflabs
..

wiki replicas: point *.labsdb to *.analytics.db.svc.eqiad.wmflabs

The legacy `*.labsdb` service names are in wide use for both web and
analytic workloads. Making this legacy set of names default to the
cluster designated for analytics will keep clients who have not switched
from penalizing the explicit web cluster users.

Bug: T142807
Change-Id: I937e8bf9a8a85ea0f6671260c24f9f5aa6c7af9e
---
M modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
1 file changed, 922 insertions(+), 922 deletions(-)


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

diff --git a/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone 
b/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
index 8b325a0..bd12c1a 100644
--- a/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
+++ b/modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
@@ -7,931 +7,931 @@
 
 tools  1H  IN  CNAME   tools.db.svc.eqiad.wmflabs.
 
-s1 1H  IN  CNAME   s1.web.db.svc.eqiad.wmflabs.
-enwiki 1H  IN  CNAME   s1.web.db.svc.eqiad.wmflabs.
+s1 1H  IN  CNAME   s1.analytics.db.svc.eqiad.wmflabs.
+enwiki 1H  IN  CNAME   s1.analytics.db.svc.eqiad.wmflabs.
 
-s2 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-bgwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-bgwiktionary   1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-cswiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-enwikiquote1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-enwiktionary   1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-eowiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-fiwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-idwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-itwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-nlwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-nowiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-plwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-ptwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-svwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-thwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-trwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
-zhwiki 1H  IN  CNAME   s2.web.db.svc.eqiad.wmflabs.
+s2 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+bgwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+bgwiktionary   1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+cswiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+enwikiquote1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+enwiktionary   1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+eowiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+fiwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+idwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+itwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+nlwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+nowiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+plwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+ptwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+svwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+thwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+trwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
+zhwiki 1H  IN  CNAME   s2.analytics.db.svc.eqiad.wmflabs.
 
-s3 1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-aawiki 1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-aawikibooks1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-aawiktionary   1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-abwiki 1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-abwiktionary   1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-acewiki1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-advisorywiki   1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-adywiki1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-afwiki 1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-afwikibooks1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-afwikiquote1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-afwiktionary   1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-akwiki 1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-akwikibooks1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-akwiktionary   1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.
-alswiki1H  IN  CNAME   s3.web.db.svc.eqiad.wmflabs.

[MediaWiki-commits] [Gerrit] operations/puppet[production]: labsdb: Point DNS at equivalent web.db.svc.eqiad.wmflabs hosts

2017-12-10 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397256 )

Change subject: labsdb: Point DNS at equivalent web.db.svc.eqiad.wmflabs hosts
..

labsdb: Point DNS at equivalent web.db.svc.eqiad.wmflabs hosts

Replace templated labsdb zone file with a static file that maps all
current wiki names from the wikimedia-config s*.dblist files as CNAMEs
of the appropriate s*.web.db.svc.eqiad.wmflabs service name.

Bug: T142807
Change-Id: Ib0351f0b8f12ef0476c8baf69153433722b8a182
---
D hieradata/common/profile/openstack/base/pdns/labsdb.yaml
A modules/profile/files/openstack/base/pdns/recursor/labsdb.zone
M modules/profile/manifests/openstack/base/pdns/recursor/service.pp
D modules/role/templates/labs/dns/db_aliases.erb
4 files changed, 934 insertions(+), 913 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/56/397256/1

diff --git a/hieradata/common/profile/openstack/base/pdns/labsdb.yaml 
b/hieradata/common/profile/openstack/base/pdns/labsdb.yaml
deleted file mode 100644
index fd17098..000
--- a/hieradata/common/profile/openstack/base/pdns/labsdb.yaml
+++ /dev/null
@@ -1,899 +0,0 @@
-# There are two old school replica servers (c1, c3 -- c2 is dead now).  The 
mapping of
-# "shards" (s1, etc.) and databases (enwiki, etc.) to these is
-# arbitrary in so much as all replicas have all the same data
-#  and can be adjusted to depool a server or redistribute load.
-
-profile::openstack::base::pdns::labsdb::c1:
-  - c1
-
-profile::openstack::base::pdns::labsdb::c2:
-  - c2
-
-profile::openstack::base::pdns::labsdb::c3:
-  - bgwiki
-  - bgwiktionary
-  - commonswiki
-  - cswiki
-  - enwiki
-  - enwikiquote
-  - enwiktionary
-  - eowiki
-  - fiwiki
-  - idwiki
-  - itwiki
-  - nlwiki
-  - nowiki
-  - plwiki
-  - ptwiki
-  - s1
-  - s2
-  - s4
-  - svwiki
-  - thwiki
-  - trwiki
-  - zhwiki
-  - aawiki
-  - aawikibooks
-  - aawiktionary
-  - abwiki
-  - abwiktionary
-  - acewiki
-  - advisorywiki
-  - adywiki
-  - afwiki
-  - afwikibooks
-  - afwikiquote
-  - afwiktionary
-  - akwiki
-  - akwikibooks
-  - akwiktionary
-  - alswiki
-  - alswikibooks
-  - alswikiquote
-  - alswiktionary
-  - amwiki
-  - amwikimedia
-  - amwikiquote
-  - amwiktionary
-  - angwiki
-  - angwikibooks
-  - angwikiquote
-  - angwikisource
-  - angwiktionary
-  - anwiki
-  - anwiktionary
-  - arcwiki
-  - arwiki
-  - arwikibooks
-  - arwikimedia
-  - arwikinews
-  - arwikiquote
-  - arwikisource
-  - arwikiversity
-  - arwiktionary
-  - arzwiki
-  - astwiki
-  - astwikibooks
-  - astwikiquote
-  - astwiktionary
-  - aswiki
-  - aswikibooks
-  - aswikisource
-  - aswiktionary
-  - atjwiki
-  - avwiki
-  - avwiktionary
-  - aywiki
-  - aywikibooks
-  - aywiktionary
-  - azbwiki
-  - azwiki
-  - azwikibooks
-  - azwikiquote
-  - azwikisource
-  - azwiktionary
-  - barwiki
-  - bat_smgwiki
-  - bawiki
-  - bawikibooks
-  - bclwiki
-  - bdwikimedia
-  - be_x_oldwiki
-  - betawikiversity
-  - bewiki
-  - bewikibooks
-  - bewikimedia
-  - bewikiquote
-  - bewikisource
-  - bewiktionary
-  - bgwikibooks
-  - bgwikinews
-  - bgwikiquote
-  - bgwikisource
-  - bhwiki
-  - bhwiktionary
-  - biwiki
-  - biwikibooks
-  - biwiktionary
-  - bjnwiki
-  - bmwiki
-  - bmwikibooks
-  - bmwikiquote
-  - bmwiktionary
-  - bnwiki
-  - bnwikibooks
-  - bnwikisource
-  - bnwiktionary
-  - bowiki
-  - bowikibooks
-  - bowiktionary
-  - bpywiki
-  - brwiki
-  - brwikimedia
-  - brwikiquote
-  - brwikisource
-  - brwiktionary
-  - bswiki
-  - bswikibooks
-  - bswikinews
-  - bswikiquote
-  - bswikisource
-  - bswiktionary
-  - bugwiki
-  - bxrwiki
-  - c3
-  - cawiki
-  - cawikibooks
-  - cawikimedia
-  - cawikinews
-  - cawikiquote
-  - cawikisource
-  - cawiktionary
-  - cbk_zamwiki
-  - cdowiki
-  - cebwiki
-  - centralauth
-  - cewiki
-  - chowiki
-  - chrwiki
-  - chrwiktionary
-  - chwiki
-  - chwikibooks
-  - chwiktionary
-  - chywiki
-  - ckbwiki
-  - cnwikimedia
-  - cowiki
-  - cowikibooks
-  - cowikimedia
-  - cowikiquote
-  - cowiktionary
-  - crhwiki
-  - crwiki
-  - crwikiquote
-  - crwiktionary
-  - csbwiki
-  - csbwiktionary
-  - cswikibooks
-  - cswikinews
-  - cswikiquote
-  - cswikisource
-  - cswikiversity
-  - cswiktionary
-  - cuwiki
-  - cvwiki
-  - cvwikibooks
-  - cywiki
-  - cywikibooks
-  - cywikiquote
-  - cywikisource
-  - cywiktionary
-  - dawiki
-  - dawikibooks
-  - dawikiquote
-  - dawikisource
-  - dawiktionary
-  - dewiki
-  - dewikibooks
-  - dewikinews
-  - dewikiquote
-  - dewikisource
-  - dewikiversity
-  - dewikivoyage
-  - dewiktionary
-  - diqwiki
-  - dkwikimedia
-  - donatewiki
-  - dsbwiki
-  - dtywiki
-  - dvwiki
-  - dvwiktionary
-  - dzwiki
-  - dzwiktionary
-  - eewiki
-  - elwiki
-  - elwikibooks
-  - elwikinews
-  - elwikiquote
-  - elwikisource
-  - elwikiversity
-  - elwikivoyage
-  - elwiktionary
-  - emlwiki
-  - enwikibooks
-  - enwikinews
-  - enwikisource
-  - enwikiversity

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Make README prettier

2017-12-06 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395925 )

Change subject: Make README prettier
..

Make README prettier

Make the README a bit nicer introduction to the functionality provided
by the plugin by converting to Markdown and adding some headings and
formatting.

Change-Id: I4b02a95c7b00b04c96915f6d94b3f715460f643c
---
D README
A README.md
2 files changed, 180 insertions(+), 144 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/tools/phan/SecurityCheckPlugin 
refs/changes/25/395925/1

diff --git a/README b/README
deleted file mode 100644
index 6b6a965..000
--- a/README
+++ /dev/null
@@ -1,144 +0,0 @@
-This is a plugin to Phan to try and detect security issues
-(such as XSS). It keeps track of any time a user can modify
-a variable, and checks to see that such variables are
-escaped before being output as html or used as an sql query, etc.
-
-It is primarily intended for scanning MediaWiki extensions,
-however it supports a generic mode which should work with
-any PHP project.
-
-This plugin should be considered beta quality. Generic mode isn't
-well tested yet.
-
-Requirements:
-* php >= 7.0
-* Phan 0.8.0 [This has not been tested on any other version of phan]
-* Lots of memory. Scanning MediaWiki seems to take about 3 minutes
-and use about 2 GB of memory. Running out of memory may be a real issue
-if you try and scan something from within a VM that has limited
-memory.
-
-== How to use ==
-=== via composer (recommended) ===
-[This doesn't actually work yet, as package not in packagist]
-
-* Run (from the root directory of your project)
-
-$ composer require --dev wikimedia/security-check-plugin
-
-* For mediawiki extension, add the following to composer.json
-
-"scripts": {
-   "seccheck": "seccheck-mwext"
-   "seccheck-fast": "seccheck-fast-mwext"
-},
-
-* For a generic php project add
-
-"scripts": {
-   "seccheck": "seccheck-generic"
-},
-
-* For mediawiki core add
-
-"scripts": {
-   "seccheck": "seccheck-mw"
-},
-
-You can then run:
-$ composer seccheck
-
-to run the security check. Note that false positives are disabled by default.
-For mediawiki extensions, this assumes the extension is installed in the normal
-extension directory, and thus MediaWiki is in ../../. If this is not the case,
-then you need to specify the MW_INSTALL_PATH environment variable.
-
-This plugin also provides variants seccheck-fast-mwext (Doesn't analyse 
mediawiki
-core. May miss some stuff related to hooks) and seccheck-slow-mwext (Also 
analyzes vendor). seccheck-mwext will generally take about 3 minutes, where 
seccheck-fast-mwext
-takes only about half a minute.
-
-Additionally, if you want to do a really quick check, you can run the 
seccheck-generic script from a mediawiki extension which will ignore all 
MediaWiki stuff,
-making the check much faster (but misses many issues).
-
-If you want to do custom configuration (to say exclude some directories), 
follow the instructions below unser Manually.
-=== Manually ===
-
-For MediaWiki mode, add MediaWikiSecurityCheckPlugin.php to the
-list of plugins in your phan config.php file.
-
-For generic mode, add GenericSecurityCheckPlugin.php to the list
-of plugins in your phan config.php file.
-
-Then run phan as you normally would:
-$ php7.0 /path/to/phan/phan -p
-
-== Using the plugin ==
-
-The plugin will output various issue types depending on what it
-detects. The issue types it outputs are:
-
-* SecurityCheckMulti - For when there are multiple types of security issues 
involved
-* SecurityCheck-XSS
-* SecurityCheck-SQLInjection
-* SecurityCheck-ShellInjection
-* SecurityCheck-PHPSerializeInjection - For when someone does unserialize( 
$_GET['d'] ); This issue type seems to have a high false positive rate 
currently.
-* SecurityCheck-CUSTOM1 - To allow people to have custom taint types
-* SecurityCheck-CUSTOM2 - ditto
-* SecurityCheck-OTHER - At the moment, this corresponds to things that don't 
have an escaping function to make input safe. e.g. eval( $_GET['foo'] ); 
require $_GET['bar'];
-* SecurityCheck-LikelyFalsePositive - A potential issue, but probably not. 
Mostly happens when the plugin gets confused.
-
-The severity field is usually marked as Issue::SEVERITY_NORMAL (5). False 
positives
-get Issue::SEVERITY_LOW (0). Issues that may result in server compromise
-(as opposed to just end user compromise) such as shell or sql injection are
-marked as Issue::SEVERITY_CRITICAL (10). SerializationInjection would normally
-be "critical" but its currently denoted as a severity of NORMAL because the 
check
-seems to have a high false positive rate at the moment.
-
-You can use the -y command line option of phan to filter by severity.
-
-=== Limitations ===
-There's much more than listed here, but some notable limitations/bugs:
-
-* When an issue is output, the plugin tries to include details about what
-line originally caused the 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: openjdk: Update to openjdk-8

2017-12-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394830 )

Change subject: openjdk: Update to openjdk-8
..

openjdk: Update to openjdk-8

Bug: T181353
Change-Id: I5bb3932fec5766be00ecf92dcaf1f725f7a5836b
---
M puppet/modules/cassandra/manifests/init.pp
M puppet/modules/kafka/manifests/init.pp
M puppet/modules/role/manifests/hadoop.pp
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/30/394830/1

diff --git a/puppet/modules/cassandra/manifests/init.pp 
b/puppet/modules/cassandra/manifests/init.pp
index ca1ca7f..1f372ae 100644
--- a/puppet/modules/cassandra/manifests/init.pp
+++ b/puppet/modules/cassandra/manifests/init.pp
@@ -53,7 +53,7 @@
 }
 
 # we use openjdk as the java distrib
-require_package('openjdk-7-jre-headless')
+require_package('openjdk-8-jre-headless')
 
 package { 'cassandra':
 ensure  => latest,
diff --git a/puppet/modules/kafka/manifests/init.pp 
b/puppet/modules/kafka/manifests/init.pp
index b97ecfe..422fca5 100644
--- a/puppet/modules/kafka/manifests/init.pp
+++ b/puppet/modules/kafka/manifests/init.pp
@@ -4,7 +4,7 @@
 require ::service
 require ::mediawiki::ready_service
 
-require_package('openjdk-7-jdk')
+require_package('openjdk-8-jdk')
 require_package('zookeeperd')
 require_package('confluent-kafka-2.11.7')
 require_package('kafkacat')
diff --git a/puppet/modules/role/manifests/hadoop.pp 
b/puppet/modules/role/manifests/hadoop.pp
index 8384d50..0f31614 100644
--- a/puppet/modules/role/manifests/hadoop.pp
+++ b/puppet/modules/role/manifests/hadoop.pp
@@ -2,7 +2,7 @@
 # Installs and runs all hadoop services.
 #
 class role::hadoop {
-require_package('openjdk-7-jdk')
+require_package('openjdk-8-jdk')
 
 $namenode_hosts   = [$::fqdn]
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bb3932fec5766be00ecf92dcaf1f725f7a5836b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Revert "Replace libmysqlclient-dev with default-libmysqlclie...

2017-12-02 Thread BryanDavis (Code Review)
Hello Dduvall, Gergő Tisza, jenkins-bot, Ejegg,

I'd like you to do a code review.  Please visit

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

to review the following change.


Change subject: Revert "Replace libmysqlclient-dev with 
default-libmysqlclient-dev"
..

Revert "Replace libmysqlclient-dev with default-libmysqlclient-dev"

This reverts commit f513150385f85ad10cdc427b6f55131a6ceda615.

Change-Id: I30207cd19b4a242dc409c7de6eb4c6254ec9509b
---
M puppet/modules/crm/manifests/tools.pp
M puppet/modules/eventlogging/manifests/init.pp
M puppet/modules/role/manifests/striker.pp
M puppet/modules/sentry/manifests/init.pp
4 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/28/394828/1

diff --git a/puppet/modules/crm/manifests/tools.pp 
b/puppet/modules/crm/manifests/tools.pp
index 17c7aab..6d70d79 100644
--- a/puppet/modules/crm/manifests/tools.pp
+++ b/puppet/modules/crm/manifests/tools.pp
@@ -15,7 +15,7 @@
 $audit_base = '/var/spool/audit'
 
 require_package(
-'default-libmysqlclient-dev',
+'libmysqlclient-dev',
 'libyaml-dev'
 )
 
@@ -50,7 +50,7 @@
 command => "pip install -r ${dir}/requirements.txt",
 require => [
 Git::Clone['wikimedia/fundraising/tools'],
-Package['default-libmysqlclient-dev'],
+Package['libmysqlclient-dev'],
 Package['libyaml-dev'],
 ],
 }
diff --git a/puppet/modules/eventlogging/manifests/init.pp 
b/puppet/modules/eventlogging/manifests/init.pp
index d205fbc..d04985e 100644
--- a/puppet/modules/eventlogging/manifests/init.pp
+++ b/puppet/modules/eventlogging/manifests/init.pp
@@ -15,7 +15,7 @@
 require => Git::Clone['eventlogging'],
 }
 
-require_package('default-libmysqlclient-dev')
+require_package('libmysqlclient-dev')
 require_package('librdkafka-dev')
 
 # Do the initial pip install into the virtualenv
@@ -25,7 +25,7 @@
 creates => 
"${path}/virtualenv/local/lib/python2.7/site-packages/eventlogging.egg-link",
 require => [
 Service::Gitupdate['eventlogging'],
-Package['default-libmysqlclient-dev'],
+Package['libmysqlclient-dev'],
 Package['librdkafka-dev']
 ],
 }
diff --git a/puppet/modules/role/manifests/striker.pp 
b/puppet/modules/role/manifests/striker.pp
index bc1965c..8fe839a 100644
--- a/puppet/modules/role/manifests/striker.pp
+++ b/puppet/modules/role/manifests/striker.pp
@@ -126,7 +126,7 @@
 require_package(
 'libffi-dev',
 'libldap2-dev',
-'default-libmysqlclient-dev',
+'libmysqlclient-dev',
 'libsasl2-dev',
 'libssl-dev',
 $python,
diff --git a/puppet/modules/sentry/manifests/init.pp 
b/puppet/modules/sentry/manifests/init.pp
index 882ce9a..fd85a72 100644
--- a/puppet/modules/sentry/manifests/init.pp
+++ b/puppet/modules/sentry/manifests/init.pp
@@ -69,7 +69,7 @@
 require ::virtualenv
 
 # 
http://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found
-require_package('default-libmysqlclient-dev')
+require_package('libmysqlclient-dev')
 # needed for building the python package lxml
 require_package('libxml2-dev', 'libxslt1-dev')
 # needed for building the python package cffi (?)
@@ -87,7 +87,7 @@
 'sentry[mysql]==7.7.0',
 'raven',
 ],
-require  => Package['default-libmysqlclient-dev'],
+require  => Package['libmysqlclient-dev'],
 timeout  => 600, # This can take a while
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I30207cd19b4a242dc409c7de6eb4c6254ec9509b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: xmp: Lower severity of XMP parse failure log events

2017-12-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394826 )

Change subject: xmp: Lower severity of XMP parse failure log events
..

xmp: Lower severity of XMP parse failure log events

Errors when parsing XMP information blocks broadly indicate that the
file is somehow malformed. This is generally a content issue rather than
an operational issue.

Bug: T118799
Change-Id: I3c7992343f28db75cd9ec0701c1eceebf6db2d08
---
M includes/libs/xmp/XMP.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/libs/xmp/XMP.php b/includes/libs/xmp/XMP.php
index 0cc1466..be823a8 100644
--- a/includes/libs/xmp/XMP.php
+++ b/includes/libs/xmp/XMP.php
@@ -370,7 +370,7 @@
$col = xml_get_current_column_number( 
$this->xmlParser );
$offset = xml_get_current_byte_index( 
$this->xmlParser );
 
-   $this->logger->warning(
+   $this->logger->info(
'{method} : Error reading XMP content: 
{error} ' .
'(line: {line} column: {column} byte 
offset: {offset})',
[

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: XMPReader: Log filename if available

2017-12-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394827 )

Change subject: XMPReader: Log filename if available
..

XMPReader: Log filename if available

Add a means to pass a filename into XMPReader and use it when creating
debug log events.

Bug: T118799
Change-Id: I68968d1ee12295d6f4a0a4356def562ead09d712
---
M includes/libs/xmp/XMP.php
M includes/media/BitmapMetadataHandler.php
2 files changed, 98 insertions(+), 31 deletions(-)


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

diff --git a/includes/libs/xmp/XMP.php b/includes/libs/xmp/XMP.php
index be823a8..931c085 100644
--- a/includes/libs/xmp/XMP.php
+++ b/includes/libs/xmp/XMP.php
@@ -130,10 +130,16 @@
private $logger;
 
/**
+* @var string
+*/
+   private $filename;
+
+   /**
 * Primary job is to initialize the XMLParser
 * @param LoggerInterface|null $logger
+* @param string $filename
 */
-   function __construct( LoggerInterface $logger = null ) {
+   function __construct( LoggerInterface $logger = null, $filename = 
'unknown' ) {
if ( !function_exists( 'xml_parser_create_ns' ) ) {
// this should already be checked by this point
throw new RuntimeException( 'XMP support requires XML 
Parser' );
@@ -143,6 +149,7 @@
} else {
$this->setLogger( new NullLogger() );
}
+   $this->filename = $filename;
 
$this->items = XMPInfo::getItems();
 
@@ -372,11 +379,13 @@
 
$this->logger->info(
'{method} : Error reading XMP content: 
{error} ' .
-   '(line: {line} column: {column} byte 
offset: {offset})',
+   '(file: {file}, line: {line} column: 
{column} ' .
+   'byte offset: {offset})',
[
'method' => __METHOD__,
'error_code' => $code,
'error' => $error,
+   'file' => $this->filename,
'line' => $line,
'column' => $col,
'offset' => $offset,
@@ -392,6 +401,7 @@
[
'method' => __METHOD__,
'exception' => $e,
+   'file' => $this->filename,
'content' => $content,
]
);
@@ -421,7 +431,11 @@
) {
$this->logger->info( __METHOD__ .
" Ignoring XMPExtended block due to wrong guid 
(guid= '{guid}')",
-   [ 'guid' => 'guid' ] );
+   [
+   'guid' => $guid,
+   'file' => $this->filename,
+   ]
+   );
 
return false;
}
@@ -433,7 +447,8 @@
$len['offset'] > $len['length']
) {
$this->logger->info(
-   __METHOD__ . 'Error reading extended XMP block, 
invalid length or offset.'
+   __METHOD__ . 'Error reading extended XMP block, 
invalid length or offset.',
+   [ 'file' => $this->filename ]
);
 
return false;
@@ -451,7 +466,9 @@
 
if ( $len['offset'] !== $this->extendedXMPOffset ) {
$this->logger->info( __METHOD__ . 'Ignoring XMPExtended 
block due to wrong order. (Offset was '
-   . $len['offset'] . ' but expected ' . 
$this->extendedXMPOffset . ')' );
+   . $len['offset'] . ' but expected ' . 
$this->extendedXMPOffset . ')',
+   [ 'file' => $this->filename ]
+   );
 
return false;
}
@@ -472,7 +489,10 @@
$atEnd = false;
}
 
-   $this->logger->debug( __METHOD__ . 'Parsing a XMPExtended 
block' );
+   $this->logger->debug(
+   __METHOD__ . 'Parsing a XMPExtended block',
+   [ 'file' => $this->filename ]
+   );
 
return 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Replace libmysqlclient-dev with default-libmysqlclient-dev

2017-12-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394823 )

Change subject: Replace libmysqlclient-dev with default-libmysqlclient-dev
..

Replace libmysqlclient-dev with default-libmysqlclient-dev

libmysqlclient-dev is only provided on jessie.
default-libmysqlclient-dev is provided on both jessie and stretch (and
resolves to libmysqlclient-dev or libmariadbclient-dev-compat).

Bug: T51652
Change-Id: I1a41a8bd56e612082ffafc651573e091ec836f75
(cherry picked from commit f513150385f85ad10cdc427b6f55131a6ceda615)
---
M puppet/modules/crm/manifests/tools.pp
M puppet/modules/eventlogging/manifests/init.pp
M puppet/modules/role/manifests/striker.pp
M puppet/modules/sentry/manifests/init.pp
4 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/23/394823/1

diff --git a/puppet/modules/crm/manifests/tools.pp 
b/puppet/modules/crm/manifests/tools.pp
index 6d70d79..17c7aab 100644
--- a/puppet/modules/crm/manifests/tools.pp
+++ b/puppet/modules/crm/manifests/tools.pp
@@ -15,7 +15,7 @@
 $audit_base = '/var/spool/audit'
 
 require_package(
-'libmysqlclient-dev',
+'default-libmysqlclient-dev',
 'libyaml-dev'
 )
 
@@ -50,7 +50,7 @@
 command => "pip install -r ${dir}/requirements.txt",
 require => [
 Git::Clone['wikimedia/fundraising/tools'],
-Package['libmysqlclient-dev'],
+Package['default-libmysqlclient-dev'],
 Package['libyaml-dev'],
 ],
 }
diff --git a/puppet/modules/eventlogging/manifests/init.pp 
b/puppet/modules/eventlogging/manifests/init.pp
index d04985e..d205fbc 100644
--- a/puppet/modules/eventlogging/manifests/init.pp
+++ b/puppet/modules/eventlogging/manifests/init.pp
@@ -15,7 +15,7 @@
 require => Git::Clone['eventlogging'],
 }
 
-require_package('libmysqlclient-dev')
+require_package('default-libmysqlclient-dev')
 require_package('librdkafka-dev')
 
 # Do the initial pip install into the virtualenv
@@ -25,7 +25,7 @@
 creates => 
"${path}/virtualenv/local/lib/python2.7/site-packages/eventlogging.egg-link",
 require => [
 Service::Gitupdate['eventlogging'],
-Package['libmysqlclient-dev'],
+Package['default-libmysqlclient-dev'],
 Package['librdkafka-dev']
 ],
 }
diff --git a/puppet/modules/role/manifests/striker.pp 
b/puppet/modules/role/manifests/striker.pp
index 8fe839a..bc1965c 100644
--- a/puppet/modules/role/manifests/striker.pp
+++ b/puppet/modules/role/manifests/striker.pp
@@ -126,7 +126,7 @@
 require_package(
 'libffi-dev',
 'libldap2-dev',
-'libmysqlclient-dev',
+'default-libmysqlclient-dev',
 'libsasl2-dev',
 'libssl-dev',
 $python,
diff --git a/puppet/modules/sentry/manifests/init.pp 
b/puppet/modules/sentry/manifests/init.pp
index fd85a72..882ce9a 100644
--- a/puppet/modules/sentry/manifests/init.pp
+++ b/puppet/modules/sentry/manifests/init.pp
@@ -69,7 +69,7 @@
 require ::virtualenv
 
 # 
http://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found
-require_package('libmysqlclient-dev')
+require_package('default-libmysqlclient-dev')
 # needed for building the python package lxml
 require_package('libxml2-dev', 'libxslt1-dev')
 # needed for building the python package cffi (?)
@@ -87,7 +87,7 @@
 'sentry[mysql]==7.7.0',
 'raven',
 ],
-require  => Package['libmysqlclient-dev'],
+require  => Package['default-libmysqlclient-dev'],
 timeout  => 600, # This can take a while
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a41a8bd56e612082ffafc651573e091ec836f75
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Replace libmysqlclient-dev with default-libmysqlclient-dev

2017-12-02 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394819 )

Change subject: Replace libmysqlclient-dev with default-libmysqlclient-dev
..

Replace libmysqlclient-dev with default-libmysqlclient-dev

libmysqlclient-dev is only provided on jessie. default-libmysqlclient-dev is 
provided on both jessie and stretch (and resolves to libmysqlclient-dev or 
libmariadbclient-dev-compat).

Change-Id: I1a41a8bd56e612082ffafc651573e091ec836f75
---
M puppet/modules/crm/manifests/tools.pp
M puppet/modules/eventlogging/manifests/init.pp
M puppet/modules/role/manifests/striker.pp
M puppet/modules/sentry/manifests/init.pp
4 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/19/394819/1

diff --git a/puppet/modules/crm/manifests/tools.pp 
b/puppet/modules/crm/manifests/tools.pp
index 6d70d79..17c7aab 100644
--- a/puppet/modules/crm/manifests/tools.pp
+++ b/puppet/modules/crm/manifests/tools.pp
@@ -15,7 +15,7 @@
 $audit_base = '/var/spool/audit'
 
 require_package(
-'libmysqlclient-dev',
+'default-libmysqlclient-dev',
 'libyaml-dev'
 )
 
@@ -50,7 +50,7 @@
 command => "pip install -r ${dir}/requirements.txt",
 require => [
 Git::Clone['wikimedia/fundraising/tools'],
-Package['libmysqlclient-dev'],
+Package['default-libmysqlclient-dev'],
 Package['libyaml-dev'],
 ],
 }
diff --git a/puppet/modules/eventlogging/manifests/init.pp 
b/puppet/modules/eventlogging/manifests/init.pp
index d04985e..d205fbc 100644
--- a/puppet/modules/eventlogging/manifests/init.pp
+++ b/puppet/modules/eventlogging/manifests/init.pp
@@ -15,7 +15,7 @@
 require => Git::Clone['eventlogging'],
 }
 
-require_package('libmysqlclient-dev')
+require_package('default-libmysqlclient-dev')
 require_package('librdkafka-dev')
 
 # Do the initial pip install into the virtualenv
@@ -25,7 +25,7 @@
 creates => 
"${path}/virtualenv/local/lib/python2.7/site-packages/eventlogging.egg-link",
 require => [
 Service::Gitupdate['eventlogging'],
-Package['libmysqlclient-dev'],
+Package['default-libmysqlclient-dev'],
 Package['librdkafka-dev']
 ],
 }
diff --git a/puppet/modules/role/manifests/striker.pp 
b/puppet/modules/role/manifests/striker.pp
index 8fe839a..bc1965c 100644
--- a/puppet/modules/role/manifests/striker.pp
+++ b/puppet/modules/role/manifests/striker.pp
@@ -126,7 +126,7 @@
 require_package(
 'libffi-dev',
 'libldap2-dev',
-'libmysqlclient-dev',
+'default-libmysqlclient-dev',
 'libsasl2-dev',
 'libssl-dev',
 $python,
diff --git a/puppet/modules/sentry/manifests/init.pp 
b/puppet/modules/sentry/manifests/init.pp
index fd85a72..882ce9a 100644
--- a/puppet/modules/sentry/manifests/init.pp
+++ b/puppet/modules/sentry/manifests/init.pp
@@ -69,7 +69,7 @@
 require ::virtualenv
 
 # 
http://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found
-require_package('libmysqlclient-dev')
+require_package('default-libmysqlclient-dev')
 # needed for building the python package lxml
 require_package('libxml2-dev', 'libxslt1-dev')
 # needed for building the python package cffi (?)
@@ -87,7 +87,7 @@
 'sentry[mysql]==7.7.0',
 'raven',
 ],
-require  => Package['libmysqlclient-dev'],
+require  => Package['default-libmysqlclient-dev'],
 timeout  => 600, # This can take a while
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a41a8bd56e612082ffafc651573e091ec836f75
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
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...OpenStackManager[master]: Add maintenance script for attaching existing LDAP accounts

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

Change subject: Add maintenance script for attaching existing LDAP accounts
..

Add maintenance script for attaching existing LDAP accounts

The attachLdapUser.php maintenance script can be used to attach an
existing LDAP account to the local wiki. In addition to creating the
user table entries, it will also add the expected user creation log
events.

Bug: T180813
Change-Id: Id7aa131c64fc0a7df934ebcbc56d367e996b8355
---
A maintenance/attachLdapUser.php
1 file changed, 64 insertions(+), 0 deletions(-)


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

diff --git a/maintenance/attachLdapUser.php b/maintenance/attachLdapUser.php
new file mode 100644
index 000..d4cd49a
--- /dev/null
+++ b/maintenance/attachLdapUser.php
@@ -0,0 +1,64 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+if ( getenv( 'MW_INSTALL_PATH' ) ) {
+   $IP = getenv( 'MW_INSTALL_PATH' );
+} else {
+   $IP = __DIR__ . '/../../..';
+}
+require_once "$IP/maintenance/Maintenance.php";
+
+use MediaWiki\Auth\AuthManager;
+
+/**
+ * Attach an existing LDAP account to the local wiki with all expected log
+ * events created as well.
+ *
+ * @copyright © 2017 Wikimedia Foundation and contributors
+ */
+class AttachLdapUser extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+   $this->mDescription = "Attach an existing LDAP user to the 
local wiki";
+   $this->addOption( 'user', 'Username', true, true );
+   $this->addOption( 'email', 'Email address', true, true );
+   $this->addOption( 'domain', 'LDAP domain', false, true );
+   }
+
+   public function execute() {
+   // Setup the internal state of LdapAuthenticationPlugin as 
though the
+   // login form was used. Ugly but this is what LdapAuthentication
+   // forces us to do.
+   $ldap = LdapAuthenticationPlugin::getInstance();
+   $ldap->LDAPUsername = $this->getOption( 'user' );
+   $ldap->email = $this->getOption( 'email' );
+   $domain = $this->getOption( 'domain', $ldap->getDomain() );
+   $ldap->setDomain( $domain );
+   $_SESSION['wsDomain'] = $domain;
+
+   $user = User::newFromName( $ldap->LDAPUsername, 'creatable' );
+   AuthManager::singleton()->autoCreateUser(
+   $user, LdapPrimaryAuthenticationProvider::class, false 
);
+   }
+}
+
+$maintClass = "AttachLdapUser";
+require_once RUN_MAINTENANCE_IF_MAIN;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7aa131c64fc0a7df934ebcbc56d367e996b8355
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenStackManager
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] labs...stashbot[master]: flake8: E722 do not use bare except

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

Change subject: flake8: E722 do not use bare except
..

flake8: E722 do not use bare except

Newer versions of flake8 decided that they are smarter than the
developer, so try to make them shut up without opening too many
unhandled error cases that will crash the bot.

Change-Id: I48b9e9ce776a7ea6d915fa17575383dd3b627914
---
M stashbot/bot.py
M stashbot/ldap.py
M stashbot/sal.py
3 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/stashbot 
refs/changes/59/394359/1

diff --git a/stashbot/bot.py b/stashbot/bot.py
index d293942..f65561a 100644
--- a/stashbot/bot.py
+++ b/stashbot/bot.py
@@ -208,7 +208,7 @@
 continue
 try:
 info = self.phab.taskInfo(task)
-except:
+except Exception:
 self.logger.exception('Failed to lookup info for %s', task)
 else:
 self.respond(conn, event, self.config['phab']['echo'] % info)
diff --git a/stashbot/ldap.py b/stashbot/ldap.py
index f6e25a4..a22d358 100644
--- a/stashbot/ldap.py
+++ b/stashbot/ldap.py
@@ -65,7 +65,7 @@
 return self.search(*args, retriable=False, **kwargs)
 else:
 raise
-except:
+except Exception:
 # If anything at all goes wrong, ditch the connection out of
 # paranoia. We really don't want to have to restart the bot for
 # dumb things like LDAP hiccups.
diff --git a/stashbot/sal.py b/stashbot/sal.py
index 27733b6..75f8454 100644
--- a/stashbot/sal.py
+++ b/stashbot/sal.py
@@ -138,7 +138,7 @@
 if respond_to_channel:
 self.irc.respond(
 conn, event, 'Logged the message at %s' % url)
-except:
+except Exception:
 self.logger.exception('Error writing to wiki')
 if respond_to_channel:
 self.irc.respond(
@@ -152,7 +152,7 @@
 if 'twitter' in channel_conf:
 try:
 self._tweet(bang, channel_conf)
-except:
+except Exception:
 self.logger.exception('Error writing to twitter')
 
 def _log_duplicate(self, conn, event, doc, **kwargs):
@@ -221,7 +221,7 @@
 return [g.cn for g in res]
 else:
 self.logger.error('Failed to get LDAP data for %s', dn)
-except:
+except Exception:
 self.logger.exception('Exception getting LDAP data for %s', dn)
 return []
 
@@ -240,7 +240,7 @@
 for task in m:
 try:
 self.phab.comment(task, msg)
-except:
+except Exception:
 self.logger.exception('Failed to add note to phab task')
 
 def _write_to_wiki(self, bang, channel_conf):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I48b9e9ce776a7ea6d915fa17575383dd3b627914
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/stashbot
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] labs...stashbot[master]: !log: only update Phabricator tasks if we are responding in ...

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

Change subject: !log: only update Phabricator tasks if we are responding in 
channel
..

!log: only update Phabricator tasks if we are responding in channel

Add a guard condition to stashbot.sal._store_in_es() to prevent
Phabricator task comments from being created. Set this guard condition
to the same value as stashbot.sal.log()'s respond_to_channel flag when
processing log events.

There is a funky edge case for !log messages in #wikimedia-cloud and
These messages are written both to the main SAL for the channel the
message originates in and to the Release Engineering SAL. An unintended
side effect of this double logging was that any Phabricator tasks
mentioned in the log message would get two Stashbot mentions (one for the
original SAL and a second for the RelEng SAL).

Change-Id: I7c078e538440b186f8ce9cf17e5f85cb824859e4
---
M stashbot/sal.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/stashbot 
refs/changes/56/394356/1

diff --git a/stashbot/sal.py b/stashbot/sal.py
index 27733b6..7ada76f 100644
--- a/stashbot/sal.py
+++ b/stashbot/sal.py
@@ -130,7 +130,7 @@
 channel='#wikimedia-releng'
 )
 
-self._store_in_es(bang)
+self._store_in_es(bang, do_phab=respond_to_channel)
 
 if 'wiki' in channel_conf:
 try:
@@ -225,10 +225,11 @@
 self.logger.exception('Exception getting LDAP data for %s', dn)
 return []
 
-def _store_in_es(self, bang):
+def _store_in_es(self, bang, do_phab=True):
 """Save a !log message to elasticsearch."""
 ret = self.es.index(index='sal', doc_type='sal', body=bang)
 if (
+do_phab and
 'phab' in self.config['sal'] and
 'created' in ret and ret['created'] is True
 ):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c078e538440b186f8ce9cf17e5f85cb824859e4
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/stashbot
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/vagrant[master]: role::huggle

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

Change subject: role::huggle
..

role::huggle

Provision the Huggle git repo and libraries and utilities needed to
compile and test Huggle using QT4. Running Huggle from inside the VM
should work if the host computer has a working X server.

Bug: T178141
Change-Id: I9b71be4711054cca1c3743eb024133fb4e98a823
---
A puppet/modules/role/manifests/huggle.pp
A puppet/modules/role/templates/huggle/VagrantRoleHuggle.wiki.erb
2 files changed, 47 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/01/394001/1

diff --git a/puppet/modules/role/manifests/huggle.pp 
b/puppet/modules/role/manifests/huggle.pp
new file mode 100644
index 000..4fc0008
--- /dev/null
+++ b/puppet/modules/role/manifests/huggle.pp
@@ -0,0 +1,29 @@
+# == Class: role::huggle
+# Provision build environment for Huggle.
+#
+# Clones the Huggle git repository and installs libraries needed for
+# development and testing. See
+# http://dev.wiki.local.wmftest.net:8080/wiki/VagrantRoleHuggle for details.
+class role::huggle {
+include ::mwv
+
+require_package(
+'libqt4-dev',
+'libqt4-webkit',
+'libqt4-network',
+'qt4-qmake',
+'libqtwebkit-dev',
+'libqt4-dev-bin',
+'qt4-dev-tools',
+)
+
+git::clone { 'huggle':
+directory => "${::mwv::services_dir}/huggle",
+remote=> 'https://github.com/huggle/huggle3-qt-lx.git',
+}
+
+# Add some documentation for developers
+mediawiki::import::text { 'VagrantRoleHuggle':
+content => template('role/huggle/VagrantRoleHuggle.wiki.erb'),
+}
+}
diff --git a/puppet/modules/role/templates/huggle/VagrantRoleHuggle.wiki.erb 
b/puppet/modules/role/templates/huggle/VagrantRoleHuggle.wiki.erb
new file mode 100644
index 000..8c4ee83
--- /dev/null
+++ b/puppet/modules/role/templates/huggle/VagrantRoleHuggle.wiki.erb
@@ -0,0 +1,18 @@
+'''Huggle''' is an anti-vandalism tool for use on MediaWiki based projects.
+
+== Getting started ==
+
+  $ vagrant ssh
+  $ cd /vagrant/srv/huggle/huggle
+  $ ./configure --qt4 --extension --no-audio
+  $ cd /vagrant/srv/huggle/huggle/huggle_release
+  $ make
+  $ cd /vagrant/srv/huggle/huggle/tests/test
+  $ cmake .
+  $ make
+  $ ./tst_testmain
+
+== See also ==
+* [https://en.wikipedia.org/wiki/Wikipedia:Huggle Wikipedia:Huggle]
+* [https://github.com/huggle/huggle3-qt-lx Huggle on GitHub]
+* [https://github.com/huggle/huggle3-qt-lx/wiki/Developer-guide Developer 
guide]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b71be4711054cca1c3743eb024133fb4e98a823
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
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/vagrant[trusty-compat]: Revert "Merge "Fix .gitreview for compat branch" into trusty...

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

Change subject: Revert "Merge "Fix .gitreview for compat branch" into 
trusty-compat"
..

Revert "Merge "Fix .gitreview for compat branch" into trusty-compat"

This reverts commit a92d9b0ea6ed283a950ad198934623acdf7c65f0, reversing
changes made to 81fd32c95c0c08c12ea740cc86f931c965798731.

Bug: T171537
Change-Id: Idaa4775223c09f7eb001e64634d2a3231024bb1d
---
M .gitmodules
M .rubocop.yml
M Gemfile
M Gemfile.lock
M Vagrantfile
A lib/labs-vagrant.rb
M lib/mediawiki-vagrant/lsb_check/provisioner.rb
M puppet/hieradata/common.yaml
M puppet/hieradata/provider/lxc.yaml
M puppet/modules/apache/manifests/init.pp
M puppet/modules/apache/manifests/mod/access_compat.pp
M puppet/modules/apache/manifests/mod/proxy_fcgi.pp
A puppet/modules/apache/manifests/mod/version.pp
M puppet/modules/apache/templates/ports.conf.erb
M puppet/modules/apt/manifests/init.pp
M puppet/modules/apt/manifests/ppa.pp
D puppet/modules/apt/templates/backports.list.erb
M puppet/modules/apt/templates/mwv-apt.list.erb
M puppet/modules/apt/templates/wikimedia.list.erb
M puppet/modules/browsertests/manifests/bundle.pp
M puppet/modules/browsertests/manifests/init.pp
A puppet/modules/cgroup/files/cgrulesengd.conf
M puppet/modules/cgroup/manifests/init.pp
D puppet/modules/cgroup/templates/systemd/cgrulesengd.erb
M puppet/modules/citoid/manifests/init.pp
M puppet/modules/elasticsearch/manifests/init.pp
M puppet/modules/eventlogging/manifests/devserver.pp
M puppet/modules/eventlogging/manifests/service.pp
A puppet/modules/eventlogging/templates/devserver.upstart.erb
A puppet/modules/eventlogging/templates/service.upstart.erb
D puppet/modules/eventlogging/templates/systemd/eventlogging-devserver.erb
D puppet/modules/eventlogging/templates/systemd/eventlogging-service.erb
M puppet/modules/git/manifests/init.pp
A puppet/modules/hhvm/files/hhvm.conf
D puppet/modules/hhvm/manifests/fcgi.pp
M puppet/modules/hhvm/manifests/init.pp
D puppet/modules/hhvm/templates/systemd/hhvm.erb
A puppet/modules/kafka/files/upstart
M puppet/modules/kafka/manifests/init.pp
D puppet/modules/kafka/templates/log4j.properties.erb
D puppet/modules/kafka/templates/systemd/kafka.erb
A puppet/modules/mariadb
M puppet/modules/mediawiki/manifests/apache.pp
M puppet/modules/mediawiki/manifests/init.pp
M puppet/modules/mediawiki/manifests/jobrunner.pp
D puppet/modules/mediawiki/manifests/ready_service.pp
A puppet/modules/mediawiki/templates/jobchron.conf.erb
A puppet/modules/mediawiki/templates/jobrunner.conf.erb
M puppet/modules/mediawiki/templates/jobrunner.json.erb
A puppet/modules/mediawiki/templates/mediawiki-bridge.conf.erb
D puppet/modules/mediawiki/templates/systemd/jobchron.erb
D puppet/modules/mediawiki/templates/systemd/jobrunner.erb
D puppet/modules/mediawiki/templates/systemd/mediawiki-ready.erb
D puppet/modules/mediawiki/templates/wait-for-mediawiki.sh.erb
M puppet/modules/misc/files/mediawiki_vagrant_motd
M puppet/modules/misc/manifests/init.pp
M puppet/modules/motd/manifests/init.pp
D puppet/modules/mwv/manifests/cachefilesd.pp
M puppet/modules/mwv/manifests/init.pp
D puppet/modules/mwv/manifests/packages.pp
M puppet/modules/nginx
M puppet/modules/npm/files/nodesource.sources.list
M puppet/modules/payments/files/Main_Page.wiki
M puppet/modules/postfix/manifests/init.pp
D puppet/modules/role/files/keystone/logging.conf
D puppet/modules/role/files/keystone/policy.json
D puppet/modules/role/files/keystone/use-openstack
D puppet/modules/role/files/keystone/wmfkeystonehooks.egg-info/PKG-INFO
D puppet/modules/role/files/keystone/wmfkeystonehooks.egg-info/entry_points.txt
D puppet/modules/role/files/keystone/wmfkeystonehooks/__init__.py
D puppet/modules/role/files/keystone/wmfkeystonehooks/wmfkeystonehooks.py
D puppet/modules/role/files/striker/20160916-01-initial.sql
M puppet/modules/role/manifests/cirrussearch.pp
M puppet/modules/role/manifests/citoid.pp
D puppet/modules/role/manifests/keystone.pp
M puppet/modules/role/manifests/ores.pp
M puppet/modules/role/manifests/striker.pp
M puppet/modules/role/manifests/timedmediahandler.pp
D puppet/modules/role/manifests/timeless.pp
A puppet/modules/role/manifests/trafficserver.pp
A puppet/modules/role/manifests/zotero.pp
A puppet/modules/role/settings/trafficserver.yaml
M puppet/modules/role/templates/elk/VagrantRoleElk.wiki.erb
M puppet/modules/role/templates/elk/monolog.php.erb
D puppet/modules/role/templates/keystone/admin-openrc.erb
D puppet/modules/role/templates/keystone/bootstrap_keystone.erb
D puppet/modules/role/templates/keystone/keystone.conf.erb
M puppet/modules/role/templates/swift/apache2.conf.erb
M puppet/modules/role/templates/wikidata/shared.php.erb
M puppet/modules/rsyslog/manifests/init.pp
M puppet/modules/ruby/manifests/bundle.pp
A puppet/modules/ruby/manifests/default.pp
A puppet/modules/ruby/manifests/gem.pp
M puppet/modules/ruby/manifests/init.pp
A 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Fix legacy usage of Capitalized resource names

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

Change subject: Fix legacy usage of Capitalized resource names
..

Fix legacy usage of Capitalized resource names

Puppet4 complains and this usage has long been deprecated.

Change-Id: I79970cf89260e82e8c4ca309ef439e17cb3e4139
---
M puppet/modules/apt/manifests/init.pp
M puppet/modules/role/manifests/striker.pp
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/86/393786/1

diff --git a/puppet/modules/apt/manifests/init.pp 
b/puppet/modules/apt/manifests/init.pp
index 5af3c83..7932f24 100644
--- a/puppet/modules/apt/manifests/init.pp
+++ b/puppet/modules/apt/manifests/init.pp
@@ -76,5 +76,5 @@
 mode   => '0444',
 }
 
-Class['Apt'] -> Package <| |>
+Class['apt'] -> Package <| |>
 }
diff --git a/puppet/modules/role/manifests/striker.pp 
b/puppet/modules/role/manifests/striker.pp
index 4318bd9..8fe839a 100644
--- a/puppet/modules/role/manifests/striker.pp
+++ b/puppet/modules/role/manifests/striker.pp
@@ -187,7 +187,7 @@
   before  => Exec['striker manage.py migrate'],
   require => [
   Mysql::User[$db_user],
-  Class[Mysql::Large_prefix],
+  Class['mysql::large_prefix'],
   ],
   subscribe   => Mysql::Db[$db_name],
 }
@@ -197,7 +197,7 @@
 command => "${venv}/bin/python manage.py migrate",
 require => [
 Mysql::User[$db_user],
-Class[Mysql::Large_prefix],
+Class['mysql::large_prefix'],
 File['/etc/striker/striker.ini'],
 ],
 onlyif  => "${venv}/bin/python manage.py showmigrations --plan | 
/bin/grep -q '\\[ \\]'",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79970cf89260e82e8c4ca309ef439e17cb3e4139
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Fix broken $::mediawiki::wiki_db usage

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

Change subject: Fix broken $::mediawiki::wiki_db usage
..

Fix broken $::mediawiki::wiki_db usage

At some point the $::mediawiki::wiki_db setting was renamed to
$::mediawiki::wiki_name, but we missed a few usages of the old name.
Puppet4 actually notices this and complains when compiling the catalog
which is nice.

Change-Id: Ie1131cd252af4d5492531944c3075e03a22054fe
---
M puppet/modules/role/manifests/restbase.pp
M puppet/modules/role/manifests/thumb_on_404.pp
M puppet/modules/role/manifests/visualeditor.pp
3 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/85/393785/1

diff --git a/puppet/modules/role/manifests/restbase.pp 
b/puppet/modules/role/manifests/restbase.pp
index d8318dc..d28dd92 100644
--- a/puppet/modules/role/manifests/restbase.pp
+++ b/puppet/modules/role/manifests/restbase.pp
@@ -36,7 +36,7 @@
 mediawiki::settings { 'RESTBase-VRS':
 values   => template('role/restbase/vrs.php.erb'),
 priority => $::load_first,
-wiki => $::mediawiki::wiki_db,
+wiki => $::mediawiki::wiki_name,
 }
 
 # Reverse proxy /api/rest_v1/ to RESTBase server
@@ -52,7 +52,7 @@
 wgVisualEditorRestbaseURL => $ve_url,
 },
 priority => $::load_early,
-wiki => $::mediawiki::wiki_db,
+wiki => $::mediawiki::wiki_name,
 }
 
 mediawiki::import::text { 'VagrantRoleRestbase':
diff --git a/puppet/modules/role/manifests/thumb_on_404.pp 
b/puppet/modules/role/manifests/thumb_on_404.pp
index 2458e87..900aa61 100644
--- a/puppet/modules/role/manifests/thumb_on_404.pp
+++ b/puppet/modules/role/manifests/thumb_on_404.pp
@@ -9,6 +9,6 @@
 role::thumb_on_404::multiwiki { $::mediawiki::wiki_name:
 images_url => '/images',
 images_dir => "${::mwv::files_dir}/images",
-wiki   => $::mediawiki::wiki_db,
+wiki   => $::mediawiki::wiki_name,
 }
 }
diff --git a/puppet/modules/role/manifests/visualeditor.pp 
b/puppet/modules/role/manifests/visualeditor.pp
index 8ae9547..ceb0e7d 100644
--- a/puppet/modules/role/manifests/visualeditor.pp
+++ b/puppet/modules/role/manifests/visualeditor.pp
@@ -18,6 +18,6 @@
 settings  => template('role/visualeditor/conf.php.erb'),
 browser_tests => 'modules/ve-mw/tests/browser',
 priority  => $::load_early,
-wiki  => $::mediawiki::wiki_db,
+wiki  => $::mediawiki::wiki_name,
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1131cd252af4d5492531944c3075e03a22054fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: apt: Update Wikimedia apt config

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

Change subject: apt: Update Wikimedia apt config
..

apt: Update Wikimedia apt config

* New PGP signing key
* Remove components not present for Stretch per
  

Bug: T181354
Change-Id: If3c897d81d06d38f214de6dda58944d44ecbbe4c
---
M puppet/modules/apt/files/wikimedia-pubkey.asc
M puppet/modules/apt/manifests/init.pp
2 files changed, 30 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/00/393500/1

diff --git a/puppet/modules/apt/files/wikimedia-pubkey.asc 
b/puppet/modules/apt/files/wikimedia-pubkey.asc
index f2a0487..30a45ec 100644
--- a/puppet/modules/apt/files/wikimedia-pubkey.asc
+++ b/puppet/modules/apt/files/wikimedia-pubkey.asc
@@ -1,30 +1,32 @@
+
 -BEGIN PGP PUBLIC KEY BLOCK-
-Version: GnuPG v1.4.11 (GNU/Linux)
+Version: GnuPG v1
 
-mQGiBEUtBY8RBACJTZdWEBZHlibArWM1HrX5rcPCb+o2nmeTfNrtMpmVbkmi9vBE
-VmIDnjc+VQlJNoiBOKMhAhRSO0rIwEbOTewiQSPERfsClGpv0ikb3kQVFls5HpfZ
-49u9EAERRez+P2VJUH7CBmigKdxtKRGM5aLI+eOLUl+lZUn4NU6BsQOUGwCgtLiL
-I+8DSNkoiV40UR3uFsS9KLMD/30Lth9A9JgwrDTFl8rlNxq3Eluulv0+2MYoDutW
-2p384vJ8Vil+x1GPzZXT1NVHCPdJMXqfnUl33XkPJEFSJ3B1WhwU3muItPoM+GKM
-cnJMn2rYJa6Fae7UZy8iRJwSuqSg4mGNa900m/izyYoijJzl1u4HtZhbV++lgubO
-j+YfA/4sz68H/ZQZwG+d8X/xTgZ3+9qekqGFgxdGTICtiD7IRPPaQ7EUWOBml6tn
-SHfd0TBkCKtfFkr6+rA3ZJ5pyo3OwO2yUAvlBOPeaX4ZKTl7+8lG9kqqGIBm/iZy
-bHC75DF506Zm4IiesAXRmRqfB8gReOHEJybZkaCg8FZqhdGErLQ8V2lraW1lZGlh
-IEFyY2hpdmUgQXV0b21hdGljIFNpZ25pbmcgS2V5IDxyb290QHdpa2ltZWRpYS5v
-cmc+iF8EExECACAFAkUtBY8CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRAJ
-29n5P2zUSmaGAJjipA+xkWInJJHCCcoJrf7rBzqEAJ9OEsJuxbBOvOJBovwpWtNh
-goMcubkCDQRFLQWdEAgAvEAe6PnzhGdOC3ZYIeJalQyBEelRZiEdzjtdojTNEf29
-6J75O8QqjQt/pyOZ9w/DCiy81dym3GlXeS61tcfNdSBMXqGtgXAskLV1djz0U7SU
-89MiwjrSiYhYRYNSQcrshVDjzpHkj8HY0gwNyN5yZ1xnZ9/WG46Kay6quHQbfKn7
-Egxs6ONJJaW7H1MM2cPzsJuzk1aXq4PJOFHgDo9J2j+nGVgk8XdGqgk5t0we69Oh
-YXlxUTjgOE+XMxk4PEOFDjk0pTmxOUMP0b08dpvJf652O4jpnylBIiT9ZxRadENM
-zmeBT//sJJIleYDh2a1xeDDQwzRig1swFnfYeuEugwADBQf/b7xdqYrLZYqtJVLO
-fgh3HOJ605KNYlyreKj67x04fy8lIhrkp3wraVTN74+jObNhJTq3VesUoPPgJqRi
-sABCwbGQeKriz7NUAflBliVapPjSd7qD696zO+wQd03z8wJecdxAcmw89+8jyHWV
-bgSf3Thy0pfCDBOZL5ApDzPp/zveTAJJdl9xJ+kQA9g4kXIbqdsv0ytqfT56CAOC
-vBIJ7JuzIz8eKZ5LlPoGosU5C6TPwlHwfrh1ttD5/LdoSbcz1ThCM3Q9nasvmQjQ
-EGZteBiJH8UogRLTsqbJCtQM6aQL8J/+bWjSrmPdCp2z/dzFTgtga4DKcXiSYo+U
-JVwilYhJBBgRAgAJBQJFLQWdAhsMAAoJEAnb2fk/bNRK/HEAn0ud2S4zsHv4Ayzp
-QqdXQFnLYQ6mAJ9LlSuxDwXm+ln+7o++xUBMQCKJ7g==
-=XekF
+mQINBFieKQEBEACZXCSJEwJnXsEofPUIunQTqF8p1IipjkDF4sNSgyuA17AD235h
+EEll1Czzd13bajM4D9dO+Yz4q9lWcrdoaHXklTEnA1Dhjk0wgTRqEqa37PBxjm7p
+xTuSOEFAHnQfjM9ZzV6Bd3kzIlfxnTguiYbN1pf4KQ7u4TQSchKr8V4p+mf4Y+Xg
+6hhskLrvMRYO7mNGEzm0vdfWsGbbvPZlhrRMea4oyCrOGd2piXAIPLR6DFXpyrb9
+GdEKrg8evTUnntsIqQ60h8veFETGNUmtpSF9OwzVGfH8TKACV7qA30Bbp6wDSLeY
+JefpX4yBexY3FbNx1oxXbXTZbDR8RZ4olWjP+inKYJTwHxQnvYjXWgMeNR/BgX2s
+ontLXqK5BzBP+1E0vHdAAYSU/8vjr+zmy1qyDWYtIlqdMXzDkXTCZIkJE0WPp5Sx
+sEFqpLdO7ggqJV5UF7h/yIq9bcxoaNxYGJFRDWg3Lj6ZLCxiSN/QHuqascMijKAU
+2RHzQtXhfXzZA8PwZp92dalOZOguytEYyhzrPfJlysvOnXTigHa9WeybDcJgsOO8
+xFbgU9P98NgyE4ZIel6P1GpLnBY8j0KpbhWfCi5mmomwwK5OUWe0g9/u4z5FmN3z
+/WWA/8BjuJI9MFnS3YoU3safEUi0vD5pnuktVQGJOkSnR6gAN4dAoCcVEwARAQAB
+tDxXaWtpbWVkaWEgQXJjaGl2ZSBBdXRvbWF0aWMgU2lnbmluZyBLZXkgPHJvb3RA
+d2lraW1lZGlhLm9yZz6JAjcEEwEKACEFAlieKQECGwMFCwkIBwMFFQoJCAsFFgID
+AQACHgECF4AACgkQnTktP/rfGPtmohAAhQhGkOe0DX5ZSK6uEs2IpB1W3EvCPK87
+vSgI6FZyGEURH7s/MknQR2lMShgHZ1oqLwZV1DE5ao/D4khPw1JZFeYajXOxQ3Sr
+/Qjg6ZayrJ/r9sSchC4nd6m+rFpzuRsx22FWrVenzRBau6/J6OUz3WawsjX3Bwrg
+/Hw11/+kgsabkdsdK28ENWdVj0tLp5asSxrs4L4d2RjKpfiufBAGpkqFV5p2J8aw
+cJ7Wh3/1mMo+biTtuemHtWf4XfWmXv99ltSEVe8PpMYQ+FjNUHDzEZMS5K39em+V
+EOC7GsE+SHHF6lgjH2BtDcpkimbU9uROnGeIWtpRr+PNMu/yhFLUCxe7tf4yffIJ
+NIAL3RFcRhLj0xCbL3fd5DbQP4eB68k9pLHwYxpKba7DDmH0aMstvk5xrpphdHAP
+p03VbE6ZThKxA828yb2jWtumDhoYRlkHs2KrVufUPA411mUE+A53pwqBse/KM9Iq
+Pidc+TwMwy2nByRB9WFyyGS08wqhewpwp8mwIOejvRf+3yi+CGHM2Xi4bTmEqVL+
+Jm1D5W49O5/j1T6HyVPGsyH/0QgYwg2IVZwL5Jfy9w3974jTV3QAcCBafR9hcZCS
+S2wOIo0ckRI0APw6DQSFMyBrNs9rWy72Ixu9RC1GtzCCn5OaMRUM9FaqjRnTKX4m
+grWsU8i35fI=
+=ib96
 -END PGP PUBLIC KEY BLOCK-
+
\ No newline at end of file
diff --git a/puppet/modules/apt/manifests/init.pp 
b/puppet/modules/apt/manifests/init.pp
index a7586e6..5af3c83 100644
--- a/puppet/modules/apt/manifests/init.pp
+++ b/puppet/modules/apt/manifests/init.pp
@@ -34,7 +34,7 @@
 apt::repository { 'wikimedia':
 uri => 'https://apt.wikimedia.org/wikimedia',
 dist=> "${::lsbdistcodename}-wikimedia",
-components  => 'main backports thirdparty',
+components  => 'main',
 keyfile => 'puppet:///modules/apt/wikimedia-pubkey.asc',
 comment_old => true,
 }

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

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: nodejs: Switch to jessie apt repo

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

Change subject: nodejs: Switch to jessie apt repo
..

nodejs: Switch to jessie apt repo

Bug: T181354
Change-Id: I3c95bc017b12e91809888055fbdda9a8dac14b49
---
M puppet/modules/npm/files/nodesource.sources.list
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/98/393498/1

diff --git a/puppet/modules/npm/files/nodesource.sources.list 
b/puppet/modules/npm/files/nodesource.sources.list
index 69ce671..d027f78 100644
--- a/puppet/modules/npm/files/nodesource.sources.list
+++ b/puppet/modules/npm/files/nodesource.sources.list
@@ -1,2 +1,2 @@
-deb https://deb.nodesource.com/node_6.x jessie main
-deb-src https://deb.nodesource.com/node_6.x jessie main
+deb https://deb.nodesource.com/node_6.x stretch main
+deb-src https://deb.nodesource.com/node_6.x stretch main

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c95bc017b12e91809888055fbdda9a8dac14b49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: type safe comparisons

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

Change subject: puppet4: type safe comparisons
..

puppet4: type safe comparisons

Puppet4 is strict about argument type matching when making comparisons.
Use data type comparisons to either replace or guard string comparisons.

Bug: T181354
Change-Id: I129f50036c5afbb28ce7121b8b51b6e3b9147dee
---
M puppet/modules/apache/manifests/conf.pp
M puppet/modules/env/manifests/profile_script.pp
M puppet/modules/mediawiki/manifests/settings.pp
M puppet/modules/motd/manifests/script.pp
M puppet/modules/rsyslog/manifests/conf.pp
5 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/96/393496/1

diff --git a/puppet/modules/apache/manifests/conf.pp 
b/puppet/modules/apache/manifests/conf.pp
index 9c14849..9172f01 100644
--- a/puppet/modules/apache/manifests/conf.pp
+++ b/puppet/modules/apache/manifests/conf.pp
@@ -45,7 +45,7 @@
 ) {
 include ::apache
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail('"priority" must be between 0 - 99')
 }
 if $ensure !~ /^(present|absent)$/ {
diff --git a/puppet/modules/env/manifests/profile_script.pp 
b/puppet/modules/env/manifests/profile_script.pp
index 886f3d0..c0bf3e4 100644
--- a/puppet/modules/env/manifests/profile_script.pp
+++ b/puppet/modules/env/manifests/profile_script.pp
@@ -36,7 +36,7 @@
 ) {
 include ::env
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail('"priority" must be between 0 - 99')
 }
 if $ensure !~ /^(present|absent)$/ {
diff --git a/puppet/modules/mediawiki/manifests/settings.pp 
b/puppet/modules/mediawiki/manifests/settings.pp
index b78293b..bde54d5 100644
--- a/puppet/modules/mediawiki/manifests/settings.pp
+++ b/puppet/modules/mediawiki/manifests/settings.pp
@@ -113,7 +113,7 @@
 
 if $wiki_name == $::mediawiki::wiki_name {
 $db_name = $::mediawiki::db_name
-} elsif $wiki_name =~ /wiki$/ {
+} elsif $wiki_name =~ String and $wiki_name =~ /wiki$/ {
 $db_name = $wiki_name
 } else {
 $db_name = "${wiki_name}wiki"
diff --git a/puppet/modules/motd/manifests/script.pp 
b/puppet/modules/motd/manifests/script.pp
index 5e07efd..fd76142 100644
--- a/puppet/modules/motd/manifests/script.pp
+++ b/puppet/modules/motd/manifests/script.pp
@@ -33,7 +33,7 @@
 ) {
 include ::motd
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail('"priority" must be between 0 - 99')
 }
 if $ensure !~ /^(present|absent)$/ {
diff --git a/puppet/modules/rsyslog/manifests/conf.pp 
b/puppet/modules/rsyslog/manifests/conf.pp
index 6f5f7c6..54d3669 100644
--- a/puppet/modules/rsyslog/manifests/conf.pp
+++ b/puppet/modules/rsyslog/manifests/conf.pp
@@ -34,7 +34,7 @@
 ) {
 include ::rsyslog
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail("'priority' must be an integer between 0 - 99 (got: 
${priority}).")
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I129f50036c5afbb28ce7121b8b51b6e3b9147dee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: php7.0: Convert php5 to php7.0

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

Change subject: php7.0: Convert php5 to php7.0
..

php7.0: Convert php5 to php7.0

Most of the changes are straight forward replacements of "php5" with
"php7.0" in package names. The php5-xhprof extension is replaced with
php-tideways (). The
php5 session cleanup script patches that we had added are also removed.

Bug: T181354
Change-Id: I33e74217203c037c29d6389c29f367e639131ba3
---
M puppet/hieradata/common.yaml
M puppet/modules/apache/files/envvars
M puppet/modules/apache/manifests/init.pp
D puppet/modules/apache/manifests/mod/php5.pp
A puppet/modules/apache/manifests/mod/php70.pp
M puppet/modules/crm/manifests/civicrm.pp
M puppet/modules/mediawiki/manifests/apache.pp
R puppet/modules/mediawiki/templates/mediawiki-php7-site.erb
M puppet/modules/mediawiki/templates/multiwiki/alldbs.erb
M puppet/modules/mediawiki/templates/multiwiki/multiversion-install.erb
M puppet/modules/mediawiki/templates/multiwiki/mwscript.erb
M puppet/modules/mediawiki/templates/mwrepl/mwrepl.erb
M puppet/modules/mediawiki/templates/systemd/jobchron.erb
M puppet/modules/mediawiki/templates/systemd/jobrunner.erb
M puppet/modules/memcached/manifests/php.pp
M puppet/modules/phabricator/manifests/init.pp
D puppet/modules/php/files/php5.cron.d
D puppet/modules/php/files/sessionclean
M puppet/modules/php/manifests/composer.pp
M puppet/modules/php/manifests/ini.pp
M puppet/modules/php/manifests/init.pp
M puppet/modules/php/manifests/remote_debug.pp
D puppet/modules/php/manifests/sessionclean.pp
M puppet/modules/php/manifests/xhprof.pp
M puppet/modules/php/templates/prune_php_ini_files.bash.erb
M puppet/modules/redis/manifests/php.pp
M puppet/modules/role/manifests/fss.pp
M puppet/modules/role/manifests/ldapauth.pp
M puppet/modules/role/manifests/mediawiki.pp
M puppet/modules/role/manifests/zend.pp
30 files changed, 70 insertions(+), 164 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/99/393499/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index fdf9553..3eb1b97 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -225,7 +225,7 @@
 mediawiki::branch: master
 
 mediawiki::apache::docroot: "%{hiera('apache::docroot')}"
-mediawiki::apache::php5_site_name: "php5%{hiera('mwv::tld')}"
+mediawiki::apache::php7_site_name: "php7%{hiera('mwv::tld')}"
 
 mediawiki::jobrunner::enable: true
 mediawiki::jobrunner::dir: "%{hiera('mwv::services_dir')}/jobrunner"
@@ -287,8 +287,6 @@
 phabricator::log_dir: "/vagrant/logs/phd"
 phabricator::vhost_name: "phabricator%{hiera('mwv::tld')}"
 phabricator::remote: https://secure.phabricator.com/diffusion/P/phabricator.git
-
-php::sessionclean::ensure: present
 
 php::xhprof::profile_storage_dir: /vagrant/profiles
 
diff --git a/puppet/modules/apache/files/envvars 
b/puppet/modules/apache/files/envvars
index 430884f..27823ea 100644
--- a/puppet/modules/apache/files/envvars
+++ b/puppet/modules/apache/files/envvars
@@ -15,9 +15,9 @@
   . "$envfile"
 done
 
-for ini in /etc/php5/conf.d/*.ini; do
+for ini in /etc/php/7.0/conf.d/*.ini; do
   [ -r "$ini" ] || break
-  mv "$ini" /etc/php5/mods-available
-  /usr/sbin/php5enmod -s ALL "$(basename $ini .ini)"
+  mv "$ini" /etc/php/7.0/mods-available
+  /usr/sbin/phpenmod -s ALL "$(basename $ini .ini)"
 done
-rm -rf /etc/php5/conf.d
+rm -rf /etc/php/7.0/conf.d
diff --git a/puppet/modules/apache/manifests/init.pp 
b/puppet/modules/apache/manifests/init.pp
index 6d6de02..0327cd5 100644
--- a/puppet/modules/apache/manifests/init.pp
+++ b/puppet/modules/apache/manifests/init.pp
@@ -14,7 +14,7 @@
 ensure  => present,
 }
 
-include apache::mod::php5
+include apache::mod::php70
 include apache::mod::access_compat
 
 file { '/etc/apache2/ports.conf':
diff --git a/puppet/modules/apache/manifests/mod/php5.pp 
b/puppet/modules/apache/manifests/mod/php5.pp
deleted file mode 100644
index 3da7d3b..000
--- a/puppet/modules/apache/manifests/mod/php5.pp
+++ /dev/null
@@ -1,8 +0,0 @@
-# == Class: apache::mod::php5
-#
-class apache::mod::php5 {
-package { 'libapache2-mod-php5': }
-apache::mod_conf { 'php5':
-require => Package['libapache2-mod-php5'],
-}
-}
diff --git a/puppet/modules/apache/manifests/mod/php70.pp 
b/puppet/modules/apache/manifests/mod/php70.pp
new file mode 100644
index 000..ff85eb8
--- /dev/null
+++ b/puppet/modules/apache/manifests/mod/php70.pp
@@ -0,0 +1,8 @@
+# == Class: apache::mod::php70
+#
+class apache::mod::php70 {
+package { 'libapache2-mod-php7.0': }
+apache::mod_conf { 'php7.0':
+require => Package['libapache2-mod-php7.0'],
+}
+}
diff --git a/puppet/modules/crm/manifests/civicrm.pp 
b/puppet/modules/crm/manifests/civicrm.pp
index df56792..3b2ed8a 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: s/trusted/can_trust/

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

Change subject: puppet4: s/trusted/can_trust/
..

puppet4: s/trusted/can_trust/

'trusted' is a reserved variable name in Puppet4

Bug: T181354
Change-Id: If4a5a9673ac2dbb7d955c6783c742c51e0d39082
---
M puppet/modules/apt/manifests/init.pp
M puppet/modules/apt/manifests/repository.pp
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/95/393495/1

diff --git a/puppet/modules/apt/manifests/init.pp 
b/puppet/modules/apt/manifests/init.pp
index f294535..a7586e6 100644
--- a/puppet/modules/apt/manifests/init.pp
+++ b/puppet/modules/apt/manifests/init.pp
@@ -51,7 +51,7 @@
 uri=> 'https://mwv-apt.wmflabs.org/repo',
 dist   => "${::lsbdistcodename}-mwv-apt",
 components => 'main',
-trusted=> true,
+can_trust  => true,
 source => false,
 }
 
diff --git a/puppet/modules/apt/manifests/repository.pp 
b/puppet/modules/apt/manifests/repository.pp
index ee11914..23a6c12 100644
--- a/puppet/modules/apt/manifests/repository.pp
+++ b/puppet/modules/apt/manifests/repository.pp
@@ -26,7 +26,7 @@
 # [*keyfile*]
 #   GPG key used to sign packages in this repo. Default undef.
 #
-# [*trusted*]
+# [*can_trust*]
 #   Should this repo be trusted for installing unsinged packages?
 #   Default false.
 #
@@ -42,11 +42,11 @@
 $components,
 $source  = true,
 $keyfile = undef,
-$trusted = false,
+$can_trust   = false,
 $comment_old = false,
 $ensure  = 'present',
 ) {
-$trust = $trusted ? {
+$trust = $can_trust ? {
 true=> '[trusted=yes] ',
 default => '',
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4a5a9673ac2dbb7d955c6783c742c51e0d39082
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: wmflib: Copy from 626a7ccc09 upstream

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

Change subject: wmflib: Copy from 626a7ccc09 upstream
..

wmflib: Copy from 626a7ccc09 upstream

Copy in the upstream operations/puppet.git wmflib module@ 626a7ccc09

Bug: T181354
Change-Id: I1d0fd5be73fccb606a699abefc2dfd101aacee32
---
M puppet/modules/wmflib/README.md
M puppet/modules/wmflib/Rakefile
M puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/mwyaml_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/nuyaml_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/proxy_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/role_backend.rb
M puppet/modules/wmflib/lib/hiera/httpcache.rb
M puppet/modules/wmflib/lib/hiera/mwcache.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/conftool.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/cron_splay.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ensure_mounted.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/get_clusters.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/hash_deselect_re.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/hash_select_re.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/init_template.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/os_version.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/puppet_ssldir.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/require_package.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/requires_os.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/role.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/shell_exports.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/systemd_template.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/sysvinit_template.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/upstart_template.rb
A 
puppet/modules/wmflib/spec/fixtures/modules/foo/templates/initscripts/fooservice.systemd.erb
M puppet/modules/wmflib/spec/functions/conftool_spec.rb
M puppet/modules/wmflib/spec/functions/ensure_mounted_spec.rb
A puppet/modules/wmflib/spec/functions/init_template_spec.rb
M puppet/modules/wmflib/spec/functions/ipresolve_spec.rb
A puppet/modules/wmflib/spec/functions/os_version_spec.rb
M puppet/modules/wmflib/spec/functions/role_spec.rb
M puppet/modules/wmflib/spec/hiera/proxy_backend_spec.rb
M puppet/modules/wmflib/spec/hiera/role_backend_spec.rb
38 files changed, 348 insertions(+), 215 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/94/393494/1

diff --git a/puppet/modules/wmflib/README.md b/puppet/modules/wmflib/README.md
index f6ab3fe..baea3fb 100644
--- a/puppet/modules/wmflib/README.md
+++ b/puppet/modules/wmflib/README.md
@@ -231,8 +231,8 @@
 
 ### Examples
 
-# True if Ubuntu Trusty or newer or Debian Jessie or newer
-os_version('ubuntu >= trusty || debian >= Jessie')
+# True if Ubuntu Trusty or newer or Debian jessie or newer
+os_version('ubuntu >= trusty || debian >= jessie')
 
 # True if exactly Debian Jessie
 os_version('debian jessie')
diff --git a/puppet/modules/wmflib/Rakefile b/puppet/modules/wmflib/Rakefile
index a0c3b79..cd3d379 100644
--- a/puppet/modules/wmflib/Rakefile
+++ b/puppet/modules/wmflib/Rakefile
@@ -1,37 +1 @@
-require 'rake'
-require 'fileutils'
-
-require 'rspec/core/rake_task'
-
-modulename = File.basename(File.expand_path(File.dirname(__FILE__)))
-
-symlinks = { 'spec/fixtures/modules/%s/files' % modulename => 
'../../../../files',
- 'spec/fixtures/modules/%s/manifests' % modulename => 
'../../../../manifests',
- 'spec/fixtures/modules/%s/templates' % modulename => 
'../../../../templates',
-   }
-
-
-task :setup do
-  FileUtils.mkdir_p('spec/fixtures/modules/%s' % modulename)
-  symlinks.each do |x|
-if !File.exist?(x[0])
-  FileUtils.ln_s(x[1], x[0])
-end
-  end
-end
-
-task :teardown do
-  symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
-  FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
-end
-
-RSpec::Core::RakeTask.new(:realspec) do |t|
-  t.fail_on_error = false
-  t.pattern = 'spec/*/*_spec.rb'
-end
-
-task :spec_standalone => [ :setup, :realspec, :teardown]
-
-task :default => :spec do
-end
+require 'puppetlabs_spec_helper/rake_tasks'
diff --git a/puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb 
b/puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb
index fae9f51..3106cf5 100644
--- a/puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb
+++ 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: gerrit: configure for feature branch development

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

Change subject: gerrit: configure for feature branch development
..

gerrit: configure for feature branch development

Bug: T181353
Change-Id: I3acb4cffd286246d6ba52e259ae42fa99a8bac62
---
M .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/90/393490/1

diff --git a/.gitreview b/.gitreview
index 94edce0..f9039ba 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,5 +2,5 @@
 host=gerrit.wikimedia.org
 port=29418
 project=mediawiki/vagrant.git
-defaultbranch=master
+defaultbranch=stretch-migration
 defaultrebase=0

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3acb4cffd286246d6ba52e259ae42fa99a8bac62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: Update $::LOAD_* for Puppet4 compatibility

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

Change subject: puppet4: Update $::LOAD_* for Puppet4 compatibility
..

puppet4: Update $::LOAD_* for Puppet4 compatibility

Puppet4 requires variables to begin with a lowercase letter, so change
our "constants" from uppercase to lowercase.

Bug: T181354
Change-Id: I753a57d55636c5a398d2b80cfe976946367d3c51
---
M puppet/manifests/site.pp
M puppet/modules/mediawiki/manifests/wiki.pp
M puppet/modules/role/manifests/articlecreationworkflow.pp
M puppet/modules/role/manifests/articleplaceholder.pp
M puppet/modules/role/manifests/betafeatures.pp
M puppet/modules/role/manifests/cldr.pp
M puppet/modules/role/manifests/commons.pp
M puppet/modules/role/manifests/education.pp
M puppet/modules/role/manifests/eventbus.pp
M puppet/modules/role/manifests/eventlogging.pp
M puppet/modules/role/manifests/flow.pp
M puppet/modules/role/manifests/gadgets2.pp
M puppet/modules/role/manifests/geodata.pp
M puppet/modules/role/manifests/geodata_elastic.pp
M puppet/modules/role/manifests/jsonconfig.pp
M puppet/modules/role/manifests/offline.pp
M puppet/modules/role/manifests/poolcounter.pp
M puppet/modules/role/manifests/questycaptcha.pp
M puppet/modules/role/manifests/restbase.pp
M puppet/modules/role/manifests/semanticmediawiki.pp
M puppet/modules/role/manifests/visualeditor.pp
M puppet/modules/role/manifests/wikidata.pp
M puppet/modules/role/manifests/zero.pp
23 files changed, 30 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/93/393493/1

diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp
index e67bd18..a71ba7f 100644
--- a/puppet/manifests/site.pp
+++ b/puppet/manifests/site.pp
@@ -17,11 +17,11 @@
 # Human-readable constants which may be used in lieu of literal numbers
 # for specifying loading priority of resource types which support this
 # notion (like mediawiki::extension, mediawiki::settings, and mediawiki::wiki).
-$LOAD_FIRST  = 0
-$LOAD_EARLY  = 5
-$LOAD_NORMAL = 10
-$LOAD_LATER  = 15
-$LOAD_LAST   = 20
+$load_first  = 0
+$load_early  = 5
+$load_normal = 10
+$load_later  = 15
+$load_last   = 20
 
 # Declares a default search path for executables, allowing the path to
 # be omitted from individual resources. Also configures Puppet to log
diff --git a/puppet/modules/mediawiki/manifests/wiki.pp 
b/puppet/modules/mediawiki/manifests/wiki.pp
index dc0fab8..ca75d3e 100644
--- a/puppet/modules/mediawiki/manifests/wiki.pp
+++ b/puppet/modules/mediawiki/manifests/wiki.pp
@@ -65,7 +65,7 @@
 #
 # [*priority*]
 #   Position of this wiki in foreachwiki.  Uses the scale of
-#   the LOAD_ constants from site.php. (default: $LOAD_NORMAL)
+#   the $::load_* constants from site.php. (default: $::load_normal)
 #
 # [*wgconf*]
 #   Hash of extra wgConf settings for this wiki. One use case for this is
@@ -102,7 +102,7 @@
 $upload_path  = "/${title}images",
 $server_url   = 
"http://${title}${::mediawiki::multiwiki::base_domain}${::port_fragment};,
 $primary_wiki = false,
-$priority = $::LOAD_NORMAL,
+$priority = $::load_normal,
 $wgconf   = {},
 ) {
 include ::mwv
diff --git a/puppet/modules/role/manifests/articlecreationworkflow.pp 
b/puppet/modules/role/manifests/articlecreationworkflow.pp
index cd31439..7641e58 100644
--- a/puppet/modules/role/manifests/articlecreationworkflow.pp
+++ b/puppet/modules/role/manifests/articlecreationworkflow.pp
@@ -4,6 +4,6 @@
 # [1] https://www.mediawiki.org/wiki/Extension:ArticleCreationWorkflow
 class role::articlecreationworkflow {
   mediawiki::extension { 'ArticleCreationWorkflow':
-  priority => $::LOAD_EARLY, # Must load before VisualEditor
+  priority => $::load_early, # Must load before VisualEditor
   }
 }
diff --git a/puppet/modules/role/manifests/articleplaceholder.pp 
b/puppet/modules/role/manifests/articleplaceholder.pp
index 606b400..58cd876 100644
--- a/puppet/modules/role/manifests/articleplaceholder.pp
+++ b/puppet/modules/role/manifests/articleplaceholder.pp
@@ -14,7 +14,7 @@
 values   => {
 "wgWBRepoSettings['allowEntityImport']" => true,
 },
-priority => $::LOAD_LATER,
+priority => $::load_later,
 }
 
 mediawiki::import::dump { 'ImportImageProperty':
diff --git a/puppet/modules/role/manifests/betafeatures.pp 
b/puppet/modules/role/manifests/betafeatures.pp
index 3d10cb2..f3fb49f 100644
--- a/puppet/modules/role/manifests/betafeatures.pp
+++ b/puppet/modules/role/manifests/betafeatures.pp
@@ -3,6 +3,6 @@
 class role::betafeatures {
 mediawiki::extension { 'BetaFeatures':
 needs_update => true,
-priority => $::LOAD_EARLY,
+priority => $::load_early,
 }
 }
diff --git a/puppet/modules/role/manifests/cldr.pp 
b/puppet/modules/role/manifests/cldr.pp
index 039893e..2d7e2db 100644
--- a/puppet/modules/role/manifests/cldr.pp

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Switch base image to Debian Stretch

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

Change subject: Switch base image to Debian Stretch
..

Switch base image to Debian Stretch

Bug: T181354
Change-Id: Iab5e0647b9e71c91d0c39c5a043ea45e89eb4d44
---
M Vagrantfile
1 file changed, 10 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/91/393491/1

diff --git a/Vagrantfile b/Vagrantfile
index f39293e..834298c 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -57,13 +57,13 @@
 
   # Default VirtualBox provider
   config.vm.provider :virtualbox do |_vb, override|
-override.vm.box = 'debian/contrib-jessie64'
+override.vm.box = 'debian/contrib-stretch64'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
   # VMWare Fusion provider. Enable with `--provider=vmware_fusion`
   config.vm.provider :vmware_fusion do |_vw, override|
-override.vm.box = 'dhoppe/debian-8.8.0-amd64-nocm'
+override.vm.box = 'gneric/debian9'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
@@ -77,14 +77,14 @@
   # NAT and port redirection are not automatically set up for you.
   #
   config.vm.provider :hyperv do |_hyperv, override|
-override.vm.box = 'ira/leap'
+override.vm.box = 'generic/debian9'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
   # LXC provider. Enable wtih `--provider=lxc`
   # Requires vagrant-lxc plugin and Vagrant 1.7+
   config.vm.provider :lxc do |_lxc, override|
-override.vm.box = 'LEAP/jessie'
+override.vm.box = 'debian/stretch64'
   end
 
   # Parallels provider. Enable with `--provider=parallels`
@@ -96,16 +96,15 @@
   # Note that port forwarding works via localhost but not via external
   # interfaces of the host machine by default...
   config.vm.provider :parallels do |_parallels, override|
-override.vm.box = 'bento/debian-8.9'
+override.vm.box = 'kolaephant/debian9-amd64'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
   # libvirt (KVM/QEMU) provider.  Enable with `--provider=libvirt`.
-  # config.vm.provider :libvirt do |_libvirt, override|
-  #   override.vm.box = 'trusty-cloud'
-
-  #   override.vm.network :private_network, ip: settings[:static_ip]
-  # end
+  config.vm.provider :libvirt do |_libvirt, override|
+override.vm.box = 'debian/stretch64'
+override.vm.network :private_network, ip: settings[:static_ip]
+  end
 
   config.vm.network :forwarded_port,
 guest: settings[:http_port], host: settings[:http_port], host_ip: 
settings[:host_ip],
@@ -210,7 +209,7 @@
 
   config.vm.provision :lsb_check do |lsb|
 lsb.vendor = 'Debian'
-lsb.version = '^8'
+lsb.version = '^9'
   end
 
   config.vm.provision :mediawiki_reload if mwv.reload?

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab5e0647b9e71c91d0c39c5a043ea45e89eb4d44
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: apt: Remove jessie-backports pinning

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

Change subject: apt: Remove jessie-backports pinning
..

apt: Remove jessie-backports pinning

Backports are not needed (yet) on stretch.

Bug: T181354
Change-Id: I5c5bc73a9e38afe71aea3a0b39b2cb6b30e08bb9
---
M puppet/modules/apt/manifests/ppa.pp
M puppet/modules/git/manifests/init.pp
M puppet/modules/role/manifests/horizon.pp
M puppet/modules/role/manifests/keystone.pp
M puppet/modules/swift/manifests/init.pp
M puppet/modules/thumbor/manifests/init.pp
6 files changed, 2 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/97/393497/1

diff --git a/puppet/modules/apt/manifests/ppa.pp 
b/puppet/modules/apt/manifests/ppa.pp
index 67e15ce..260cc93 100644
--- a/puppet/modules/apt/manifests/ppa.pp
+++ b/puppet/modules/apt/manifests/ppa.pp
@@ -33,7 +33,7 @@
 $onlyif  = "/usr/bin/test -e ${listfile}"
 } else {
 # PPA's are for Ubuntu, not Debian but may work if we hack the distro
-# name to be a modern Ubuntu LTS instead of jessie.
+# name to be a modern Ubuntu LTS instead of stretch.
 $command = "/usr/bin/add-apt-repository --yes ppa:${ppa} && /bin/sed 
-i 's/${::lsbdistcodename}/xenial/g' ${listfile} && /usr/bin/apt-get update"
 $onlyif  = "/usr/bin/test ! -e ${listfile}"
 }
diff --git a/puppet/modules/git/manifests/init.pp 
b/puppet/modules/git/manifests/init.pp
index acc39e5..ce8663d 100644
--- a/puppet/modules/git/manifests/init.pp
+++ b/puppet/modules/git/manifests/init.pp
@@ -32,15 +32,9 @@
 'git',
 'git-man',
 ]
-apt::pin { 'git':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1001',
-}
 
 package { $packages:
 ensure  => 'present',
-require => Apt::Pin['git'],
 }
 
 package { 'git-review':
diff --git a/puppet/modules/role/manifests/horizon.pp 
b/puppet/modules/role/manifests/horizon.pp
index b3c7324..739292e 100644
--- a/puppet/modules/role/manifests/horizon.pp
+++ b/puppet/modules/role/manifests/horizon.pp
@@ -94,15 +94,8 @@
   'python-xstatic-term.js',
 ]
 
-apt::pin { 'horizon':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1001',
-}
-
 package { $packages:
 ensure  => 'present',
-require => Apt::Pin['horizon'],
 }
 
 file { "${log_dir}/horizon":
diff --git a/puppet/modules/role/manifests/keystone.pp 
b/puppet/modules/role/manifests/keystone.pp
index bf21d54..0bc0ff2 100644
--- a/puppet/modules/role/manifests/keystone.pp
+++ b/puppet/modules/role/manifests/keystone.pp
@@ -68,15 +68,8 @@
 'websockify',
 ]
 
-apt::pin { 'keystone':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1001',
-}
-
 package { $packages:
 ensure  => 'present',
-require => Apt::Pin['keystone'],
 }
 
 mysql::db { 'keystone':
diff --git a/puppet/modules/swift/manifests/init.pp 
b/puppet/modules/swift/manifests/init.pp
index ceac5fa..51c3bfc 100644
--- a/puppet/modules/swift/manifests/init.pp
+++ b/puppet/modules/swift/manifests/init.pp
@@ -62,23 +62,8 @@
 'swift*'
 ]
 
-apt::pin { 'swift-python-backports':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1000',
-}
-
-package { ['swift', 'swift-account', 'swift-container', 'swift-object', 
'swift-proxy', 'python-webob']:
+package { ['swift', 'swift-account', 'swift-container', 'swift-object', 
'swift-proxy', 'python-webob', 'python-swiftclient']:
 ensure  => 'present',
-require => [
-Apt::Pin['swift-python-backports'],
-],
-}
-
-exec { 'ins-apt-python-swiftclient':
-command => '/usr/bin/apt-get update && /usr/bin/apt-get install -y 
--force-yes -t jessie-backports "python-swiftclient"',
-environment => 'DEBIAN_FRONTEND=noninteractive',
-unless  => '/usr/bin/dpkg -l python-swiftclient',
 }
 
 user { 'swift':
diff --git a/puppet/modules/thumbor/manifests/init.pp 
b/puppet/modules/thumbor/manifests/init.pp
index d27ef9b..784e4e7 100644
--- a/puppet/modules/thumbor/manifests/init.pp
+++ b/puppet/modules/thumbor/manifests/init.pp
@@ -32,12 +32,6 @@
 'python-pil',
 ]
 
-apt::pin { 'thumbor-python-backports':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1000',
-}
-
 package { 'raven':
 provider => 'pip',
 }
@@ -45,9 +39,6 @@
 package { 'python-thumbor-wikimedia':
 ensure  => 'present',
 notify  => 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: Change Vagrantfile for Puppet4

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

Change subject: puppet4: Change Vagrantfile for Puppet4
..

puppet4: Change Vagrantfile for Puppet4

Vagrant will use Puppet4 command semantics when puppet.environment_path
is set in the Vagrantfile.

Bug: T181354
Change-Id: I369cae97aa92d2d1447241dcfb4a5bc73174b6f9
---
M Vagrantfile
A puppet/environments/vagrant/.gitignore
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/92/393492/1

diff --git a/Vagrantfile b/Vagrantfile
index 834298c..87c2a0c 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -226,6 +226,9 @@
 puppet.manifests_path = [:guest, '/vagrant/puppet/manifests']
 puppet.manifest_file = 'site.pp'
 
+puppet.environment_path = [:guest, '/vagrant/puppet/environments']
+puppet.environment = 'vagrant'
+
 puppet.options = [
   '--modulepath', '/vagrant/puppet/modules',
   '--hiera_config', '/vagrant/puppet/hiera.yaml',
diff --git a/puppet/environments/vagrant/.gitignore 
b/puppet/environments/vagrant/.gitignore
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/puppet/environments/vagrant/.gitignore

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I369cae97aa92d2d1447241dcfb4a5bc73174b6f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 

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


[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...ThrottleOverride[master]: Move expired record purge to a job

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

Change subject: Move expired record purge to a job
..

Move expired record purge to a job

Purge expired throttle override records using a job queued after any
creation or edit of another record. Expired records are hidden from the
list special page. Expired records are also filtered out when searching
for rules that apply to a request. These changes ensure that GET
requests remain idempotent.

Bug: T181025
Change-Id: I31e8f464e097a7d62cb02f717cdf68a02256a204
---
M SpecialOverrideThrottle.php
M SpecialThrottleOverrideList.php
M ThrottleOverride.hooks.php
M ThrottleOverridePager.php
A ThrottleOverridePurgeJob.php
M extension.json
6 files changed, 60 insertions(+), 32 deletions(-)


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

diff --git a/SpecialOverrideThrottle.php b/SpecialOverrideThrottle.php
index 0785f9a..9134ada 100644
--- a/SpecialOverrideThrottle.php
+++ b/SpecialOverrideThrottle.php
@@ -202,6 +202,11 @@
$dbw->insert( 'throttle_override', $row, __METHOD__ );
}
 
+   // Queue a job that will delete expired records
+   JobQueueGroup::singleton()->lazyPush(
+   new ThrottleOverridePurgeJob()
+   );
+
return true;
}
 
diff --git a/SpecialThrottleOverrideList.php b/SpecialThrottleOverrideList.php
index 6edfe93..c4af7c1 100644
--- a/SpecialThrottleOverrideList.php
+++ b/SpecialThrottleOverrideList.php
@@ -65,23 +65,6 @@
}
 
function onSubmit( array $data, HTMLForm $form = null ) {
-   if ( !wfReadOnly() && !mt_rand( 0, 10 ) ) {
-   // Purge expired entries on one in every 10 queries
-   $dbw = ThrottleOverrideUtils::getCentraDB( DB_MASTER );
-   $method = __METHOD__;
-   $dbw->onTransactionIdle( function () use ( $dbw, 
$method ) {
-   $dbw->delete(
-   'throttle_override',
-   [
-   $dbw->addIdentifierQuotes( 
'thr_expiry' ) .
-   ' < ' .
-   $dbw->addQuotes( 
$dbw->timestamp() )
-   ],
-   $method
-   );
-   } );
-   }
-
$pager = new ThrottleOverridePager( $this, [
'throttleType' => $data['ThrottleType'],
] );
diff --git a/ThrottleOverride.hooks.php b/ThrottleOverride.hooks.php
index 1dc4e59..c0e2fe7 100644
--- a/ThrottleOverride.hooks.php
+++ b/ThrottleOverride.hooks.php
@@ -68,9 +68,17 @@
$dbr = ThrottleOverrideUtils::getCentraDB( 
DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr 
);
 
+   $quotedIp = $db->addQuotes( $hexIp );
$expiry = $dbr->selectField(
'throttle_override',
'thr_expiry',
+   [
+   "thr_range_start <= $quotedIp",
+   "thr_range_end >= $quotedIp",
+   'thr_expiry > ' . 
$dbr->addQuotes( $dbr->timestamp() ),
+   'thr_type' . $dbr->buildLike(
+   $dbr->anyString(), 
$action, $dbr->anyString() ),
+   ],
ThrottleOverrideHooks::makeConds( $dbr, 
$hexIp, $action ),
'ThrottleOverrideHooks::onPingLimiter',
[ 'ORDER BY' => 'thr_expiry DESC' ]
@@ -112,14 +120,6 @@
 
$result = false;
return false;
-   } elseif ( $expiry !== false ) {
-   // Expired exemption. Delete it from the DB.
-   $dbw = ThrottleOverrideUtils::getCentraDB( DB_MASTER );
-   $dbw->delete(
-   'throttle_override',
-   self::makeConds( $dbw, $hexIp, $action ),
-   __METHOD__
-   );
}
 
return true;
@@ -134,13 +134,6 @@
 * @return array Conditions
 */
private static function makeConds( $db, $hexIp, $action ) {
-   $quotedIp = $db->addQuotes( $hexIp );
- 

[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Add multi-wiki support

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

Change subject: Add multi-wiki support
..

Add multi-wiki support

Add a $wgThrottleOverrideCentralWiki configuration setting  that can be used to
designate a single wiki in a wiki farm as the location for managing
ThrottleOverride exemptions.

Bug: T147364
Change-Id: I56fa0866133668a2151ce04510e0021f0ae3cbdd
---
M SpecialOverrideThrottle.php
M SpecialThrottleOverrideList.php
M ThrottleOverride.hooks.php
A ThrottleOverrideUtils.php
M extension.json
5 files changed, 77 insertions(+), 13 deletions(-)


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

diff --git a/SpecialOverrideThrottle.php b/SpecialOverrideThrottle.php
index 7599ece..0785f9a 100644
--- a/SpecialOverrideThrottle.php
+++ b/SpecialOverrideThrottle.php
@@ -124,7 +124,7 @@
$data['Target']['default'] = $this->par;
 
// We need the most recent data here, we're about to 
change the throttle.
-   $dbw = wfGetDB( DB_MASTER );
+   $dbw = ThrottleOverrideUtils::getCentraDB( DB_MASTER );
$row = $dbw->selectRow(
'throttle_override',
[ 'thr_expiry', 'thr_reason', 'thr_type' ],
@@ -181,7 +181,7 @@
$logEntry->publish( $logId );
 
// Save the new exemption
-   $dbw = wfGetDB( DB_MASTER );
+   $dbw = ThrottleOverrideUtils::getCentraDB( DB_MASTER );
$row = [
'thr_target' => $this->target,
'thr_expiry' => $dbw->encodeExpiry( $data['Expiry'] ),
@@ -214,7 +214,7 @@
 * @return int
 */
public static function getThrottleOverrideId( $ip, $dbtype = DB_REPLICA 
) {
-   $db = wfGetDB( $dbtype );
+   $db = ThrottleOverrideUtils::getCentraDB( $dbtype );
$field = $db->selectField(
'throttle_override',
'thr_id',
diff --git a/SpecialThrottleOverrideList.php b/SpecialThrottleOverrideList.php
index 7113ce3..6edfe93 100644
--- a/SpecialThrottleOverrideList.php
+++ b/SpecialThrottleOverrideList.php
@@ -67,7 +67,7 @@
function onSubmit( array $data, HTMLForm $form = null ) {
if ( !wfReadOnly() && !mt_rand( 0, 10 ) ) {
// Purge expired entries on one in every 10 queries
-   $dbw = wfGetDB( DB_MASTER );
+   $dbw = ThrottleOverrideUtils::getCentraDB( DB_MASTER );
$method = __METHOD__;
$dbw->onTransactionIdle( function () use ( $dbw, 
$method ) {
$dbw->delete(
diff --git a/ThrottleOverride.hooks.php b/ThrottleOverride.hooks.php
index 6db4026..1dc4e59 100644
--- a/ThrottleOverride.hooks.php
+++ b/ThrottleOverride.hooks.php
@@ -44,7 +44,7 @@
 * @return bool
 */
public static function onPingLimiter( User &$user, $action, &$result, 
$ip = null ) {
-   global $wgRateLimits;
+   global $wgRateLimits, $wgThrottleOverrideCentralWiki;
 
if ( $action !== 'actcreate' && !isset( $wgRateLimits[$action] 
) ) {
return true;
@@ -59,10 +59,13 @@
 
$cache = 
MediaWikiServices::getInstance()->getMainWANObjectCache();
$expiry = $cache->getWithSetCallback(
-   $cache->makeKey( 'throttle_override', $action, $hexIp ),
+   $cache->makeKey(
+   'throttle_override',
+   $wgThrottleOverrideCentralWiki, $action, $hexIp
+   ),
$cache::TTL_HOUR,
function ( $cValue, &$ttl, &$setOpts, $asOf ) use ( 
$hexIp, $action ) {
-   $dbr = wfGetDB( DB_REPLICA );
+   $dbr = ThrottleOverrideUtils::getCentraDB( 
DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr 
);
 
$expiry = $dbr->selectField(
@@ -111,7 +114,7 @@
return false;
} elseif ( $expiry !== false ) {
// Expired exemption. Delete it from the DB.
-   $dbw = wfGetDB( DB_MASTER );
+   $dbw = ThrottleOverrideUtils::getCentraDB( DB_MASTER );
$dbw->delete(
'throttle_override',
self::makeConds( $dbw, $hexIp, $action ),
@@ -162,4 +165,18 @@
 
return true;
}
+
+   public static function onSetupAfterCache() {
+   global $wgThrottleOverrideCentralWiki;
+ 

[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Use WANCache for throttle lookups

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

Change subject: Use WANCache for throttle lookups
..

Use WANCache for throttle lookups

Check for throttle records in the configured WANCache instance and cache
new database lookup results on cache miss. Cached data is not purged
when the backing database record is edited, so the cache duration is low
(1 hour).

Bug: T147362
Change-Id: I11aa1eb5c13edb3638970fcba4d41a689bc106f7
---
D ThrottleOverride.hooks.php
A ThrottleOverrideHooks.php
M extension.json
3 files changed, 161 insertions(+), 121 deletions(-)


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

diff --git a/ThrottleOverride.hooks.php b/ThrottleOverride.hooks.php
deleted file mode 100644
index c52a353..000
--- a/ThrottleOverride.hooks.php
+++ /dev/null
@@ -1,120 +0,0 @@
-
- *
- * 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 3 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, see .
- */
-
-use MediaWiki\Logger\LoggerFactory;
-
-class ThrottleOverrideHooks {
-   /**
-* @param string $ip
-* @return bool
-*/
-   public static function onExemptFromAccountCreationThrottle( $ip ) {
-   $result = false;
-   $user = RequestContext::getMain()->getUser();
-   return self::onPingLimiter( $user, 'actcreate', $result, $ip );
-   }
-
-   /**
-* @throws InvalidArgumentException If $action is invalid
-*
-* @param User $user
-* @param string $action
-* @param $result
-* @param null|string $ip
-*
-* @return bool
-*/
-   public static function onPingLimiter( User &$user, $action, &$result, 
$ip = null ) {
-   global $wgRateLimits;
-
-   if ( $action !== 'actcreate' && !isset( $wgRateLimits[$action] 
) ) {
-   return true;
-   }
-
-   $dbr = wfGetDB( DB_REPLICA );
-
-   if ( $user->isAnon() && IP::isValid( $user->getName() ) ) {
-   $ip = $user->getName();
-   } elseif ( $ip === null ) {
-   $ip = RequestContext::getMain()->getRequest()->getIP();
-   }
-
-   $quotedIp = $dbr->addQuotes( IP::toHex( $ip ) );
-   $conds = [
-   "thr_range_start <= $quotedIp",
-   "thr_range_end >= $quotedIp",
-   'thr_type' . $dbr->buildLike( $dbr->anyString(), 
$action, $dbr->anyString() )
-   ];
-
-   $expiry = $dbr->selectField(
-   'throttle_override',
-   'thr_expiry',
-   $conds,
-   __METHOD__,
-   [ 'ORDER BY' => 'thr_expiry DESC' ]
-   );
-
-   if ( $expiry > wfTimestampNow() ) {
-   // Valid exemption. Disable the throttle.
-
-   $logger = LoggerFactory::getInstance( 
'throttleOverride' );
-   $logger->info( 'User {user} (ip: {ip}) exempted from 
throttle {action}', [
-   'user' => $user,
-   'ip' => $ip,
-   'action' => $action,
-   ] );
-
-   $result = false;
-   return false;
-   } elseif ( $expiry !== false ) {
-   // Expired exemption. Delete it from the DB.
-   wfGetDB( DB_MASTER )->delete(
-   'throttle_override',
-   $conds,
-   __METHOD__
-   );
-   }
-
-   return true;
-   }
-
-   /**
-* @param DatabaseUpdater $updater
-* @return bool
-*/
-   public static function onLoadExtensionSchemaUpdates( DatabaseUpdater 
$updater ) {
-   $updater->addExtensionTable(
-   'throttle_override',
-   __DIR__ . '/patches/table.sql'
-   );
-   $updater->addExtensionIndex(
-   'throttle_override',
-   'thr_expiry',
-   __DIR__ . '/patches/expiry_index.sql'
-  

  1   2   3   4   5   6   7   8   9   10   >