New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto update migrations #1151
base: doryphore-dev
Are you sure you want to change the base?
Auto update migrations #1151
Conversation
4e15609
to
2297b12
Compare
@seballot gros et beau travail. J'ai identifié dans ta branche de travail quelques points qui pourraient être améliorés pour nous prémunir d'attaques farfelues mais possibles. Est-ce que tu souhaites que je te propose une petite PR vers ta branche pour te proposer ces correctifs ? |
oui bien sur ! merci :) |
OK je te prépare ceci d'ici demain. |
…ame instead of $defaultName
2297b12
to
e2aa15f
Compare
@seballot j'essaie de comprendre le code de cette PR pour anticiper les impacts pour les extensions.
Qu'en dis-tu ? |
oui pas de soucis pour émettre des évènements, bonne idée ! |
Je te fais une PR dans ce sens d'ici lundi |
As-tu essayé en mettant dans Parce que pour les tests automatiques en ligne de commande, il n'y a pas l'interface web avec le js pour faire ce qu'il faut pour faire la sauvegarde automatique |
faudra plutot voir si l'on peut rendre les backups auto avant upgrade compatibles cli et docker, j'essayerais de regarder si c'est faisable facilement, sinon je ferai une issue pour que l'on corrige le soucis un jour. |
Normalement, ça vient de l'image docker qui n'ouvre pas les droits d'écriture pour le dossier |
UpdateHandler
to a serviceMigrationsService
, with a new mecanism to perform migration (see below)update
action to use the new YesWikiAction styletools/atoupdate/app
totools/autoupdate/entities
./yeswicli migrate
and./yeswicli upgrade (package)
To create a new migration :
./yeswicli generate:migration
It will create a new file under
migrations
folder. You can move this file in a tools folder if you prefer (or in extensions)Once the file is ready, run
./yeswicli migrate
Each migration completed is stored in the TripleStore, so we run it only once.
The migration is automatically done when upgrading the wiki or an extension via the UI. It's also done when docker start (see entrypoint.sh)
A lot of the migration code that I have moved is obscure to me, I hope I did not do any mistake. The migrations run for me, but I cannot test the result for sure
I have also remove all the outputs from previous migration, leaving only one message if the migration passed or not
Main files to review
UpdateAction.php
MigrationsService.php
Sorry it will be hard to review cause a lot of code have been moved, with some small changes. Also some linting have been applied here and there..
The commit history is not super clean because I have made different tries so come out to the final solution with one file per migration
How to test
For me, using docker, the back ups are not working, preventing to test the update process, so I comment those lines to skip it