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
F13211083: D20953.diff
Fri, May 17, 5:28 AM
F13207598: D20953.id.diff
Thu, May 16, 1:07 AM
F13194964: D20953.diff
Sun, May 12, 10:01 PM
F13178009: D20953.id49919.diff
Wed, May 8, 8:06 PM
F13177669: D20953.diff
Wed, May 8, 7:52 PM
Unknown Object (File)
Sun, May 5, 2:21 PM
Unknown Object (File)
Mon, Apr 29, 4:14 PM
Unknown Object (File)
Wed, Apr 24, 11:57 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.