[16.0][MIG] database_cleanup: Migration to 16.0 - #2684
Conversation
bealdav
left a comment
There was a problem hiding this comment.
LGTM
I've tested to manually add an ir.model.data and db_cleanup allow to purge nicely
Thanks for this PR
| ((modules - installed) + (modules - installed).downstream_dependencies()).write( | ||
| {"state": "to remove"} | ||
| ) | ||
| installed.button_immediate_uninstall() |
There was a problem hiding this comment.
this code is complex and not obvious about the intent.
If I read correctly, modules not in installed, to upgrade (filtered here) and uninstallable, installed, to remove (default argument of downstream_dependencies) are excluded.
So it let: uninstalled to remove, to install. Is it expected ?
Plus, it looks like this code can be shorter if it use the right exclude_filter of modules.downstream_dependencies().
There was a problem hiding this comment.
@miikanissi Any comment on above question?
There was a problem hiding this comment.
I asked to add this in the previous PR: hbrunn@08c5df6
That's because in v16 a test was added in this function that raises for modules that are not installed.
[cut some nonsense I wrote before]
|
/ocabot rebase |
|
@ChrisOForgeFlow The rebase process failed, because command |
|
@miikanissi Can you rebase and fix conflicts, thank you in advance |
avoid ''NoneType' object has no attribute 'exists'' error when purging models fix my change guewen.baconnier@camptocamp.com-20140203103254-v1mzu2uib047xb9h, wrong lines replaced...
raw SQL query (but never read afterwards). Workaround for
lp:1277899
[FIX] Preserve dangling workflow table which is in use
[RFR] Group models per table when detecting columns to purge
to prevent problems with models sharing the same table
[ADD] Allow purging of dangling data entries
[FIX] Data purging now working
[IMP] Docstrings
[FIX] Label
[FIX] Catch attempt to unlink field from nonexisting model
[RFR] Flake8
[CHG] database_cleanup: move description to README.rst
[IMP] order wizard lines by name [IMP] deal with modules whose models can't be loaded [IMP] double quotes for docstring [FIX] use exists query instead of huge in list [IMP] hide unnecessary buttons in wizard II [IMP] readability [FIX] cope with purging nonexisting models
[IMP] adaptto upstream changes
[ADD] test purging modules [ADD] test purging tables
[FIX] database_cleanup reloads the registry which has weird side effects during testing. Take care database_cleanup's tests don't mess up the following tests
* [FIX] database_cleanup: Isolate build * Isolate `database_cleanup` into its own build in Travis file to fix #689 * [FIX] database_cleanup: Remove KeyError assertion * Remove KeyError assertion in tests due to PR in comment being merged
* [ADD] allow creating missing indexes * [FIX] tests; installation * [ADD] allow purging properties * [ADD] missing file * [ADD] test purging properties * [ADD] missing parent_id for menu entry * [FIX] don't delete too many and wrong properties
Using new base model inheritance.
[FIX] don't try to uninstall uninstalled modules [DEL] weird code [FIX] actually cleanup where we can
|
please also include #2648 here |
No need to rollback here as TransactionCase does a safe rollback.
Needed for purging payment providers which recompute module_state
Included and rebased. Good to go? |
|
Thanks for the followup. Still need to deal with the last test failure I'd suggest to patch away Or maybe we don't need the commit in v16? |
|
I'm not very familiar with the unittest mock objects. I'd need help to figure out the patch. |
|
off the top of my head: |
|
/ocabot merge nobump |
|
This PR looks fantastic, let's merge it! |
|
This PR has the |
1 similar comment
|
This PR has the |
|
Congratulations, your PR was merged at c963e27. Thanks a lot for contributing to OCA. ❤️ |
|
/ocabot migration database_cleanup |
Original PR author seems to be unavailable at #2473
This PR continues the progress made in that and includes a cherry pick to fix tests