Skip to content

[19.0][IMP] base: Load additional renames/merges from env.#5765

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
Tecnativa:19.0-imp-base-external_merges
Jul 7, 2026
Merged

[19.0][IMP] base: Load additional renames/merges from env.#5765
OCA-git-bot merged 1 commit into
OCA:19.0from
Tecnativa:19.0-imp-base-external_merges

Conversation

@david-banon-tecnativa

@david-banon-tecnativa david-banon-tecnativa commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

With this change, merging and renaming private modules no longer needs to be done in a custom module, and now can happen at the same time as OCA modules.
To use this feature:

When running openupgrade, set the OPENUPGRADE_MERGED_MODULES and OPENUPGRADE_RENAMED_MODULES environment variables to raw JSON data containing the private renames/merges in the same format as in apriori.py .
Example OPENUPGRADE_MERGED_MODULES to merge "custom module" into "helpdesk_mgmt".
{"custom_module":"helpdesk_mgmt"}

No changes should be made on current workflows if this feature is not used.

Once this PR gets approved i'll backport to all versions of OU

@pedrobaeza @victoralmau
@Tecnativa TT63118

@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:19.0 labels Jul 1, 2026
@pedrobaeza pedrobaeza added this to the 19.0 milestone Jul 1, 2026

@hbrunn hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to see this in openupgradelib, otherwise we have to reimplement this for every version

@pedrobaeza

Copy link
Copy Markdown
Member

@hbrunn that's not possible, as you may call update_module_names multiple times over whole OpenUpgrade migration scripts, and add there all the injected environment variables is not correct IMO.

@hbrunn

hbrunn commented Jul 1, 2026

Copy link
Copy Markdown
Member

so add a parameter enabling this which defaults to False

@pedrobaeza

Copy link
Copy Markdown
Member

so add a parameter enabling this which defaults to False

And we will need to modify the same each OpenUpgrade version to add here such parameter...

@hbrunn

hbrunn commented Jul 1, 2026

Copy link
Copy Markdown
Member

true, but we don't need to copy&paste a bunch of logic

@hbrunn

hbrunn commented Jul 1, 2026

Copy link
Copy Markdown
Member

another option would be to have a function in openupgrade_scripts itself that does the initial renaming and merging, which the base migration just calls, and your code happens there. that then also goes automatically to all new versions

@pedrobaeza

Copy link
Copy Markdown
Member

OK, let's do it that way. @david-banon-tecnativa do you have clear what to do? The keyword argument can be use_environment_arg=False, and when True, and depending on merge_modules variable, read one or the other.

@pedrobaeza

Copy link
Copy Markdown
Member

another option would be to have a function in openupgrade_scripts itself that does the initial renaming and merging, which the base migration just calls, and your code happens there. that then also goes automatically to all new versions

You wrote meanwhile I was writing the other. The problem with this suggestion is that there's no apriori.py file in openupgralib to import, so I don't think we can move such code.

# Copyright 2025 Hunki Enterprises BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add here extra line.

@david-banon-tecnativa david-banon-tecnativa force-pushed the 19.0-imp-base-external_merges branch from 0ba602e to 7eec2f6 Compare July 6, 2026 08:03
@pedrobaeza pedrobaeza requested a review from hbrunn July 6, 2026 10:53

@hbrunn hbrunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge nobump

@hbrunn

hbrunn commented Jul 7, 2026

Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 19.0-ocabot-merge-pr-5765-by-hbrunn-bump-nobump, awaiting test results.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@hbrunn The merge process could not start, because command git push origin 19.0-ocabot-merge-pr-5765-by-hbrunn-bump-nobump failed with output:

To https://github.com/OCA/OpenUpgrade
 ! [remote rejected]         19.0-ocabot-merge-pr-5765-by-hbrunn-bump-nobump -> 19.0-ocabot-merge-pr-5765-by-hbrunn-bump-nobump (cannot lock ref 'refs/heads/19.0-ocabot-merge-pr-5765-by-hbrunn-bump-nobump': reference already exists)
error: failed to push some refs to 'https://github.com/OCA/OpenUpgrade'

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

1 similar comment
@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot merged commit 6437799 into OCA:19.0 Jul 7, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 6437799. Thanks a lot for contributing to OCA. ❤️

david-banon-tecnativa added a commit to Tecnativa/OpenUpgrade that referenced this pull request Jul 7, 2026
pedrobaeza pushed a commit that referenced this pull request Jul 7, 2026
pedrobaeza pushed a commit that referenced this pull request Jul 7, 2026
pedrobaeza pushed a commit that referenced this pull request Jul 7, 2026
pedrobaeza pushed a commit that referenced this pull request Jul 7, 2026
pedrobaeza pushed a commit that referenced this pull request Jul 7, 2026
pedrobaeza pushed a commit that referenced this pull request Jul 7, 2026
@hbrunn

hbrunn commented Jul 7, 2026

Copy link
Copy Markdown
Member

@david-banon-tecnativa please document the env vars somewhere in https://github.com/OCA/OpenUpgrade/tree/documentation

@hbrunn

hbrunn commented Jul 7, 2026

Copy link
Copy Markdown
Member

@david-banon-tecnativa

Copy link
Copy Markdown
Contributor Author

Ok, OMW

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants