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

[ADD] Add option for Odoo 17.0 #425

Merged
merged 10 commits into from
Nov 23, 2023
Merged

[ADD] Add option for Odoo 17.0 #425

merged 10 commits into from
Nov 23, 2023

Conversation

celm1990
Copy link
Contributor

@celm1990 celm1990 commented Nov 11, 2023

I'm not sure if it's a good idea to use Copier 9, but I have problems with the old version. @yajo, can you please review?

TODO: adapt github actions to V17 and PY 3.10

Is need execute copier copy with option --trust similar to OCA/oca-addons-repo-template#202

copier.yml Show resolved Hide resolved
@celm1990 celm1990 marked this pull request as ready for review November 12, 2023 06:23
@celm1990
Copy link
Contributor Author

@pedrobaeza @yajo

Please review the comments associated with each commit for additional details.

I attempted to adapt the test, but encountered errors during precommit. I suspect this is because the oca-addons-repo-template now utilizes ruff instead of black, isort, flake8, autoflake, and pyupgrade. However, I am uncertain whether the maximum line length is now set to 79 instead of 88. @sbidoul, could you please provide your insights on this matter?

Refer to the following commit for the changes: OCA/oca-addons-repo-template@49b350f

image

@pedrobaeza
Copy link
Member

Better to do this in several steps: limit this PR to enable the 17.0 version, and then we can investigate about switching to ruff in another one. Check anyway the file https://github.com/OCA/oca-addons-repo-template/blob/master/src/%7B%25%20if%20use_ruff%20%25%7D.ruff.toml%7B%25%20endif%25%7D.jinja for ruff options.

@celm1990
Copy link
Contributor Author

Better to do this in several steps: limit this PR to enable the 17.0 version, and then we can investigate about switching to ruff in another one.

Currently, the process is not functional without some adjustments. This is necessary due to changes made in the oca-addons-repo-template repository first on this commit the files .flake8 .isort.cfg were removed. Following that, in
this commit an option for version 17 was recently added. As a result, it's imperative to adapt to these changes.

For visual reference, please find the screenshot below:

image

@celm1990
Copy link
Contributor Author

@pedrobaeza I updated code for flake8 and isort, before the file content are taken from oca-addons-repo-template but on this PR are delete this files OCA/oca-addons-repo-template#219 So now I put content directly here. Can you enable github actions and review please

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: these diff files are less helpful each time. The origin idea behind these files was to implement some kind of snapshot testing that served us as a warning sign when we diverged from the recommended linter configurations from OCA.

However, it's impossible for a human to interpret correctly 16 plain diffs in a review.

Back then, when oca-addons-repo-template didn't exist, OCA was using standard configurations per version, based on their MQT repo, which is mostly useless today (OCA/maintainer-quality-tools#717).

Now that updates are based on Copier, and don't happen randomly, what's the point on freezing the linter configurations per version? It's useless IMHO. Linters don't happen at Odoo runtime. They happen at dev time, in the dev laptop. Or on CI, in separate jobs. You can lint today code for Odoo 8 using today's linters, with a modern python version, and it will lint it properly.

So linters should depend on the template version, and not on the odoo version. In OCA they don't think like this and it's a maintenance burden in their template. I don't think we should follow the same path.

IMHO we should just review the new linters, enable those that make sense for all supported versions, and remove this diff snapshotting method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this is my first contribution into doodba-copier-template and I attempted to adhere to this guide. However, upon executing invoke update-test-samples all diff are altered, I'm having difficulty understanding why it has become more complex.
Do you recommend removing all the test related?

Currently, my primary objective is to enable V17 for Doodba. Unfortunately, the testing process is proving to be intricate and a bit frustrating. :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the diff tests all together then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed all test related, can you enable github actions please .
On my repo get the followin error(The test attempts to commit with a manifest containing a higher version, and it should fail the pre-commit check) , but Pylint-odoo working properly up to version v8.0.5, but starting from version v8.0.6, it encounters issues., please check issue reported here
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, the names of the linters to execute changed on that version from underscores (_) to dashes (-).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, the names of the linters to execute changed on that version from underscores (_) to dashes (-).

The configuration is OK, issue become from pylint-odoo not support V17.0 yet.
waiting OCA/pylint-odoo#477 to upgrade oca-addons-repo-template and try again

celm1990 added a commit to celm1990/doodba-copier-template that referenced this pull request Nov 14, 2023
@celm1990
Copy link
Contributor Author

@pedrobaeza @yajo
I updated code, could please enable github actions, on my repo test are execute and green
https://github.com/celm1990/doodba-copier-template/actions/runs/6907131396

@celm1990
Copy link
Contributor Author

@pedrobaeza @yajo
Can you please help me, I run test on my repo but for V14.0 the tests never finished
When I removed version 14.0 from the CI, now all the tests are completing successfully. I don't understand why
image
For version 14.0 I couldn't find relevant information in the logs(I added the --verbose flag)
https://github.com/celm1990/doodba-copier-template/actions/runs/6911268511/job/18805570859

image

@celm1990
Copy link
Contributor Author

@pedrobaeza @yajo
Help me please, I tried understand test on doodba-copier-template, in this test is used doodba-qa to test pylint However, as mentioned in another issue, pylint-odoo after version v8.0.6 is need replace underscore by dashes, Therefore, is it necessary to adapt doodba-qa as well, or are these tests obsolete?
Please refer to:
https://github.com/Tecnativa/doodba-qa/blob/fcd49526d9a8deed03d5584912f37e3626d7fba9/insider/pylint#L30

I hope I explained myself well.

celm1990 added a commit to celm1990/doodba-copier-template that referenced this pull request Nov 19, 2023
@yajo
Copy link
Contributor

yajo commented Nov 20, 2023

IIRC doodba-qa should be archived, as it is no longer used.

@celm1990
Copy link
Contributor Author

@yajo @pedrobaeza
I commented on a test related to backup because, for some reason, this test for v14.0 never finishes. Could you enable CI? Additionally, can you review this test if something is causing an issue? I've checked everything and it all seems normal, but I don't understand.

On my repo all test are gree(but without this commit)
https://github.com/celm1990/doodba-copier-template/actions/runs/6917156814
image

@celm1990
Copy link
Contributor Author

@yajo @pedrobaeza all tests are OK, CI is green without this commit, but if these tests are enabled, V14.0 never finishes. I haven't changed the code in this test; everything seems normal, but I don't understand. Any ideas?

Please your help

@pedrobaeza pedrobaeza changed the title [WIP] Add option for Odoo 17.0 [ADD] Add option for Odoo 17.0 Nov 20, 2023
@pedrobaeza
Copy link
Member

@celm1990 Please remove the last 2 commits and instead, just add one commenting the import of the test in __init__.py. We merge this for having the scaffolding available, and later we investigate about the failure.

@celm1990
Copy link
Contributor Author

@celm1990 Please remove the last 2 commits and instead, just add one commenting the import of the test in __init__.py. We merge this for having the scaffolding available, and later we investigate about the failure.

@pedrobaeza I see __init__.py and it's empty, where is done import?
image

@pedrobaeza
Copy link
Member

OK, try to rename the file instead. It seems it imports all the files starting with test_.

.flake8.jinja Outdated
@@ -1 +1,10 @@
{%- include "vendor/oca-addons-repo-template/.flake8" -%}
[flake8]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you have hardcoded this. The idea is to use the same linter configuration here that on oca-addons-repo-template, so instead you have to use the new .pre-commit-config.yaml from vendor submodule and remove these ones.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you replace for ruff, probably this file will not be needed anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the idea. In fact, the .pre-commit-config.yaml from oca-addons-repo-template has changed to ruff (not the one being templated):

https://github.com/OCA/oca-addons-repo-template/blob/8ad97a63fde3efe033fb262a6fb73d08a897e73d/.pre-commit-config.yaml#L24

.pre-commit-config.yaml.jinja Outdated Show resolved Hide resolved
- odoo to V17 change module note and add project_todo, this commit adapt test
this test never finished by an unknown reason(for V14.0)
Versions from V7 to V10 are skipped in the test, so they should be removed from the CI.
@celm1990
Copy link
Contributor Author

@pedrobaeza
I squashed the commits and removed V7-10 from CI. Please let me know if any additional changes are needed or if this PR is ready to merge?.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the effort.

@pedrobaeza pedrobaeza merged commit 56ea28e into Tecnativa:main Nov 23, 2023
27 checks passed
@celm1990 celm1990 deleted the main-V17 branch November 23, 2023 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants