Add Maniphest Herald condition "Acting user's projects"
Summary:
Support performing a Herald action in Maniphest only when the acting user is a member of specific project(s) defined in the conditions of the Herald rule.
This can be useful when project membership is restricted (projects used as Access control lists (ACL)).
Example use case: Make Herald add a comment when the description of a newly created task is empty but do not add a comment when done by a user who is a member of the #Trusted-Folks ACL project.
This borrows/copies code from DiffusionPreCommitContentAuthorProjectsHeraldField.
Closes T16120
Test Plan:
* Go to http://phorge.localhost/herald/edit/?content_type=HeraldManiphestTaskAdapter&rule_type=global to create a global Herald rule for Maniphest tasks.
* Click the "New Condition" button and see under "Supporting Applications" a new option "Acting user's projects"
* Under "Conditions", set:
** When all of these conditions are met:
** Description | matches regexp | @^$@
** Is newly created | is true
** Acting user's projects | include any of | #someExistingProject
* Under "Actions", set:
** Take these actions every time this rule matches:
** Change status to Spite
* Add yourself as a member to #someExistingProject
* File a task with an empty description, see that Herald set its status to Spite
* File more tasks with empty descriptions after changing the Herald condition to the other available options "include none of", "include all of" (after joining another project), "exists", and "does not exist", still behaves as expected
* Under "Acting user's projects | include any of", try to enter or select a milestone, see that it's not available as milestones cannot have members
It's all pretty much the same game as the condition "Author's projects" in http://phorge.localhost/herald/edit/?content_type=differential.diff&rule_type=global (with additional milestone exclusion).
Reviewers: O1 Blessed Committers, mainframe98
Reviewed By: O1 Blessed Committers, mainframe98
Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T16120
Differential Revision: https://we.phorge.it/D26101