Link users to Issues imported from Phabricator
Link users to the imported Phabricator Tasks
For each user mentioned in the task JSON, we should find all the related users, for that we'll need the user.search
API call, and we should pass it all related user phids
as constraints:
{
"phids": [
"PHID-USER-hi",
"PHID-USER-ha"
]
}
The user's we'd need to link can be found in these fields:
-
subscribers
=> GitLab subscribers. -
authorPHID
=> Issue Author -
ownerPHID
=> Assignee
We should try to find this phid
in a redis cache first, mapped to a GitLab user ID, if it does not exist we'll make the API call to Phabricator, to find the username for the user. Then, if a user with the same username exists on the GitLab instance, we use that, otherwise, we'll use the Ghost user.
When looking for users by username we should limit to users that have access to the project.
Edited by Bob Van Landuyt