Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: [NEWS] oca-port: a new version has been released!

by
Camptocamp France SAS, Sébastien Alix
- 20/11/2024 17:27:36

Yes exactly it is a helper, but it won't do everything automatically sadly :)

When it comes to migrate a module, it'll play the usual "git format-patch" command and pre-commit for you, and will print the next steps (and the link of the OCA migration guide you just provided).

But its main strength is to compare two different git history (e.g. 14.0 and 16.0) for a module already migrated but which evolved overtime in 14.0, and list missing commits from 14.0 in 16.0, and "help" you to port them, example here some ports for the module 'account_invoice_section_sale_order', one branch after another:

Basically it's mostly a helper to forward-port and backport (switch the branches!) commits from one branch/repo to another.

Here are talks that were made about this tool:

Yes, I'm not good to promote things, will try to improve that!

Le 20/11/2024 à 15:52, Rolando Pérez Rebollo a écrit :

Wow, are there any OCA talks or similar about this? I've just discovered. From the readme looks like could assist in the migration of addons. Is It a helper that replace manual work when doing stuff like https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0?

On 11/20/24 06:13, Mignon, Laurent wrote:
Thank you Sébastion for this useful and powerful tool!

On Wed, Nov 20, 2024 at 11:47 AM David Vidal <notifications@odoo-community.org> wrote:
Thanks for the great work!

El mié, 20 nov 2024 a las 11:38, Sebastien Alix (<notifications@odoo-community.org>) escribió:

Hello there!

A new version of oca-port has been released:

This new version changed the CLI parameters, and now allows to migrate modules or port commits from one repository to another thanks to the new syntax.

Let's say that origin remote is for OCA/social, and mail remote for the newly created OCA/mail repository, to check if mail_tracking is migrated or have commits to port from 16.0 to 18.0:

  $ cd ~/OCA/social
  $ git remote add mail git@github.com:OCA/mail.git
  $ oca-port origin/16.0 mail/18.0 mail_tracking --verbose --fetch --dry-run

Output:

Source: origin/16.0, remote origin git@github.com:OCA/social.git
Target: mail/18.0, remote mail git@github.com:OCA/mail.git
Fetch origin/16.0 from git@github.com:OCA/social.git
Fetch mail/18.0 from git@github.com:OCA/mail.git
⚠️	Migration of mail_tracking seems handled in this PR:
		https://github.com/OCA/mail/pull/1 (by trisdoan)
	We invite you to review this PR instead of opening a new one. Thank you!
ℹ️  mail_tracking can be migrated from 16.0 to 18.0.

Seems there is already a PR open on OCA/mail to migrate this module, better to review this one before opening a new one!

Otherwise, by removing the --dry-run flag (with an optional --destination) we could handle the migration, following OCA migration guide.

If a module is already migrated, the list of missing commits (if any) grouped by PR will be listed, up to the user to port or to blacklist them if they are not relevant.

This new version also allows you to migrate modules located in a subfolder instead of the root directory, useful for private project repositories for instance.

ROADMAP:

  • integrate odoo-module-migrator to automatically upgrade code when migrating a module (WIP)
  • register/handle renamed modules

Ideas, bugfixes and improvements are welcome.

Have a good day,

-- 
Sébastien Alix
Business Solutions Odoo Developer

Camptocamp France SA
https://www.camptocamp.com/

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

-- 
Sébastien Alix
Business Solutions Odoo Developer

Camptocamp France SA
https://www.camptocamp.com/

Reference