Page MenuHomePhabricator

Implement "Author's packages", "Added project tags", and "Removed project tags" Herald fields
Closed, ResolvedPublic

Description

See PHI1609. This issue effectively requests an [ Author's packages ] field in Herald, to write this kind of rule for reviewer management in Differential:

[ Affected packages ][ include ][ X ]
[ Author's packages ][ do not include ][ X ]

See PHI1553. See also https://discourse.phabricator-community.org/t/is-there-a-way-to-make-a-herald-rule-only-trigger-based-on-an-action-not-on-a-state/3316/. Previously, see T13283.

These are broadly requests for "Added project tags" and "Removed project tags" fields. I'm satisfied that T13283 is sticking so these are now reasonable to implement.

Revisions and Commits

Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

epriestley triaged this task as Wishlist priority.Jan 17 2020, 5:05 PM
epriestley created this task.
epriestley added a revision: Restricted Differential Revision.Jan 21 2020, 7:31 PM
epriestley added a revision: Restricted Differential Revision.Jan 23 2020, 2:17 AM

D20947 does not implement "Author's packages" as a "Commit Content" field, nor as a "Commit Content (Hook)" field. The reason for this is that getting the modern authorPHID in both cases is somewhat complicated.

  • "Commit Content" fields currently rely on authorPHID on CommitData. This isn't completely effective given that author identities now exist.
  • "Commit Content (Hook)" fields currently rely on an explicit inline identity query, but bypass the actual identity table. So they'll find the "naive" answer, but may get the wrong answer if an identity has been remapped. This should be updated.

Both cases are somewhat buggy for other "Author ..." fields today; the pathways should be sorted out before new fields are added.

epriestley added a commit: Restricted Diffusion Commit.Jan 23 2020, 2:21 AM
epriestley added a commit: Restricted Diffusion Commit.Jan 23 2020, 2:27 AM

Remaining work:

  • HeraldPreCommitContentAdapter->lookupUser() should use DiffusionRepositoryIdentityEngine to resolve an identity, not DiffusionResolveUserQuery. Currently, the wrong author will be looked up when an identity exists and is explicitly bound to a non-default user.
  • HeraldPreCommitContentAdapter->lookupUser() should probably cache results (<raw author string -> resolved identity> on the Adapter is likely an appropriate scope).
  • HeraldCommitAdapter should load identities by default.
    • It looks like this should happen in setObject()?
    • setObject() has no prototype, but the root class calls it. Yikes.
  • Existing rules which use author or committer PHIDs should use the identity versions.
  • Once this is all sorted out, "Author's packages" fields should be implemented for both Commit flavors.
epriestley added a revision: Restricted Differential Revision.Jan 23 2020, 7:42 PM
epriestley added a revision: Restricted Differential Revision.Jan 23 2020, 7:51 PM
epriestley added a revision: Restricted Differential Revision.Jan 23 2020, 11:38 PM
epriestley added a revision: Restricted Differential Revision.Jan 24 2020, 1:16 AM
epriestley added a revision: Restricted Differential Revision.Jan 29 2020, 6:40 PM
epriestley added a revision: Restricted Differential Revision.Jan 29 2020, 8:40 PM
epriestley added a revision: Restricted Differential Revision.Jan 29 2020, 10:56 PM
epriestley added a commit: Restricted Diffusion Commit.Jan 29 2020, 11:07 PM
epriestley added a commit: Restricted Diffusion Commit.Jan 29 2020, 11:11 PM
epriestley added a commit: Restricted Diffusion Commit.Jan 29 2020, 11:14 PM
epriestley added a commit: Restricted Diffusion Commit.
epriestley added a commit: Restricted Diffusion Commit.Jan 29 2020, 11:49 PM
epriestley closed this task as Resolved by committing Restricted Diffusion Commit.Jan 29 2020, 11:52 PM
epriestley added a commit: Restricted Diffusion Commit.
epriestley added a revision: Restricted Differential Revision.Feb 3 2020, 1:05 PM
epriestley added a commit: Restricted Diffusion Commit.Feb 3 2020, 1:09 PM
epriestley added a commit: Restricted Diffusion Commit.
epriestley added a commit: Restricted Diffusion Commit.Feb 4 2020, 3:37 PM