-
-
Notifications
You must be signed in to change notification settings - Fork 785
[16.0][FIX] openupgrade_framework : end-migration scripts are forced … #4107
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
[16.0][FIX] openupgrade_framework : end-migration scripts are forced … #4107
Conversation
|
Hi @hbrunn, @StefanRijnhart, @legalsylvain, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, the CI errors are unrelated.
do we have any core modules where this is the case in v16? If so, a test for that would be great.
|
@hbrunn There is no end-migration script for v16 in openupgrade_scripts, but there are 2 files in native Odoo CE :
Can we use those files to run a test ? |
|
never tried it, but I think it could just work to drop a folder with the module name and correct version into https://github.com/OCA/OpenUpgrade/tree/16.0/openupgrade_scripts/scripts, cf https://github.com/OCA/OpenUpgrade/blob/16.0/openupgrade_framework/odoo_patch/odoo/tests/loader.py#L30 Edit: ah wait, those are localization modules and those aren't installed in the test database we use. And it must be a newly pulled module anyways. How about adding an end migration script for ie spreadsheet (that's new in v16 and pulled during the migration), check for environment variable OPENUPGRADE_TESTS and if that's set, ie set some config parameter as marker that you can check for in the test? |
|
Hello @hbrunn Instead of creating an end-migration script in the "production" tree of openupgrade_scripts, I'd like to copy such script during the tests using data.py file... but I'm struggling to get a right path from the Odoo shell. It seems I can't get the value of GITHUB_WORKSPACE... any advice ? |
070a19a to
16de61e
Compare
|
just Just to be clear, I don't insist on the test, just thought it was nice |
|
No idea, sorry. |
|
so... do we go ahead and merge this? |
|
OK, please rebase to check the CI. |
|
H everyone, CI is not OK after rebase, I'll convert this PR to draft for the moment because it seems to me that some others changes in the way odoo is loading modules are preventing post-* and end-* migration scripts to execute for newly installed ones... |
|
Hi @hbrunn Hi @pedrobaeza Sorry for the delay... I just rebased and had to fix some typo for pre-commit to run OK. I think we can go ahead... |
|
Could you rebase correctly? I see merge branch commits there. I think you should have here only two commits (the pre-commit commit can be fused with the commit that adds tests) |
971df15 to
c2f89a6
Compare
|
@MiquelRForgeFlow Rebase correctly done, thanks end migration script for newly installed spreadsheet module runs : https://github.com/OCA/OpenUpgrade/actions/runs/12910128466/job/35999439017?pr=4107#step:16:18582 |
| to_install = pkg.state == "to install" | ||
| if to_install: | ||
| pkg.state = "to upgrade" | ||
| load_state_to_install = getattr(pkg, "load_state", False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should adapt the docstring of this method...
|
This PR has the |
| @@ -0,0 +1,14 @@ | |||
| # Copyright 2023 Odoo Community Association (OCA) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not testing really the feature, as this module is not installed during the upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pedrobaeza
Look at .github/workflows/test.yml, this file is copied to spreadsheet directory which is installed during the upgrade.
Do you think I should create a directory containing only tests ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see, it seems it works for this version, but for the next ones, spreadsheet will be already installed.
|
/ocabot merge patch |
|
What a great day to merge this nice PR. Let's do it! |
|
Congratulations, your PR was merged at e5653f9. Thanks a lot for contributing to OCA. ❤️ |
…to run at install too
Fixes #4106