Page MenuHomePhabricator

Respect repository identities when figuring out authors/committers in Herald pre-commit hook rules

Authored by epriestley on Jan 24 2020, 1:16 AM.



Ref T13480. Currently, Herald commit hook rules use a raw address resolution query to identify the author and committer for a commit. This will get the wrong answer when the raw identity string has been explicitly bound to some non-default user (most often, it will fail to identify an author when one exists).

Instead, use the "IdentityEngine" to properly resolve identities.

Test Plan

Authored a commit as X <>, a raw identity with no "natural" matches to users (e.g., no user with that email or username). Bound the identity to a particular user in Diffusion. Wrote a Herald pre-commit content rule, pushed the commit. Saw Herald recognize the correct user when evaluating rules.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Jan 24 2020, 1:16 AM
epriestley requested review of this revision.Jan 24 2020, 1:17 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 29 2020, 11:15 PM
This revision was automatically updated to reflect the committed changes.