Skip to content
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

[IMP] ORM: Add new --migrations-path CLI option #32650

Open
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
7 participants
@lcontzen
Copy link

commented Apr 12, 2019

This commit adds a new way to use a migrations scripts folder
whithout needing to symlink it to an hardcoded path.

The folder specified in --migrations-path is then being used by
migration.py to find and execute migrations scripts per module
specified in the -u CLI option.

The folder needs to have the following structure:

- <migrations_path folder>
	- <module1 name>
		- <version1>
			- <script1>
			- <script2>
			- ...
			- <scriptn>
		- <version2>
			- <scripts>
	- <module2 name>
		- <versions>
			- <scripts>
	- ...

@lcontzen lcontzen requested review from KangOl and dbo-odoo Apr 12, 2019

@robodoo robodoo added the seen 🙂 label Apr 12, 2019

@KangOl KangOl requested a review from antonylesuisse Apr 12, 2019

@KangOl

KangOl approved these changes Apr 12, 2019

Show resolved Hide resolved odoo/modules/migration.py Outdated
Show resolved Hide resolved odoo/cli/server.py Outdated

@C3POdoo C3POdoo added the RD label Apr 12, 2019

@robodoo robodoo added the CI 🤖 label Apr 12, 2019

@lcontzen lcontzen force-pushed the odoo-dev:master-migration-path-lco branch to 6821878 Apr 12, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Apr 12, 2019

@KangOl

KangOl approved these changes Apr 12, 2019

Copy link
Contributor

left a comment

LGTM

@antonylesuisse

This comment has been minimized.

Copy link
Contributor

commented Apr 12, 2019

I'm still undecided. What the opinion of @odony ?

@odony
Copy link
Contributor

left a comment

@antonylesuisse In terms of risk for stable, I would go for an extra option --upgrades-path, as this will need the least amount of changes. In master we can improve the consistency of the parameter names.

Show resolved Hide resolved odoo/tools/config.py Outdated
Show resolved Hide resolved odoo/tools/config.py Outdated
Show resolved Hide resolved odoo/tools/config.py Outdated
Show resolved Hide resolved odoo/cli/server.py Outdated
Show resolved Hide resolved odoo/modules/migration.py Outdated
Show resolved Hide resolved odoo/modules/migration.py Outdated

@lcontzen lcontzen force-pushed the odoo-dev:master-migration-path-lco branch from 6821878 May 10, 2019

@robodoo robodoo removed the CI 🤖 label May 10, 2019

@lcontzen lcontzen force-pushed the odoo-dev:master-migration-path-lco branch to 43243c8 May 10, 2019

@lcontzen lcontzen requested a review from odony May 10, 2019

@robodoo robodoo added the CI 🤖 label May 10, 2019

Show resolved Hide resolved odoo/tools/config.py Outdated

@robodoo robodoo removed the CI 🤖 label May 14, 2019

@lcontzen lcontzen force-pushed the odoo-dev:master-migration-path-lco branch May 14, 2019

@robodoo robodoo added the CI 🤖 label May 17, 2019

@lcontzen lcontzen force-pushed the odoo-dev:master-migration-path-lco branch Jun 3, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Jun 3, 2019

lcontzen and others added some commits Apr 11, 2019

[IMP] ORM: Add new --upgrades-paths CLI option
This commit adds a new way to use upgrades scripts folders
whithout needing to symlink them to an hardcoded path.

The folders specified in --upgrades-paths is then being used by
migration.py to find and execute migrations scripts per module
specified in the -u CLI option.

The folder needs to have the following structure:
- <upgrades_paths folder 1>
	- <module1 name>
		- <version1>
			- <script1>
			- <script2>
			- ...
			- <scriptn>
		- <version2>
			- <scripts>
	- <module2 name>
		- <versions>
			- <scripts>
	- ...
- <upgrades_paths folder 2>
	- ...

Update odoo/tools/config.py

Co-Authored-By: Olivier Dony <odony@users.noreply.github.com>
[ADD] core: new magical `odoo.upgrades` package
This package point to first package found in `upgrades_paths` or
fallback to alias of legacy `odoo.addons.base.maintenance.migrations`.

@lcontzen lcontzen force-pushed the odoo-dev:master-migration-path-lco branch to 8aa7eda Jun 21, 2019

@robodoo robodoo removed the CI 🤖 label Jun 21, 2019

@KangOl

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2019

@robodoo retry

@robodoo

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2019

Staging failed: ci/runbot (view more at http://runbot.odoo.com/runbot/build/545419)

@KangOl

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2019

@robodoo retry

@robodoo

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2019

Staging failed: ci/runbot on 61e40d55d88600e753b7151beab406fb4581413d (view more at http://runbot.odoo.com/runbot/build/545467)

@robodoo robodoo added the error 🙅 label Jun 21, 2019

@d-fence

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2019

Is it going to be back-ported ?

@lcontzen

This comment has been minimized.

Copy link
Author

commented Jun 24, 2019

@d-fence part of it is supposed to go in 10: #33379

@KangOl

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2019

Why not the whole patch?

@lcontzen

This comment has been minimized.

Copy link
Author

commented Jun 24, 2019

I thought you were against it but we can do the whole thing if everyone agrees

@odony

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2019

Why not the whole patch?

Why would we backport anything that is not strictly necessary? The whole thing is already a very questionable bugfix, shouldn't we avoid useless risks?

@KangOl

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2019

The primary reason that was given for this patch was that developers weren't able to symlink migration scripts to odoo/addons/base/maintenance directory and having a config entry was easier.

However, without the import hook, it's useless as all our scripts currently do a from odoo.addons.base.maintenance.migrations import util which only works with the symlink.

So both parts are tightly linked and cannot be used separately.

@robodoo robodoo removed the error 🙅 label Jun 25, 2019

@KangOl

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2019

New version of the magical odoo.upgrades package; done without import hook (less intrusive)

@robodoo robodoo added the CI 🤖 label Jun 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.