Improve the capabilities of diff parsing, and document the full support.

Review Request #10778 — Created Nov. 3, 2019 and updated

chipx86
Review Board
release-4.0.x
bca12d4...
reviewboard

Diff parsing is one of the oldest parts of Review Board, and has shown
its age. It used to be that DiffParser and its subclasses would
populate a dictionary with keys and values. Eventually, we introduced a
File class (later renamed ParsedDiffFile) that would hold the
resulting information, but only after the dictionaries were populated.
This approach was error-prone (partly fixed in 4.0 when validation was
added), and made it hard to expand the type of information we collect.

This change improves the capabilities of parsers by giving them direct
access to a ParsedDiffFile object, removing the intermediary
dictionary. It also documents each of the methods in detail, discussing
each one's responsibilities and what subclasses may want to do to
customize behavior.

Currently, only the base DiffParser uses the new way of setting
attributes, to ensure that backwards-compatibility works as expected.
Other parsers will be updated shortly.

Unit tests pass in both Review Board and Power Pack.

Description From Last Updated

This doesn't seem right :)

daviddavid
Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. 
      
  2. reviewboard/diffviewer/parser.py (Diff revision 1)
     
     
     
     

    This doesn't seem right :)

  3. 
      
Loading...