Page MenuHomePhabricator
Diviner Phabricator Tech Docs DoorkeeperAsanaFeedWorker

final class DoorkeeperAsanaFeedWorker
Phabricator Technical Documentation (Doorkeeper)

Publishes tasks representing work that needs to be done into Asana, and updates the tasks as the corresponding Phabricator objects are updated.

Methods

protected function publishFeedStory()

DoorkeeperFeedWorker

Actually publish the feed story. Subclasses will generally make API calls to publish some version of the story into external systems.

DoorkeeperAsanaFeedWorker

Publish stories into Asana using the Asana API.

Return
void

public function isEnabled()

DoorkeeperFeedWorker

Enable or disable the worker. Normally, this checks configuration to see if Phabricator is linked to applicable external systems.

DoorkeeperAsanaFeedWorker

This worker is enabled when an Asana workspace ID is configured with asana.workspace-id.

Return
boolTrue if this worker should try to publish stories.

protected function getFeedStory()
Inherited

DoorkeeperFeedWorker

Get the PhabricatorFeedStory that should be published.

Return
PhabricatorFeedStoryThe story to publish.

protected function getViewer()
Inherited

DoorkeeperFeedWorker

Get the viewer for the act of publishing.

NOTE: Publishing currently uses the omnipotent viewer because it depends on loading external accounts. Possibly we should tailor this. See T3732. Using the actor for most operations might make more sense.
Return
PhabricatorUserViewer.

protected function getPublisher()
Inherited

DoorkeeperFeedWorker

Get the DoorkeeperFeedStoryPublisher which handles this object.

Return
DoorkeeperFeedStoryPublisherObject publisher.

protected function getStoryObject()
Inherited

DoorkeeperFeedWorker

Get the primary object the story is about, like a DifferentialRevision or ManiphestTask.

Return
objectObject which the story is about.

private function loadPublisher()
Inherited

DoorkeeperFeedWorker

Load the DoorkeeperFeedStoryPublisher which corresponds to this object. Publishers provide a common API for pushing object updates into foreign systems.

Return
DoorkeeperFeedStoryPublisherPublisher for the story's object.

final protected function doWork()
Inherited

DoorkeeperFeedWorker

Doorkeeper workers set up some context, then call publishFeedStory().

Return
wild

public function getMaximumRetryCount()
Inherited

DoorkeeperFeedWorker

By default, Doorkeeper workers perform a small number of retries with exponential backoff. A consideration in this policy is that many of these workers are laden with side effects.

Return
wild

public function getWaitBeforeRetry($task)
Inherited

DoorkeeperFeedWorker

See getMaximumRetryCount() for a description of Doorkeeper retry defaults.

Parameters
PhabricatorWorkerTask$task
Return
wild

private function getWorkspaceID()

This method is not documented.
Return
wild

private function getProvider()

This method is not documented.
Return
wild

private function getAsanaTaskData($object)

This method is not documented.
Parameters
$object
Return
wild

private function getAsanaSubtaskData($object)

This method is not documented.
Parameters
$object
Return
wild

private function getSynchronizationWarning()

This method is not documented.
Return
wild

private function lookupAsanaUserIDs($all_phids)

This method is not documented.
Parameters
$all_phids
Return
wild

private function findAnyValidAsanaAccessToken($user_phids)

This method is not documented.
Parameters
array$user_phids
Return
wild

private function makeAsanaAPICall($token, $action, $method, $params)

This method is not documented.
Parameters
$token
$action
$method
array$params
Return
wild

private function newRefFromResult($type, $result)

This method is not documented.
Parameters
$type
$result
Return
wild

private function addFollowers($oauth_token, $task_id, $followers, $silent)

This method is not documented.
Parameters
$oauth_token
$task_id
array$followers
$silent
Return
wild

private function getAsanaProjectIDs()

This method is not documented.
Return
wild

private function addProjects($oauth_token, $task_id, $project_ids)

This method is not documented.
Parameters
$oauth_token
$task_id
array$project_ids
Return
wild