-
-
Notifications
You must be signed in to change notification settings - Fork 534
[10.0] Revert "[ADD] queue_job module: migration from 9.0" #23
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
Conversation
1 similar comment
|
I agree. Fast-tracking. Besides, |
|
You are totally misunderstanding the use of migrations. This is not incorrect. The explanation is here: OCA/connector#256 (comment) Don't fast track things that you don't know. |
|
@pedrobaeza I fast-track things that might add a bug and that do not hurt to be reverted, until further proof that they work. |
|
They don't hurt anything and it was correctly reviewed. Please restore it as it was. |
|
@lmignon did you observed side effects? |
|
@pedrobaeza @guewen I did not observe side effects but queue_job don't depend on 'connector' therefore we must keep it without reference to the connector addon. Moreover we have successfully migrated 2 projects from 8.0 and 9.0 to 10.0 using the connector addon without this migration script. When you call odoo with |
|
The problem is that you will have for example record rules duplicated, field definition garbage.... (although mostly working). This is the correct flow:
|
|
Why would you have garbage? When a entry in And when you upgrade Installing |
Yes it's.
👍 |
|
It's not installing, it's upgrading. Please, if you don't understand the migration process, don't refute the arguments. There's more than just |
|
@pedrobaeza PLZ don't say we don't understand the migration process. Here you introduce code required by the way how you migrate. This piece of code is only required if the migration is done by openupgrade. IMO this code should be in your migration script. |
|
No, it's not my way of migration. It's the official OCA way. Any way, if you don't use OpenUpgrade, there isn't also any problem with this migration script. |
|
IMO we must avoid and it's not a good practice to add piece of code required by external tools not required by the addon itself. |
|
Please stop trying to justify the incorrect revert, and just restore it. It's not a bad practice. It's the correct one that it's being done since 8.0 in the OCA modules that needs any adaptation in the migration to major versions. One quick reference, but I don't want to lose more time with this: |
|
@pedrobaeza do you realize that you sound rude and aggressive? I understand that you have been hurt by the revert, but honestly I don't think my actions are incorrect:
Ultimately, my main concern is the part where you say that it would update the 'connector' module and you would need to remove it afterward. I won't accept that, maybe the original state of the |
|
Sorry for sounding that way. I rephrase the sentence: "As in v10, queue features are now isolated in |
|
I didn't had any explanation so far for this question:
There surely is a reason why it is needed for openupgrade. Please educate ourselves on the matter. Here we are not in the openupgrade repository, so you have to assume that not everyone in this project will be familiar with it, and still they have to be responsible for it. As this change concerns only openupgrade and nevertheless you want to include it in this repo, at the very least you have to be sure that it has been well understood by the team, which require explanation / documentation. You can't blame someone for not knowing something that you don't explain. |
|
Yeah, it will be upgraded also. OK, I'm teaching you on this, but the facts are that:
|
So we agree it's useless? |
|
No, that's not what I'm saying. I understood bad the question. Without this, the migration won't work correctly. It's harmless for the rest. |
IMO this is not enough to keep code. Untested / not properly commented code deserves to be removed. In such case it was really unclear this was of any use as it is related to an other project outside of this repository. While it was clearly not critical it had no reason to stay there. The commit message is not clear enough nor the comments: @pedrobaeza it seems that #20 lacks some proper commit message / comment or explanation. There was not even one mention to OpenUpgrade when it was merged, so I think you overreacted and that #20 was merged too soon. |
|
I agree w/ Laurent, Guewen and Yannick. |
|
No, it doesn't lack anything, as the comment is on code, not on commit (@guewen knows we prefer that method), and it wasn't merged too fast. OpenUpgrade has optimistic merging. I'm very tired of this, and I don't understand why if you are not being able to give me any valid reason for not having this, you are still fighting against it. I have my flow covered even if you don't merge it. This is for the entire community. but I think all of you that don't make any OpenUpgrade contribution are not in position of determining what's the proper flow. |
|
@simahawk, I have explained clearly why. Just read previous comments and links. |
|
Do you need any other explanation? |
|
Well, you explained that you need for openupgrade, but not why this code is required, i.e. why in odoo if you upgrade queue_job, connector is automatically upgraded and not in openupgrade. Is it not a bug in openupgrade? |
|
Well, it has been explained previously and this is annoying, but here it is again:
|
|
Sorry @pedrobaeza I assure you that I read that and understood it clear and sound, but you keep repeating the same except that you don't answer to my question. So maybe I'm not giving enough details on my reasoning, I'll expand it there:
|
|
Thanks for clarifying your doubts, but it's not a problem of upgrading, which OpenUgprade, as any regular Odoo distribution, does. It's a problem of preserving data:
openupgrade.rename_xmlids(
env.cr, [
('queue_job.group_connector_manager',
'queue_job.group_queue_job_manager',)
],
)
|
|
@pedrobaeza regarding custom translations, won't we loose half of them anyway? The module is actually split, not merely renamed so I imagine a perfect migration cannot be achieved in this case. |
|
Of course I know that not all the translations will be kept, but most of. Any way, that's the standard OpenUpgrade method: try to keep the most. Why are you so reluctant to add this? |
|
@pedrobaeza I'll call me stubborn, but my whole point is there, you claim it's not a problem of upgrade but look: With the migration file present, I run: As you can see, the state of the |
If we finally find out this code is useless (as suggested by my previous comment), it will simplify all the upcoming migration for split of modules. (incidentally I don't like to merge unnecessary code or that I don't understand) |
|
You are not coming from a 9.0 migration, and thus the process is different. Don't miss the step of OCA/OpenUpgrade#1038. As said, it's harmless if you are not migrating from v9, but needed for a proper v9 migration (but remember that there's one mistake right now and we need to include here also the other code). |
|
Okay... I still don't know why openupgrade would not automatically set the state of dependent addons to |
|
OK, here it is: #24 |
|
@pedrobaeza so if I follow correctly, can we say this is a bug / missing feature in OpenUpgrade which reveals itself when a renamed module is not actually renamed but split in pieces? I'm not saying we can't merge #24, but like @guewen I like to get to the bottom of things and I still don't understand the root cause. |
|
OK, I'm not going to follow with this. If you don't want it, I have my own branch for migrations. |
|
wow, what a heated discussion. I'm a big fan of understanding stuff instead of just accepting someone claiming something, and @sbidoul's comment sounds a lot like that, so I'll try my best. Some preliminaries:
What @pedrobaeza wants to avoid is that when you upgrade from 9 to 10, you'll lose all records created by connector(old) which now live in job_queue(new), because all the former connector.* xmlids that belong to job_queue.* now will be unclaimed after updating connector. Depending on constraints, things might actually even break before when during the update job_queue is installed which might create new records that conflict with their equivalent that was created by connector. That's why we need to do this probably somewhat backwards feeling stunt in OpenUpgrade of first renaming connector to job_queue, but then pulling connector again during the update of job_queue. Is this intelligible? About the code itself: There might be some xmlids that this migration script should move back into connector in order to avoid the inverse of what I wrote above, but I don't know the internals of this code well enough to tell if that's the case or not. |
Exactly that. If I understand correctly what you say, OpenUpgrade tricks the upgrade by modifying the Thanks a lot for your explanation ⭐ |
|
@hbrunn that helps, thanks. So I gather the root cause is therefore the renaming in the OpenUpgrade script that is actually not a true renaming in this case but merely a split where xmlids of the old must be copied to the new yet preserved in the old. Does that make sense? Would it make sense to have a kind of Again, I'm not against merging #24, nor am I saying that anything must be done now, but if we have a more robust solution on the horizon that would be nice! |
|
@guewen @sbidoul glad I could help This could be done more beautifully indeed, but we try to avoid patching odoo core as much as possible, so we don't modify the upgrade process a lot. If we'd introduce the splitting function, we'd need to put the knowledge about what belongs where somewhere centrally in OpenUpgrade (that's how the mechanics of odoo work), and this will probably become a biggish list for all of OCA. And I like the fact that (nearly) everything relevant for some module happens in its migration script. Here's a completely different idea to handle those cases: If we duplicate the module to be split (or actually n-ify it with n being the amount of resulting modules) in OpenUpgrade such that on the start of the upgrade run, we have modules split1, split2, ... splitN each with all xmlids from the original module. Given Odoo doesn't delete records pointed to by another xmlid, the rest then should follow automatically: The framework will delete the superfluous xmlids, and if some xmlid isn't claimed by any of the split modules, the record will be deleted too. Then the migration scripts of the split modules would be quite simple and natural, as they'd only contains xmlids that were actually renamed. Next time we split a module, let's do it like this. But I think that's rather something for OpenUpgrade 11 |
|
💡 thanks @hbrunn ! |
Reverts #20
The queue_job addon doesn't depend on 'connector' and don't exist in 9.0.
ping @guewen