-
-
Notifications
You must be signed in to change notification settings - Fork 707
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
[RFC] OCA modules migration scripts host #2661
Comments
In my opinion the closer the migration code is to where the actual code is, the better. Also migration scripts between major versions OCA modules are not so different from migration scripts of minor ones |
Well, the same can apply then to Odoo core modules and OpenUpgrade migration scripts, and in v14 we have isolate both in the refactoring. Anyways, this opinion is welcomed and I'll add it to the cons. |
Specially, we have to consider the design changes inside the same serie. Usually we have an atomtic PR with both the design change and its migration script, all goes inside the same merge once aproved together. If we split the business logic and the OpenUpgrade script instead, it may be harder to guarantee a smooth user experience: for instance the module change 1st, break everyone installation and the OpenUpgrade script makes it only a few days later. You may also not checkout the 2 repos when you should... Also consider the discrepencies in the review process, the fact the number of OpenUpgrade PSC cannot scale to the diversity of the other modules repos PSCs... OpenUpdgrade PSC will likely have no clue what module change in localization X means, hence the review process may lag or instead be too permissive if localization guys start to approve generic OpenUpgrade wizardery they don't master... |
It's not the same thing. For changes inside same version, migration scripts will still be in the same repository, as they belong to them. This is only for strictly major version changes (from 13.0 to 14.0 for example).
Again this is a problem for changes inside same version. Even for changes across versions, when a module is migrated to a new version, it can delay a lot of time until migration scripts for previous version are proposed.
This fact exists more or less doing it on the other OCA repository: you can be a PSC and don't know anything about a specific module to validate the migration scripts. Anyways, there's another cons that I'm annotating (with a possible workaround): merges must be done by OpenUpgrade PSCs, not repo PSCs. |
Hi @pedrobaeza. Thanks for your RFC, and for centralizing analysis. |
Regarding the pro-arguments
For exemple, for the web module
Point A : how the test environment will know how to test that script ? based on the last version available ? (the 10.0) Regarding the cons-arguments
(*) : it is theoretical, because the version 12 of openupgrade is on the old design. But it's just an exemple. |
I would be in favor of not changing (keep migration scripts inside the OCA modules repos) for the following reasons:
|
@legalsylvain don't understimate having the CI for OCA modules migration scripts. We are not talking about creating tests for them, but at least being run for not having an invalid SQL expression or data integrity in a real flow in a migration from previous version to current one. This test is very difficult to be done by scripts developers, as the needed playground for such thing is very huge. My idea on the CI workflow is to see subfolders (aka modules names) of the new folder |
Something I was thinking about: may be we can find a way, for each repo to elect the modules wich are both the most mature and the most popular (warning announce you do all accounting for country X can drive a lot of hype, it doesn't necessarily translate to being a mature module, IMHO these modules should be both popular and mature/serious). For instance we can ask each PSC to give a shortlist of 10% of most mature+popular modules of their repo and start from there. Then for these popular and mature modules, eventually, we also get their major serie migration tested in OCA/OpenUpgrade as @pedrobaeza suggested. But we would still get the scripts maintained in the modules repos. I also want to emphasis migrations between series and minor are not so different as some said, they are usually done by the same people and often a major change is in fact done inside the same serie. Specially because just the migration might be a lot of work so design changes are often postponed months later after the bare serie migration. Random examples of both mature and popular modules I can think about: That would both serve as offering a stronger foundation basis for everybody, without creating a new monster that wouldn't scale and just make OpenUpgrade a mess IMHO. |
@rvalyi usually the modules that you mention don't require migration scripts, and the list can be subjective, so I don't think doing some of them here and others inline would help, so I would say that is an all or nothing question, and for now it seems all of you prefer to leave it as is. If nothing changes in the coming days, I just close this and continue the same way. |
Agree with everything that @jcdrubay says in #2661 (comment). I would much prefer to keep the migration files together with their module code. |
I'm also in favor of keeping migration scripts of a module close to its code (i.e. inside the module itself). About having migration scripts in OpenUpgrade:
Managing migration scripts differently for major and minor version can be confusing for the developer, because they are basically the same thing. |
OK, then I think it's not worth to keep this discussion. Let's close the RFC and keep as we are. Thanks all for your opinions. |
Hello @pedrobaeza there is also an other issue with the "test all OCA module migration in OpenUpgrade" approach you suggested when you say "all or nothing". Bare in mind that it's impossible to even just install all modules together. It's already hard to get all modules on a single repo install together and get their test all passing... So if you would like to test these modules migration, I think you have to go for a shortlist no matter what, otherwise be prepared for adding extra 100+ Travis runs per OCA/Openupgrade test run (like one pass per repo). And again this raises a scalability issue... Again I praise the intention, I just question the way to do it. |
You don't need to install everything. Just the modules that have migration scripts here (a few). Anyways, no need to discuss more, as most people don't want this, so let's focus in other things (like v14 migration scripts 😉) |
Due to the new design of OpenUpgrade in v14, we can host all the migration scripts here (Odoo core modules and OCA modules) in this repository, as they will be used the same as for the core modules. Let's balance the pros and cons:
This is summarizing whole thread
Pros of putting everything together in OCA/OpenUpgrade repo
Cons of putting everything together in OCA/OpenUpgrade repo:
[1] The scripts can't be used by other upgrade mechanisms, like the enterprise one. I think this is not totally true (but I can't confirm for sure), as enterprise process will upgrade core modules, and then you can perform another update, and you are able to indicate this repo as migration scripts source, and only not yet updated modules will be run.
I also don't think this is necessarily a cons, as some migration scripts are very coupled to the design decisions done on OpenUpgrade, so they will miserably fail when used with other migration process. For example, on v13, we put on
account.move
the fieldold_invoice_id
for pointing to the legacyaccount.invoice
record that links to the move. The rest of the modules that added fields onaccount.invoice
and now are moved toaccount.move
, contains migration scripts based on this assumption. You then decide if using this as migration path or not for your migration process.[2] This repository will get more dirty. True, but we can organize folders this way:
\openupgrade_framework
\openupgrade_scripts
\oca_scripts
and host in the last one the migration for OCA modules, and thus we split conveniently the number of contained folders.
[3] When migrating a module to v14, you may want to add migration scripts at the same time, and with this structure, you are forced to do 2 PRs, one in the module repo, and one here. This one can't be avoided, but for me it's not a great trade-off.
[4] Pointed by @JordiBForgeFlow: The closer the migration code is to where the actual code is, the better. Answer by @pedrobaeza: We have such isolation though on Odoo core/OpenUpgrade main migration scripts now on v14.
[5] Pointed by @JordiBForgeFlow: migration scripts between major versions OCA modules are not so different from migration scripts of minor ones. Answer by @pedrobaeza: I think minor versions migration scripts are very rare and specific, while major versions scripts are common and very tied to OpenUpgrade itself, so not too much in common.
[6] Inspired by @rvalyi: merges must be done by OpenUpgrade PSCs, not repo PSCs. Answer by @pedrobaeza: This can be workarounded with a delegate system like Odoo has in their repo, writing
\ocabot delegate @OCA/accounting-maintainers
or similar for allowing to merge to that people. This needs to be developed though.As you can see in my rationale, I clearly see that including them here is a better approach, but maybe I'm missing some cons or PoV, so let's start the debate!
The text was updated successfully, but these errors were encountered: