Closed victoralmau closed 3 years ago
some remarks inline. I have to review it more deeply.
thanks for proposing this must have feature.
just a question : did you take a look on this module https://github.com/OCA/server-tools/tree/12.0/module_analysis ?
module_analysis is a similar addon, analyze the ir_module object and all the files related to addon.
In this case the funcionality is some different because is possible to define some repositories that not contain addons, or different branch with different files, and too create custom rules to analyze the line codes related to custom paths.
I have created a test related to download a OCA report to analyze code after but i have found this error: https://travis-ci.org/github/OCA/interface-github/jobs/729927007#L575 I think that this error is about not specify in config github credentials. Any suggestion about make this test possible?
Note: local_path in repository_branch is a readonly field and can't use it.
Maybe you can change the github_login
variable to something different. If you used something like test
would it work?
Maybe you can change the
github_login
variable to something different. If you used something liketest
would it work?
Thanks Joao, little change applied now and only test OCA organization (error github login disappear) but error in tests continue. I have to investigate more about it
Test problem solved!
Add admin user to GitHub manager group (in data, not in demo).
Add series 13.0 and 14.0 to OCA demo organization
It's changed now.
Functional review:
* Seems that some rules don't fetch results:
IMO you don't get data about rules because paths in demo rules not fine, changed now and works. Other option is modify analysis rules about tests.
Tests rule must be put on demo data on github_connector_odoo that makes more sense, but the rest should work. About repository branch rule definition, it can't be put at the other module level, as you can have differences in paths not talking about Odoo modules (for example, the ORM being hosted in openerp
or in odoo
folder), but don't think in this only for Odoo itself, but for Python libraries, so we need to add such definition here.
Tests rule must be put on demo data on github_connector_odoo that makes more sense, but the rest should work.
Now github_connector_odoo
add other rules in data (in other PR) but rules defined in this PR work fine?
About repository branch rule definition, it can't be put at the other module level, as you can have differences in paths not talking about Odoo modules (for example, the ORM being hosted in
openerp
or inodoo
folder), but don't think in this only for Odoo itself, but for Python libraries, so we need to add such definition here.
About it, it's necessary to add root_path
field in repository_branch model and analysis rules apply about this path. It's correct?
root_path
is something of this PR? I think only rules should be defined at repository branch level.
root_path
is something of this PR? I think only rules should be defined at repository branch level.
Sorry for confusion. Now, rules can apply repository branch too and analyze all (organization + repository + repository_branch).
@victoralmau please rebase this and fix conflicts, and check if https://github.com/OCA/server-tools/pull/2036 applies here
The rebase has been applied.
This PR - https://github.com/OCA/server-tools/pull/2036 - was already applied here but you introduced me to a new addon that I didn't know: module_analysis
.
Some things about it:
module_authors
for example).module_analysis
to add "analysis rules" according to module rules and file extensions. Create new report to include it and replace "Installed Modules by Types" pivot view. (these change or similar maybe allow it to include as dependency in https://github.com/OCA/interface-github/pull/64).
What do you think about it?Talked by chat. Go ahead with it!
/ocabot merge major
This PR looks fantastic, let's merge it! Prepared branch 13.0-ocabot-merge-pr-63-by-pedrobaeza-bump-major, awaiting test results.
Congratulations, your PR was merged at 4b8b1e81c55a9e0fe7606ed29d32b5ebfcaab472. Thanks a lot for contributing to OCA. ❤️
Analysis source code
It's possible to create custom analaysis rule that can related to Organization and/or Repository to analyze repository code
. Go to 'Settings' / 'Analysis rule groups' and create records that allow to organize the rules
. Go to 'Settings' / 'Analysis rules' and create rules, for example:
*
*.py
*.xml
Note: Paths field in 'Analysis rule' allow to put multiple paths for line, path format is according to https://github.com/cpburnz/python-path-specification#tutorial definition
. Go to 'Organizations' and define Analysis rules (optional)
. Go to 'Repositories' and define Analysis rules (optional)
Analysis source code is executed when 'Update Source Code Analysis' button in some 'Repository Branch', get all the Analysis rules (Repository + Organization) and analyze code and generate info about it
In 'Repository Branh' / 'Code Analysis' show the info related to Analysis rules
Analysis source code is generated by https://github.com/roskakori/pygount
Please, @pedrobaeza review it
@Tecnativa TT25569