Commit Graph

276 Commits

Author SHA1 Message Date
Sylvain LE GAL
dbdf592990 [IMP] 'run' cli command. Add '--update-modules' option 2024-03-01 15:51:09 +01:00
Sylvain LE GAL
d890a460ea [IMP] Harmonize run and upgrade cli command. Allow to call command with argument --with-demo / --without-demo like in install-from-csv.
For that purpose, create a new decorator.
[REF] Change the default of install-from-csv to harmonize. (allways False)
2024-03-01 15:51:09 +01:00
Rémy Taymans
02c6fa48cf Merge branch 'FIX-prevent-error-empty-addon-path' into 'main'
[FIX] Do not crash silently, when a repos.yml file reference an empty addons folder.

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!56
2024-03-01 14:12:35 +00:00
Sylvain LE GAL
f75821c2bc [FIX] Do not crash silently, when a repos.yml file reference an empty addons folder.
Step to reproduce :
- run a V15 instance
- add a reference to 'OCA/geospatial' repo that doesn't contain any odoo module.
As a result, Odoo will exit with the following error:
    odoo-bin: error: option --addons-path: the path '/odoo_env/src/OCA/geospatial' is not a valid addons directory

To avoid such problem, and avoid to have to remove empty repository
(that could become non empty in the future, and contains some migrations scripts),
- we reimplement a version of the odoo function _is_addons_path (odoo/odoo/tools/config.py)
- we add an info log :
    Skipping addons path '.../src/env_15.0/src/OCA/geospatial'  because it doesn't contain any odoo module.
2024-03-01 13:47:26 +01:00
Rémy Taymans
52568cedc5 Merge branch '42-add-dropdb' into 'main'
[ADD] dropdb

Closes #42

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!55
2024-02-22 08:09:48 +00:00
Rémy Taymans
30198392c5 [ADD] dropdb 2024-02-22 08:53:45 +01:00
Rémy Taymans
e5921fe4c7 Merge branch 'update_ci' into 'main'
New CI to auto build and publish

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!51
2024-02-21 18:49:41 +00:00
Rémy Taymans
72a5dcf434 New CI to auto build and publish
Using a commit message to trigger the build does not work when merging a
PR because last commit is the merge commit and not the commit edited
with the right name.

Given that, the jobs that will run, are defined at the creation of the
pipeline, publishing and creating a release cannot be done based on the
sate of the code.

A way to trigger publication and release is the git tags.

So with theses changes:

- linting is done only on a merge request
- testing and building are performed on a merge request and on the main
  branch

When a tag is pushed:

- check are done to ensure that the tag is the same as the version of
  the program, in order to not publish and release someting that is not
  coherent.
- the program is published on pypi.
- a release is created, but only if the tag is for a major, minor or
  patch version. No release created for an alpha, beta or pre-release
  version.

So all versions of the program are published on PyPI, but only the
important ones are published via the release mechanism. Because the
release mechanism will warn user for a new version. Version that are not
major, minor or patch are not intended to be used by end users.

The idea of auto publishing and releasing every time a commit is pushed
on the main branch does not work with semantic versioning. For doing
that maybe a calversioning will be better.

The idea of using the CI to push a tag for a new release lead to
security risk. Because the CI will contains credential for writing to
the repository, any contributor can read this token by editing the
gitlab-ci file and use token for bad purposes. Gitlab does not provide
token for writing to a repository owned by the project.

So for now, we control the publication and release of a new version with
two actions:

- updating the version on the pyproject.toml file.
- creating a tag with the same version as in the pyproject.toml file.
2024-02-21 11:50:27 +01:00
LE GAL SYLVAIN
dea0bbd70c Merge branch 'fix-estimate-workload' into 'main'
[FIX] estimate-workload: wrong warning message

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!53
2024-02-08 09:51:34 +00:00
LE GAL SYLVAIN
717f396dc6 Merge branch 'fix-install-from-csv-demo' into 'main'
[FIX] install-from-csv: add with-demo option

Closes #41

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!54
2024-02-08 09:45:39 +00:00
Rémy Taymans
25655d4b7a [FIX] install-from-csv: add with-demo option
Add a flag to specify if the database created by install-from-csv should
install demo data or not.

Fix #41
2024-02-07 17:25:56 +01:00
Rémy Taymans
2b0e359d4e [FIX] estimate-workload: wrong warning message
Previous syntax does not replace correctly the markers in the string.

