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

Check migration before yunohost operation #599

Open
wants to merge 1 commit into
base: stretch-unstable
from

Conversation

Projects
None yet
2 participants
@Josue-T
Copy link
Contributor

Josue-T commented Dec 12, 2018

The problem

Doing the migration is not mandatory to be able to use Yunohost.

By example we can have a use case of a user which upgrade the debian package but don't do the migration.

If the migration change the structure of data in yunohost, using Yunohost without doing the migration could make some data corruption.

Solution

Add a mechanism to check if a migration is mandatory before to do the actions.

PR Status

Should be ready. Need more tests.

How to test

Create a migration mandatory. If your migration contains this code is mandatory :

    @property
    def required(self):
        return True

Try to do some yunohost action before before the migration is done. Normally you should have this message :

Erreur : To be able do the yunohost operation you need to do the migration

After do the migration and check that you can do everything you want.

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :

@Josue-T Josue-T requested review from Psycojoker , JimboJoe , zamentur , alexAubin and YunoHost/core-dev Dec 12, 2018

@Psycojoker

This comment has been minimized.

Copy link
Member

Psycojoker commented Dec 14, 2018

Create a migration mandatory. If your migration contains this code is mandatory :

    @property
    def required(self):
        return True

FYI you can simply do:

class Migration(...):
    required = True

And it will do the same thing.

@Josue-T Josue-T force-pushed the check_migrations branch from 34449ed to 20b1b95 Dec 14, 2018

@Josue-T

This comment has been minimized.

Copy link
Contributor

Josue-T commented Dec 14, 2018

Should be changed

@Josue-T Josue-T force-pushed the check_migrations branch from 20b1b95 to 7d412ae Dec 15, 2018

@Josue-T Josue-T force-pushed the check_migrations branch from 7d412ae to 2fed2e9 Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment