HomePhabricator

Begin making change parsers testable

Description

Begin making change parsers testable

Summary:
Ref T4327. There are a bunch of other probably-related tasks too, some linked there.

We have some rare/unusual bugs in the change parsers, mostly in Subversion, but it's terrifying to touch them because they're complicated and fragile and have no test coverage.

To fix this stuff, I want to make them more testable. In particular, they basically end with this big INSERT right now. Instead, I'm going to make them return objects representing the data to be inserted, then have the common infrastructure do the insert. This gives us two benefits:

  • Reduced code duplication on the insert;
  • we can stop before the insert and have unit tests examine the objects.

This swaps the Git parser over, but doesn't swap the hg/svn parsers yet. I'll do those separately, the SVN one looks a bit tricky.

Test Plan:

  • Used scripts/repository/reparse.php to reparse a Git commit, with --trace. Verified it looked the same as before and the SQL that was executed seemed reasonable.
  • Did the same for hg / svn commits, to make sure I didn't derp anything. These aren't expected to do anything differently.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4327

Differential Revision: https://secure.phabricator.com/D7980

Details

Provenance
epriestleyAuthored on
epriestleyPushed on Jan 20 2014, 9:12 PM
Reviewer
btrahan
Differential Revision
D7980: Begin making change parsers testable
Parents
rP35ffcf6e42cc: Add PHUIObjectBoxView to Diffusion Tags
Branches
Unknown
Tags
Unknown
Tasks
T4327: Problems trying to import project

Event Timeline