Using an f-string fix this.

Before:
2024-02-06 10:47:02.303 | WARNING  | odoo_openupgrade_wizard.tools.tools_odoo_module:get_odoo_apps_url:359 - Error when trying to get %s: %s

After:
2024-02-07 10:51:11.964 | WARNING  | odoo_openupgrade_wizard.tools.tools_odoo_module:get_odoo_apps_url:356 - Error when trying to get https://apps.odoo.com/apps/modules/12.0/partner_contact_address/: Exceeded 30 redirects.
2024-02-07 11:15:23 +01:00
LE GAL SYLVAIN
a878df2915 Merge branch 'fix-estimate-workload' into 'main'
[FIX] getting url on apps.odoo.com

Closes #40

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!52
2024-02-06 00:42:09 +00:00
Rémy Taymans
38ac07c141 [FIX] getting url on apps.odoo.com
Fix #40
2024-02-05 16:14:06 +01:00
Rémy Taymans
372d797430 Merge branch 'main-add-C2C-author' into 'main'
[DOC] Update contributors list

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!46
2023-11-16 10:59:55 +00:00
Sylvain LE GAL
51f90a5338 [DOC] Update contributors list 2023-11-16 11:40:28 +01:00
Rémy Taymans
1f720c667e Merge branch 'update_ci' into 'main'
New CI with docker-in-docker

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!48
2023-11-16 10:36:01 +00:00
Rémy Taymans
d781709cb5 Fix 404 not found errors when using docker 2023-11-09 20:50:46 +01:00
Rémy Taymans
0dc011684d Use docker-in-docker to run tests
Cortesy @maisim.

This commit allow to use docker-in-docker to run tests.

Also it will run the tests on python version defined in the
PYTHON_VERSION array. The tox.ini file is not needed anymore.
Test locally can be run on the user python version, and check against
several python version will be done by the CI.

Notice the ODOO_RPC_URL environment variable which allow to mock the RPC
request to the right url.

This tests needs to be run on custom privileged runner.
! Using gitlab runner does not work !
2023-11-09 20:50:46 +01:00
Rémy Taymans
6a36c97ee4 Use last python image for linting
The linting check can be done on any docker image with the latest python
version.

This updates de pre-commit checks and fix file linting to conform to new
standards.
2023-11-09 17:02:24 +01:00
Rémy Taymans
690ab60699 Fix Dockerfile when using root on host
root user should not be used to create container and oow should not be
run as root.

But when running oow in a docker, then the default user of this docker
can be root.

This fix allow to link the odoo user in the odoo environment docker to
match a root user of the host docker.
2023-11-09 16:36:53 +01:00
Rémy Taymans
a3a8af9a70 Fix listing containers during removal of containers
Removing a container can take some time to be performed. Listing
containers when a container is currently being removed may cause errors.
Because listing container and filtering them by name requires to fetch
data from the container that is currently being removed.
2023-11-09 16:27:29 +01:00
Rémy Taymans
a0307847b9 Allow mocking the ODOO_RPC_URL for testing
Depending of the test environment, the url of the odoo container may
change.

Using pytest in a local shell, Odoo will be available at 0.0.0.0
address.

Using pytest in a docker-in-docker environment, the url for the Odoo
container will be exposed on a different address depending on the
configuration of the docker-in-docker environment.

The mock check whether the user has configured a différent URL for the
Odoo RPC calls, and set it accordingly using mock feature.

In the gitlab-ci, the ODOO_RPC_URL should be used to set the correct
address for the RPC calls.
2023-11-09 16:21:20 +01:00
Rémy Taymans
8ea0195aaf Add pytest-mock dev dependencies
The lock file is regenerated and some dependencies are updated.

Poetry now uses a system of group for extra dependencies. Dependencies
for testing purposes has been put in the "dev" group in the
pyproject.toml file.
2023-11-09 16:17:04 +01:00
LE GAL SYLVAIN
71ae846462 Merge branch 'test-disable-copy-db' into 'main'
[FIX] fix copydb tests. do no use case sensitive database name

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!50
2023-11-07 09:57:23 +00:00
Sylvain LE GAL
8235481032 [FIX] fix copydb tests. do no use case sensitive database name 2023-11-07 10:25:22 +01:00
LE GAL SYLVAIN
0c6110373a Merge branch 'FIX-copydb-add-copyfilestore' into 'main'
Finish copydb. (add copy of the filestore)

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!39
2023-07-18 08:55:41 +00:00
Sylvain LE GAL
7a31cc666d [FIX] copydb : add the copy of the filestore
[DOC] Add documentation section for the copydb function
2023-07-17 14:12:14 +02:00
Rémy Taymans
114f7bfe32 Bump to version 0.5.0
Main new features:
- oow psql: run any query on a database
- oow dumpdb: dump database and its filestore
- Documentation improvement.

