[16.0][IMP] Add support for migration scan between repository (modules moved to new repos)#91
Conversation
d200831 to
411efbc
Compare
9913122 to
af9d269
Compare
hparfr
left a comment
There was a problem hiding this comment.
I didn't read carefully this PR yet.
I think it can bee cool if we can know between 2 major versions (16->18):
- module rename
- change of repository
- discontinuation of a module (because not needed anymore | or merged into another (=rename)
- split of module
Odoo Standard
Example: coupon, gift_card -> loyalty
Expected: coupon: removed, loyalty added. We don't care about migration for std modules.
OCA
Renaming:
Example: delivery_carrier_customer_info -> partner_delivery_info
About migration: it' a problem of oca-port.
Repository change:
OCA/stock-logistics-warehouse/
stock_quant_package_dimension -> OCA/stock-logistics-tracking/
stock_quant_package_dimension
Split:
(14) base_delivery_carrier_label -> (16) base_delivery_carrier_label + (16) delivery_carrier_account
Publishing on OCA:
(14) custom_module -> (16) oca_module
How does oca-port handle all these cases ?
IMO, having just a "rename" link between two modules in diffrent versions is ok here.
There was a problem hiding this comment.
moved_to_standard does it exists ?
May be just moved is enough ?
There was a problem hiding this comment.
Yes, module l10n_eu_oss (while it's not really a move, more Odoo that creates its own, and OCA needed to rename its own with suffix _oca), same for knowledge module, Odoo creates its own enterprise module starting from 16.0, forcing OCA to rename it document_knowledge.
So I agree it's not really a "move" functionally speaking, it's the technical module name that has been moved only, but that highlight something we should take care during a migration.
|
@hparfr I agree with all your remarks. But some of these data cannot easily be retrieved only by scanning code (or we cannot be confident with them to automate the process if we start to parse PR description/commit content to understand what happened - even module renaming is difficult to see with how So basically how I see things:
For now |
|
On OCA. We have the issue for instance for Someone can try to migrate the module OCA/stock-logistics-warehouse#18.0 If it's the same name, we may have a warning by pypi. But if there is module rename, we may never see it. I think of two implementations: A) On the repo: It will create on OCA/stock-logistics-warehouse/ # Issue B) On a global repo: it can be then used for generate openupgrade#apriori |
|
I like the idea to get a mapping file somewhere in OCA to consolidate this knowledge that can be used by any tool 👍 EDIT: we should use a JSON or YAML format with such file so pre-commit can validate its format |
|
Do you know where i can put this discussion ? |
|
On the contributor mailing list I guess |
|
I thinked a lot about this. One first easier step is first to declare the change. In a second time, leverage the tagged PR by ocabot to generate a list of the change and publish it in a new repo.
I found something a bit akward but lot more simple and no subject to conflicts: just create folders and files. Like this: tree
.
├── 16.0
│ ├── account
│ │ └── odoo
│ │ └── odoo
│ │ └── oca
│ │ └── account-financial-tool
│ │ ├── account_balance_line
│ │ └── account_force-removal
│ ├── account_edi_facturx
│ │ └── odoo
│ │ └── odoo
│ │ └── odoo
│ │ └── odoo
│ │ └── account_edi_ubl_cii
│ ├── account_edi_ubl
│ │ └── odoo
│ │ └── odoo
│ │ └── odoo
│ │ └── odoo
│ │ └── account_edi_ubl_cii
│ ├── account_edi_ubl_bis3
│ │ └── odoo
│ │ └── odoo
│ │ └── odoo
│ │ └── odoo
│ │ └── account_edi_ubl_cii
│ ├── account_reconciliation_widget
│ │ └── oca
│ │ └── account-reconcile
│ │ └── oca
│ │ └── account-reconcile
│ │ └── account_reconcile_oca
│ ├── base_delivery_carrier_label
│ │ └── oca
│ │ └── delivery-carrier
│ ├── loyalty
│ │ └── odoo
│ │ └── odoo
│ │ └── odoo
│ │ └── odoo
│ │ └── coupon
│ └── payment_test
│ └── odoo
│ └── odoo
│ └── odoo
│ └── odoo
│ └── payment_demo
├── 17.0
│ └── base_delivery_carrier_label
│ └── oca
│ └── delivery-carrier
└── 18.0
├── base_delivery_carrier_label
│ └── oca
│ └── delivery-carrier
│ └── oca
│ └── delivery-carrier
│ └── base_delivery_carrier_label
├── delivery_carrier_account
│ └── oca
│ └── delivery-carrier
│ └── oca
│ └── delivery-carrier
│ └── base_delivery_carrier_label
├── partner_delivery_info
│ └── oca
│ └── delivery-carrier
│ └── oca
│ └── delivery-carrier
│ └── delivery_carrier_customer_info
└── stock_quant_package_product_packaging
└── oca
└── stock-logistics-tracking
└── oca
└── stock-logistics-workflow
└── stock_quant_package_product_packagingthe layout is: (d) : directory A ci workflow can then just generate a listing directory .html and an apriori (openupgrade) file (the algo may be quite stupid). |
|
I like the idea, the structure is a bit akward like you said but the usage is simple. That means: EDIT: But how to use that structure easily to answer the question "how this {module} of version {x} was migrated in next version?", we only have as input the name of the module, and its current version. The current structure implies to know at first EDIT: I would change the |
Yes.
Not exactly. For instance, if module NOTE: I didn't state it in my first example, but I think know it's better to always complete this file: standard migration, module addition, and of course module rename / module merge ... I do not know the good practice when someone needs it in v17. I think it's better to keep the old repo / old name in this case, but it's not necessary to enforce it. I guess both will work within
The structure tells you the actual situation and is never changed. Like I said just previously, if some module is not migrated every version, you don't konw where it will in the intermediate version if it's ported lated (v17: delivery_carrier_customer_info or partner_delivery_info). With the following timeline:
$ find . -name 'delivery_carrier_customer_info'
15.0/delivery_carrier_customer_info/oca/delivery-carrierWe know the module at this time only exists in v15
$ find . -name 'delivery_carrier_customer_info'
15.0/delivery_carrier_customer_info/oca/delivery-carrier
16.0/delivery_carrier_customer_info/oca/delivery-carrier
$ find . -name 'delivery_carrier_customer_info'
15.0/delivery_carrier_customer_info/oca/delivery-carrier
16.0/delivery_carrier_customer_info/oca/delivery-carrier
18.0/partner_delivery_info/oca/delivery-carrier/oca/delivery-carrier/delivery_carrier_customer_infoAt this time, we know the module has not been migrated in v17 yet. $ find . -name 'partner_delivery_info'
18.0/partner_delivery_info/oca/delivery-carrier/oca/delivery-carrier/delivery_carrier_customer_infoSo here, we know it's the first occurence of partner_delivery_info; It's not a merge of the modules, just a rename.
$ find . -name 'delivery_carrier_customer_info'
15.0/delivery_carrier_customer_info/oca/delivery-carrier
16.0/delivery_carrier_customer_info/oca/delivery-carrier
17.0/partner_delivery_info/oca/delivery-carrier/oca/delivery-carrier/delivery_carrier_customer_info
18.0/partner_delivery_info/oca/delivery-carrier/oca/delivery-carrier/delivery_carrier_customer_infoHere, we see they did not enforce the good practice and renamed the module in v17, but they not forget to tell us ! I think we will add a ci step, it will generate a apriori.py, some reports, yaml... for easy parsing and inverse lookup when you need it.
I didn't get it :) |
|
Ok, so this structure is answering the question perfectly if we use But whatever, as soon as we have these info gathered somewhere, we can fetch them and re-consolidate these data the way we want to ease requests (like Sounds good 👍 |
af9d269 to
2e85a1b
Compare
…ories
This supports the migration scan for modules that have been moved to
another repository.
This commit also adds new technical flags and migration states to
improve module qualification during a migration:
- Moved to standard
- Moved to OCA
- Moved to generic repo (specific modules moved to generic repo)
Migration with such states won't trigger a migration scan as modules
could be different. E.g. 'l10n_eu_oss' Odoo module is not the same than
OCA one starting from 15.0, and OCA renamed its module 'l10n_eu_oss_oca' from
this version, either to complete std implementation, or to propose
another one. So these states will help integrators to identify such
modules.
Later we could add a feature to set a given module as renamed from a
given version, like 'l10n_eu_oss' renamed to 'l10n_eu_oss_oca', so the
module won't be qualified with 'Moved to standard' state as it's just a
renaming. But such feature will require to also improve 'oca-port' to
handle such case to perform a migration scan.
2e85a1b to
c34e6b5
Compare
|
Will merge this one, and will open another PR to address module renaming:
It will also leverage the renaming of module with Current PR has been tested live for weeks now, working fine. |
This supports the migration scan for modules that have been moved to another repository (like mail modules moved from OCA/social to OCA/mail starting from 18.0):

This commit also adds new technical flags and migration states to improve module qualification during a migration:
- Moved to standard
- Moved to OCA
- Moved to generic repo (specific modules moved to generic repo)
Migration with such states won't trigger a migration scan as modules could be different. E.g.
l10n_eu_ossOdoo module is not the same than OCA one starting from 15.0, and OCA renamed its modulel10n_eu_oss_ocafrom this version, either to complete std implementation, or to propose another one. So these states will help integrators to identify such modules.Later we could add a feature to set a given module as renamed from a given version, like
l10n_eu_ossrenamed tol10n_eu_oss_oca, so the module won't be qualified withMoved to standardstate anymore as it's just a renaming. But such feature will require to also improveoca-portto handle such case to perform a migration scan.Project module migration status will be updated accordingly as well:
