Page MenuHomePhabricator

Provide a standalone query for resolution of commit author/committer into Phabricator users
ClosedPublic

Authored by epriestley on Dec 19 2013, 4:42 PM.
Tags
None
Referenced Files
F14897930: D7801.id17660.diff
Sun, Feb 9, 10:54 AM
F14897929: D7801.id17654.diff
Sun, Feb 9, 10:54 AM
F14897928: D7801.id.diff
Sun, Feb 9, 10:54 AM
Unknown Object (File)
Wed, Feb 5, 5:01 PM
Unknown Object (File)
Wed, Feb 5, 3:48 PM
Unknown Object (File)
Tue, Feb 4, 12:36 AM
Unknown Object (File)
Mon, Feb 3, 9:27 AM
Unknown Object (File)
Mon, Feb 3, 9:26 AM
Subscribers

Details

Summary

Ref T4195. To implement the "Author" and "Committer" rules, I need to resolve author/committer strings into Phabricator users.

The code to do this is currently buried in the daemons. Extract it into a standalone query.

I also added bin/repository lookup-users <commit> to test this query, both to improve confidence I'm getting this right and to provide a diagnostic command for users, since there's occasionally some confusion over how author/committer strings resolve into valid users.

Test Plan

I tested this using bin/repository lookup-users and reparse.php --message on Git, Mercurial and SVN commits. Here's the lookup-users output:

>>> orbital ~/devtools/phabricator $ ./bin/repository lookup-users rINIS3
Examining commit rINIS3...
Raw author string: epriestley
Phabricator user: epriestley (Evan Priestley   )
Raw committer string: null
>>> orbital ~/devtools/phabricator $ ./bin/repository lookup-users rPOEMS165b6c54f487c8
Examining commit rPOEMS165b6c54f487...
Raw author string: epriestley <git@epriestley.com>
Phabricator user: epriestley (Evan Priestley   )
Raw committer string: epriestley <git@epriestley.com>
Phabricator user: epriestley (Evan Priestley   )
>>> orbital ~/devtools/phabricator $ ./bin/repository lookup-users rINIH6d24c1aee7741e
Examining commit rINIH6d24c1aee774...
Raw author string: epriestley <hg@yghe.net>
Phabricator user: epriestley (Evan Priestley   )
Raw committer string: null
>>> orbital ~/devtools/phabricator $

The reparse.php output was similar, and all VCSes resolved authors correctly.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

btrahan added inline comments.
src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php
2

this was a great idea