Page MenuHomePhabricator

Begin making change parsers testable
ClosedPublic

Authored by epriestley on Jan 16 2014, 1:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 12:36 AM
Unknown Object (File)
Wed, Nov 6, 12:35 AM
Unknown Object (File)
Wed, Nov 6, 12:35 AM
Unknown Object (File)
Wed, Nov 6, 12:35 AM
Unknown Object (File)
Mon, Nov 4, 10:52 AM
Unknown Object (File)
Sun, Oct 27, 12:10 PM
Unknown Object (File)
Oct 18 2024, 4:10 PM
Unknown Object (File)
Oct 18 2024, 6:41 AM
Subscribers

Details

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.

Diff Detail

Branch
cparser1
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

epriestley updated this revision to Unknown Object (????).Jan 17 2014, 8:49 PM
  • Rebase onto all the other stuff, one minor tweak.