Other small fixes.
2023-07-13 17:57:15 +02:00
Rémy Taymans
f143e218a0 (Also improve CI) 2023-07-13 14:24:20 +00:00
Simon
070143f3fe Wait for the container name to be truly freed before returning 2023-07-13 14:24:20 +00:00
Rémy Taymans
60f7b78413 Merge branch '26-dump-db-command' into 'main'
[ADD] dumpdb command

Closes #26

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!32
2023-07-12 06:52:11 +00:00
Rémy Taymans
757cc19576 [FIX] dumpdb: error when using force 2023-07-12 08:35:20 +02:00
Rémy Taymans
f130ecf078 [ADD] dumpdb: tests 2023-07-12 08:35:20 +02:00
Rémy Taymans
e9e02d450d [ADD] dumpdb: doc 2023-07-12 08:32:57 +02:00
Rémy Taymans
debf57bac3 [ADD] dumpdb command 2023-07-12 08:32:57 +02:00
LE GAL SYLVAIN
0764b811d5 Merge branch 'ci-build-and-release' into 'main'
[ADD] build and release in CI

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!41
2023-07-11 21:11:18 +00:00
Rémy Taymans
59025a14e0 [ADD] build and release in CI
This will produce the following behaviour:

When a commit with a title like "Bump to version x.y.z" is committed to
main branch (either by merging a merge request or by pushing it directly
to the main branch), a build of the project is triggered and the result
is pushed on PyPI.

Also a release on the github project is created with the version of the
program as title and the content of the commit message as description.

This will help deploying release of oow. It will also warn followers
that a new version is released by a notification if they choose to.

PYPI_USER and PYPI_TOKEN are value set on the gitlab settings of the
project and can only be viewed by maintainers.
2023-07-11 17:03:00 +02:00
LE GAL SYLVAIN
badba4bd31 Merge branch '21-psql-command' into 'main'
[ADD] psql command

Closes #21

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!31
2023-07-06 15:23:02 +00:00
Rémy Taymans
a436490a68 Merge branch '21-psql-command-improvement-sylvain' into '21-psql-command'
Improve #31

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!38
2023-07-06 15:14:39 +00:00
Sylvain LE GAL
c813f3ddd4 -[DOC] psl command : add description 2023-07-06 16:37:52 +02:00
Sylvain LE GAL
8a79974232 [REF] Use f-string to make the code lighter
[FIX] execute_psql_command: make optional database argument working correctly
[FIX] execute_psql_command: avoid to have an error
2023-07-06 16:37:52 +02:00
Rémy Taymans
284417bb00 [ADD] psql command 2023-05-09 21:34:17 +02:00
LE GAL SYLVAIN
3b34f52ddd Merge branch 'DOC-legalsylvain-add-extra-badge' into 'main'
[DOC] Add extra badges

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!35
2023-04-26 19:08:56 +00:00
Sylvain LE GAL
9afa13054e [DOC] Add extra badges 2023-04-26 21:04:18 +02:00
LE GAL SYLVAIN
ec537d1abf Merge branch 'legalsylvain-table-of-content' into 'main'
[DOC] Add Table of content in Readme.md file

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!34
2023-04-26 18:13:07 +00:00
Sylvain LE GAL
17ea6aa9c2 [DOC] Add badges 2023-04-26 19:45:58 +02:00
Sylvain LE GAL
ad0f51267c [DOC] Add Table of content in Readme.md file 2023-04-26 14:49:41 +02:00
LE GAL SYLVAIN
3aab973729 Merge branch 'fix-debian-image-archive' into 'main'
[FIX] Image debian changed repo to archive for V11 and V12 dockerfile

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!33
2023-04-26 10:22:34 +00:00
Cyril Jeanneret
c5c4276a82 Fix image debian changed repo to archive 2023-04-26 06:45:19 +00:00