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)
Wed, Apr 24, 11:57 PM
Unknown Object (File)
Wed, Apr 24, 11:57 PM
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
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
Branch
author6
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 23745
Build 32655: Run Core Tests
Build 32654: arc lint + arc unit

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.