Page MenuHomePhabricator

Distinguish between empty and unparsed commits in Diffusion
ClosedPublic

Authored by epriestley on Oct 27 2013, 2:20 AM.
Tags
None
Referenced Files
F14033221: D7428.id16755.diff
Sat, Nov 9, 5:06 PM
F14033220: D7428.id16740.diff
Sat, Nov 9, 5:06 PM
F14033219: D7428.id16722.diff
Sat, Nov 9, 5:06 PM
F14033218: D7428.id.diff
Sat, Nov 9, 5:06 PM
F14020428: D7428.diff
Wed, Nov 6, 12:33 AM
F14010824: D7428.id16755.diff
Thu, Oct 31, 12:44 PM
F14010722: D7428.id16740.diff
Thu, Oct 31, 12:05 PM
F14010721: D7428.id16722.diff
Thu, Oct 31, 12:05 PM
Subscribers

Details

Reviewers
btrahan
Maniphest Tasks
Restricted Maniphest Task
Restricted Maniphest Task
Restricted Maniphest Task
Restricted Maniphest Task
Commits
Restricted Diffusion Commit
rP912509558723: Distinguish between empty and unparsed commits in Diffusion
Summary

Fixes T3416. Fixes T1733.

  • Adds a flag to the commit table showing whether or not we have parsed it.
  • The flag is set to 0 initially when the commit is discovered.
  • The flag is set to 1 when the changes are parsed.
  • The UI can now use the flag to distinguish between "empty commit" and "commit which we haven't imported changes for yet".
  • Simplify rendering code a little bit.
  • Fix an issue with the Message parser for empty commits.
  • There's a key on the flag so we can do SELECT * FROM repository_commit WHERE repositoryID = %d AND importStatus = 0 LIMIT 1 soon, to determine if a repository is fully imported or not. This will let us improve the UI (Ref T776, Ref T3217).
Test Plan
  • Ran bin/storage upgrade -f.
  • Created an empty commit.
  • Without the daemons running, ran bin/repository pull GTEST and bin/repository discover GTEST.
  • Viewed web UI to get the first screenshot ("Still Importing...").
  • Ran the message and change steps with scripts/repository/reparse.php.
  • Viewed web UI to get the second screenshot ("Empty Commit").

Diff Detail

Branch
redit17
Lint
Lint Passed
Unit
Tests Passed

Event Timeline

I'm going to flag each import stage instead. The result will look approximately like this, but the "importStatus" field will have more possible values.

epriestley updated this revision to Unknown Object (????).Oct 29 2013, 10:02 PM

Treat the field as a bitmask, and mask in bits as we complete steps. This will let us build a more detailed view of the import process.

To test this, I reimported libphutil and ran this while it was importing a bunch of times:

select importStatus, count(*) from repository_commit where repositoryID = 24 group by importStatus;

The commits bucked up as expected, e.g.:

mysql> select importStatus, count(*) from repository_commit where repositoryID = 24 group by importStatus;
+--------------+----------+
| importStatus | count(*) |
+--------------+----------+
|            0 |       28 |
|            7 |      643 |
|           15 |       35 |
+--------------+----------+
3 rows in set (0.00 sec)