Skip to content

[IMP] Add support for module renaming #74

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sebalix
Copy link
Collaborator

@sebalix sebalix commented Apr 2, 2025

Different approach than #64 to move/rename a module to address issue #11:

  • new module name is given as an optional parameter: oca-port {source} {target} {addon_path} [--move-to {new_addon_path}]
  • store the old name + new name in source/target data object
  • move/rename a module once the git history is retrieved (with git-filter-repo, thanks for the tip @trisdoan )
  • use git filter-branch to rename the module (see [18.0][MIG] commission + rename to commission_oca commission#610 (comment))
  • rename terms in the renamed modules (in PO files, XML-ID references...)
  • 🚧 adapt PortAddonPullRequest to work on moved/renamed module (rework patches to apply to target the new module/folder name, ...)

Optional (can be done in a future PR):

  • store this info in .oca/oca-port/ directory with Storage class
  • read data stored in .oca/oca-port/ so a migration attempt will automatically detect that this module has been renamed in target branch, launching analysis with the right module name

Example

Migrate & rename a module at the same time:

$ oca-port origin/17.0 origin/18.0 stock_packaging_calculator --move-to product_packaging_calculator --dry-run
ℹ️  stock_packaging_calculator can be migrated from 16.0 to 18.0 and moved to product_packaging_calculator
Module already migrated under a different name: ```sh $ oca-port origin/17.0 origin/18.0 stock_packaging_calculator ℹ️ stock_packaging_calculator has been renamed product_packaging_calculator in origin/18.0 product_packaging_calculator already exists on origin/18.0, checking PRs to port... ```

@sebalix sebalix added enhancement New feature or request work in progress labels Apr 2, 2025
@sebalix sebalix added this to the 0.19 milestone Apr 2, 2025
@sebalix sebalix force-pushed the add-support-for-module-renaming branch 3 times, most recently from 71c59a0 to 627ba0c Compare April 3, 2025 13:34
@sebalix sebalix force-pushed the add-support-for-module-renaming branch from 627ba0c to a78ee5f Compare May 7, 2025 14:35
@sebalix sebalix force-pushed the add-support-for-module-renaming branch 4 times, most recently from b46cc12 to 6240175 Compare May 28, 2025 07:38
@sebalix sebalix force-pushed the add-support-for-module-renaming branch 3 times, most recently from 78c2ed1 to 9d85885 Compare June 17, 2025 14:34
@sebalix sebalix force-pushed the add-support-for-module-renaming branch 2 times, most recently from b11ba39 to a5df020 Compare June 27, 2025 13:23
@sebalix sebalix force-pushed the add-support-for-module-renaming branch from a5df020 to fd479bc Compare July 10, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants