Description
the diff/line based textual analysis is probably the fastest way to detect commits that might have altered the Odoo database structure. The problem is there are a few false positives such as https://github.com/akretion/odoo-module-diff-analysis/tree/main/17.0/sale
This is either because of fields that were moves ore because the changes are over several lines (especially right now we don't try to detect selection changes because they often span over several lines) and our heuristics are limited. The idea is that by tuning the parameters it is "good enough" to point to the important commits most of the time.
It should however be possible to tests the files before and after the commit more carefully to remove potential false positives.
Ways that could be done:
- try to collapse multi-lines field diff over a single line before applying textual heuristics
- use tree-sitter to parse the file before and after and see the exact structure diff. See https://github.com/tree-sitter/py-tree-sitter
- use diffstatic https://difftastic.wilfred.me.uk