Page MenuHomePhabricator

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

Authored by epriestley on Jan 24 2020, 1:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 20, 5:01 PM
Unknown Object (File)
Mon, Apr 15, 12:56 AM
Unknown Object (File)
Thu, Apr 11, 8:14 AM
Unknown Object (File)
Sun, Apr 7, 5:46 AM
Unknown Object (File)
Sat, Apr 6, 7:30 PM
Unknown Object (File)
Fri, Mar 29, 6:57 AM
Unknown Object (File)
Mar 10 2024, 7:43 PM
Unknown Object (File)
Feb 19 2024, 7:26 PM
Subscribers
None

Details

Summary

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 <y@example.com>, 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

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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.