Page MenuHomePhabricator

vagrant destroy && vagrant up doesn't trigger the needs_update field of mediawiki::extension
Closed, ResolvedPublic

Description

Performing a destroy and recreate when using an extension that has db changes seems to have a bug of some sort, not really sure how to fix this:

Reproduction steps:

create a vanilla instance

vagrant up

enable and provision flow

vagrant enable-role flow
vagrant provision

at this point flow works

vagrant destroy
vagrant up

now flow errors out because it cant find its database tables

rm settings.d/puppet-managed/10-Flow.php
vagrant provision

now everything works again


Version: unspecified
Severity: normal

Details

Reference
bz62550

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:01 AM
bzimport set Reference to bz62550.

This happens because the Exec['update database'] puppet step only happens when the contents of the extension specific settings file change. In the given workflow, the puppet run triggered by the second vagrant up command will check settings.d/puppet-managed/10-Flow.php and find that the current file on disk has the correct sha1 and thus not fire the notify event that triggers the database update.

It should be possible to use the vagrant plugin API's action_hook call as part of the MediaWiki-Vagrant plugin to install a routine to run following vagrant destroy that would clean up the various puppet-managed settings files in settings.d. This would mimic the manual rm of the extension settings.

I have a dist-clean.sh script that I use to reset the Vagrant environment that I use for testing pending gerrit commits which does something similar:

#!/usr/bin/env bash
set -e
vagrant destroy -f
rm settings.d/puppet-managed/*
git checkout -- settings.d/puppet-managed/README
rm -rf settings.d/multiwiki/
rm -rf puppet/manifests/manifests.d/vagrant-managed.pp
rm -rf .settings.yaml

Change 146002 had a related patch set uploaded by BryanDavis:
Purge puppet created files on host when destroying

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

Change 146002 merged by jenkins-bot:
Purge puppet created files on host when destroying

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